juks (juks) wrote in changelog,
juks
juks
changelog

[ljcom] r10204: LJSUP-8089 St. Patrick day

Committer: iaskarov
LJSUP-8089 St. Patrick day
U   trunk/cgi-bin/LJ/Hooks/Homepage.pm
Modified: trunk/cgi-bin/LJ/Hooks/Homepage.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/Homepage.pm	2011-03-09 10:53:14 UTC (rev 10203)
+++ trunk/cgi-bin/LJ/Hooks/Homepage.pm	2011-03-09 11:39:17 UTC (rev 10204)
@@ -1,4 +1,5 @@
 package LJ::LJcom;
+use Time::Local;
 use strict;
 
 sub _is_xbox_reskining_active {
@@ -47,7 +48,32 @@
 LJ::register_hook("service_page_reskining", sub {
     my $params = shift || {};
     
-    if (LJ::SUP->is_remote_sup()) {
+    my $is_sup = LJ::SUP->is_remote_sup();
+    
+    my ($sp_start, $sp_end);
+    
+    # my $dt = DateTime->new( year => 2011, month => 3, day => 17, hour => 0, minute => 0, second => 0, time_zone => $is_sup ? 'Europe/Moscow' : 'UTC', );
+    # my $sp_start = $dt->epoch(); my $sp_end   = $sp_start + 86400;
+    
+    my $cur_time = $is_sup ? gmtime() + 10800 : gmtime();
+
+    # 2011-03-17 till 2011-03-17 in GMT and MSC 
+    if($is_sup) {
+        ($sp_start, $sp_end) = (1300309200, 1300395600);
+    } else {
+        ($sp_start, $sp_end) = (1300320000, 1300406400);
+    }
+
+    if ($cur_time >= $sp_start && $cur_time <= $sp_end) {
+        LJ::need_res("stc/reskining/2011/march/stpd/header.css");
+        
+        my $text = LJ::Lang::ml('reskining.stpd2011');
+        LJ::CleanHTML::clean(\$text); ## to expand <lj-user> tags
+        
+        return qq[<dl class="b-reskining-about"><dt></dt><dd>$text</dd></dl>];
+    }
+    
+    if ($is_sup) {
         LJ::need_res("stc/reskining/2011/march/cyr/header.css"); 
         
         return '';

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