vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[ljcom] r11292: LJSUP-10825: LJ.com homepage branding (D...

Committer: vad
LJSUP-10825: LJ.com homepage branding (Dragon_Tatoo)
U   trunk/cgi-bin/LJ/Hooks/Homepage.pm
Modified: trunk/cgi-bin/LJ/Hooks/Homepage.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/Homepage.pm	2011-12-22 12:00:39 UTC (rev 11291)
+++ trunk/cgi-bin/LJ/Hooks/Homepage.pm	2011-12-22 14:30:26 UTC (rev 11292)
@@ -45,7 +45,7 @@
     return 1;
 }
 
-sub LJ::_is_branding_active {
+sub LJ::_is_ny_branding_active {
     ## Only homepage must be branded
     return unless LJ::Request->hostname eq "www.$LJ::DOMAIN";
 
@@ -66,10 +66,42 @@
     return 1;    
 }
 
+sub LJ::_is_branding_active { 
+    ## Only homepage must be branded 
+    return unless LJ::Request->hostname eq "www.$LJ::DOMAIN"; 
+
+    my $uri = LJ::Request->uri; 
+    return unless $uri eq '/index.bml' or $uri eq '/'; 
+
+    ## Don't show to logged-in paid and basic accounts 
+    my $remote = LJ::get_remote(); 
+    return if $remote && ($remote->get_cap('paid') || !$remote->in_class('plus')); 
+
+    ## only Cyr users 
+    return unless LJ::SUP->is_remote_sup; 
+
+    ## from 2011-12-16 00:00:00 MSK till 2011-12-22 23:59:59 MSK 
+    my $time = time(); 
+    return if ($time < 1323979200 || $time > 1324583999); ## uncomment this line before commit! 
+
+    return 1; 
+}
+
 LJ::register_hook("service_page_branding", sub {
     my $opts = shift || {};
 
-     if (LJ::_is_branding_active()) {
+    if (LJ::_is_branding_active()) { 
+         my $rnd = int(rand(1_000_000)); 
+         return 
+             '<a href="http://sup.adfox.ru/7386/goLink?p1=bdzfe&p2=v&p5=ziyd&pr='. 
+             $rnd . 
+             '&puid1=&puid2=&puid3=&puid4=&puid5=" target="_blank" class="brandingomg-link">&nbsp;</a>' . 
+             '<img src="http://sup.adfox.ru/7386/getCode?p1=bdzfe&p2=v&pe=b&pfc=jpmv&pfb=ziyd&puid1=&puid2=&puid3=&puid4=&puid5=&pr='. 
+             $rnd . 
+             '" width="1" height="1" border="0" class="brandingomg-pixel" />'; 
+     }
+
+     if (LJ::_is_ny_branding_active()) {
          my $rnd = int(rand(1_000_000));
          return 
              '<a href="http://sup.adfox.ru/7386/goLink?p1=bebcg&p2=v&p5=zumf&pr=' . 
@@ -84,9 +116,15 @@
 LJ::register_hook("service_page_reskining", sub {
     my $params = shift || {};
 
-    if (LJ::_is_branding_active()) {
+    if (LJ::_is_branding_active()) { 
+        LJ::need_res("stc/reskining/2011/december/omg/homepage.css"); 
+        return ''; 
+    }
+
+    if (LJ::_is_ny_branding_active()) {
         LJ::need_res("stc/reskining/2011/december/dragon/homepage.css");
     }
+
     ##
     ## experimental ServicePageReskinning part 
     ##

Tags: ljcom, pm, vad, vadvs
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