juks (juks) wrote in changelog,
juks
juks
changelog

[ljcom] r9983: LJSUP-7445 Try & buy

Committer: iaskarov
LJSUP-7445 Try & buy
U   trunk/cgi-bin/LJ/Pay.pm
U   trunk/cgi-bin/LJ/Widget/HomepageEN.pm
U   trunk/cgi-bin/LJ/Widget/HomepageRU.pm
Modified: trunk/cgi-bin/LJ/Pay.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay.pm	2011-02-02 10:03:00 UTC (rev 9982)
+++ trunk/cgi-bin/LJ/Pay.pm	2011-02-02 11:03:13 UTC (rev 9983)
@@ -390,6 +390,8 @@
     my $upgrade_link = !$u->in_class("plus") && !$u->get_cap("paid") ? LJ::run_hook("upgrade_link", $u, "plus") : "";
 
     my $ret;
+    
+    my $show_trynbuy = !$u || !$u->get_cap('paid');
 
     $ret .= "<?standout " unless $opts->{'nostandout'};
 
@@ -401,7 +403,7 @@
     $ret .= '<td class="b-accstats-subhead b-accstats-storage"><span>' . BML::ml('pay.widget.storage.title') . '</span></td>' unless $is_comm || $is_identity;
     $ret .= '<td class="b-accstats-subhead b-accstats-subs"><span>' . BML::ml('pay.widget.subscriptions.title') . '</span></td>' if $u->can_use_esn && !$u->is_community;
     $ret .= '<td class="b-accstats-subhead b-accstats-voice"><span>' . BML::ml('pay.widget.voiceposts.title') . '</span></td>' unless $is_comm || $is_identity;
-    if (!$u->get_cap('paid')) {
+    if ($show_trynbuy) {
         $ret .= '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/manage/account/?changelevel=1" class="b-accstats-trynbuy">' . BML::ml('pay.widget.trynbuy') . '</a></td>';
         $ret .= $is_identity ? '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/identity/convert.bml" class="b-accstats-upgrade">' . BML::ml('pay.widget.upgradefull') . '</a></td>' : '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/manage/account/?changelevel=2" class="b-accstats-upgrade">' . BML::ml('pay.widget.upgradenow') . '</a></td>';
     }
@@ -456,7 +458,7 @@
         unless $is_comm || $is_identity;
     
     $ret .= '</tr>';
-    if (!$u->get_cap('paid')) {
+    if($show_trynbuy) {
         $ret .= '<tr>';
         $ret .= '<th class="b-accstats-subhead b-accstats-border">' . BML::ml('pay.widget.upgrade') . '</th>';
         $ret .= '<td class="b-accstats-border">' . BML::ml('pay.widget.upgradebonus.userpics') . '</td>';

Modified: trunk/cgi-bin/LJ/Widget/HomepageEN.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/HomepageEN.pm	2011-02-02 10:03:00 UTC (rev 9982)
+++ trunk/cgi-bin/LJ/Widget/HomepageEN.pm	2011-02-02 11:03:13 UTC (rev 9983)
@@ -156,7 +156,9 @@
     $result{widget_publicstats} = LJ::Widget::PublicStats->render( show_latest_posts => 0, short_numbers => 1 );
     
     ## Widget Trynbuy
-    $result{widget_trynbuy} = LJ::Widget::Trynbuy->render(stage => 'simple');
+    if(!$remote || !$remote->get_cap('paid') && !LJ::TryNBuy->active($remote)) {
+        $result{widget_trynbuy} = LJ::Widget::Trynbuy->render(stage => 'simple');
+    }
     
     ## Strings
     $result{string_loggedout_facts_open} = BML::ml('.loggedout.facts.open', { aopts => "href='http://www.livejournal.org/'" });

Modified: trunk/cgi-bin/LJ/Widget/HomepageRU.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/HomepageRU.pm	2011-02-02 10:03:00 UTC (rev 9982)
+++ trunk/cgi-bin/LJ/Widget/HomepageRU.pm	2011-02-02 11:03:13 UTC (rev 9983)
@@ -129,8 +129,10 @@
     $result{widget_settingproddisplay} = LJ::Widget::SettingProdDisplay->render;
     
     ## Widget Trynbuy
-    $result{widget_trynbuy} = LJ::Widget::Trynbuy->render(stage => 'simple');
-    
+    if(!$remote || !$remote->get_cap('paid') && !LJ::TryNBuy->active($remote)) {
+        $result{widget_trynbuy} = LJ::Widget::Trynbuy->render(stage => 'simple');
+    }
+
     ## Strings
     $result{string_join_lj_url} = LJ::run_hook('construct_adcall', orient => "App-Join-Livejournal");
 

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