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); } } }
<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>
<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 } } ?>
?> <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>
<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;
/** * 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()) { $paramsHTML .= '<span class="joms-media__remove" data-action="remove-preview" onClick="joms.api.commentRemovePreview(\'' . $wall->id . '\');"><svg viewBox="0 0 16 16" class="joms-icon"><use xlink:href="#joms-icon-remove"></use></svg></span>'; } if ($params->get('image')) { $paramsHTML .= $params->get('link'); $paramsHTML .= '<div class="joms-media__thumbnail">'; $paramsHTML .= '<a href="' . $params->get('link') ? $params->get('link') : '#' . '">'; $paramsHTML .= '<img src="' . array_shift($image) . '" />'; $paramsHTML .= '</a>'; $paramsHTML .= '</div>'; } $url = $params->get('url') ? $params->get('url') : '#'; $paramsHTML .= '<div class="joms-media__body">'; $paramsHTML .= '<a href="' . $url . '">'; $paramsHTML .= '<h4 class="joms-media__title">' . $params->get('title') . '</h4>'; $paramsHTML .= '<p class="joms-media__desc reset-gap">' . CStringHelper::trim_words($params->get('description')) . '</p>'; if ($params->get('link')) { $paramsHTML .= '<span class="joms-text--light"><small>' . preg_replace('#^https?://#', '', $params->get('link')) . '</small></span>'; } $paramsHTML .= '</a></div></div>'; } } } if (!$params->get('title') && $params->get('url')) { $paramsHTML .= '<div class="joms-gap"></div>'; $paramsHTML .= '<div class="joms-media--album">'; $paramsHTML .= '<a href="' . $params->get('url') . '">'; $paramsHTML .= '<img class="joms-stream-thumb" src="' . $params->get('url') . '" />'; $paramsHTML .= '</a>'; $paramsHTML .= '</div>'; } $wall->comment = nl2br($wall->comment); $wall->comment = CUserHelper::replaceAliasURL($wall->comment); $wall->comment = CStringHelper::getEmoticon($wall->comment); $wall->comment = CStringHelper::converttagtolink($wall->comment); // convert to hashtag $template = new CTemplate(); $template->set('wall', $wall)->set('originalComment', $origComment)->set('date', $date)->set('isLiked', $isLiked)->set('likeCount', $likeCount)->set('canRemove', $allowRemove)->set('canEdit', $canEdit)->set('canRemove', $allowRemove)->set('user', $user)->set('photoThumbnail', $photoThumbnail)->set('paramsHTML', $paramsHTML); $commentsHTML = $template->fetch('stream/single-comment'); return $commentsHTML; }
// 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');
$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');
/** * 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(); $likedItem->title = $cid->name; $likedItem->content = $cid->description; $likedItem->thumb = $cid->getCoverThumbPath(); $dataObj->likedContent = $likedItem; break; } return $dataObj; }
$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;
/** * 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); }
//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);
/** * 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 $wallContent = CWallLibrary::getWallContents('events', $event->id, $isAdmin, $config->get('stream_default_comments'), 0, 'wall/content', 'events,events'); $wallCount = CWallLibrary::getWallCount('events', $event->id); $viewAllLink = false; if ($jinput->request->get('task', '', 'STRING') != 'app') { $viewAllLink = CRoute::_('index.php?option=com_community&view=events&task=app&eventid=' . $event->id . '&app=walls'); } $wallContent .= CWallLibrary::getViewAllLinkHTML($viewAllLink, $wallCount); $wallForm = ''; // Construct the RVSP radio list $arr = array(JHTML::_('select.option', COMMUNITY_EVENT_STATUS_ATTEND, JText::_('COM_COMMUNITY_EVENTS_YES')), JHTML::_('select.option', COMMUNITY_EVENT_STATUS_WONTATTEND, JText::_('COM_COMMUNITY_EVENTS_NO')), JHTML::_('select.option', COMMUNITY_EVENT_STATUS_MAYBE, JText::_('COM_COMMUNITY_EVENTS_MAYBE'))); $status = $event->getMemberStatus($my->id); $radioList = JHTML::_('select.radiolist', $arr, 'status', '', 'value', 'text', $status, false); $unapprovedCount = $event->inviteRequestCount(); //... $editEvent = $jinput->get->get('edit', false, 'NONE'); $editEvent = $editEvent == 1 ? true : false; // Am I invited in this event? $isInvited = false; $join = ''; $friendsCount = 0; $isInvited = $eventModel->isInvitedMe(0, $my->id, $event->id); // If I was invited, I want to know my invitation informations if ($isInvited) { $invitor = CFactory::getUser($isInvited[0]->invited_by); $join = '<a href="' . CUrlHelper::userLink($invitor->id) . '">' . $invitor->getDisplayName() . '</a>'; // Get users friends in this group $friendsCount = $eventModel->getFriendsCount($my->id, $event->id); } // Get like $likes = new CLike(); $isUserLiked = false; if ($isLikeEnabled = $likes->enabled('events')) { $isUserLiked = $likes->userLiked('events', $event->id, $my->id); } $totalLikes = $likes->getLikeCount('events', $event->id); // Is this event is a past event? $now = new JDate(); $isPastEvent = $event->getEndDate(false)->toSql() < $now->toSql(true) ? true : false; // Get the formated date & time $format = $config->get('eventshowampm') ? JText::_('COM_COMMUNITY_EVENTS_TIME_FORMAT_12HR') : JText::_('COM_COMMUNITY_EVENTS_TIME_FORMAT_24HR'); $startDate = $event->getStartDate(false); $endDate = $event->getEndDate(false); $allday = false; if ($startDate->format('%Y-%m-%d') == $endDate->format('%Y-%m-%d') && $startDate->format('%H:%M:%S') == '00:00:00' && $endDate->format('%H:%M:%S') == '23:59:59') { $format = JText::_('COM_COMMUNITY_EVENT_TIME_FORMAT_LC1'); $allday = true; } $event->startdateHTML = CTimeHelper::getFormattedTime($event->startdate, $format); $event->enddateHTML = CTimeHelper::getFormattedTime($event->enddate, $format); if (!isset($event->params)) { $event->params = ''; } $params = new CParameter($event->params); $event->defaultCover = $event->isDefaultCover(); // Cover position. $event->coverPostion = $params->get('coverPosition', ''); if (strpos($event->coverPostion, '%') === false) { $event->coverPostion = 0; } // Find cover album and photo. $event->coverAlbum = false; $event->coverPhoto = false; $album = JTable::getInstance('Album', 'CTable'); $albumId = $album->isCoverExist('event', $event->id); if ($albumId) { $album->load($albumId); $event->coverAlbum = $albumId; $event->coverPhoto = $album->photoid; } $inviteHTML = CInvitation::getHTML(null, 'events,inviteUsers', $event->id, CInvitation::SHOW_FRIENDS, CInvitation::SHOW_EMAIL); $status = new CUserStatus($event->id, 'events'); $tmpl = new CTemplate(); $creator = new CUserStatusCreator('message'); $creator->title = $isMine ? JText::_('COM_COMMUNITY_STATUS') : JText::_('COM_COMMUNITY_MESSAGE'); $creator->html = $tmpl->fetch('status.message'); $status->addCreator($creator); // Upgrade wall to stream @since 2.5 $event->upgradeWallToStream(); // Add custom stream $streamHTML = $eventLib->getStreamHTML($event); if ($event->getMemberStatus($my->id) == COMMUNITY_EVENT_STATUS_ATTEND) { $RSVPmessage = JText::_('COM_COMMUNITY_EVENTS_ATTENDING_EVENT_MESSAGE'); } else { if ($event->getMemberStatus($my->id) == COMMUNITY_EVENT_STATUS_WONTATTEND) { $RSVPmessage = JText::_('COM_COMMUNITY_EVENTS_NOT_ATTENDING_EVENT_MESSAGE'); } else { $RSVPmessage = JText::_('COM_COMMUNITY_EVENTS_NOT_RESPOND_RSVP_MESSAGE'); } } // Get recurring event series $eventSeries = null; $seriesCount = 0; if ($event->isRecurring()) { $advance = array('expired' => false, 'return' => 'object', 'limit' => COMMUNITY_EVENT_SERIES_LIMIT, 'exclude' => $event->id, 'published' => 1); $tempseries = $eventModel->getEventChilds($event->parent, $advance); foreach ($tempseries as $series) { $table = JTable::getInstance('Event', 'CTable'); $table->bind($series); $eventSeries[] = $table; } $seriesCount = $eventModel->getEventChildsCount($event->parent); } //pending request invitation guest $pendingRequestGuests = $event->getMembers(COMMUNITY_EVENT_STATUS_REQUESTINVITE, 0, false, false); // Pre-load multiple users at once $tempUserInfo = array(); foreach ($pendingRequestGuests as $uid) { $tempUserInfo[] = CFactory::getUser($uid->id); } $pendingRequestGuests = $tempUserInfo; $featured = new CFeatured(FEATURED_EVENTS); $featuredList = $featured->getItemIds(); // Get Attending Event Guests $maybeList = $event->getMembers(COMMUNITY_EVENT_STATUS_MAYBE, 12, CC_RANDOMIZE); $maybeCount = $event->getMembersCount(COMMUNITY_EVENT_STATUS_MAYBE); $tempUserInfo = array(); foreach ($maybeList as $uid) { $tempUserInfo[] = CFactory::getUser($uid->id); } $maybeList = $tempUserInfo; $wontAttendList = $event->getMembers(COMMUNITY_EVENT_STATUS_WONTATTEND, 12, CC_RANDOMIZE); $wontAttendCount = $event->getMembersCount(COMMUNITY_EVENT_STATUS_WONTATTEND); $tempUserInfo = array(); foreach ($wontAttendList as $uid) { $tempUserInfo[] = CFactory::getUser($uid->id); } $wontAttendList = $tempUserInfo; //gets all the albums related to this photo $photosModel = CFactory::getModel('photos'); $albums = $photosModel->getEventAlbums($event->id); $totalPhotos = 0; foreach ($albums as $album) { $albumParams = new CParameter($album->params); $totalPhotos = $totalPhotos + $albumParams->get('count'); } //get total videos $videosModel = CFactory::getModel('videos'); $videos = $videosModel->getEventVideos($eventid); $totalVideos = count($videosModel->getEventVideos($eventid)); // Output to template echo $tmpl->setMetaTags('event', $event)->set('status', $status)->set('albums', $albums)->set('videos', $videos)->set('pendingRequestGuests', $pendingRequestGuests)->set('streamHTML', $streamHTML)->set('timezone', CTimeHelper::getTimezone($event->offset))->set('handler', $handler)->set('isUserLiked', $isUserLiked)->set('totalLikes', $totalLikes)->set('inviteHTML', $inviteHTML)->set('guestStatus', $event->getUserStatus($my->id))->set('event', $event)->set('radioList', $radioList)->set('bookmarksHTML', $bookmarksHTML)->set('isLikeEnabled', $isLikeEnabled)->set('isEventGuest', $isEventGuest)->set('isMine', $isMine)->set('isAdmin', $isAdmin)->set('isCommunityAdmin', $isCommunityAdmin)->set('unapproved', $unapprovedCount)->set('waitingApproval', $waitingApproval)->set('wallContent', $wallContent)->set('eventMembers', $eventMembers)->set('eventMembersCount', $eventMembersCount)->set('editEvent', $editEvent)->set('my', $my)->set('creator', CFactory::getUser($event->creator))->set('memberStatus', $myStatus)->set('waitingRespond', $waitingRespond)->set('isInvited', $isInvited)->set('join', $join)->set('friendsCount', $friendsCount)->set('isPastEvent', $isPastEvent)->set('adminsList', $adminsList)->set('RSVPmessage', $RSVPmessage)->set('allday', $allday)->set('eventSeries', $eventSeries)->set('seriesCount', $seriesCount)->set('groupEventDetails', isset($groupEventDetails) ? $groupEventDetails : null)->set('featuredList', $featuredList)->set('photoPermission', $params->get('photopermission'))->set('videoPermission', $params->get('videopermission'))->set('showPhotos', $params->get('photopermission') != -1 && $config->get('enablephotos') && $config->get('eventphotos'))->set('showVideos', $params->get('videopermission') != -1 && $config->get('enablevideos') && $config->get('eventvideos'))->set('totalPhotos', $totalPhotos)->set('totalVideos', $totalVideos)->set('maybeList', $maybeList)->set('maybeCount', $maybeCount)->set('wontAttendList', $wontAttendList)->set('wontAttendCount', $wontAttendCount)->fetch('events/single'); }
$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');
<?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 } ?>
<h4 class="joms-text--title"><?php echo JText::_('COM_COMMUNITY_FILES_AVAILABLE'); ?> </h4> <ul class="joms-list--files"> <?php for ($i = 0; $i <= 4; $i++) { ?> <?php if (!empty($data[$i])) { ?> <?php $filename = $data[$i]->name; $filepath = $data[$i]->filepath; $fileext = strrpos($filepath, '.'); $userlink = '<a href="' . CUrlHelper::userLink($data[$i]->user->id) . '">' . $data[$i]->user->getDisplayName() . '</a>'; if ($fileext !== false) { $filename .= substr($filepath, $fileext); } ?> <li class="joms-list__item joms-js--file-<?php echo $data[$i]->id; ?> "> <p> <a href="<?php echo $filepath; ?> " target="_blank" title="<?php echo $filename; ?>
/** * Responsible for displaying the event page. **/ function viewevent() { $mainframe = JFactory::getApplication(); $document = JFactory::getDocument(); $config = CFactory::getConfig(); $my = CFactory::getUser(); CFactory::load('libraries', 'tooltip'); CFactory::load('libraries', 'wall'); CFactory::load('libraries', 'window'); CWindow::load(); $eventid = JRequest::getInt('eventid', 0); $eventModel =& CFactory::getModel('events'); $event =& JTable::getInstance('Event', 'CTable'); CFactory::load('helpers', 'event'); $handler = CEventHelper::getHandler($event); $event->load($eventid); if (!$handler->exists()) { $mainframe->enqueueMessage(JText::_('CC EVENTS NOT AVAILABLE'), 'error'); return; } if (!$handler->browsable()) { echo JText::_('CC NOT ALLOWED TO ACCESS SECTION'); return; } // @rule: Test if the group is unpublished, don't display it at all. if (!$event->published) { echo JText::_('CC EVENTS UNDER MODERATION'); return; } $this->showSubmenu(); $event->hit(); // 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::_('CC 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)); } $this->addPathway(JText::_('CC EVENTS'), CRoute::_('index.php?option=com_community&view=events')); $this->addPathway(JText::sprintf('CC VIEW EVENTS TITLE', $event->title), ''); // Permissions and privacies CFactory::load('helpers', 'owner'); $isEventGuest = $event->isMember($my->id); $isMine = $my->id == $event->creator; $isAdmin = $event->isAdmin($my->id); $isCommunityAdmin = COwnerHelper::isCommunityAdmin(); // Get Event Admins $eventAdmins = $event->getAdmins(12, CC_RANDOMIZE); $eventAdminsCount = $event->getAdminsCount(); // Attach avatar of the admin for ($i = 0; $i < count($eventAdmins); $i++) { $row =& $eventAdmins[$i]; $eventAdmins[$i] = CFactory::getUser($row->id); } // Get Attending Event Guests $eventMembers = $event->getMembers(COMMUNITY_EVENT_STATUS_ATTEND, 12, CC_RANDOMIZE); $eventMembersCount = $event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND); // Get pending event guests $pendingMembers = $event->getMembers(COMMUNITY_EVENT_STATUS_INVITED, 12, CC_RANDOMIZE); $pendingMembersCount = $event->getMembersCount(COMMUNITY_EVENT_STATUS_INVITED); // Get blocked Event Guests $blockedMembers = $event->getMembers(COMMUNITY_EVENT_STATUS_BLOCKED, 12, CC_RANDOMIZE); $blockedMembersCount = $event->getMembersCount(COMMUNITY_EVENT_STATUS_BLOCKED); // 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 $userids = array(); foreach ($pendingMembers as $uid) { $userids[] = $uid->id; } CFactory::loadUsers($userids); for ($i = 0; $i < count($pendingMembers); $i++) { $row =& $pendingMembers[$i]; $pendingMembers[$i] = CFactory::getUser($row->id); } // Pre-load multiple users at once $userids = array(); foreach ($blockedMembers as $uid) { $userids[] = $uid->id; } CFactory::loadUsers($userids); for ($i = 0; $i < count($blockedMembers); $i++) { $row =& $blockedMembers[$i]; $blockedMembers[$i] = CFactory::getUser($row->id); } $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 CFactory::load('libraries', 'bookmarks'); $bookmarks = new CBookmarks(CRoute::getExternalURL('index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id)); $bookmarksHTML = $bookmarks->getHTML(); // Get Reporting HTML CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $reportHTML = $report->getReportingHTML(JText::_('CC REPORT EVENT'), 'events,reportEvent', array($event->id)); // Get the Wall CFactory::load('libraries', 'wall'); $wallContent = CWallLibrary::getWallContents('events', $event->id, $isAdmin, 10, 0, 'wall.content', 'events,events'); $wallCount = CWallLibrary::getWallCount('events', $event->id); $viewAllLink = false; if (JRequest::getVar('task', '', 'REQUEST') != 'app') { $viewAllLink = CRoute::_('index.php?option=com_community&view=events&task=app&eventid=' . $event->id . '&app=walls'); } $wallContent .= CWallLibrary::getViewAllLinkHTML($viewAllLink, $wallCount); $wallForm = ''; if (!$config->get('lockeventwalls') || $config->get('lockeventwalls') && $isEventGuest && !$waitingApproval && $hasResponded || $isCommunityAdmin) { $wallForm = CWallLibrary::getWallInputForm($event->id, 'events,ajaxSaveWall', 'events,ajaxRemoveWall'); } // Construct the RVSP radio list $arr = array(JHTML::_('select.option', COMMUNITY_EVENT_STATUS_ATTEND, JText::_('CC EVENT ACTION ATTEND')), JHTML::_('select.option', COMMUNITY_EVENT_STATUS_WONTATTEND, JText::_('CC EVENT ACTION DECLINE')), JHTML::_('select.option', COMMUNITY_EVENT_STATUS_MAYBE, JText::_('CC EVENT ACTION UNSURE'))); $status = $event->getMemberStatus($my->id); $radioList = JHTML::_('select.radiolist', $arr, 'status', '', 'value', 'text', $status, false); $unapprovedCount = $event->inviteRequestCount(); //... $editEvent = JRequest::getVar('edit', false, 'GET'); $editEvent = $editEvent == 1 ? true : false; // Am I invited in this event? $isInvited = false; $join = ''; $friendsCount = 0; $isInvited = $eventModel->isInvitedMe(0, $my->id, $event->id); // If I was invited, I want to know my invitation informations if ($isInvited) { $invitor = CFactory::getUser($isInvited[0]->invited_by); $join = '<a href="' . CUrlHelper::userLink($invitor->id) . '">' . $invitor->getDisplayName() . '</a>'; // Get users friends in this group $friendsCount = $eventModel->getFriendsCount($my->id, $event->id); } $friendsModel = CFactory::getModel('Friends'); $tmpFriends = $friendsModel->getFriends($my->id, 'name', false); $friends = array(); for ($i = 0; $i < count($tmpFriends); $i++) { $friend =& $tmpFriends[$i]; if (!$event->isMember($friend->id)) { $friends[] = $friend; } } unset($tmpFriends); // Get like CFactory::load('libraries', 'like'); $likes = new CLike(); $likesHTML = $likes->getHTML('events', $event->id, $my->id); // Is this event is a past event? $now = new JDate(); $isPastEvent = $event->getEndDate(false)->toMySQL() < $now->toMySQL(true) ? true : false; // Output to template $tmpl = new CTemplate(); CFactory::load('libraries', 'invitation'); $inviteHTML = CInvitation::getHTML($friends, 'events,inviteUsers', $event->id, CInvitation::SHOW_FRIENDS, CInvitation::HIDE_EMAIL); $tmpl->setMetaTags('event', $event); $tmpl->set('timezone', CTimeHelper::getTimezone($event->offset)); $tmpl->set('handler', $handler); $tmpl->set('likesHTML', $likesHTML); $tmpl->set('inviteHTML', $inviteHTML); $tmpl->set('guestStatus', $event->getUserStatus($my->id)); $tmpl->set('event', $event); $tmpl->set('radioList', $radioList); $tmpl->set('bookmarksHTML', $bookmarksHTML); $tmpl->set('reportHTML', $reportHTML); $tmpl->set('isEventGuest', $isEventGuest); $tmpl->set('isMine', $isMine); $tmpl->set('isAdmin', $isAdmin); $tmpl->set('isCommunityAdmin', $isCommunityAdmin); $tmpl->set('unapproved', $unapprovedCount); $tmpl->set('waitingApproval', $waitingApproval); $tmpl->set('wallForm', $wallForm); $tmpl->set('wallContent', $wallContent); $tmpl->set('eventAdmins', $eventAdmins); $tmpl->set('eventAdminsCount', $eventAdminsCount); $tmpl->set('eventMembers', $eventMembers); $tmpl->set('eventMembersCount', $eventMembersCount); $tmpl->set('blockedMembers', $blockedMembers); $tmpl->set('blockedMembersCount', $blockedMembersCount); $tmpl->set('pendingMembers', $pendingMembers); $tmpl->set('pendingMembersCount', $pendingMembersCount); $tmpl->set('editEvent', $editEvent); $tmpl->set('my', $my); $tmpl->set('memberStatus', $myStatus); $tmpl->set('waitingRespond', $waitingRespond); $tmpl->set('isInvited', $isInvited); $tmpl->set('join', $join); $tmpl->set('friendsCount', $friendsCount); $tmpl->set('isPastEvent', $isPastEvent); echo $tmpl->fetch('events.viewevent'); }
<div class="clr"></div> <div class="group-discussion-author small"> <?php if (isset($row->lastreplier) && !empty($row->lastreplier)) { ?> <span class="groups-news-author"> <?php echo JText::sprintf('CC DISCUSSION LAST REPLIED', '<a href="' . CUrlHelper::userLink($row->lastreplier->post_by->id) . '">' . $row->lastreplier->post_by->getDisplayName() . '</a>', JHTML::_('date', $row->lastreplier->date, JText::_('DATE_FORMAT_LC'))); ?> </span> <?php } else { ?> <span class="groups-news-author"> <?php echo JText::sprintf('CC DISCUSS STARTED BY', '<a href="' . CUrlHelper::userLink($row->user->id) . '">' . $row->user->getDisplayName() . '</a>'); ?> </span> <?php } ?> </div> </div> <?php } } else { ?> <div class="empty"><?php echo JText::_('CC NO DISCUSSIONS'); ?> </div>
<?php } else { ?> <img src="<?php echo $message->avatar; ?> " alt="" > <?php } ?> </a> </div> <div class="joms-comment__body"> <a href="<?php echo $task == 'sent' && !empty($message->smallAvatar[0]) ? CUrlHelper::userLink($message->to[0]) : CUrlHelper::userLink($message->user->id); ?> "> <strong> <?php if ($task == 'sent' && !empty($message->smallAvatar[0])) { echo $message->to_name[0]; } else { echo $message->from_name; } ?> </strong> </a> <?php $count = --$message->recipientCount; if ($count > 0) {
<!--NEWS FEED AVATAR--> <!--NEWS FEED CONTENT--> <div class="newsfeed-content"> <div class="newsfeed-content-top"> <?php // Put user header link if necessary if ($apptype == 'group' && $act->eventid) { // For group event, show the arrow indicator (using <span class="com_icons com_icons12 com_icons-inline com_icons-rarr">»</span>) echo '<div class="newsfeed-content-actor"><a href="' . CUrlHelper::userLink($act->actor) . '">' . $actor->getDisplayName() . '</a> <span class="com_icons com_icons12 com_icons-inline com_icons-rarr">»</span> <a href="' . CUrlHelper::eventLink($act->eventid) . '">' . $act->appTitle . '</a></div>'; } else { ?> <div class="newsfeed-content-actor"> <strong><a class="actor-link" href="<?php echo CUrlHelper::userLink($act->actor); ?> "><?php echo $actor->getDisplayName(); ?> </a></strong> </div> <?php } // Order of replacement $order = array("\r\n", "\n", "\r"); $replace = '<br/>'; // Processes \r\n's first so they aren't converted twice. $messageDisplay = str_replace($order, $replace, $act->title); echo $messageDisplay; ?>
*/ defined('_JEXEC') or die; $user = CFactory::getUser($this->act->actor); $users = explode(',', $this->actors); // We want the last guy joining to be the first mentioned $users = array_reverse($users); $userCount = count($users); $slice = 2; if ($userCount > 2) { $slice = 1; } $users = array_slice($users, 0, $slice); $actorsHTML = array(); ?> <div class="joms-stream-content"> <i class="joms-icon-users"></i> <?php foreach ($users as $actor) { $user = CFactory::getUser($actor); $actorsHTML[] = '<a class="cStream-Author" href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>'; } $others = ''; if ($userCount > 2) { $others = JText::sprintf('COM_COMMUNITY_STREAM_OTHERS_JOIN_GROUP', $userCount - 1, 'onClick="joms.stream.showOthers(' . $act->id . ');return false;"'); } echo implode(' ' . JText::_('COM_COMMUNITY_AND') . ' ', $actorsHTML) . $others; echo JText::sprintf('COM_COMMUNITY_GROUPS_GROUP_JOIN', $this->group->getLink(), $this->group->name); ?> </div>
/** * Display the full list of people who likes this stream item * * @param <type> $objResponse * @param <type> $actid * @param <type> $like_type * @param <type> $like_id */ private function _streamShowLikes($objResponse, $actid, $like_type, $like_id, $target = '') { $my = CFactory::getUser(); $like = new CLike(); $likes = $like->getWhoLikes($like_type, $like_id); $canUnlike = false; $likeHTML = ''; $likeUsers = array(); foreach ($likes as $user) { $likeUsers[] = '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>'; if ($my->id == $user->id) { $canUnlike = true; } } if (count($likeUsers) != 0) { if ($target === 'popup') { $tmpl = new CTemplate(); $tmpl->set('users', $likes); $likeHTML = $tmpl->fetch('ajax.stream.showothers'); } else { $likeHTML .= implode(", ", $likeUsers); $likeHTML = CStringHelper::isPlural(count($likeUsers)) ? JText::sprintf('COM_COMMUNITY_LIKE_THIS_MANY_LIST', $likeHTML) : JText::sprintf('COM_COMMUNITY_LIKE_THIS_LIST', $likeHTML); } } return $likeHTML; }
"></div> </div> <div class="joms-list__footer joms-padding"> <a class="joms-avatar" href="<?php echo CUrlHelper::userLink($creator->id); ?> "><img src="<?php echo $creator->getAvatar(); ?> " alt="" ></a> <?php echo JText::_('COM_COMMUNITY_GROUPS_CREATED_BY'); ?> <a href="<?php echo CUrlHelper::userLink($creator->id); ?> "><?php echo $creator->getDisplayName(); ?> </a> </div> <span class="joms-list__permission joms-js--invitation-buttons-group-<?php echo $group->id; ?> "> <a class="joms-button--neutral joms-button--smallest" href="javascript:" onclick="joms.api.invitationReject('group', '<?php echo $group->id; ?> ');"><?php
if ($my->id == $user1->id) { $you = $user1; $other = $user2; } if ($my->id == $user2->id) { $you = $user2; $other = $user1; } ?> <div class="joms-stream__body no-head"> <p> <svg viewBox="0 0 16 16" class="joms-icon"> <use xlink:href="<?php echo CRoute::getURI(); ?> #joms-icon-user"></use> </svg> <?php if (!is_null($you)) { // @todo: use sprintf with language code echo JText::sprintf('COM_COMMUNITY_STREAM_MY_FRIENDS', $other->getDisplayName(), CUrlHelper::userLink($other->id)); ?> <?php } else { // @todo: use sprintf with language code echo JText::sprintf('COM_COMMUNITY_STREAM_OTHER_FRIENDS', $user1->getDisplayName(), $user2->getDisplayName(), CUrlHelper::userLink($user1->id), CUrlHelper::userLink($user2->id)); } ?> </p> </div>
</a> </div> <div class="joms-stream__meta"> <a class="joms-stream__user" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $groupId . '&topicid=' . $row->id); ?> "> <?php echo $row->title; ?> </a> <span class="joms-stream__time"> <small> <?php echo JText::sprintf('COM_COMMUNITY_GROUPS_DISCUSSION_CREATOR', '<a href="' . CUrlHelper::userLink($row->user->id) . '">' . $row->user->getDisplayName() . '</a>'); ?> <?php echo JHTML::_('date', $row->created, JText::_('DATE_FORMAT_LC')); ?> </small> </span> </div> <div class="joms-stream__replies"> <a class="joms-button--neutral joms-button--small" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $groupId . '&topicid=' . $row->id); ?> "> <?php echo JText::sprintf(CStringHelper::isPlural($row->count) ? 'COM_COMMUNITY_TOTAL_REPLIES_MANY' : 'COM_COMMUNITY_GROUPS_DISCUSSION_REPLY_COUNT', $row->count); ?>
/** * Displays specific groups **/ public function viewGroup($group) { $mainframe =& JFactory::getApplication(); CFactory::load('libraries', 'tooltip'); CFactory::load('libraries', 'wall'); CFactory::load('libraries', 'window'); CFactory::load('libraries', 'videos'); CFactory::load('libraries', 'activities'); CFactory::load('helpers', 'group'); CWindow::load(); $config = CFactory::getConfig(); $document = JFactory::getDocument(); $groupLib = new CGroups(); // Load appropriate models $groupModel = CFactory::getModel('groups'); $wallModel = CFactory::getModel('wall'); $userModel = CFactory::getModel('user'); $discussModel = CFactory::getModel('discussions'); $bulletinModel = CFactory::getModel('bulletins'); $photosModel = CFactory::getModel('photos'); $activityModel = CFactory::getModel('activities'); //$groupid = JRequest::getInt( 'groupid' , '' ); //CError::assert( $groupid , '' , '!empty' , __FILE__ , __LINE__ ); $editGroup = JRequest::getVar('edit', false, 'GET'); $editGroup = $editGroup == 1 ? true : false; $params = $group->getParams(); CFactory::load('helpers', 'string'); $document->setMetaData('title', CStringHelper::escape($group->name)); $document->setMetaData('description', CStringHelper::escape(strip_tags($group->description))); $document->addCustomTag('<link rel="image_src" href="' . JURI::root() . $group->thumb . '" />'); // @rule: Test if the group is unpublished, don't display it at all. if (!$group->published) { $this->_redirectUnpublishGroup(); return; } // Show submenu $this->showSubmenu(); // Set the group info to contain proper <br> $group->description = nl2br($group->description); $this->addPathway(JText::_('COM_COMMUNITY_GROUPS'), CRoute::_('index.php?option=com_community&view=groups')); $this->addPathway(JText::sprintf('COM_COMMUNITY_GROUPS_NAME_TITLE', $group->name), ''); // Load the current browsers data $my = CFactory::getUser(); // If user are invited $isInvited = $groupModel->isInvited($my->id, $group->id); // Get members list for display //$members = $groupModel->getAllMember($group->id); //Set limit for member listing on view group page $limit = 12; $approvedMembers = $groupModel->getMembers($group->id, $limit, true, false, true); CError::assert($approvedMembers, 'array', 'istype', __FILE__, __LINE__); $membersCount = $groupModel->total; // Is there any my friend is the member of this group? $join = ''; $friendsCount = 0; if ($isInvited) { // Get the invitors $invitors = $groupModel->getInvitors($my->id, $group->id); if (count($invitors) == 1) { $user = CFactory::getUser($invitors[0]->creator); $join = '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>'; } else { for ($i = 0; $i < count($invitors); $i++) { $user = CFactory::getUser($invitors[$i]->creator); if ($i + 1 == count($invitors)) { $join .= ' ' . JText::_('COM_COMMUNITY_AND') . ' ' . '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>'; } else { $join .= ', ' . '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>'; } } } // Get users friends in this group $friendsCount = $groupModel->getFriendsCount($my->id, $group->id); } $admins = $groupModel->getAdmins($group->id, $limit, CC_RANDOMIZE); // Get list of unapproved members $groupModel->getMembers($group->id, null, false); $unapproved = $groupModel->total; //Get list of approved members // Test if the current user is admin $isAdmin = $groupModel->isAdmin($my->id, $group->id); // Test if the current browser is a member of the group $isMember = $groupModel->isMember($my->id, $group->id); $waitingApproval = false; // Test if the current user is banned from this group $isBanned = $group->isBanned($my->id); // Attach avatar of the member // Pre-load multiple users at once $userids = array(); $limitloop = $limit; foreach ($approvedMembers as $uid) { $userids[] = $uid->id; if (--$limitloop < 1) { break; } } CFactory::loadUsers($userids); $limitloop = $limit; for ($i = 0; $i < count($approvedMembers); $i++) { $row =& $approvedMembers[$i]; $approvedMembers[$i] = CFactory::getUser($row->id); if (--$limitloop < 1) { break; } } if ($isBanned) { $mainframe->enqueueMessage(JText::_('COM_COMMUNITY_GROUPS_MEMBER_BANNED'), 'error'); } // If I have tried to join this group, but not yet approved, display a notice if ($groupModel->isWaitingAuthorization($my->id, $group->id)) { $waitingApproval = true; } // Get the walls if (!$isBanned) { $wallContent = CWallLibrary::getWallContents('groups', $group->id, $isAdmin, 10, 0, 'wall.content', 'groups,group'); } else { $wallContent = CWallLibrary::getWallContents('groups', $group->id, $isAdmin, 10, 0, 'wall.content', 'groups,group', null, '1'); } $wallCount = CWallLibrary::getWallCount('groups', $group->id); $viewAllLink = false; if (JRequest::getVar('task', '', 'REQUEST') != 'app') { $viewAllLink = CRoute::_('index.php?option=com_community&view=groups&task=app&groupid=' . $group->id . '&app=walls'); } $wallContent .= CWallLibrary::getViewAllLinkHTML($viewAllLink, $wallCount); $wallForm = ''; CFactory::load('helpers', 'owner'); if (!$config->get('lockgroupwalls') || $config->get('lockgroupwalls') && ($isMember && !$isBanned) && !$waitingApproval || COwnerHelper::isCommunityAdmin()) { $wallForm = CWallLibrary::getWallInputForm($group->id, 'groups,ajaxSaveWall', 'groups,ajaxRemoveWall'); } // Get like CFactory::load('libraries', 'like'); $likes = new CLike(); $likesHTML = $isMember && !$isBanned ? $likes->getHTML('groups', $group->id, $my->id) : $likes->getHtmlPublic('groups', $group->id); // Get discussions data $discussionData = $this->_cachedCall('_getDiscussionListHTML', array($params, $group->id), $group->id, array(COMMUNITY_CACHE_TAG_GROUPS_DETAIL)); $discussionsHTML = $discussionData['HTML']; $totalDiscussion = $discussionData['total']; $discussions = $discussionData['data']; // Get bulletins data $bulletinData = $this->_cachedCall('_getBulletinListHTML', array($group->id), $group->id, array(COMMUNITY_CACHE_TAG_GROUPS_DETAIL)); $totalBulletin = $bulletinData['total']; $bulletinsHTML = $bulletinData['HTML']; $bulletins = $bulletinData['data']; // Get album data $albumData = $this->_cachedCall('_getAlbums', array($params, $group->id), $group->id, array(COMMUNITY_CACHE_TAG_GROUPS_DETAIL)); $albums = $albumData['data']; $totalAlbums = $albumData['total']; // Get video data $videoData = $this->_getVideos($params, $group->id); $videos = $videoData['data']; $totalVideos = $videoData['total']; $tmpl = new CTemplate(); // Get categories list // 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); }
▶ <a href="<?php echo CUrlHelper::groupLink($group->id); ?> "><?php echo $group->name; ?> </a> </span> <!-- Target is user profile --> <?php } else { if ($activity->get('app') == 'profile' && $activity->get('target') != 0 && $activity->get('target') != $user->id) { ?> <span class="joms-stream__reference"> ▶ <a href="<?php echo CUrlHelper::userLink($activity->target); ?> "><?php echo CFactory::getUser($activity->get('target'))->getDisplayName(); ?> </a> </span> <?php } } } ?> <a href="<?php echo CRoute::_('index.php?option=com_community&view=profile&userid=' . $activity->actor . '&actid=' . $activity->id); ?>
echo '<strong><a class="actor-link" href="' . CUrlHelper::userLink($act->actor) . '">' . $actor->getDisplayName() . '</a></strong> <span class="com_icons com_icons12 com_icons-inline com_icons-rarr">»</span> <a href="' . CUrlHelper::groupLink($act->groupid) . '">' . $act->appTitle . '</a>'; if ($act->group_access == 1) { echo ' <span title="' . JText::_('COM_COMMUNITY_GROUPS_PRIVATE') . '" class="com_icons com_icons12 com_icons-inline com_icons-private jomNameTips">' . JText::_('COM_COMMUNITY_GROUPS_PRIVATE') . '</span>'; } echo '</div>'; } else { if (!empty($act->target) && $act->target != $act->actor && $act->app == 'profile' && $act->target != $actorId) { // Actor doing something to target echo '<div class="newsfeed-content-actor">'; echo '<strong><a class="actor-link" href="' . CUrlHelper::userLink($act->actor) . '">' . $actor->getDisplayName() . '</a></strong> '; echo '<span class="com_icons com_icons12 com_icons-inline com_icons-rarr">»</span> '; echo '<a class="actor-link" href="' . CUrlHelper::userLink($act->target) . '">' . $target->getDisplayName() . '</a>'; echo '</div>'; } else { // Everythings else should have the actor's title $actorNeedle = '<a class="actor-link" href="' . CUrlHelper::userLink($act->actor) . '">' . $actor->getDisplayName() . '</a>'; // Will do a preg search for the actor's name and avoid a duplicated display if (!preg_match('/^<a(.)+class="(.)?actor-link(.)?"(.)+>' . $actor->getDisplayName() . '<\\/a>/', $messageDisplay)) { echo '<div class="newsfeed-content-actor">'; echo '<strong>' . $actorNeedle . '</strong>'; echo '</div>'; } } } } echo $messageDisplay; ?> </div> <?php if (!empty($act->content) && $showMore) { ?>
?> <?php } else { if ($this->act->app == 'events.featured') { ?> <?php $this->load('activities.events.featured'); } else { ?> <?php $table = JTable::getInstance('Activity', 'CTable'); $table->load($this->act->id); if (!$table->delete()) { ?> <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;
function _getWallHTML($wall, $wallComments, $appType, $isOwner, $processFunc, $templateFile) { CFactory::load('helpers', 'url'); CFactory::load('helpers', 'user'); CFactory::load('helpers', 'videos'); CFactory::load('libraries', 'comment'); CFactory::load('helpers', 'owner'); CFactory::load('helpers', 'time'); $user = CFactory::getUser($wall->post_by); $date = CTimeHelper::getDate($wall->date); $config = CFactory::getConfig(); // @rule: for site super administrators we want to allow them to view the remove link $isOwner = COwnerHelper::isCommunityAdmin() ? true : $isOwner; $isEditable = CWall::isEditable($processFunc, $wall->id); // Apply any post processing on the content $wall->comment = CWallLibrary::_processWallContent($wall->comment); $commentsHTML = ''; $comment = new CComment(); // If the wall post is a user wall post (in profile pages), we // add wall comment feature if ($appType == 'user' || $appType == 'groups' || $appType == 'events') { $commentsHTML = $comment->getHTML($wallComments, 'wall-cmt-' . $wall->id, CWall::canComment($wall->type, $wall->contentid)); } $avatarHTML = CUserHelper::getThumb($wall->post_by, 'avatar'); //var_dump($avatarHTML);exit; // @rule: We only allow editing of wall in 15 minutes $now = JFactory::getDate(); $interval = CTimeHelper::timeIntervalDifference($wall->date, $now->toMySQL()); $interval = COMMUNITY_WALLS_EDIT_INTERVAL - abs($interval); $editInterval = round($interval / 60); // Create new instance of the template $tmpl = new CTemplate(); $tmpl->set('id', $wall->id); $tmpl->set('author', $user->getDisplayName()); $tmpl->set('avatarHTML', $avatarHTML); $tmpl->set('authorLink', CUrlHelper::userLink($user->id)); $tmpl->set('created', $date->toFormat(JText::_('DATE_FORMAT_LC2'))); $tmpl->set('content', $wall->comment); $tmpl->set('commentsHTML', $commentsHTML); $tmpl->set('avatar', $user->getThumbAvatar()); $tmpl->set('isMine', $isOwner); $tmpl->set('isEditable', $isEditable); $tmpl->set('editInterval', $editInterval); $tmpl->set('processFunc', $processFunc); $tmpl->set('config', $config); return $tmpl->fetch($templateFile); }