changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[livejournal] r15583: LJSUP-4627 Modify thread expander so tha...

Committer: afedorov
LJSUP-4627 Modify thread expander so that there will be no ad calls in loaded pages


U   trunk/cgi-bin/LJ/S2.pm
Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm	2009-08-04 09:50:45 UTC (rev 15582)
+++ trunk/cgi-bin/LJ/S2.pm	2009-08-05 05:32:41 UTC (rev 15583)
@@ -3309,6 +3309,8 @@
 
 sub Comment__expand_link
 {
+    use Digest::MD5 qw( md5_hex );
+
     my ($ctx, $this, $opts) = @_;
     $opts ||= {};
 
@@ -3345,7 +3347,17 @@
     my $title = $opts->{title} ? " title='" . LJ::ehtml($opts->{title}) . "'" : "";
     my $class = $opts->{class} ? " class='" . LJ::ehtml($opts->{class}) . "'" : "";
 
-    return "<a href='$this->{thread_url}'$title$class onClick=\"Expander.make(this,'$this->{thread_url}','$this->{talkid}'); return false;\">$text</a>";
+    ## Add key for disable banners
+    my $banners_off = md5_hex( $this->{journal}->{_u}->{_journalbase} .
+                               $this->{journal}->{_u}->{userid} .
+                               $this->{journal}->{_u}->{caps} .
+                               $this->{journal}->{_u}->{lang} .
+                               $this->{talkid} );
+
+    my $expand_url = $this->{thread_url};
+    $expand_url =~ s/(?=#)/&expand=$banners_off/;
+    
+    return "<a href='$this->{thread_url}'$title$class onClick=\"Expander.make(this,'$expand_url','$this->{talkid}'); return false;\">$text</a>";
 }
 
 sub Comment__print_expand_link

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