juks (juks) wrote in changelog,
juks
juks
changelog

[ljcom] r10039: LJSUP-7445 Try & buy

Committer: iaskarov
LJSUP-7445 Try & buy
U   trunk/cgi-bin/LJ/Pay.pm
U   trunk/htdocs/community/account.bml
Modified: trunk/cgi-bin/LJ/Pay.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay.pm	2011-02-15 08:15:04 UTC (rev 10038)
+++ trunk/cgi-bin/LJ/Pay.pm	2011-02-15 08:28:34 UTC (rev 10039)
@@ -391,7 +391,7 @@
 
     my $ret;
     
-    my $show_trynbuy = !$u || !$u->get_cap('paid');
+    my $show_trynbuy = !$u || LJ::TryNBuy->can_enable($u);
 
     $ret .= "<?standout " unless $opts->{'nostandout'};
 
@@ -403,10 +403,15 @@
     $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 ($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>';
+        $ret .= $is_comm ? '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/community/account.bml?authas=' . $u->user . '" class="b-accstats-trynbuy">' . BML::ml('pay.widget.trynbuy') . '</a></td>' : '<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>';
     }
+    
+    if(!$u->get_cap('paid')) {    
+        $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>' : ($is_comm ? '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/shop/paidaccount.bml?form=3" class="b-accstats-upgrade">' . BML::ml('pay.widget.upgradenow') . '</a></td>' : '<td rowspan="3" class="b-accstats-button"><a href="' . $LJ::SITEROOT .'/shop/paidaccount.bml?form=1" class="b-accstats-upgrade">' . BML::ml('pay.widget.upgradenow') . '</a></td>'));
+    }
+    
     $ret .= '</tr>';
     $ret .= '<tr>';
     $ret .= '<th class="b-accstats-subhead">' . BML::ml('pay.widget.header') . '</th>';
@@ -458,7 +463,7 @@
         unless $is_comm || $is_identity;
     
     $ret .= '</tr>';
-    if($show_trynbuy) {
+    if($show_trynbuy || !$u->get_cap('paid')) {
         $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/htdocs/community/account.bml
===================================================================
--- trunk/htdocs/community/account.bml	2011-02-15 08:15:04 UTC (rev 10038)
+++ trunk/htdocs/community/account.bml	2011-02-15 08:28:34 UTC (rev 10039)
@@ -94,7 +94,10 @@
         };
 
         # If Plus account
-        if ($u->in_class("plus")) {
+        if(LJ::TryNBuy->active($u)) {
+            $body .= "hui VAM!!!1";
+        # Free without ads
+        } elsif ($u->in_class("plus")) {
             $body .= "<table cellpadding='0' cellspacing='0' border='0'>";
             $body .= "<tr><td valign='top' width='50%' style='padding-right: 10px'>";
             if ($POST{areyousure}) {
@@ -132,8 +135,6 @@
             }
 
             $body .= "</td><td valign='top' width='50%'>\n";
-
-        # Free without ads
         } else {
             $body .= "<table cellpadding='0' cellspacing='0' border='0'>";
             $body .= "<tr><td valign='top' width='50%' style='padding-right: 10px'>";

Tags: bml, 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