Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r19007: LJSUP-8734: Need correct links to next (...

Committer: gariev
LJSUP-8734: Need correct links to next (or prev) entry on entry page (with comments)

U   trunk/cgi-bin/LJ/S2.pm
Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm	2011-04-29 03:16:46 UTC (rev 19006)
+++ trunk/cgi-bin/LJ/S2.pm	2011-04-29 03:24:58 UTC (rev 19007)
@@ -3847,15 +3847,25 @@
     }
 
     if ($key eq "nav_prev") {
-        return LJ::S2::Link("$LJ::SITEROOT/go.bml?journal=$journal&itemid=$this->{'itemid'}&dir=prev",
+        my $jumpid = LJ::get_itemid_before2($journalu, int($this->{'itemid'}/256));
+        if ($jumpid) {
+            return LJ::S2::Link($journalu->journal_base . "/$jumpid.html",
                             $ctx->[S2::PROPS]->{"text_entry_prev"},
                             LJ::S2::Image("$LJ::IMGPREFIX/btn_prev.gif", 24, 24));
+        } else {
+            return $null_link;
+        }
     }
 
     if ($key eq "nav_next") {
-        return LJ::S2::Link("$LJ::SITEROOT/go.bml?journal=$journal&itemid=$this->{'itemid'}&dir=next",
+        my $jumpid = LJ::get_itemid_after2($journalu, int($this->{'itemid'}/256));
+        if ($jumpid) {
+            return LJ::S2::Link($journalu->journal_base . "/$jumpid.html",,
                             $ctx->[S2::PROPS]->{"text_entry_next"},
                             LJ::S2::Image("$LJ::IMGPREFIX/btn_next.gif", 24, 24));
+        } else {
+            return $null_link;
+        }
     }
 
     if ($key eq "flag") {

Tags: gariev, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments