/**
  * Load view with appropriate public post list. Default to reverse chronological order.
  * @param string $list
  */
 private function loadPublicPostList($list)
 {
     $totals = $this->post_dao->getTotalPagesAndPostsByPublicInstances($this->total_posts_per_page);
     switch ($list) {
         case 'timeline':
             $this->addToView('posts', $this->post_dao->getPostsByPublicInstances($this->current_page, $this->total_posts_per_page));
             $this->addToView('header', 'Latest');
             $this->addToView('description', 'Latest public posts and public replies');
             break;
         case 'mostretweets':
             $this->addToView('posts', $this->post_dao->getMostRetweetedPostsByPublicInstances($this->current_page, $this->total_posts_per_page));
             $this->addToView('header', 'Most forwarded');
             $this->addToView('description', 'Posts that have been forwarded most often');
             break;
         case 'mostretweets1wk':
             $this->addToView('posts', $this->post_dao->getMostRetweetedPostsByPublicInstancesInLastWeek($this->current_page, $this->total_posts_per_page));
             $this->addToView('header', 'Most forwarded this week');
             $this->addToView('description', 'Posts that have been forwarded most often this week');
             $totals = $this->post_dao->getTotalPagesAndPostsByPublicInstances($this->total_posts_per_page, 7);
             break;
         case 'mostreplies':
             $this->addToView('posts', $this->post_dao->getMostRepliedToPostsByPublicInstances($this->current_page, $this->total_posts_per_page));
             $this->addToView('header', 'Most replied to');
             $this->addToView('description', 'Posts that have been replied to most often');
             break;
         case 'mostreplies1wk':
             $this->addToView('posts', $this->post_dao->getMostRepliedToPostsByPublicInstancesInLastWeek($this->current_page, $this->total_posts_per_page));
             $this->addToView('header', 'Most replied to this week');
             $this->addToView('description', 'Posts that have been replied to most often this week');
             $totals = $this->post_dao->getTotalPagesAndPostsByPublicInstances($this->total_posts_per_page, 7);
             break;
         case 'photos':
             $this->addToView('posts', $this->post_dao->getPhotoPostsByPublicInstances($this->current_page, $this->total_posts_per_page));
             $this->addToView('header', 'Photos');
             $this->addToView('description', 'Posted photos');
             break;
         case 'links':
             $totals = $this->post_dao->getTotalLinkPagesAndPostsByPublicInstances($this->total_posts_per_page);
             $this->addToView('posts', $this->post_dao->getLinkPostsByPublicInstances($this->current_page, $this->total_posts_per_page));
             $this->addToView('header', 'Links');
             $this->addToView('description', 'Posted links');
             break;
         default:
             $this->addToView('posts', $this->post_dao->getPostsByPublicInstances($this->current_page, $this->total_posts_per_page));
             $this->addToView('header', 'Latest');
             $this->addToView('description', 'Latest public posts and public replies');
             break;
     }
     if ($totals['total_pages'] > $this->current_page) {
         $this->addToView('next_page', $this->current_page + 1);
     }
     $this->addToView('total_pages', $totals['total_pages']);
 }
Exemple #2
0
         $s->assign('posts', $pd->getMostRetweetedPostsByPublicInstances($page, $count));
         $s->assign('site_root', $THINKTANK_CFG['site_root_path']);
     }
     $s->assign('header', 'Most forwarded');
     $s->assign('description', 'Posts that have been forwarded most often');
     $s->display('public.tpl', 'mostretweets-' . $i->network_username . "-" . $_u . "-" . $page);
     break;
 case 'mostreplies':
     if (!$s->is_cached('public.tpl', 'mostreplies-' . $page)) {
         $totals = $pd->getTotalPagesAndPostsByPublicInstances($count);
         if ($totals['total_pages'] > $page) {
             $s->assign('next_page', $page + 1);
         }
         $s->assign('current_page', $page);
         $s->assign('total_pages', $totals['total_pages']);
         $s->assign('posts', $pd->getMostRepliedToPostsByPublicInstances($page, $count));
         $s->assign('site_root', $THINKTANK_CFG['site_root_path']);
     }
     $s->assign('header', 'Most replied to');
     $s->assign('description', 'Posts that have been replied to most often');
     $s->display('public.tpl', 'mostreplies-' . $i->network_username . "-" . $_u . "-" . $page);
     break;
 case 'photos':
     if (!$s->is_cached('public.tpl', 'photos-' . $page)) {
         $totals = $pd->getTotalPhotoPagesAndPostsByPublicInstances($count);
         if ($totals['total_pages'] > $page) {
             $s->assign('next_page', $page + 1);
         }
         $s->assign('current_page', $page);
         $s->assign('total_pages', $totals['total_pages']);
         $s->assign('posts', $pd->getPhotoPostsByPublicInstances($page, $count));