Beispiel #1
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);
 }
Beispiel #2
0
 public function addAction()
 {
     $vote = Red_User::isLoggedIn();
     if ($vote) {
         $this->_helper->redirector('vote', 'content');
     }
     $form = $this->getAddContentForm('Add Content!');
     if ($this->getRequest()->isPost()) {
         /**
          * Form Posted ????
          */
         if ($form->isValid($_POST)) {
             $content = $form->getValues();
             $contentID = Red_Content::addContent($content['title'], $content['description']);
             if ($contentID) {
                 $this->_helper->redirector('profile', 'user');
             }
         }
     }
     $this->view->form = $form;
 }