[Slashdotjp-dev 1508] [1039] Add feed discussion prev/next link

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2009年 2月 23日 (月) 21:23:34 JST


Revision: 1039
          http://svn.sourceforge.jp/view?root=slashdotjp&view=rev&rev=1039
Author:   tach
Date:     2009-02-23 21:23:34 +0900 (Mon, 23 Feb 2009)

Log Message:
-----------
Add feed discussion prev/next link

Modified Paths:
--------------
    slashjp/trunk/Slash/Utility/Comments/Comments.pm


-------------- next part --------------
Modified: slashjp/trunk/Slash/Utility/Comments/Comments.pm
===================================================================
--- slashjp/trunk/Slash/Utility/Comments/Comments.pm	2009-02-23 12:16:37 UTC (rev 1038)
+++ slashjp/trunk/Slash/Utility/Comments/Comments.pm	2009-02-23 12:23:34 UTC (rev 1039)
@@ -2714,14 +2714,20 @@
 		push(@$stories, $item);
 	}
 
-#use Data::Dumper; print STDERR Dumper($stories);
-
-	# poll
-
 	# feed
+	if ($kind eq "feed") {
+		my $item = { 'prev' => {}, 'next' => {}, 'up' => {} };
+		if (my $prev = $reader->getDiscussionByTime('<', $discussion, { dkid => $discussion->{dkid} })) {
+			$item->{prev} = { url => $prev->{url}, title => $prev->{title} };
+		}
+		if (my $next = $reader->getDiscussionByTime('>', $discussion, { dkid => $discussion->{dkid} })) {
+			$item->{next} = { url => $next->{url}, title => $next->{title} };
+		}
+		$item->{up}->{title} = Slash::getData('feeds', {}, 'misc');
+		$item->{up}->{url} = "$constants->{rootdir}/firehose.pl?fhfilter=feed&color=violet";
+		push(@$stories, $item);
+	}
 
-	# project
-
 	$ret = slashDisplay('printCommentsSuffix', {
 		stories	=> $stories,
 	}, { Return => $options->{return} });



Slashdotjp-dev メーリングリストの案内
Zurück zum Archiv-Index