Committer: wisest-owl
LJSUP-13388: LJ Shop - StylesU trunk/cgi-bin/LJ/Widget/ThemeChooser.pm
Modified: trunk/cgi-bin/LJ/Widget/ThemeChooser.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/ThemeChooser.pm 2012-12-05 07:09:04 UTC (rev 23415) +++ trunk/cgi-bin/LJ/Widget/ThemeChooser.pm 2012-12-05 07:46:30 UTC (rev 23416) @@ -133,11 +133,12 @@ next unless defined $theme; my $is_bought = 0; + my $shop_theme = LJ::Pay::Theme->load_by_s2lid ($theme->s2lid); if ($theme->is_buyable) { - my $shop_theme = LJ::Pay::Theme->load_by_s2lid ($theme->s2lid); 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); + $is_bought = 1 if grep { $shop_theme && $_->s2lid == $shop_theme->s2tid } @purchased; + next if $shop_theme && $shop_theme->is_bough_out && $shop_theme->owner ne $u->{'user'}; + next if $shop_theme && $shop_theme->is_disabled && !$is_bought; } # figure out the type(s) of theme this is so we can modify the output accordingly @@ -190,7 +191,7 @@ $ret .= "<div class='theme-item$theme_class'><div class='theme-item-in'>"; $ret .= "<img src='" . $theme->preview_imgurl . "' class='theme-preview' alt='' />"; - $ret .= "<h4>" . $theme->name . "</h4>"; + $ret .= "<h4>" . ( $theme->is_buyable ? $shop_theme->name : $theme->name ) . "</h4>"; my $preview_redirect_url; if ($theme->themeid) {