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; }
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']; } } }