Exemplo n.º 1
0
 public static function thumbDown($purchase_id, $content_id)
 {
     $database = Zend_Db_Table::getDefaultAdapter();
     $update = array('positive' => 0);
     $database->update('purchase', $update, "purchase_id = {$purchase_id}");
     $content = Red_Content::getContent($content_id);
     $oldprice = $content['price'];
     if ($oldprice > 1) {
         $update = array('price' => $oldprice - 0.1);
         $database->update('content', $update, "content_id = {$content_id}");
     }
     return true;
 }
Exemplo n.º 2
0
 public function profileAction()
 {
     $vote = Red_User::isLoggedIn();
     if ($vote) {
         $this->_helper->redirector('vote', 'content');
     }
     $user_id = $this->getRequest()->getParam('user');
     if (!$user_id) {
         $user_id = $_SESSION['user']['user_id'];
     }
     $this->view->contents = Red_Content::getContents(null, 'date_added', $user_id);
     $this->view->user = Red_User::selectProfile($user_id);
 }
Exemplo n.º 3
0
 public function indexAction()
 {
     $ipn_data = array('payment_status' => 'verified', 'first_name' => 'Stephan', 'last_name' => 'Thayne', 'payer_email' => '*****@*****.**', 'payer_id' => '1', 'address_name' => 'Stephan Thayne', 'address_country' => 'USA', 'address_zip' => '84065', 'address_state' => 'Utah', 'address_city' => 'Riverton', 'address_street' => '12020 s 2240 e', 'address_country_code' => 'US', 'buisness' => 'Stephan', 'reciever_email' => '*****@*****.**', 'reciever_id' => '22', 'item_name' => 'content', 'mc_gross' => '1.00', 'custom' => array('user_id' => '1', 'content_id' => '1'));
     $user_id = $ipn_data['custom']['user_id'];
     $content_id = $ipn_data['custom']['content_id'];
     $content = $ipn_data['item_name'];
     $first_name = $ipn_data['first_name'];
     $last_name = $ipn_data['last_name'];
     $email = $ipn_data['payer_email'];
     $payment_status = $ipn_data['payment_status'];
     if ($payment_status == 'verified') {
         Red_Content::purchaseContent($user_id, $content_id);
         $user = array('first_name' => $first_name, 'last_name' => $last_name, 'email' => $email, 'content' => $content);
         Red_Content::emailPurchase($user);
     }
 }
Exemplo n.º 4
0
 public function voteAction()
 {
     $purchase = Red_User::getNeedsVote($_SESSION['user']['user_id']);
     foreach ($purchase as $check) {
         if ($check['positive'] == '') {
             $this->view->vote = Red_Content::getContent($check['content_id']);
             $this->view->purchase_id = $check['purchase_id'];
         }
     }
 }