本文整理汇总了PHP中ActivityModel::getComments方法的典型用法代码示例。如果您正苦于以下问题:PHP ActivityModel::getComments方法的具体用法?PHP ActivityModel::getComments怎么用?PHP ActivityModel::getComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActivityModel
的用法示例。
在下文中一共展示了ActivityModel::getComments方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: item
/**
* Display a single activity item & comments.
*
* Email notifications regarding activities link to this method.
*
* @since 2.0.0
* @access public
*
* @param int $ActivityID Unique ID of activity item to display.
*/
public function item($ActivityID = 0)
{
$this->addJsFile('activity.js');
$this->title(t('Activity Item'));
if (!is_numeric($ActivityID) || $ActivityID < 0) {
$ActivityID = 0;
}
$this->ActivityData = $this->ActivityModel->getWhere(array('ActivityID' => $ActivityID));
$this->setData('Comments', $this->ActivityModel->getComments(array($ActivityID)));
$this->setData('Activities', $this->ActivityData);
$this->render();
}
示例2: item
/**
* Display a single activity item & comments.
*
* Email notifications regarding activities link to this method.
*
* @since 2.0.0
* @access public
*
* @param int $ActivityID Unique ID of activity item to display.
*/
public function item($ActivityID = 0)
{
$this->addJsFile('activity.js');
$this->title(t('Activity Item'));
if (!is_numeric($ActivityID) || $ActivityID < 0) {
$ActivityID = 0;
}
$this->ActivityData = $this->ActivityModel->getWhere(array('ActivityID' => $ActivityID));
// Check visibility.
$userid = val('NotifyUserID', $this->ActivityData->firstRow());
switch ($userid) {
case ActivityModel::NOTIFY_PUBLIC:
// Carry on!
break;
case ActivityModel::NOTIFY_MODS:
if (!checkPermission('Garden.Moderation.Manage')) {
throw permissionException();
}
break;
case ActivityModel::NOTIFY_ADMIN:
if (!checkPermission('Garden.Settings.Manage')) {
throw permissionException();
}
break;
default:
// Actual userid.
if (!checkPermission('Garden.Community.Manage') && Gdn::Session()->UserID !== $userid) {
throw permissionException();
}
break;
}
$this->setData('Comments', $this->ActivityModel->getComments(array($ActivityID)));
$this->setData('Activities', $this->ActivityData);
$this->render();
}