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); }
public function indexAction() { $vote = Red_User::isLoggedIn(); if ($vote) { $this->_helper->redirector('vote', 'content'); } $database = Zend_Db_Table::getDefaultAdapter(); if (isset($_POST['searched'])) { $search = $_POST['searched']; $sort = $_POST['sort']; $this->view->last_search = $search; $this->view->last_sort = $sort; $this->view->contents = Red_Content::getContents($search, $sort); } else { $this->view->contents = Red_Content::getContents(); } }