[Slashdotjp-dev 1572] [1103] fix for new RSS.pm spec

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 4月 2日 (木) 21:12:12 JST


Revision: 1103
          http://svn.sourceforge.jp/view?root=slashdotjp&view=rev&rev=1103
Author:   tach
Date:     2009-04-02 21:12:12 +0900 (Thu, 02 Apr 2009)

Log Message:
-----------
fix for new RSS.pm spec

Modified Paths:
--------------
    slashjp/trunk/debian/changelog
    slashjp/trunk/plugins/Journal/journal.pl


-------------- next part --------------
Modified: slashjp/trunk/debian/changelog
===================================================================
--- slashjp/trunk/debian/changelog	2009-04-02 10:19:45 UTC (rev 1102)
+++ slashjp/trunk/debian/changelog	2009-04-02 12:12:12 UTC (rev 1103)
@@ -23,7 +23,7 @@
   * Change structure of Slash/XML/RSS.pm about inserting dsecription
     - Add "content:encoded" only when type="rss"
 
- -- Taku YASUI <tach****@osdn*****>  Thu,  2 Apr 2009 09:49:08 +0000
+ -- Taku YASUI <tach****@osdn*****>  Thu,  2 Apr 2009 12:11:44 +0000
 
 slash (2.5.0.233-7) unstable; urgency=low
 

Modified: slashjp/trunk/plugins/Journal/journal.pl
===================================================================
--- slashjp/trunk/plugins/Journal/journal.pl	2009-04-02 10:19:45 UTC (rev 1102)
+++ slashjp/trunk/plugins/Journal/journal.pl	2009-04-02 12:12:12 UTC (rev 1103)
@@ -262,21 +262,21 @@
 		my $link = "$gSkin->{absolutedir}/~" . fixparam($nickname) . "/journal/$article->[3]";
 		my $journalurl = "$gSkin->{absolutedir}/~" . fixparam($nickname) . "/journal/";
 		my $text = strip_mode($article->[1], $article->[4]);
-		$text .= getData('rss_readmore', {
-			link		=> $link,
-			journalurl	=> $journalurl,
-			nickname	=> $nickname,
+		my $suffix = getData('rss_item_suffix', {
+			item_url         => $link,
+			user_journal_url => $journalurl,
+			nickname         => $nickname,
+			tid              => $article->[5],
 		});
+		$suffix =~ s/\s+/ /g;
 
 		push @items, {
 			story		=> {
-				'time'		=> $article->[0],
-				uid		=> $juid,
-				tid		=> $article->[5],
+				'time'  => $article->[0],
 			},
 			title		=> $article->[2],
-			description	=> strip_notags($article->[1]),
-			'content:encoded' =>  balanceTags($text, { deep_nesting => 1 }),
+			description	=> strip_notags($article->[1]) . $suffix,
+			'content:encoded' =>  balanceTags($text . $suffix, { deep_nesting => 1 }),
 			'link'		=> root2abs() . '/~' . fixparam($nickname) . "/journal/$article->[3]",
 			relation		=> $journalurl,
 		};
@@ -352,26 +352,36 @@
 		my $link = "$gSkin->{absolutedir}/~" . fixparam($entry->[1]) . "/journal/$entry->[4]";
 		my $journalurl = "$gSkin->{absolutedir}/~" . fixparam($entry->[1]) . "/journal/";
 		my $text = strip_mode($entry->[6], $entry->[7]);
-		$text .= getData('rss_readmore', {
-			link		=> $link,
-			journalurl	=> $journalurl,
-			nickname	=> $entry->[1],
+		my $suffix = getData('rss_item_suffix', {
+			item_url         => $link,
+			user_journal_url => $journalurl,
+			nickname         => $entry->[1],
+			tid              => $entry->[8],
 		});
+		$suffix =~ s/\s+/ /g;
 
 		push @items, {
 			story	=> {
 				'time'	=> $entry->[3],
-				uid	=> $entry->[2],
-				tid	=> $entry->[8],
 			},
 			title			=> $title,
 			link			=> $link,
-			'content:encoded'	=> balanceTags($text, { deep_nesting => 1 }),
-			description		=> strip_notags($entry->[6]),
+			'content:encoded'	=> balanceTags($text . $suffix, { deep_nesting => 1 }),
+			description		=> strip_notags($entry->[6]) . $suffix,
 			relation		=> $journalurl,
 		};
 	}
 
+	my $rss_html = $constants->{journal_rdfitemdesc_html} && (
+		($user->{is_admin} || isAdmin($user))
+			||
+		($constants->{journal_rdfitemdesc_html} == 1)
+			||
+		($constants->{journal_rdfitemdesc_html} > 1 && ($user->{is_subscriber}))
+			||
+		($constants->{journal_rdfitemdesc_html} > 2 && !$user->{is_anon})
+	);
+
 	xmlDisplay($form->{content_type} => {
 		channel => {
 			title		=> getData('rss_top_recent_title'),
@@ -381,6 +391,7 @@
 		image	=> 1,
 		items	=> \@items,
 		rdfitemdesc		=> $constants->{journal_rdfitemdesc},
+		rdfitemdesc_html	=> $rss_html,
 	}, { mcdkey => $mcdkey });
 }
 



Slashdotjp-dev メーリングリストの案内
Back to archive index