本文整理汇总了PHP中CGroups::getStreamHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP CGroups::getStreamHTML方法的具体用法?PHP CGroups::getStreamHTML怎么用?PHP CGroups::getStreamHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGroups
的用法示例。
在下文中一共展示了CGroups::getStreamHTML方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxStreamAdd
//.........这里部分代码省略.........
if (isset($attachment['mood']) && $attachment['mood'] != 'Mood') {
$activityParams->set('mood', $attachment['mood']);
}
$act->params = $activityParams->toString();
$activityData = CApiActivities::add($act);
CTags::add($activityData);
CUserPoints::assignPoint('group.wall.create');
$recipient = CFactory::getUser($attachment['target']);
$params = new CParameter('');
$params->set('message', $emailMessage);
$params->set('group', $group->name);
$params->set('group_url', 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id);
$params->set('url', CRoute::getExternalURL('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id, false));
//Get group member emails
$model = CFactory::getModel('Groups');
$members = $model->getMembers($attachment['target'], null, true, false, true);
$membersArray = array();
if (!is_null($members)) {
foreach ($members as $row) {
if ($my->id != $row->id) {
$membersArray[] = $row->id;
}
}
}
$groupParams = new CParameter($group->params);
if ($groupParams->get('wallnotification')) {
CNotificationLibrary::add('groups_wall_create', $my->id, $membersArray, JText::sprintf('COM_COMMUNITY_NEW_WALL_POST_NOTIFICATION_EMAIL_SUBJECT', $my->getDisplayName(), $group->name), '', 'groups.post', $params);
}
//@since 4.1 when a there is a new post in group, dump the data into group stats
$statsModel = CFactory::getModel('stats');
$statsModel->addGroupStats($group->id, 'post');
// Add custom stream
// Reload the stream with new stream data
$streamHTML = $groupLib->getStreamHTML($group, array('showLatestActivityOnTop' => true));
break;
// Message posted from Event page
// Message posted from Event page
case 'events':
$eventLib = new CEvents();
$event = JTable::getInstance('Event', 'CTable');
$event->load($attachment['target']);
// Permission check, only site admin and those who has
// mark their attendance can post message
if (!COwnerHelper::isCommunityAdmin() && !$event->isMember($my->id) && $config->get('lockeventwalls')) {
$objResponse->addScriptCall("alert('permission denied');");
return $objResponse->sendResponse();
}
// If this is a group event, set the group object
$groupid = $event->type == 'group' ? $event->contentid : 0;
//
$groupLib = new CGroups();
$group = JTable::getInstance('Group', 'CTable');
$group->load($groupid);
$act = new stdClass();
$act->cmd = 'events.wall';
$act->actor = $my->id;
$act->target = 0;
$act->title = $message;
$act->content = '';
$act->app = 'events.wall';
$act->cid = $attachment['target'];
$act->groupid = $event->type == 'group' ? $event->contentid : 0;
$act->group_access = $group->approvals;
$act->eventid = $event->id;
$act->event_access = $event->permission;
$act->access = 0;
示例2: viewGroup
//.........这里部分代码省略.........
// We should really load this in saperate file
// @todo: editing group should really open a new page
if ($my->id == $group->ownerid || COwnerHelper::isCommunityAdmin()) {
$categories = $groupModel->getCategories();
CError::assert($categories, 'array', 'istype', __FILE__, __LINE__);
$tmpl->set('categories', $categories);
}
$isMine = $my->id == $group->ownerid;
// Get reporting html
CFactory::load('libraries', 'reporting');
$report = new CReportingLibrary();
$reportHTML = $report->getReportingHTML(JText::_('COM_COMMUNITY_REPORT_GROUP'), 'groups,reportGroup', array($group->id));
$isSuperAdmin = COwnerHelper::isCommunityAdmin();
if ($group->approvals == '1' && !$isMine && !$isMember && !$isSuperAdmin) {
$this->addWarning(JText::_('COM_COMMUNITY_GROUPS_PRIVATE_NOTICE'));
}
$videoThumbWidth = CVideoLibrary::thumbSize('width');
$videoThumbHeight = CVideoLibrary::thumbSize('height');
$eventsModel = CFactory::getModel('Events');
$tmpEvents =& $eventsModel->getGroupEvents($group->id, $params->get('grouprecentevents', GROUP_EVENT_RECENT_LIMIT));
$totalEvents = $eventsModel->getTotalGroupEvents($group->id);
$events = array();
foreach ($tmpEvents as $event) {
$table =& JTable::getInstance('Event', 'CTable');
$table->bind($event);
$events[] = $table;
}
$allowManagePhotos = CGroupHelper::allowManagePhoto($group->id);
$allowManageVideos = CGroupHelper::allowManageVideo($group->id);
$allowCreateEvent = CGroupHelper::allowCreateEvent($my->id, $group->id);
CFactory::load('libraries', 'bookmarks');
$bookmarks = new CBookmarks(CRoute::getExternalURL('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id));
$bookmarksHTML = $bookmarks->getHTML();
$isCommunityAdmin = COwnerHelper::isCommunityAdmin();
if ($group->approvals == '0' || $isMine || $isMember && !$isBanned || $isCommunityAdmin) {
// Set feed url
$feedLink = CRoute::_('index.php?option=com_community&view=groups&task=viewbulletins&groupid=' . $group->id . '&format=feed');
$feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('COM_COMMUNITY_SUBSCRIBE_TO_BULLETIN_FEEDS') . '" href="' . $feedLink . '"/>';
$document->addCustomTag($feed);
$feedLink = CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussions&groupid=' . $group->id . '&format=feed');
$feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('COM_COMMUNITY_SUBSCRIBE_TO_DISCUSSION_FEEDS') . '" href="' . $feedLink . '"/>';
$document->addCustomTag($feed);
$feedLink = CRoute::_('index.php?option=com_community&view=photos&groupid=' . $group->id . '&format=feed');
$feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('COM_COMMUNITY_SUBSCRIBE_TO_GROUP_PHOTOS_FEEDS') . '" href="' . $feedLink . '"/>';
$document->addCustomTag($feed);
$feedLink = CRoute::_('index.php?option=com_community&view=videos&groupid=' . $group->id . '&format=feed');
$feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('COM_COMMUNITY_SUBSCRIBE_TO_GROUP_VIDEOS_FEEDS') . '" href="' . $feedLink . '"/>';
$document->addCustomTag($feed);
$feedLink = CRoute::_('index.php?option=com_community&view=events&groupid=' . $group->id . '&format=feed');
$feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('COM_COMMUNITY_SUBSCRIBE_TO_GROUP_EVENTS_FEEDS') . '" href="' . $feedLink . '"/>';
$document->addCustomTag($feed);
}
$friendsModel = CFactory::getModel('Friends');
$groupsModel = CFactory::getModel('Groups');
CFactory::load('libraries', 'invitation');
$inviteHTML = CInvitation::getHTML(null, 'groups,inviteUsers', $group->id);
// Add tagging code
/*
$tagsHTML = '';
if($config->get('tags_groups')){
CFactory::load('libraries', 'tags');
$tags = new CTags();
$tagsHTML = $tags->getHTML('groups', $group->id, $isAdmin );
}
*/
// Upgrade wall to stream @since 2.5
if (!$params->get('stream', FALSE)) {
$group->upgradeWallToStream();
}
// Add custom stream
$activities = new CActivities();
$streamHTML = $groupLib->getStreamHTML($group);
$totalStream = $activityModel->getTotalActivities(array("`groupid` = '{$group->id}'"));
CFactory::load('libraries', 'userstatus');
$creators = array();
$creators[] = CUserStatusCreator::getMessageInstance();
if ($isAdmin && $params->get('photopermission') == 1 || $isMember && $params->get('photopermission') == 2) {
$creators[] = CUserStatusCreator::getPhotoInstance();
}
if ($isAdmin && $params->get('videopermission') == 1 || $isMember && $params->get('videopermission') == 2) {
$creators[] = CUserStatusCreator::getVideoInstance();
}
if ($allowCreateEvent && $config->get('group_events') && $config->get('enableevents') && ($config->get('createevents') || COwnerHelper::isCommunityAdmin())) {
$creators[] = CUserStatusCreator::getEventInstance();
}
$status = new CUserStatus($group->id, 'groups', $creators);
// Get Event Admins
$groupAdmins = $group->getAdmins(12, CC_RANDOMIZE);
$adminsInArray = array();
// Attach avatar of the admin
for ($i = 0; $i < count($groupAdmins); $i++) {
$row =& $groupAdmins[$i];
$admin = CFactory::getUser($row->id);
array_push($adminsInArray, '<a href="' . CUrlHelper::userLink($admin->id) . '">' . $admin->getDisplayName() . '</a>');
}
$adminsList = ltrim(implode(', ', $adminsInArray), ',');
echo $tmpl->setMetaTags('group', $group)->set('streamHTML', $streamHTML)->set('status', $status)->set('likesHTML', $likesHTML)->set('events', $events)->set('totalEvents', $totalEvents)->set('inviteHTML', $inviteHTML)->set('showEvents', $config->get('group_events') && $config->get('enableevents'))->set('showPhotos', $params->get('photopermission') != -1)->set('showVideos', $params->get('videopermission') != -1)->set('bookmarksHTML', $bookmarksHTML)->set('allowManagePhotos', $allowManagePhotos)->set('allowManageVideos', $allowManageVideos)->set('allowCreateEvent', $allowCreateEvent)->set('videos', $videos)->set('videoThumbWidth', $videoThumbWidth)->set('videoThumbHeight', $videoThumbHeight)->set('totalVideos', $totalVideos)->set('albums', $albums)->set('totalAlbums', $totalAlbums)->set('reportHTML', $reportHTML)->set('editGroup', $editGroup)->set('waitingApproval', $waitingApproval)->set('config', $config)->set('my', $my)->set('isMine', $isMine)->set('isAdmin', $isAdmin)->set('isSuperAdmin', $isSuperAdmin)->set('isMember', $isMember)->set('isInvited', $isInvited)->set('friendsCount', $friendsCount)->set('join', $join)->set('unapproved', $unapproved)->set('membersCount', $membersCount)->set('group', $group)->set('totalBulletin', $totalBulletin)->set('totalDiscussion', $totalDiscussion)->set('totalVideos', $totalVideos)->set('members', $approvedMembers)->set('bulletins', $bulletins)->set('wallForm', $wallForm)->set('wallContent', $wallContent)->set('discussions', $discussions)->set('discussionsHTML', $discussionsHTML)->set('bulletinsHTML', $bulletinsHTML)->set('isCommunityAdmin', $isCommunityAdmin)->set('isBanned', $isBanned)->set('isPrivate', $group->approvals)->set('limit', $limit)->set('adminsList', $adminsList)->set('alertNewDiscussion', $my->count('group_discussion_' . $group->id) != $totalDiscussion)->set('alertNewBulletin', $my->count('group_bulletin_' . $group->id) != $totalBulletin)->set('alertNewStream', $my->count('group_activity_' . $group->id) != $totalStream)->fetch('groups.viewgroup');
// Update stream count cache, can only set this after we've set the alert aove
$my->setCount('group_activity_' . $group->id, $totalStream);
}
示例3: ajaxStreamAdd
//.........这里部分代码省略.........
$act->title = $message;
$act->content = '';
$act->app = 'groups.wall';
$act->cid = $attachment['target'];
$act->groupid = $group->id;
$act->group_access = $group->approvals;
$act->eventid = 0;
$act->access = 0;
$act->comment_id = CActivities::COMMENT_SELF;
$act->comment_type = 'groups.wall';
$act->like_id = CActivities::LIKE_SELF;
$act->like_type = 'groups.wall';
CActivityStream::add($act);
CUserPoints::assignPoint('profile.status.update');
$recipient = CFactory::getUser($attachment['target']);
$params = new CParameter('');
$params->set('message', $message);
$params->set('group', $group->name);
$params->set('url', CRoute::getExternalURL('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id, false));
//Get group member emails
$model = CFactory::getModel('Groups');
$members = $model->getMembers($attachment['target'], null);
$membersArray = array();
if (!is_null($members)) {
foreach ($members as $row) {
if ($my->id != $row->id) {
$membersArray[] = $row->id;
}
}
}
CNotificationLibrary::add('etype_groups_wall_create', $my->id, $membersArray, JText::sprintf('COM_COMMUNITY_NEW_WALL_POST_NOTIFICATION_EMAIL_SUBJECT', $my->getDisplayName(), $group->name), '', 'groups.wall', $params);
// Add custom stream
// Reload the stream with new stream data
$streamHTML = $groupLib->getStreamHTML($group);
break;
// Message posted from Event page
// Message posted from Event page
case 'events':
CFactory::load('libraries', 'events');
$eventLib = new CEvents();
$event = JTable::getInstance('Event', 'CTable');
$event->load($attachment['target']);
// Permission check, only site admin and those who has
// mark their attendance can post message
if (!COwnerHelper::isCommunityAdmin() && !$event->isMember($my->id)) {
$objResponse->addScriptCall("alert('permission denied');");
return $objResponse->sendResponse();
}
// If this is a group event, set the group object
$groupid = $event->type == 'group' ? $event->contentid : 0;
CFactory::load('libraries', 'groups');
$groupLib = new CGroups();
$group = JTable::getInstance('Group', 'CTable');
$group->load($groupid);
$act = new stdClass();
$act->cmd = 'events.wall';
$act->actor = $my->id;
$act->target = 0;
$act->title = $message;
$act->content = '';
$act->app = 'events.wall';
$act->cid = $attachment['target'];
$act->groupid = $event->type == 'group' ? $event->contentid : 0;
$act->group_access = $group->approvals;
$act->eventid = $event->id;
$act->event_access = $event->permission;