[Slashdotjp-dev 1483] [1014] Add printCommentsSuffix() to show comments suffix (e.g.

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2009年 2月 18日 (水) 22:45:55 JST


Revision: 1014
          http://svn.sourceforge.jp/view?root=slashdotjp&view=rev&rev=1014
Author:   tach
Date:     2009-02-18 22:45:54 +0900 (Wed, 18 Feb 2009)

Log Message:
-----------
Add printCommentsSuffix() to show comments suffix (e.g. navigation)

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


-------------- next part --------------
Modified: slashjp/trunk/Slash/Utility/Comments/Comments.pm
===================================================================
--- slashjp/trunk/Slash/Utility/Comments/Comments.pm	2009-02-18 13:22:53 UTC (rev 1013)
+++ slashjp/trunk/Slash/Utility/Comments/Comments.pm	2009-02-18 13:45:54 UTC (rev 1014)
@@ -1209,6 +1209,7 @@
 #slashProfEnd();
 
 	print $comment_html;
+	printCommentsSuffix($discussion);
 }
 
 #========================================================================
@@ -2631,7 +2632,33 @@
 		? $user->{discussion2} : 0;
 }
 
+########################################################
+# comments suffix
+sub printCommentsSuffix {
+	my ($discussion, $options) = @_;
+	my $constants = getCurrentStatic();
+	my $reader = getObject('Slash::DB', { db_type => 'reader' });
+	my $stories = {};
+	my $ret = '';
 
+	return $ret if (!$discussion || ref($discussion) ne "HASH");
+
+	my $sid = $reader->getStorySidFromDiscussion($discussion->{id});
+	if ($sid) {
+		my $story = $reader->getStory($sid);
+		if ($constants->{use_prev_next_link}) {
+			$stories->{prev} = $reader->getStoryByTime('<', $story);
+			$stories->{next} = $reader->getStoryByTime('>', $story) unless $story->{is_future};
+		}
+	}
+
+	$ret = slashDisplay('printCommentsSuffix', {
+		stories	=> $stories,
+	}, { Return => $options->{return} });
+
+	return $ret;
+}
+
 1;
 
 __END__

Modified: slashjp/trunk/debian/changelog
===================================================================
--- slashjp/trunk/debian/changelog	2009-02-18 13:22:53 UTC (rev 1013)
+++ slashjp/trunk/debian/changelog	2009-02-18 13:45:54 UTC (rev 1014)
@@ -8,8 +8,9 @@
   * Change color to red for "This story will not appear" messa****@admin*****
   * Fix: vanish olderstuff slashbox from top page when moved
   * Fix: dupliicate slashboxes
+  * Add printCommentsSuffix() to show comments suffix (e.g. navigation)
 
- -- Taku YASUI <tach****@osdn*****>  Fri, 13 Feb 2009 09:43:12 +0000
+ -- Taku YASUI <tach****@osdn*****>  Wed, 18 Feb 2009 13:45:06 +0000
 
 slash (2.5.0.233-4) unstable; urgency=low
 



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