juks (juks) wrote in changelog,
juks
juks
changelog

[livejournal] r18186: LJSUP-7445 Try & buy

Committer: iaskarov
LJSUP-7445 Try & buy
U   trunk/htdocs/update.bml
Modified: trunk/htdocs/update.bml
===================================================================
--- trunk/htdocs/update.bml	2011-02-02 09:19:09 UTC (rev 18185)
+++ trunk/htdocs/update.bml	2011-02-02 11:01:22 UTC (rev 18186)
@@ -45,6 +45,11 @@
 
     # get remote and see if they can post right now
     my $remote = LJ::get_remote();
+    
+    # Should we show try and buy
+    my $show_trynbuy = !$remote
+                        || !(!LJ::TryNBuy->active($remote) && $remote->get_cap('paid')) && !LJ::TryNBuy->already_used($remote)
+                        || !LJ::TryNBuy->active($remote) && !LJ::TryNBuy->already_used($remote);
 
     # Errors that are unlikely to change between starting
     # to compose an entry and submitting it.
@@ -539,7 +544,8 @@
                         "</ul>";
 
                     $$body .= LJ::Widget::GettingStarted->render;
-                    $$body .= LJ::Widget::Trynbuy->render(stage => 'simple');
+                    
+                    $$body .= LJ::Widget::Trynbuy->render(stage => 'simple') if($show_trynbuy);
                 }
 
                 $$body .= "</td><td style=\"padding-left: 2em;\">";
@@ -568,13 +574,13 @@
     {
         my $ad_details;
         my $ad = LJ::get_ads({ location => 'bml.update/main', get_slots_params => \$ad_details, interests_extra => $qid ? { qotd => $qotd } : {} });
-        my $trynbuy = LJ::Widget::Trynbuy->render(stage => 'simple');
+        my $trynbuy = LJ::Widget::Trynbuy->render(stage => 'simple') if($show_trynbuy);
         if ($ad) {
             my $width = $ad_details->[-1]->{width};
             my $adunit = $ad_details->[-1]->{adunit};
             $$body .= "<td class='$adunit' style='width: ${width}px; padding-left: 1em;'>$ad $trynbuy";
         } else {
-            $$body .= "<td>";
+            $$body .= "<td>$trynbuy";
         }
     }
 

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