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

[ljcom] r12239: LJSUP-12658: LiveJournal Ratings for 24 ...

Committer: dnikolaev
LJSUP-12658: LiveJournal Ratings for 24 hours

U   trunk/cgi-bin/LJ/Widget/HomepageRU.pm
Modified: trunk/cgi-bin/LJ/Widget/HomepageRU.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/HomepageRU.pm	2012-07-06 15:36:13 UTC (rev 12238)
+++ trunk/cgi-bin/LJ/Widget/HomepageRU.pm	2012-07-09 08:05:13 UTC (rev 12239)
@@ -150,10 +150,19 @@
     ## Widget RatingTop10
     # $result{widget_ratingtop10} = LJ::Widget::RatingTop10->render;
 
-    $result{widget_ratingtop10_users} = LJ::Widget::RatingTopJournals->render('what' => 'users', 'sort' => $GET->{'sort'});
+    {
+        my $rating_top_journals_sort = $GET->{'sort'};
+        unless (defined $rating_top_journals_sort) {
+            $rating_top_journals_sort =  LJ::Request->cookie('rating_top_journals_sort');
+        }
 
-    $result{widget_ratingtop10_comms} = LJ::Widget::RatingTopJournals->render('what' => 'communities', 'sort' => $GET->{'sort'});
+        my $output = {};
+        $result{widget_ratingtop10_users} = LJ::Widget::RatingTopJournals->render('what' => 'users',       'sort' => $rating_top_journals_sort, 'output' => $output);
+        $result{widget_ratingtop10_comms} = LJ::Widget::RatingTopJournals->render('what' => 'communities', 'sort' => $rating_top_journals_sort, 'output' => $output);
 
+        LJ::Request->set_cookie('rating_top_journals_sort' => $output->{'sort'}, 'expires' => time + 60*60*24*180);
+    }
+
     ## Widget SettingWindow
     $result{widget_settingwindow} = LJ::Widget::SettingWindow->render;
 

Tags: dnikolaev, ljcom, 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