vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r19582: LJSUP-9326: Friendstimes. Incorrect styl...

Committer: vad
LJSUP-9326: Friendstimes. Incorrect style on page Friendstimes for some users.
U   trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2011-08-03 09:45:28 UTC (rev 19581)
+++ trunk/cgi-bin/weblib.pl	2011-08-03 09:57:12 UTC (rev 19582)
@@ -1337,6 +1337,13 @@
             }
         }
 
+        my %journal_info;
+        if (my $journalu = LJ::get_active_journal()) {
+            %journal_info = $journalu->info_for_js;
+            $journal_base ||= $journalu->journal_base;
+            $journal      ||= $journalu->username;
+        }
+
         my $remote = LJ::get_remote();
         my $hasremote = $remote ? 1 : 0;
         my $remote_is_suspended = $remote && $remote->is_suspended ? 1 : 0;
@@ -1387,12 +1394,6 @@
 
         my $site_params = LJ::js_dumper(\%site);
 
-        my %journal_info;
-
-        if (my $journalu = LJ::get_active_journal()) {
-            %journal_info = $journalu->info_for_js;
-        }
-
         my $current_lang = eval { BML::get_language(); } || ($LJ::DEFAULT_LANG || $LJ::LANGS[0]);
            $current_lang =~ s/^([^_]+)_.*/$1/; # en_LJ -> en
 
@@ -2238,16 +2239,22 @@
     push @classes, @{ $opts{'classes'} } if $opts{'classes'};
     push @classes, (LJ::get_remote()) ? 'logged-in' : 'logged-out';
 
-    my $uri = LJ::Request->uri;
+    my $uri  = LJ::Request->uri;
+    my $host = LJ::Request->header_in("Host");
     if ($uri =~ m!^/index\.bml$!) {
         push @classes, "index-page";
     } elsif ($uri =~ m!^/shop(/.*)?$!) {
         push @classes, "shop-page";
     } elsif ($uri =~ m!^/browse(/.*)?$!) {
         push @classes, "catalogue-page";
-    } elsif ($uri =~ m!^/games(/.*)?$! || LJ::Request->header_in("Host") eq "$LJ::USERAPPS_SUBDOMAIN.$LJ::DOMAIN") {
+    } elsif ($uri =~ m!^/games(/.*)?$! || $host eq "$LJ::USERAPPS_SUBDOMAIN.$LJ::DOMAIN") {
         push @classes, 'framework-page';
-    } elsif ($uri =~ m|^/friendstimes|){
+    } elsif ($uri =~ m|^/friendstimes|
+             or ($host =~ m!^(\w+)\.\Q$LJ::USER_DOMAIN\E$!
+                 and $LJ::IS_USER_DOMAIN->{$1}
+                 and $uri =~ m!/([\w-]+)/friendstimes/?!
+                 )
+    ){
         push @classes, "p-friendstimes";
     }
     return join(" ", @classes);

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