madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[ljcom] r12753: LJSUP-13883: Journal pages optimizaiton ...

Committer: sbelyaev
LJSUP-13883: Journal pages optimizaiton : stage 1
U   trunk/cgi-bin/LJ/Hooks/PartnerSites.pm
Modified: trunk/cgi-bin/LJ/Hooks/PartnerSites.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/PartnerSites.pm	2012-10-15 08:22:01 UTC (rev 12752)
+++ trunk/cgi-bin/LJ/Hooks/PartnerSites.pm	2012-10-15 08:23:00 UTC (rev 12753)
@@ -75,6 +75,12 @@
 LJ::register_hook( 'override_entry_url' => sub {
     my ( $u, $entry, $entry_url_ref ) = @_;
 
+    my $jitemid   = $entry->jitemid;
+    my $key       =  "__partner_site_$jitemid";
+
+    return $u->{$key} 
+        if exists $u->{$key};
+
     return if ! $u || $u->equals( LJ::get_remote() );
 
     my $partner = LJ::PartnerSite->find_by_journal_username( $u->username );
@@ -84,6 +90,7 @@
     return unless $docid;
 
     $$entry_url_ref = $partner->article_link($docid);
+    $u->{$key} = $$entry_url_ref;
 } );
 
 LJ::register_hook( 'override_comments_url' => sub {

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