本文整理汇总了PHP中CUrlHelper::userLink方法的典型用法代码示例。如果您正苦于以下问题:PHP CUrlHelper::userLink方法的具体用法?PHP CUrlHelper::userLink怎么用?PHP CUrlHelper::userLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUrlHelper
的用法示例。
在下文中一共展示了CUrlHelper::userLink方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: friends
public function friends($data = null)
{
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$document = JFactory::getDocument();
$id = JRequest::getCmd('userid', 0);
$sorted = $jinput->get->get('sort', 'latest', 'STRING');
//JRequest::getVar( 'sort' , 'latest' , 'GET' );
$filter = JRequest::getWord('filter', 'all', 'GET');
$isMine = $id == $my->id && $my->id != 0;
$my = CFactory::getUser();
$id = $id == 0 ? $my->id : $id;
$user = CFactory::getUser($id);
$friends = CFactory::getModel('friends');
$blockModel = CFactory::getModel('block');
$document->setLink(CRoute::_('index.php?option=com_community'));
$rows = $friends->getFriends($id, $sorted, true, $filter);
// Hide submenu if we are viewing other's friends
if ($isMine) {
$document->setTitle(JText::_('COM_COMMUNITY_FRIENDS_MY_FRIENDS'));
} else {
$document->setTitle(JText::sprintf('COM_COMMUNITY_FRIENDS_ALL_FRIENDS', $user->getDisplayName()));
}
$sortItems = array('latest' => JText::_('COM_COMMUNITY_SORT_RECENT_FRIENDS'), 'online' => JText::_('COM_COMMUNITY_ONLINE'));
$resultRows = array();
// @todo: preload all friends
foreach ($rows as $row) {
$user = CFactory::getUser($row->id);
$obj = clone $row;
$obj->friendsCount = $user->getFriendCount();
$obj->profileLink = CUrlHelper::userLink($row->id);
$obj->isFriend = true;
$obj->isBlocked = $blockModel->getBlockStatus($user->id, $my->id);
$resultRows[] = $obj;
}
unset($rows);
foreach ($resultRows as $row) {
if (!$row->isBlocked) {
// load individual item creator class
$item = new JFeedItem();
$item->title = strip_tags($row->name);
$item->link = CRoute::_('index.php?option=com_community&view=profile&userid=' . $row->id);
$item->description = '<img src="' . JURI::base() . $row->_thumb . '" alt="" /> ' . $row->_status;
$item->date = $row->lastvisitDate;
$item->category = '';
//$row->category;
$item->description = CString::str_ireplace('_QQQ_', '"', $item->description);
// Make sure url is absolute
$item->description = CString::str_ireplace('href="/', 'href="' . JURI::base(), $item->description);
// loads item info into rss array
$document->addItem($item);
}
}
}
示例2:
<li>
<b>
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $item->groupid . '&topicid=' . $item->id);
?>
" class="cTitle"><?php
echo $item->title;
?>
</a>
</b>
<div class="small">
<?php
if (!empty($item->commentorName)) {
echo JText::sprintf('COM_COMMUNITY_GROUPS_DISCUSSION_LAST_REPLY', '<a href="' . CUrlHelper::userLink($item->lastReplier) . '">' . $item->commentorName . '</a>');
} else {
echo JText::sprintf('COM_COMMUNITY_GROUPS_DISCUSSION_CREATOR', '<a href="' . CUrlHelper::userLink($item->creator) . '">' . $item->creatorName . '</a>');
}
?>
</div>
</li>
<?php
}
//end for
}
//end if
?>
</ul>
</div>
</div>
示例3: foreach
<h3 class="app-box-header"><?php
echo JText::sprintf('COM_COMMUNITY_EVENTS_CONFIRMED_GUESTS');
?>
</h3>
<?php
if ($eventMembersCount > 0) {
?>
<div class="app-box-content">
<ul class="cThumbsList cResetList clearfix">
<?php
if ($eventMembers) {
foreach ($eventMembers as $member) {
?>
<li>
<a href="<?php
echo CUrlHelper::userLink($member->id);
?>
">
<img class="cAvatar jomNameTips" src="<?php
echo $member->getThumbAvatar();
?>
" title="<?php
echo CTooltip::cAvatarTooltip($member);
?>
" alt="" />
</a>
</li>
<?php
}
}
?>
示例4:
?>
<div>
<?php
if ($bulletins) {
for ($i = 0; $i < count($bulletins); $i++) {
$row =& $bulletins[$i];
?>
<div class="joms-stream__container joms-stream--discussion">
<div class="joms-stream__header <?php
echo CUserHelper::onlineIndicator($row->creator);
?>
">
<div class="joms-avatar--stream">
<a href="<?php
echo CUrlHelper::userLink($row->creator->id);
?>
">
<img data-author="<?php
echo $row->creator->id;
?>
"
src="<?php
echo $row->creator->getThumbAvatar();
?>
"
alt="<?php
echo $row->creator->getDisplayName();
?>
"/>
</a>
示例5:
<div class="joms-avatar">
<img src="<?php
echo $row->user->getThumbAvatar();
?>
" alt="<?php
echo $row->user->getDisplayName();
?>
" >
</div>
</div>
<div class="joms-popover__content joms-js--frequest-msg-<?php
echo $row->connection_id;
?>
">
<h5><a href="<?php
echo CUrlHelper::userLink($row->user->id);
?>
"><?php
echo $row->user->getDisplayName();
?>
</a></h5>
<?php
echo $row->msg;
?>
</div>
<div class="joms-popover__actions joms-js--frequest-btn-<?php
echo $row->connection_id;
?>
">
<button class="joms-button--neutral joms-button--small" onclick="joms.api.friendReject('<?php
echo $row->connection_id;
示例6: formatComment
/**
* Return formatted comment given the wall item
*/
public static function formatComment($wall)
{
$config = CFactory::getConfig();
$my = CFactory::getUser();
$actModel = CFactory::getModel('activities');
$like = new CLike();
$likeCount = $like->getLikeCount('comment', $wall->id);
$isLiked = $like->userLiked('comment', $wall->id, $my->id);
$user = CFactory::getUser($wall->post_by);
// Censor if the user is banned
if ($user->block) {
$wall->comment = $origComment = JText::_('COM_COMMUNITY_CENSORED');
} else {
// strip out the comment data
$CComment = new CComment();
$wall->comment = $CComment->stripCommentData($wall->comment);
// Need to perform basic formatting here
// 1. support nl to br,
// 2. auto-link text
$CTemplate = new CTemplate();
$wall->comment = $origComment = $CTemplate->escape($wall->comment);
$wall->comment = CStringHelper::autoLink($wall->comment);
}
$commentsHTML = '';
$commentsHTML .= '<div class="cComment wall-coc-item" id="wall-' . $wall->id . '"><a href="' . CUrlHelper::userLink($user->id) . '"><img src="' . $user->getThumbAvatar() . '" alt="" class="wall-coc-avatar" /></a>';
$date = new JDate($wall->date);
$commentsHTML .= '<a class="wall-coc-author" href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a> ';
$commentsHTML .= $wall->comment;
$commentsHTML .= '<span class="wall-coc-time">' . CTimeHelper::timeLapse($date);
$cid = isset($wall->contentid) ? $wall->contentid : null;
$activity = $actModel->getActivity($cid);
$ownPost = $my->id == $wall->post_by;
$allowRemove = $my->authorise('community.delete', 'walls', $wall);
$canEdit = $config->get('wallediting') && $my->id == $wall->post_by || COwnerHelper::isCommunityAdmin();
// only poster can edit
if ($allowRemove) {
$commentsHTML .= ' <span class="wall-coc-remove-link">• <a href="#removeComment">' . JText::_('COM_COMMUNITY_WALL_REMOVE') . '</a></span>';
}
$commentsHTML .= '</span>';
$commentsHTML .= '</div>';
$editHTML = '';
if ($config->get('wallediting') && $ownPost || COwnerHelper::isCommunityAdmin()) {
$editHTML .= '<a href="javascript:" class="joms-button--edit">';
$editHTML .= '<svg viewBox="0 0 16 16" class="joms-icon"><use xlink:href="' . CRoute::getURI() . '#joms-icon-pencil"></use></svg>';
$editHTML .= '<span>' . JText::_('COM_COMMUNITY_EDIT') . '</span>';
$editHTML .= '</a>';
}
$removeHTML = '';
if ($allowRemove) {
$removeHTML .= '<a href="javascript:" class="joms-button--remove">';
$removeHTML .= '<svg viewBox="0 0 16 16" class="joms-icon"><use xlink:href="' . CRoute::getURI() . '#joms-icon-remove"></use></svg>';
$removeHTML .= '<span>' . JText::_('COM_COMMUNITY_WALL_REMOVE') . '</span>';
$removeHTML .= '</a>';
}
$removeTagHTML = '';
if (CActivitiesHelper::hasTag($my->id, $wall->comment)) {
$removeTagHTML = '<span><a data-action="remove-tag" data-id="' . $wall->id . '" href="javascript:">' . JText::_('COM_COMMUNITY_WALL_REMOVE_TAG') . '</a></span>';
}
/* user deleted */
if ($user->guest == 1) {
$userLink = '<span class="cStream-Author">' . $user->getDisplayName() . '</span> ';
} else {
$userLink = '<a class="cStream-Avatar cStream-Author cFloat-L" href="' . CUrlHelper::userLink($user->id) . '"> <img class="cAvatar" src="' . $user->getThumbAvatar() . '"> </a> ';
}
$params = $wall->params;
$paramsHTML = '';
$image = (array) $params->get('image');
$photoThumbnail = false;
if ($params->get('attached_photo_id') > 0) {
$photo = JTable::getInstance('Photo', 'CTable');
$photo->load($params->get('attached_photo_id'));
$photoThumbnail = $photo->getThumbURI();
$paramsHTML .= '<div style="padding: 5px 0"><img class="joms-stream-thumb" src="' . $photoThumbnail . '" /></div>';
} else {
if ($params->get('title')) {
$video = self::detectVideo($params->get('url'));
if (is_object($video)) {
$paramsHTML .= '<div class="joms-media--video joms-js--video"';
$paramsHTML .= ' data-type="' . $video->type . '"';
$paramsHTML .= ' data-id="' . $video->id . '"';
$paramsHTML .= ' data-path="' . ($video->type === 'file' ? JURI::root(true) . '/' : '') . $video->path . '"';
$paramsHTML .= ' style="margin-top:10px;">';
$paramsHTML .= '<div class="joms-media__thumbnail">';
$paramsHTML .= '<img src="' . $video->getThumbnail() . '">';
$paramsHTML .= '<a href="javascript:" class="mejs-overlay mejs-layer mejs-overlay-play joms-js--video-play joms-js--video-play-' . $wall->id . '">';
$paramsHTML .= '<div class="mejs-overlay-button"></div>';
$paramsHTML .= '</a>';
$paramsHTML .= '</div>';
$paramsHTML .= '<div class="joms-media__body">';
$paramsHTML .= '<h4 class="joms-media__title">' . JHTML::_('string.truncate', $video->title, 50, true, false) . '</h4>';
$paramsHTML .= '<p class="joms-media__desc">' . JHTML::_('string.truncate', $video->description, $config->getInt('streamcontentlength'), true, false) . '</p>';
$paramsHTML .= '</div>';
$paramsHTML .= '</div>';
} else {
$paramsHTML .= '<div class="joms-gap"></div>';
$paramsHTML .= '<div class="joms-media--album joms-relative joms-js--comment-preview">';
if ($user->id == $my->id || COwnerHelper::isCommunityAdmin()) {
//.........这里部分代码省略.........
示例7: stdClass
// Setup group table
$group = $this->group;
// Setup Discussion Table
$discussion = JTable::getInstance('Discussion', 'CTable');
$discussion->load($act->cid);
$discussionLink = CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $group->id . '&topicid=' . $discussion->id);
if ($user->block) {
$discussion->title = $discussion->message = JText::_('COM_COMMUNITY_CENSORED');
}
// Load params
$action = $act->params->get('action');
$actors = $act->params->get('actors');
$this->set('actors', $actors);
$stream = new stdClass();
$stream->actor = $user;
$stream->target = null;
$stream->datetime = $createdTime;
$stream->headline = '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a> ' . JTEXT::_('COM_COMMUNITY_GROUPS_NEW_GROUP_DISCUSSION') . '<span class="joms-stream__time"><small>' . $stream->datetime . '</small></span>';
$stream->message = "";
$stream->group = $group;
$stream->groupid = $group->id;
$stream->attachments = array();
$stream->link = $discussionLink;
$stream->title = $discussion->title;
$stream->access = $act->access;
$attachment = new stdClass();
$attachment->type = 'create_discussion';
$attachment->message = $this->escape(JHTML::_('string.truncate', $discussion->message, $config->getInt('streamcontentlength'), true, false));
$stream->attachments[] = $attachment;
$this->set('stream', $stream);
$this->load('activities.stream');
示例8: JRegistry
$bulletin->load($act->cid);
// get created date time
$date = JFactory::getDate($act->created);
if ($config->get('activitydateformat') == "lapse") {
$createdTime = CTimeHelper::timeLapse($date);
} else {
$createdTime = $date->format($config->get('profileDateFormat'));
}
// Load params
$param = new JRegistry($this->act->params);
$action = $param->get('action');
$actors = $param->get('actors');
$this->set('actors', $actors);
$stream = new stdClass();
$stream->actor = $user;
$stream->target = null;
$stream->datetime = $createdTime;
$stream->headline = '<a class="joms-stream-author" href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a> ' . JTEXT::_('COM_COMMUNITY_GROUPS_NEW_GROUP_NEWS') . '<p class="joms-share-meta date">' . $stream->datetime . '</p>';
$stream->message = "";
$stream->group = $group;
$stream->groupid = $group->id;
$stream->attachments = array();
$stream->title = $bulletin->title;
$stream->link = CRoute::_('index.php?option=com_community&view=groups&task=viewbulletin&groupid=' . $group->id . '&bulletinid=' . $bulletin->id);
$stream->access = $act->access;
$attachment = new stdClass();
$attachment->type = 'create_announcement';
$attachment->message = $this->escape(JHTML::_('string.truncate', $bulletin->message, $config->getInt('streamcontentlength'), true, false));
$stream->attachments[] = $attachment;
$this->set('stream', $stream);
$this->load('activities.stream');
示例9: generateHTMLData
/**
* Generate like string
* @param [object] $obj [description]
* @return [object] [description]
*/
public static function generateHTMLData($obj)
{
$dataObj = new stdClass();
switch ($obj->app) {
case 'profile.like':
$cid = CFactory::getUser($obj->cid);
$dataObj->urlLink = CUrlHelper::userLink($cid->id);
$dataObj->name = $cid->getDisplayName();
$dataObj->element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_PROFILE';
/* Do prepare content for liked item
* @since 3.2
* @todo Need check if load success
*/
$likedItem = new stdClass();
$likedItem->title = $cid->name;
$likedItem->content = $cid->get('description');
$likedItem->thumb = $cid->getAvatar();
$dataObj->likedContent = $likedItem;
break;
case 'groups.like':
$cid = JTable::getInstance('Group', 'CTable');
$cid->load($obj->groupid);
$dataObj->urlLink = $cid->getLink();
$dataObj->name = $cid->name;
$dataObj->element = 'COM_COMMUNITY_SINGULAR_GROUP';
break;
case 'events.like':
$cid = JTable::getInstance('Event', 'CTable');
$cid->load($obj->eventid);
$dataObj->urlLink = $cid->getLink();
$dataObj->name = $cid->title;
$dataObj->element = 'COM_COMMUNITY_SINGULAR_EVENT';
/* Do prepare content for liked item
* @since 3.2
* @todo Need check if load success
*/
$likedItem = new stdClass();
$likedItem->title = $cid->title;
$likedItem->content = $cid->description;
$likedItem->thumb = $cid->getAvatar();
$dataObj->likedContent = $likedItem;
break;
case 'photo.like':
$cid = JTable::getInstance('Photo', 'CTable');
$cid->load($obj->cid);
$config = CFactory::getConfig();
$isPhotoModal = $config->get('album_mode') == 1;
$dataObj->urlLink = $cid->getPhotoLink();
$dataObj->urlLink = $isPhotoModal ? 'javascript:" onclick="joms.api.photoOpen(\'' . $cid->albumid . '\', \'' . $cid->id . '\');' : $dataObj->urlLink;
$dataObj->name = $cid->caption;
$dataObj->element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_PHOTO_SINGLE';
/* Do prepare content for liked item
* @since 3.2
* @todo Need check if load success
*/
$likedItem = new stdClass();
$likedItem->title = $cid->caption;
$likedItem->content = '';
$likedItem->thumb = $cid->getImageURI();
$dataObj->likedContent = $likedItem;
break;
case 'videos.like':
$cid = JTable::getInstance('Video', 'CTable');
$cid->load($obj->cid);
$config = CFactory::getConfig();
$isVideoModal = $config->get('video_mode') == 1;
$dataObj->urlLink = $cid->getViewURI();
$dataObj->urlLink = $isVideoModal ? 'javascript:" onclick="joms.api.videoOpen(\'' . $cid->id . '\');' : $dataObj->urlLink;
$dataObj->name = $cid->getTitle();
$dataObj->element = 'COM_COMMUNITY_SINGULAR_VIDEO';
/* Do prepare content for liked item
* @since 3.2
* @todo Need check if load success
*/
$likedItem = new stdClass();
$likedItem->title = $cid->title;
$likedItem->content = $cid->description;
$likedItem->thumb = $cid->getThumbnail();
$likedItem->media = $cid->getPlayerHTML();
$dataObj->likedContent = $likedItem;
break;
case 'album.like':
$cid = JTable::getInstance('Album', 'CTable');
$cid->load($obj->cid);
$config = CFactory::getConfig();
$isPhotoModal = $config->get('album_mode') == 1;
$dataObj->urlLink = $cid->getURI();
$dataObj->urlLink = $isPhotoModal ? 'javascript:" onclick="joms.api.photoOpen(\'' . $cid->id . '\', \'\');' : $dataObj->urlLink;
$dataObj->name = $cid->name;
$dataObj->element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_ALBUM';
/* Do prepare content for liked item
* @since 3.2
* @todo Need check if load success
*/
$likedItem = new stdClass();
//.........这里部分代码省略.........
示例10: array
$stream->access = 10;
}
$date = JFactory::getDate($act->created);
if ($config->get('activitydateformat') == "lapse") {
$createdTime = CTimeHelper::timeLapse($date);
} else {
$createdTime = $date->format($config->get('profileDateFormat'));
}
$stream->createdtime = $createdTime;
$this->set('stream', $stream);
$this->load('stream/base-extended');
}
} else {
// Process the old ways
$user = CFactory::getUser($act->actor);
$actorLink = '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>';
$title = $act->title;
// Handle 'single' view exclusively
$title = preg_replace('/\\{multiple\\}(.*)\\{\\/multiple\\}/i', '', $title);
$search = array('{single}', '{/single}');
$title = CString::str_ireplace($search, '', $title);
$title = CString::str_ireplace('{actor}', $actorLink, $title);
//get the time
$date = JFactory::getDate($act->created);
if ($config->get('activitydateformat') == "lapse") {
$createdTime = CTimeHelper::timeLapse($date);
} else {
$createdTime = $date->format($config->get('profileDateFormat'));
}
$stream = new stdClass();
$stream->actor = $user;
示例11: getJSRoute
/**
* Method to link to a JomSocial user profile page
*
* @param integer $id The user id
*
* @return string The profile url
*/
protected static function getJSRoute($id)
{
static $exists = null;
// Include the route helper once
if (is_null($exists)) {
$file = JPATH_SITE . '/components/com_community/helpers/url.php';
$exists = file_exists($file);
if ($exists) {
require_once $file;
$file = JPATH_ROOT . '/components/com_community/libraries/core.php';
$exists = file_exists($file);
if ($exists) {
require_once $file;
}
}
}
// Return null if router was not found
if (!$exists) {
return null;
}
// Return link
return CUrlHelper::userLink((int) $id, true);
}
示例12: array
//from third party app
$attachment->content = $activity->content;
$attachment->type = 'general';
break;
}
!isset($attachment->type) ? $attachments = array() : ($attachments[] = $attachment);
$groupString = "";
if (isset($activity->groupid) && !empty($activity->groupid)) {
$groupTable = JTable::getInstance('Group', 'CTable');
$groupTable->load($activity->groupid);
$groupString = JText::sprintf('COM_COMMUNITY_SHARE_VIDEO_FROM_GROUP', $groupTable->getLink(), $groupTable->name);
}
$stream = new stdClass();
$stream->actor = $user;
$stream->target = null;
$stream->headline = JText::sprintf('COM_COMMUNITY_ACTIVITY_SHARE_STATUS', CUrlHelper::userLink($user->id), $user->getDisplayName(), CUrlHelper::userLink($actor->id), $actor->getDisplayName(), isset($app[$activity->app]) ? $app[$activity->app] : '') . $groupString;
$stream->message = CActivities::format($act->title);
$stream->mood = $params->get('mood', NULL);
$stream->sharedMessage = CActivities::format($activity->title);
$stream->sharedMood = $activityParam->get('mood', NULL);
$stream->groupid = $activity->groupid;
$stream->eventid = "";
$stream->access = $this->act->access;
$stream->attachments = $attachments;
/**
* @todo Need to clearly this one
* Right now it's return on right data
*/
$stream->attachments[] = CActivityStream::formatStreamAttachment($activity);
$stream->createdtime = $createdTime;
$this->set('stream', $stream);
示例13: viewevent
/**
* Responsible for displaying the event page.
* */
public function viewevent()
{
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$document = JFactory::getDocument();
$config = CFactory::getConfig();
$my = CFactory::getUser();
CWindow::load();
$eventLib = new CEvents();
$eventid = JRequest::getInt('eventid', 0);
$eventModel = CFactory::getModel('events');
$event = JTable::getInstance('Event', 'CTable');
$handler = CEventHelper::getHandler($event);
$event->load($eventid);
if (empty($event->id)) {
return JError::raiseWarning(404, JText::_('COM_COMMUNITY_EVENTS_NOT_AVAILABLE_ERROR'));
}
if ($event->unlisted && !$event->isMember($my->id) && !$event->getUserStatus($my->id) == 0) {
$text = JText::_('COM_COMMUNITY_EVENTS_UNLISTED_ERROR');
$text .= ' <a href="javascript:" onclick="joms.api.eventJoin(\'' . $event->id . '\');">Request Invitation</a>';
return JError::raiseWarning(403, $text);
}
if (!$handler->exists()) {
$mainframe->enqueueMessage(JText::_('COM_COMMUNITY_EVENTS_NOT_AVAILABLE_ERROR'), 'error');
return;
}
if (!$handler->browsable()) {
echo JText::_('COM_COMMUNITY_NOT_ALLOWED_TO_ACCESS_SECTION');
return;
}
// @rule: Test if the group is unpublished, don't display it at all.
if (!$event->isPublished()) {
echo JText::_('COM_COMMUNITY_EVENTS_UNDER_MODERATION');
return;
}
//$this->showSubmenu();
$event->hit();
$isGroupAdmin = false;
// Basic page presentation
if ($event->type == 'group') {
$groupId = $event->contentid;
$group = JTable::getInstance('Group', 'CTable');
$group->load($groupId);
// Set pathway for group videos
// Community > Groups > Group Name > Events
$this->addPathway(JText::_('COM_COMMUNITY_GROUPS'), CRoute::_('index.php?option=com_community&view=groups'));
$this->addPathway($group->name, CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $groupId));
$groupEventDetails = new stdClass();
$groupEventDetails->creator = CFactory::getUser($event->creator);
$groupEventDetails->groupName = $group->name;
$groupEventDetails->groupLink = CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id);
$isGroupAdmin = $group->isAdmin($my->id);
}
$this->addPathway(JText::_('COM_COMMUNITY_EVENTS'), CRoute::_('index.php?option=com_community&view=events'));
$this->addPathway($event->title);
/**
* Opengraph
*/
CHeadHelper::setType('website', JText::sprintf('COM_COMMUNITY_EVENT_PAGE_TITLE', $event->title), null, array($event->getCover()));
// Permissions and privacies
$isEventGuest = $event->isMember($my->id);
$isMine = $my->id == $event->creator;
$isAdmin = $event->isAdmin($my->id) || $isGroupAdmin;
$isCommunityAdmin = COwnerHelper::isCommunityAdmin();
// Get Event Admins
$eventAdmins = $event->getAdmins(12, CC_RANDOMIZE);
$adminsInArray = array();
// Attach avatar of the admin
for ($i = 0; $i < count($eventAdmins); $i++) {
$row = $eventAdmins[$i];
$admin = CFactory::getUser($row->id);
array_push($adminsInArray, '<a href="' . CUrlHelper::userLink($admin->id) . '">' . $admin->getDisplayName() . '</a>');
}
$adminsList = ltrim(implode(', ', $adminsInArray), ',');
// Get Attending Event Guests
$eventMembers = $event->getMembers(COMMUNITY_EVENT_STATUS_ATTEND, CFactory::getConfig()->get('event_sidebar_members_show_total', 12), CC_RANDOMIZE);
$eventMembersCount = $event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND);
// Attach avatar of the admin
// Pre-load multiple users at once
$userids = array();
foreach ($eventMembers as $uid) {
$userids[] = $uid->id;
}
CFactory::loadUsers($userids);
for ($i = 0; $i < count($eventMembers); $i++) {
$row = $eventMembers[$i];
$eventMembers[$i] = CFactory::getUser($row->id);
}
// Pre-load multiple users at once
$waitingApproval = $event->isPendingApproval($my->id);
$waitingRespond = false;
$myStatus = $event->getUserStatus($my->id);
$hasResponded = $myStatus == COMMUNITY_EVENT_STATUS_ATTEND || $myStatus == COMMUNITY_EVENT_STATUS_WONTATTEND || $myStatus == COMMUNITY_EVENT_STATUS_MAYBE;
// Get Bookmark HTML
$bookmarks = new CBookmarks(CRoute::getExternalURL('index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id));
$bookmarksHTML = $bookmarks->getHTML();
// Get the Wall
//.........这里部分代码省略.........
示例14: stdClass
$photoThumbnail = $photo->getThumbURI();
}
if ($user->block) {
$discussion->title = JText::_('COM_COMMUNITY_CENSORED');
}
// get created date time
$date = JFactory::getDate($this->act->created);
if ($config->get('activitydateformat') == "lapse") {
$createdTime = CTimeHelper::timeLapse($date);
} else {
$createdTime = $date->format($config->get('profileDateFormat'));
}
$stream = new stdClass();
$stream->actor = $user;
$stream->target = null;
$stream->headline = '<a class="cStream-Author" href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_REPLY_DISCUSSION', CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $discussion->groupid . '&topicid=' . $discussion->id), $discussion->title);
$stream->message = "";
$stream->group = $group;
$stream->groupid = $discussion->groupid;
$stream->attachments = array();
$attachment = new stdClass();
$attachment->type = 'discussion_reply';
$attachment->photoThumbnail = $photoThumbnail;
$attachment->message = JHTML::_('string.truncate', $this->act->content, $config->getInt('streamcontentlength'), true, false);
$stream->attachments[] = $attachment;
$stream->access = $act->access;
$stream->createdtime = $createdTime;
$stream->type = $attachment->type;
$this->set('stream', $stream);
$this->set('params', $wallParam);
$this->load('stream/base-extended');
示例15:
<?php
if (!$config->get('showactivityavatar')) {
echo 'no-avatar';
}
?>
">
<!--NEWS FEED AVATAR-->
<div class="newsfeed-avatar">
<?php
if ($config->get('showactivityavatar')) {
?>
<?php
if (!empty($actor->id)) {
?>
<a href="<?php
echo CUrlHelper::userLink($actor->id);
?>
"><img class="avatar" src="<?php
echo $actor->getThumbAvatar();
?>
" width="36" border="0" alt=""/></a>
<?php
} else {
?>
<img class="avatar" src="<?php
echo $actor->getThumbAvatar();
?>
" width="36" border="0" alt=""/>
<?php
}
?>