Первый фоллен на хелле (wildkin) wrote in changelog,
Первый фоллен на хелле
wildkin
changelog

[livejournal] r19013: LJSUP-8737: Incorrect paging in FriendsP...

Committer: dnikolaev
LJSUP-8737: Incorrect paging in FriendsPage calendar

U   trunk/cgi-bin/LJ/S2/FriendsPage.pm
U   trunk/cgi-bin/ljviews.pl
Modified: trunk/cgi-bin/LJ/S2/FriendsPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/FriendsPage.pm	2011-05-03 07:50:17 UTC (rev 19012)
+++ trunk/cgi-bin/LJ/S2/FriendsPage.pm	2011-05-04 03:19:30 UTC (rev 19013)
@@ -87,6 +87,8 @@
     if ($skip < 0) { $skip = 0; }
     my $itemload = $itemshow+$skip;
 
+    my $base = "$u->{'_journalbase'}/$opts->{'view'}";
+
     my $filter;
     my $group_name    = '';
     my $common_filter = 1;
@@ -94,8 +96,10 @@
     my $events_date = 0;
     my $pathextra = $opts->{pathextra};
     if ($pathextra && $pathextra =~ m/^\/(\d\d\d\d)\/(\d\d)\/(\d\d)\/?$/) {
+        $base .= $pathextra;
         $events_date = LJ::TimeUtil->mysqldate_to_time("$1-$2-$3");
         $pathextra = '';
+        $get->{date} = '';
     }
     elsif ($get->{date} =~ m!^(\d{4})-(\d\d)-(\d\d)$!) {
         $events_date = LJ::TimeUtil->mysqldate_to_time("$1-$2-$3");
@@ -114,12 +118,14 @@
             $group_name =~ s!^/!!;
             $group_name =~ s!/$!!;
 
-            if ($group_name) { 
+            if ($group_name) {
                 $group_name    = LJ::durl($group_name); 
                 $common_filter = 0; 
 
                 $p->{'filter_active'} = 1;
                 $p->{'filter_name'}   = LJ::ehtml($group_name);
+
+                $base .= "/" . LJ::eurl($group_name);
             }
         }
 
@@ -426,11 +432,6 @@
         'count' => $eventnum,
     };
 
-    my $base = "$u->{'_journalbase'}/$opts->{'view'}";
-    if ($group_name) {
-        $base .= "/" . LJ::eurl($group_name);
-    }
-
     # $linkfilter is distinct from $filter: if user has a default view,
     # $filter is now set according to it but we don't want it to show in the links.
     # $incfilter may be true even if $filter is 0: user may use filter=0 to turn

Modified: trunk/cgi-bin/ljviews.pl
===================================================================
--- trunk/cgi-bin/ljviews.pl	2011-05-03 07:50:17 UTC (rev 19012)
+++ trunk/cgi-bin/ljviews.pl	2011-05-04 03:19:30 UTC (rev 19013)
@@ -1667,6 +1667,8 @@
     if ($skip < 0) { $skip = 0; }
     my $itemload = $itemshow+$skip;
 
+    my $base = "$journalbase/$opts->{'view'}";
+
     my $filter;
     my $group;
     my $common_filter = 1;
@@ -1675,7 +1677,9 @@
     my $pathextra = $opts->{pathextra};
     if ($pathextra && $pathextra =~ m/^\/(\d\d\d\d)\/(\d\d)\/(\d\d)\/?$/) {
         $events_date = LJ::TimeUtil->mysqldate_to_time("$1-$2-$3");
+        $base .= $pathextra;
         $pathextra = '';
+        $get->{date} = '';
     }
     elsif ($get->{date} =~ m!^(\d{4})-(\d\d)-(\d\d)$!) {
         $events_date = LJ::TimeUtil->mysqldate_to_time("$1-$2-$3");
@@ -1689,7 +1693,11 @@
             $group = $pathextra;
             $group =~ s!^/!!;
             $group =~ s!/$!!;
-            if ($group) { $group = LJ::durl($group); $common_filter = 0;}
+            if ($group) {
+                $group = LJ::durl($group);
+                $common_filter = 0;
+                $base .= "/" . LJ::eurl($group);
+            }
         }
         my $grp = LJ::get_friend_group($u, { 'name' => $group || "Default View" });
         my $bit = $grp ? $grp->{'groupnum'} : 0;
@@ -2016,10 +2024,6 @@
 
     my ($skip_f, $skip_b) = (0, 0);
     my %skiplinks;
-    my $base = "$journalbase/$opts->{'view'}";
-    if ($group) {
-        $base .= "/" . LJ::eurl($group);
-    }
 
     # $linkfilter is distinct from $filter: if user has a default view,
     # $filter is now set according to it but we don't want it to show in the links.
@@ -2035,6 +2039,7 @@
 
         $linkvars{'filter'} = $linkfilter if $incfilter;
         $linkvars{'show'} = $get->{'show'} if $get->{'show'} =~ /^\w+$/;
+        $linkvars{'date'} = $get->{'date'} if $get->{'date'};
 
         my $newskip = $skip - $itemshow;
         if ($newskip > 0) { $linkvars{'skip'} = $newskip; }
@@ -2056,6 +2061,7 @@
 
         $linkvars{'filter'} = $linkfilter if $incfilter;
         $linkvars{'show'} = $get->{'show'} if $get->{'show'} =~ /^\w+$/;
+        $linkvars{'date'} = $get->{'date'} if $get->{'date'};
 
         my $newskip = $skip + $itemshow;
         $linkvars{'skip'} = $newskip;

Tags: livejournal, pl, pm, wildkin
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