wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r23349: LJSUP-13388: LJ Shop - Styles

Committer: wisest-owl
LJSUP-13388: LJ Shop - Styles

U   trunk/cgi-bin/LJ/Customize.pm
U   trunk/cgi-bin/LJ/Widget/ThemeChooser.pm
Modified: trunk/cgi-bin/LJ/Customize.pm
===================================================================
--- trunk/cgi-bin/LJ/Customize.pm	2012-11-23 07:28:18 UTC (rev 23348)
+++ trunk/cgi-bin/LJ/Customize.pm	2012-11-23 11:18:57 UTC (rev 23349)
@@ -330,7 +330,7 @@
 
         if ($theme->is_buyable) {
             my $shop_theme = LJ::Pay::Theme->load_by_s2lid ($theme->s2lid);
-            next if $shop_theme && $shop_theme->is_disabled;
+            next if $shop_theme && ($shop_theme->is_bought_out || $shop_theme->is_disabled);
         }
 
         my $theme_name = LJ::ejs($theme->name);

Modified: trunk/cgi-bin/LJ/Widget/ThemeChooser.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/ThemeChooser.pm	2012-11-23 07:28:18 UTC (rev 23348)
+++ trunk/cgi-bin/LJ/Widget/ThemeChooser.pm	2012-11-23 11:18:57 UTC (rev 23349)
@@ -132,9 +132,12 @@
     foreach my $theme (@themes_this_page) {
         next unless defined $theme;
 
+        my $is_bought = 0;
         if ($theme->is_buyable) {
             my $shop_theme = LJ::Pay::Theme->load_by_s2lid ($theme->s2lid);
-            next if $shop_theme && $shop_theme->is_disabled;
+            my @purchased = LJ::S2Theme->load_purchased ($u);
+            $is_bought = 1 if grep { $_->s2lid == $shop_theme->s2tid } @purchased;
+            next if $shop_theme && ($shop_theme->is_bought_out || $shop_theme->is_disabled);
         }
 
         # figure out the type(s) of theme this is so we can modify the output accordingly
@@ -144,9 +147,9 @@
         } elsif (!$theme->themeid && !$current_theme->themeid) {
             $theme_types{current} = 1 if $theme->layoutid == $current_theme->layoutid;
         }
-        $theme_types{upgrade} = 1 if !$filter_available && !$theme->available_to($u);
+        $theme_types{upgrade} = 1 if !$is_bought && !$filter_available && !$theme->available_to($u);
         $theme_types{special} = 1 if LJ::run_hook("layer_is_special", $theme->uniq);
-        $theme_types{shop_item} = 1 if !$theme_types{current} && $theme->is_buyable;
+        $theme_types{shop_item} = 1 if !$is_bought && !$theme_types{current} && $theme->is_buyable;
 
         
         my ($theme_class, $theme_options, $theme_icons) = ("", "", "");

Tags: livejournal, pm, wisest-owl
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