本文整理汇总了PHP中CGroups::getActivityContentHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP CGroups::getActivityContentHTML方法的具体用法?PHP CGroups::getActivityContentHTML怎么用?PHP CGroups::getActivityContentHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGroups
的用法示例。
在下文中一共展示了CGroups::getActivityContentHTML方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getActivityContent
/**
* Return the HTML formatted activity content
*/
static function getActivityContent($act)
{
$cache = CFactory::getFastCache();
$cacheid = __FILE__ . __LINE__ . serialize(func_get_args());
if ($data = $cache->get($cacheid)) {
return $data;
}
// Return empty content or content with old, invalid data
// In some old version, some content might have 'This is the body'
if ($act->content == 'This is the body') {
return '';
}
$html = $act->content;
// For known core, apps, we can simply call the content command
switch ($act->app) {
case 'videos':
CFactory::load('libraries', 'videos');
$html = CVideos::getActivityContentHTML($act);
break;
case 'photos':
CFactory::load('libraries', 'photos');
$html = CPhotos::getActivityContentHTML($act);
break;
case 'events':
CFactory::load('libraries', 'events');
$html = CEvents::getActivityContentHTML($act);
break;
case 'groups.wall':
case 'groups':
CFactory::load('libraries', 'groups');
$html = CGroups::getActivityContentHTML($act);
break;
case 'groups.discussion.reply':
case 'groups.discussion':
CFactory::load('libraries', 'groups');
$html = CGroups::getActivityContentHTML($act);
break;
case 'groups.bulletin':
CFactory::load('libraries', 'groups');
$html = CGroups::getActivityContentHTML($act);
case 'system':
CFactory::load('libraries', 'adminstreams');
$html = CAdminstreams::getActivityContentHTML($act);
break;
case 'walls':
// If a wall does not have any content, do not
// display the summary
if ($act->app == 'walls' && $act->cid == 0) {
$html = '';
return $html;
}
if ($act->cid != 0) {
CFactory::load('libraries', 'wall');
$html = CWall::getActivityContentHTML($act);
}
break;
default:
// for other unknown apps, we include the plugin see if it is is callable
// we call the onActivityContentDisplay();
CFactory::load('libraries', 'apps');
$apps =& CAppPlugins::getInstance();
$plugin =& $apps->get($act->app);
$method = 'onActivityContentDisplay';
if (is_callable(array($plugin, $method))) {
$args = array();
$args[] = $act;
$html = call_user_func_array(array($plugin, $method), $args);
} else {
$html = $act->content;
}
}
$cache->store($html, $cacheid, array('activities'));
return $html;
}
示例2:
?>
<a class="cStream-Avatar cFloat-L" href="<?php
echo CUrlHelper::userLink($user->id);
?>
">
<img class="cAvatar" data-author="<?php
echo $user->id;
?>
" src="<?php
echo $user->getThumbAvatar();
?>
">
</a>
<div class="cStream-Content">
<div class="cStream-Attachment">
<?php
$html = CGroups::getActivityContentHTML($act);
echo $html;
?>
</div>
<?php
$this->load('activities.actions');
?>
</div>
<?php
}
}
}
}
}
示例3: getActivityContent
/**
* Return the HTML formatted activity contet
*/
static function getActivityContent($act)
{
// Return empty content or content with old, invalid data
// In some old version, some content might have 'This is the body'
if ($act->content == 'This is the body') {
return '';
}
$html = $act->content;
// For know core, apps, we can simply call the content command
switch ($act->app) {
case 'videos':
CFactory::load('libraries', 'videos');
$html = CVideos::getActivityContentHTML($act);
break;
case 'photos':
CFactory::load('libraries', 'photos');
$html = CPhotos::getActivityContentHTML($act);
break;
case 'events':
CFactory::load('libraries', 'events');
$html = CEvents::getActivityContentHTML($act);
break;
case 'groups':
CFactory::load('libraries', 'groups');
$html = CGroups::getActivityContentHTML($act);
break;
case 'walls':
// If a wall does not have any content, do not
// display the summary
if ($act->app == 'walls' && $act->cid == 0) {
$html = '';
return $html;
}
default:
// for other unknown apps, we include the plugin see if it is is callable
// we call the onActivityContentDisplay();
CFactory::load('libraries', 'apps');
$apps =& CAppPlugins::getInstance();
$plugin =& $apps->get($act->app);
$method = 'onActivityContentDisplay';
if (is_callable(array($plugin, $method))) {
$args = array();
$args[] = $act;
$html = call_user_func_array(array($plugin, $method), $args);
} else {
$html = $act->content;
}
}
return $html;
}