madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20398: LJSUP-10145: Delayed entry selection has...

Committer: sbelyaev
LJSUP-10145: Delayed entry selection has changed.
U   trunk/cgi-bin/LJ/DelayedEntry.pm
U   trunk/cgi-bin/ljlib.pl
Modified: trunk/cgi-bin/LJ/DelayedEntry.pm
===================================================================
--- trunk/cgi-bin/LJ/DelayedEntry.pm	2011-10-20 13:26:36 UTC (rev 20397)
+++ trunk/cgi-bin/LJ/DelayedEntry.pm	2011-10-20 13:56:26 UTC (rev 20398)
@@ -778,7 +778,7 @@
     my $req = undef;
    
     my $memcache_key = "delayed_entry:$journalid:$delayedid";
-    my ($data_ser)  = LJ::MemCache::get($memcache_key);
+    my ($data_ser);# = LJ::MemCache::get($memcache_key);
     if (!$data_ser) {
         ($data_ser) = $dbcr->selectrow_array( "SELECT request_stor " .
                                               "FROM delayedblob2 ".

Modified: trunk/cgi-bin/ljlib.pl
===================================================================
--- trunk/cgi-bin/ljlib.pl	2011-10-20 13:26:36 UTC (rev 20397)
+++ trunk/cgi-bin/ljlib.pl	2011-10-20 13:56:26 UTC (rev 20398)
@@ -1133,8 +1133,7 @@
     my $usual_show  = $itemshow;
     my $skip_sticky = $skip;    
 
-    if ( $show_sticky_on_top && $sticky )
-    {
+    if ( $show_sticky_on_top && $sticky ) {
         if($skip > 0) {
             $skip -= 1;
         } else {
@@ -1307,10 +1306,13 @@
     };
 
     if ( $sticky && $show_sticky_on_top ) {
-        # build request to receive sticky entries
         if ( !$skip_sticky ) {
-            $sticky_sql = "$sql AND jitemid = $sticky ";
-            $sticky_sql .= "ORDER BY journalid, $sort_key ";
+            warn "sticky $sticky";
+            my $entry = LJ::Entry->new( $u, 'jitemid' => $sticky );
+            $entry->{'itemid'} = $sticky;
+            push @items, $entry;
+            push @{$opts->{'entry_objects'}}, $entry;
+            push @{$opts->{'itemids'}}, $entry->jitemid;
         }
 
         # sticky exculustion
@@ -1353,13 +1355,10 @@
             my $entry = LJ::Entry->new($userid, jitemid => $li->{itemid}, rlogtime => $li->{rlogtime});
             $entry->absorb_row($li);
             push @{$opts->{'entry_objects'}}, $entry;
+            warn LJ::D($entry);
         }
     };
 
-    
-    if ( $sticky && !$skip_sticky && $show_sticky_on_top ) {
-        $absorb_data->($sticky_sql);
-    }
     $absorb_data->($sql);
     $flush->();
 

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