Example #1
0
 public function archive()
 {
     $this->noUsername = true;
     $helper = new Helpers_Paginator_Status();
     $this->paginator = $helper->getStatuses($this->aclUser->id, $this->GET_VARS);
     $this->view->setName("common");
 }
Example #2
0
 public function rss()
 {
     $this->layout = false;
     $this->response->setHeader("Content-Type", "application/rss+xml; charset=utf-8");
     $rss = new Sabel_Rss_Writer();
     $rss->setInfo(array("title" => "Phwittr public timeline", "language" => "ja"));
     $helper = new Helpers_Paginator_Status();
     $paginator = $helper->getPublicStatuses(array());
     if ($paginator->results) {
         foreach ($paginator->results as $item) {
             $rss->addItem(array("uri" => "http://" . $_SERVER["SERVER_NAME"] . uri("a: status, param: {$item->id}"), "title" => mb_strimwidth($item->User->user_name . ": " . $item->comment, 0, 35, "..."), "content" => $item->User->user_name . ": " . $item->comment, "date" => $item->created_at));
         }
     }
     $this->contents = $rss->output();
 }
Example #3
0
 protected function home()
 {
     $protected = $this->aUser->isProtected();
     $this->clientId = $this->session->getClientId();
     if ($authenticated = $this->aclUser->isAuthenticated()) {
         $this->isFollowed = Follower::isFollowed($this->aclUser->id, $this->aUser->uid);
         if ($this->isFollowed) {
             $protected = false;
         }
     }
     if ($protected) {
         if ($authenticated) {
             $this->isRequested = Request::isRequested($this->aclUser->id, $this->aUser->uid);
         }
         $this->view->setName("protected");
     } else {
         $helper = new Helpers_Paginator_Status();
         $this->paginator = $helper->getStatuses($this->aUser->uid, $this->GET_VARS, 50);
         $this->view->setName("home");
     }
 }
Example #4
0
 /**
  * @test
  */
 public function getPublicStatuses()
 {
     $user1 = $this->getUser("test1");
     $user2 = $this->getUser("test2");
     $user3 = $this->getUser("test3");
     $helper = new Helpers_Paginator_Status();
     $paginator = $helper->getPublicStatuses(array(), 5);
     $this->eq(36, $paginator->count);
     $user2->private_flag = false;
     $user2->save();
     $paginator = $helper->getPublicStatuses(array(), 5);
     $this->eq(45, $paginator->count);
     $user2->private_flag = true;
     $user2->save();
 }