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


PHP JTable::whoMakesAction方法代码示例

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


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

示例1: whoMakesAction

 /**
  * Call this function to retrieve the item/message viewer
  * @param JTable $stream the current StreamTable
  * @param int $item_id the owner of the item (for example: id of the file or id of a message contains a link)
  * @param String $type type of the item (since tracking is done by id, being specific is safer. eg: file_220, link_220)
  */
 function whoMakesAction($stream, $item_id = 0, $type = NULL)
 {
     // get list of avatar who viewed the stream
     $whoMakesAction = $stream->whoMakesAction($item_id, $type);
     $avatarListWhoMakeAction = '';
     if ($whoMakesAction && count($whoMakesAction) > 0) {
         // Do rename the variable if its too long or easily mistyped
         $avatarListWhoMakeAction .= '<div class="user-horizontal-list message-reader-list">';
         if ($type == 'video') {
             // change language from READ to SEEN if its a video
             $avatarListWhoMakeAction .= '<span class="small">' . JText::_('COM_STREAM_LABEL_SEEN_BY') . ' ';
         } else {
             $avatarListWhoMakeAction .= '<span class="small">' . JText::_('COM_STREAM_LABEL_READ_BY') . ' ';
         }
         /* $avatarListWhoMakeAction .= count($whoMakesAction) . ' reader'; */
         $avatarListWhoMakeAction .= '<a href="#showReaders" data-content="<ul>';
         foreach ($whoMakesAction as $user_id) {
             // there will be 0 as user which in return will load current user
             if ($user_id != 0 && $user_id != NULL) {
                 $user = JXFactory::getUser($user_id);
                 $avatarListWhoMakeAction .= StreamTemplate::escape('<li><a href="' . $user->getURL() . '">' . $user->name . '</a></li>');
             }
         }
         $avatarListWhoMakeAction .= '</ul>">';
         $label = count($whoMakesAction) > 1 ? JText::_('COM_STREAM_LABEL_USERS') : JText::_('COM_STREAM_LABEL_USER');
         $avatarListWhoMakeAction .= count($whoMakesAction) . " {$label}</a>";
         $avatarListWhoMakeAction .= '</span></div>';
     }
     return $avatarListWhoMakeAction;
 }
开发者ID:ErickLopez76,项目名称:offiria,代码行数:36,代码来源:message.php


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