[livejournal] r21909: LJSUP-11807: Photohosting branding

Committer: wisest-owl
LJSUP-11807: Photohosting branding

U   trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2012-05-10 09:16:57 UTC (rev 21908)
+++ trunk/cgi-bin/weblib.pl	2012-05-10 09:25:23 UTC (rev 21909)
@@ -22,6 +22,7 @@
                       );
 use LJ::ControlStrip;
 use LJ::SiteScheme;
+use LJ::Pics::Album;
 use Apache::WURFL;
 use Encode;
 
@@ -2383,7 +2384,19 @@
     } elsif ($uri =~ m!^/shop(/.*)?$!) {
         push @classes, "shop-page";
     } elsif ($uri =~ m!^/pics(/.*)?$!) {
-        push @classes, "framework-page";
+        if (LJ::_is_pics_branding_active()) {
+            my $remote = LJ::get_remote ();
+            if (LJ::Pics::Album->list( 'userid' => $remote->userid )) {
+                ## photos exists
+                push @classes, "framework-page-view";
+            } else {
+                ## no photos
+                push @classes, "framework-page-promo";
+            }
+        } else {
+            ## branding is not active
+            push @classes, "framework-page";
+        }
     } elsif ($uri =~ m!^/browse(/.*)?$!) {
         push @classes, "catalogue-page";
     } elsif ($uri =~ m!^/games(/.*)?$! || $host eq "$LJ::USERAPPS_SUBDOMAIN.$LJ::DOMAIN") {