public function store($tweet, $author) { if (!$tweet->getId()) $tweet->createId($author); HypertableConnection::insert('tweet', $tweet->getId(), 'message', $tweet->getMessage()); $u=UserTable::load($author); $u->sendTweet($tweet); return true; }
public function followersAction() { $limit = 10; $request = $this->getRequest(); $profile = Zend_Auth::getInstance()->getIdentity(); $this->view->sendForm = $this->getSendForm(); $this->view->show = 'followers'; $user = UserTable::load($profile->getId()); if (!$user) { return $this->render('index'); } $this->view->data = $user->getFollowers($request->getParam('cutoff'), $limit); if (count($this->view->data) < $limit) { $this->view->new_cutoff_time = 0; } else { $this->view->new_cutoff_time = $user->getCutoffTime(); } return $this->render('index'); }
public function unfollowAction() { $request=$this->getRequest(); $other=basename($request->getRequestUri()); // load my own profile and user settings $profile=Zend_Auth::getInstance()->getIdentity(); $user=UserTable::load($profile->getId()); // check if we're following this user; if not, then return // to the frontpage if (!$user->isFollowing($other)) { return $this->_helper->redirector('index', 'index'); } // otherwise remove 'other' from the follower list $user->unfollow($other); return $this->_helper->redirector->gotoUrl("/profile/show/$other"); }