本文整理汇总了PHP中CActivityStream::getAppHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP CActivityStream::getAppHTML方法的具体用法?PHP CActivityStream::getAppHTML怎么用?PHP CActivityStream::getAppHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActivityStream
的用法示例。
在下文中一共展示了CActivityStream::getAppHTML方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxGetActivities
/**
* Method to retrieve activities via AJAX
**/
public function ajaxGetActivities($exclusions, $type, $userId, $latestId = 0, $isProfile = 'false', $filter = '', $app = '', $appId = '')
{
$response = new JAXResponse();
$config = CFactory::getConfig();
$my = CFactory::getUser();
$filterInput = JFilterInput::getInstance();
$exclusions = $filterInput->clean($exclusions, 'string');
$type = $filterInput->clean($type, 'string');
$userId = $filterInput->clean($userId, 'int');
$latestId = $filterInput->clean($latestId, 'int');
$isProfile = $filterInput->clean($isProfile, 'string');
$app = $filterInput->clean($app, 'string');
$appId = $filterInput->clean($appId, 'int');
CFactory::load('libraries', 'activities');
$act = new CActivityStream();
if (($app == 'group' || $app) == 'event' && $appId > 0) {
// for application stream
$option = array('app' => $app . 's', 'apptype' => $app, 'exclusions' => $exclusions);
$option[$app . 'id'] = $appId;
//application id for the right application
$option['latestId'] = $latestId > 0 ? $latestId : 0;
$html = $act->getAppHTML($option);
} else {
if ($type == 'active-profile' || $type == 'me-and-friends' || $filter == 'friends' || $filter == 'self' || $type == 'active-profile-and-friends') {
// For main and profile stream
CFactory::load('helpers', 'time');
$friendsModel = CFactory::getModel('Friends');
if ($isProfile != 'false') {
//requested from profile
$target = array($userId);
//by default, target is self
if ($filter == 'friends') {
$target = $friendsModel->getFriendIds($userId);
}
$html = $act->getHTML($userId, $target, null, $config->get('maxactivities'), 'profile', '', true, COMMUNITY_SHOW_ACTIVITY_MORE, $exclusions, COMMUNITY_SHOW_ACTIVITY_ARCHIVED, 'all', $latestId);
} else {
$html = $act->getHTML($userId, $friendsModel->getFriendIds($userId), null, $config->get('maxactivities'), '', '', true, COMMUNITY_SHOW_ACTIVITY_MORE, $exclusions, COMMUNITY_SHOW_ACTIVITY_ARCHIVED, 'all', $latestId);
}
} else {
$html = $act->getHTML('', '', null, $config->get('maxactivities'), '', '', true, COMMUNITY_SHOW_ACTIVITY_MORE, $exclusions, COMMUNITY_SHOW_ACTIVITY_ARCHIVED, 'all', $latestId);
}
}
$html = trim($html, " \n\t\r");
$text = JText::_('COM_COMMUNITY_ACTIVITIES_NEW_UPDATES');
if ($latestId == 0) {
// Append new data at bottom.
$response->addScriptCall('joms.activities.append', $html);
} else {
if ($html != '') {
$response->addScriptCall('joms.activities.appendLatest', $html, $config->get('stream_refresh_interval'), $text);
} else {
$response->addScriptCall('joms.activities.nextActivitiesCheck', $config->get('stream_refresh_interval'));
}
}
return $response->sendResponse();
}