當前位置: 首頁>>代碼示例>>PHP>>正文


PHP NewsModel::getNewsCountByNewsTreeFeedsId方法代碼示例

本文整理匯總了PHP中NewsModel::getNewsCountByNewsTreeFeedsId方法的典型用法代碼示例。如果您正苦於以下問題:PHP NewsModel::getNewsCountByNewsTreeFeedsId方法的具體用法?PHP NewsModel::getNewsCountByNewsTreeFeedsId怎麽用?PHP NewsModel::getNewsCountByNewsTreeFeedsId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NewsModel的用法示例。


在下文中一共展示了NewsModel::getNewsCountByNewsTreeFeedsId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: NewsAction


//.........這裏部分代碼省略.........
         $this->_view->assign('newsViewType', $_SESSION['newsViewType']);
         $this->_view->assign('nShowRows', 4);
         // Show all news records
     }
     $this->_view->assign('shownow', $request->shownow);
     $this->_view->assign('viewCheckedClass', $viewCheckedClass);
     $this->_view->assign('viewFilterCheckedClass', $newsViewFilter);
     // END view type and filters
     $this->_view->assign('user_id', $user->id);
     $this->_view->assign('isAdmin', $isAdmin);
     $this->_view->assign('isPartner', $isPartner);
     $news_tree_id = $request->news_tree_id;
     if ($request->news_id) {
         if ($isAdmin) {
             $isNewsTreeActive = false;
             $isNewsBannersActive = false;
         } else {
             $isNewsTreeActive = true;
             $isNewsBannersActive = true;
         }
         $news = $newsModel->getNewsById($request->news_id, $user->id, $isNewsTreeActive, $isNewsBannersActive);
         if (!$news) {
             Project::getResponse()->redirect(Project::getRequest()->createUrl('News', 'News'));
         }
         $this->_view->assign('news', $news);
         $tabsNews = array("title" => $newsModel->getNWordsFromText($news['news_title'], 7), "id" => $request->news_id);
         if (!$isTabsSnow) {
             $this->_view->assign('tab_list', TabController::getNewsTabs($user->id, $isAdmin, false, false, false, false, true, $tabsNews));
             // Show tabs
             $isTabsSnow = true;
         }
         $this->_view->assign('isShowOneNews', true);
         $newsModel->setNews_Views($request->news_id, 1);
     } else {
         if (!$isTabsSnow) {
             $this->_view->assign('tab_list', TabController::getNewsTabs($user->id, $isAdmin, true));
             // Show tabs
             $isTabsSnow = true;
         }
         $this->_view->assign('isShowOneNews', false);
     }
     $aNewsTreeList = $newsModel->getAllNews();
     $this->_view->assign('news_tree_list', $aNewsTreeList);
     // all News tree
     $this->_view->assign('filterNewsTree', $request->filterNewsTree);
     // filter by News tree ID
     $this->_view->assign('filterNewsTreeFeeds', $request->filterNewsTreeFeeds);
     // filter by News tree feeds ID
     // PAGER
     $news_per_page = $this->getParam("NEWS_PER_PAGE");
     $pager_view = new SitePagerView();
     if ($request->filterNewsTreeFeeds) {
         // pager for All news , filterNewsTreeFeeds
         $news_count = $newsModel->getNewsCountByNewsTreeFeedsId($request->filterNewsTreeFeeds, $user->id, $isOnlySubscribeNewsTree, $isOnlyFavoriteNews);
         $pages_number = $pager_view->getPagesNumber($news_count, $news_per_page);
         $current_page_number = $request->getKeyByNumber(2);
         $news_pager = $pager_view->show3('News', 'News', array("shownow" => "allnews", "filterNewsTreeFeeds" => $request->filterNewsTreeFeeds), $pages_number, $current_page_number);
         $this->_view->assign('news_tree_pager', $news_pager);
         $this->_view->assign('page_settings', array("record_per_page" => $news_per_page, "current_page_number" => $current_page_number + 1));
     } elseif ($request->filterNewsTree) {
         // pager for All news , filterNewsTree
         $news_count = $newsModel->getNewsCountByNewsTreeId($request->filterNewsTree, $user->id, $isOnlySubscribeNewsTree, $isOnlyFavoriteNews);
         $pages_number = $pager_view->getPagesNumber($news_count, $news_per_page);
         $current_page_number = $request->getKeyByNumber(2);
         $news_pager = $pager_view->show3('News', 'News', array("shownow" => "allnews", "filterNewsTree" => $request->filterNewsTree), $pages_number, $current_page_number);
         $this->_view->assign('news_tree_pager', $news_pager);
         $this->_view->assign('page_settings', array("record_per_page" => $news_per_page, "current_page_number" => $current_page_number + 1));
     }
     // END PAGER
     $aNewsSubscribe = $newsModel->getNewsSubscribeByUserId($user->id);
     $this->_view->assign('aNewsSubscribe', $aNewsSubscribe);
     // all NewsSubscribe
     switch ($request->view) {
         // View type
         /*        case 'full': // full news list
         	           $_SESSION['newsViewType'] = 'full';
         	           break;
         	        case 'report': // report news list
         	           $_SESSION['newsViewType'] = 'report';
         	           break;
         	         */
         case 'news_all':
             // no filter, all news
             $this->_view->assign('tab_list', TabController::getNewsTabs($user->id, $isAdmin, true, false, false, false, false, $tabsNews));
             // Show tabs
             break;
         case 'news_subscribe':
             // filter, only subscribe news
             $this->_view->assign('tab_list', TabController::getNewsTabs($user->id, $isAdmin, false, false, true, false, false, $tabsNews));
             // Show tabs
             break;
         case 'news_stared':
             // filter, only news star
             $this->_view->assign('tab_list', TabController::getNewsTabs($user->id, $isAdmin, false, false, false, false, false, $tabsNews, false, false, false, false, false, true));
             // Show tabs
             break;
     }
     $this->_view->NewsPage();
     $this->_view->parse();
 }
開發者ID:amanai,項目名稱:next24,代碼行數:101,代碼來源:NewsController.php

示例2: getNewsCountByNewsTreeFeedsId

 public function getNewsCountByNewsTreeFeedsId($news_tree_feeds_id, $user_id = 0, $isOnlySubscribeNewsTree = false, $isOnlyFavoriteNews = false, $isFeedActive = true, $isNewsTreeActive = true, $isNewsBannersActive = true)
 {
     $newsModel = new NewsModel();
     $newsCount = $newsModel->getNewsCountByNewsTreeFeedsId($news_tree_feeds_id, $user_id, $isOnlySubscribeNewsTree, $isOnlyFavoriteNews, $isFeedActive, $isNewsTreeActive, $isNewsBannersActive);
     return $newsCount;
 }
開發者ID:amanai,項目名稱:next24,代碼行數:6,代碼來源:NewsView.php


注:本文中的NewsModel::getNewsCountByNewsTreeFeedsId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。