журнал журнал (shhh) wrote in changelog,
журнал журнал
shhh
changelog

[livejournal] r22659: LJSUP-13108: Paid repost button

Committer: nnikulochkina
LJSUP-13108: Paid repost button
U   trunk/cgi-bin/LJ/Entry/Repost.pm
Modified: trunk/cgi-bin/LJ/Entry/Repost.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry/Repost.pm	2012-08-15 13:46:35 UTC (rev 22658)
+++ trunk/cgi-bin/LJ/Entry/Repost.pm	2012-08-15 13:47:28 UTC (rev 22659)
@@ -319,6 +319,9 @@
     my $reposted = 0;
     my $paid     = 0;
     my $cost     = 0;
+    
+    my $is_owner = ($entry_obj->posterid == $u->userid) ? 1 : 0;
+
     if ($u) {
         ($reposted, $cost) = __get_repost( $entry_obj->journal, 
                                            $entry_obj->jitemid, 
@@ -331,7 +334,7 @@
         if ($paid && !$reposted) {
             $cost = __get_cost($entry_obj, $u);
 
-            $paid = 0 if ($cost == 0 && $entry_obj->posterid != $u->userid)
+            $paid = 0 if ($cost == 0 && !$is_owner)
         }
     }
 
@@ -339,6 +342,7 @@
               'reposted' => $reposted,
               'paid'     => $paid,
               'cost'     => $cost,
+              $is_owner ? ('budget' => $entry_obj->repost_budget) : (),
             };
 }
 

Tags: livejournal, nikulochkina, nnikulochkina, 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