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


PHP ActivityModel::getComments方法代码示例

本文整理汇总了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();
 }
开发者ID:oMadMartigaNo,项目名称:readjust-forum,代码行数:22,代码来源:class.activitycontroller.php

示例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();
 }
开发者ID:sitexa,项目名称:vanilla,代码行数:45,代码来源:class.activitycontroller.php


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