pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] changelog2009-05-10 05:47 pm

[dw-free] ?style=mine should persist from any journal view

[commit: http://hg.dwscoalition.org/dw-free/rev/df81a3e83008]

http://bugs.dwscoalition.org/show_bug.cgi?id=77

Add style=mine support to RecentPage.pm.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/LJ/S2/RecentPage.pm
--------------------------------------------------------------------------------
diff -r b5e4dbc4f66f -r df81a3e83008 cgi-bin/LJ/S2/RecentPage.pm
--- a/cgi-bin/LJ/S2/RecentPage.pm	Sun May 10 16:55:50 2009 +0000
+++ b/cgi-bin/LJ/S2/RecentPage.pm	Sun May 10 17:47:00 2009 +0000
@@ -69,6 +69,9 @@ sub RecentPage
     my $maxskip = $LJ::MAX_SCROLLBACK_LASTN-$itemshow;
     if ($skip < 0) { $skip = 0; }
     if ($skip > $maxskip) { $skip = $maxskip; }
+
+    # honor ?style=mine
+    my $mine = $get->{'style'} eq "mine" ? "mine" : "";
 
     # do they want to view all entries, regardless of security?
     my $viewall = 0;
@@ -189,13 +192,12 @@ sub RecentPage
             $text .= LJ::S2::get_tags_text($opts->{ctx}, \@taglist);
         }
 
-        my $nc = "";
-        $nc .= "nc=$replycount" if $replycount && $remote && $remote->prop('opt_nctalklinks');
-
         my $permalink = "$journalbase/$ditemid.html";
-        my $readurl = $permalink;
-        $readurl .= "?$nc" if $nc;
+        my $nc = $replycount if $replycount && $remote && $remote->prop('opt_nctalklinks');
         my $posturl = $permalink . "?mode=reply";
+        my $readurl = LJ::make_link( $permalink, { style => $mine,
+                                                   s2id  => LJ::eurl( $get->{s2id} ) || "",
+                                                   nc    => $nc || "" } );
 
         my $comments_enabled = ($u->{'opt_showtalklinks'} eq "Y" && ! $logprops{$itemid}->{'opt_nocomments'}) ? 1 : 0;
         my $has_screened = ($logprops{$itemid}->{'hasscreened'} && LJ::can_manage($remote, $u)) ? 1 : 0;
@@ -268,9 +270,12 @@ sub RecentPage
         my $newskip = $skip - $itemshow;
         $newskip = 0 if $newskip <= 0;
         $nav->{'forward_skip'} = $newskip;
-        $nav->{'forward_url'} = LJ::make_link("$p->{base_url}/", { skip     => ($newskip                   || ""),
-                                                                   tag      => (LJ::eurl($get->{tag})      || ""),
-                                                                   security => (LJ::eurl($get->{security}) || "") });
+        $nav->{'forward_url'} = LJ::make_link( "$p->{'base_url'}/",
+                                { skip     => $newskip                        || "",
+                                  style    => $mine                           || "",
+                                  s2id     => LJ::eurl( $get->{s2id} )        || "",
+                                  tag      => LJ::eurl( $get->{tag} )         || "",
+                                  security => LJ::eurl( $get->{security} )    || "" } );
         $nav->{'forward_count'} = $itemshow;
         $p->{head_content} .= qq{<link rel="next" href="$nav->{forward_url}" />\n}
     }
@@ -286,9 +291,12 @@ sub RecentPage
             $nav->{'backward_url'} = "$p->{'base_url'}/$date_slashes";
         } else {
             my $newskip = $skip + $itemshow;
-            $nav->{'backward_url'} = LJ::make_link("$p->{'base_url'}/", { skip     => ($newskip                   || ""),
-                                                                          tag      => (LJ::eurl($get->{tag})      || ""),
-                                                                          security => (LJ::eurl($get->{security}) || "") });
+            $nav->{'backward_url'} = LJ::make_link( "$p->{'base_url'}/",
+                                     { skip     => $newskip                        || "",
+                                       style    => $mine                           || "",
+                                       s2id     => LJ::eurl( $get->{s2id} )        || "",
+                                       tag      => LJ::eurl( $get->{tag} )         || "",
+                                       security => LJ::eurl( $get->{security} )    || "" } );
             $nav->{'backward_skip'} = $newskip;
         }
         $p->{head_content} .= qq{<link rel="prev" href="$nav->{backward_url}" />\n};
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org