当前位置: 首页>>代码示例>>PHP>>正文


PHP DiscussionModel::GetCountParticipated方法代码示例

本文整理汇总了PHP中DiscussionModel::GetCountParticipated方法的典型用法代码示例。如果您正苦于以下问题:PHP DiscussionModel::GetCountParticipated方法的具体用法?PHP DiscussionModel::GetCountParticipated怎么用?PHP DiscussionModel::GetCountParticipated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DiscussionModel的用法示例。


在下文中一共展示了DiscussionModel::GetCountParticipated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DiscussionsController_Participated_Create

 public function DiscussionsController_Participated_Create(&$Sender, $Args)
 {
     $Sender->Permission('Garden.SignIn.Allow');
     $Page = GetValue(0, $Args);
     $Limit = GetValue(1, $Args);
     list($Offset, $Limit) = OffsetLimit($Page, Gdn::Config('Vanilla.Discussions.PerPage', 30));
     // Get Discussions
     $DiscussionModel = new DiscussionModel();
     $Sender->DiscussionData = $DiscussionModel->GetParticipated(Gdn::Session()->UserID, $Offset, $Limit);
     $Sender->SetData('Discussions', $Sender->DiscussionData);
     $CountDiscussions = $DiscussionModel->GetCountParticipated(Gdn::Session()->UserID);
     $Sender->SetData('CountDiscussions', $CountDiscussions);
     // Build a pager
     $PagerFactory = new Gdn_PagerFactory();
     $Sender->EventArguments['PagerType'] = 'Pager';
     $Sender->FireEvent('BeforeBuildPager');
     $Sender->Pager = $PagerFactory->GetPager($Sender->EventArguments['PagerType'], $Sender);
     $Sender->Pager->ClientID = 'Pager';
     $Sender->Pager->Configure($Offset, $Limit, $CountDiscussions, 'discussions/participated/%1$s');
     $Sender->FireEvent('AfterBuildPager');
     // Deliver JSON data if necessary
     if ($Sender->DeliveryType() != DELIVERY_TYPE_ALL) {
         $Sender->SetJson('LessRow', $Sender->Pager->ToString('less'));
         $Sender->SetJson('MoreRow', $Sender->Pager->ToString('more'));
         $Sender->View = 'discussions';
     }
     // Add modules
     $Sender->AddModule('NewDiscussionModule');
     $Sender->AddModule('CategoriesModule');
     $BookmarkedModule = new BookmarkedModule($Sender);
     $BookmarkedModule->GetData();
     $Sender->AddModule($BookmarkedModule);
     $Sender->Render($this->GetView('participated.php'));
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:34,代码来源:class.participated.plugin.php

示例2: GetCountParticipated

 protected function GetCountParticipated()
 {
     if (is_null($this->CountParticipated)) {
         $DiscussionModel = new DiscussionModel();
         try {
             $this->CountParticipated = $DiscussionModel->GetCountParticipated(NULL);
         } catch (Exception $e) {
             $this->CountParticipated = FALSE;
         }
     }
     return $this->CountParticipated;
 }
开发者ID:SatiricMan,项目名称:addons,代码行数:12,代码来源:class.participated.plugin.php


注:本文中的DiscussionModel::GetCountParticipated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。