本文整理汇总了PHP中ActivityModel::joinComments方法的典型用法代码示例。如果您正苦于以下问题:PHP ActivityModel::joinComments方法的具体用法?PHP ActivityModel::joinComments怎么用?PHP ActivityModel::joinComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActivityModel
的用法示例。
在下文中一共展示了ActivityModel::joinComments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Default activity stream.
*
* @since 2.0.0
* @access public
*
* @param int $Offset Number of activity items to skip.
*/
public function index($Filter = false, $Page = false)
{
switch (strtolower($Filter)) {
case 'mods':
$this->title(t('Recent Moderator Activity'));
$this->permission('Garden.Moderation.Manage');
$NotifyUserID = ActivityModel::NOTIFY_MODS;
break;
case 'admins':
$this->title(t('Recent Admin Activity'));
$this->permission('Garden.Settings.Manage');
$NotifyUserID = ActivityModel::NOTIFY_ADMINS;
break;
case '':
case 'feed':
// rss feed
$Filter = 'public';
$this->title(t('Recent Activity'));
$this->permission('Garden.Activity.View');
$NotifyUserID = ActivityModel::NOTIFY_PUBLIC;
break;
default:
throw notFoundException();
}
// Which page to load
list($Offset, $Limit) = offsetLimit($Page, c('Garden.Activities.PerPage', 30));
$Offset = is_numeric($Offset) ? $Offset : 0;
if ($Offset < 0) {
$Offset = 0;
}
// Page meta.
$this->addJsFile('activity.js');
$this->addJsFile('spoilers.js');
$this->addCssFile('spoilers.css');
if ($this->Head) {
$this->Head->addRss(url('/activity/feed.rss', true), $this->Head->title());
}
// Comment submission
$Session = Gdn::session();
$Comment = $this->Form->getFormValue('Comment');
$Activities = $this->ActivityModel->getWhere(array('NotifyUserID' => $NotifyUserID), '', '', $Limit, $Offset)->resultArray();
$this->ActivityModel->joinComments($Activities);
$this->setData('Filter', strtolower($Filter));
$this->setData('Activities', $Activities);
$this->addModule('ActivityFilterModule');
$this->View = 'all';
$this->render();
}