/** * * @param JDate $date * */ public static function timeLapse($date) { $now = new JDate(); $dateDiff = CTimeHelper::timeDifference($date->toUnix(), $now->toUnix()); if ($dateDiff['days'] > 0) { $lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['days']) ? 'CC LAPSED DAY MANY' : 'CC LAPSED DAY', $dateDiff['days']); } elseif ($dateDiff['hours'] > 0) { $lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['hours']) ? 'CC LAPSED HOUR MANY' : 'CC LAPSED HOUR', $dateDiff['hours']); } elseif ($dateDiff['minutes'] > 0) { $lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['minutes']) ? 'CC LAPSED MINUTE MANY' : 'CC LAPSED MINUTE', $dateDiff['minutes']); } else { $lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['seconds']) ? 'CC LAPSED SECOND MANY' : 'CC LAPSED SECOND', $dateDiff['seconds']); } return $lapse; }
/** * Return avatar tooltip title * @todo: this is perfect candidate for caching * * @param row user object */ function cAvatarTooltip(&$row) { $friendsModel = CFactory::getModel('friends'); $userModel = CFactory::getModel('user'); $user = CFactory::getUser($row->id); $numFriends = $user->getFriendCount(); if ($user->isOnline()) { $isOnline = '<img style="vertical-align:middle;padding: 0px 4px;" src="' . JURI::base() . 'components/com_community/assets/status_online.png" />' . JText::_('CC ONLINE'); } else { $isOnline = '<img style="vertical-align:middle;padding: 0px 4px;" src="' . JURI::base() . 'components/com_community/assets/status_offline.png" />' . JText::_('CC OFFLINE'); } CFactory::load('helpers', 'string'); $html = $row->getDisplayName() . '::'; $html .= $user->getStatus() . '<br/>'; $html .= '<hr noshade="noshade" height="1"/>'; $html .= $isOnline . ' | <img style="vertical-align:middle;padding: 0px 4px;" src="' . JURI::base() . 'components/com_community/assets/default-favicon.png" />' . JText::sprintf(CStringHelper::isPlural($numFriends) ? 'CC FRIENDS COUNT MANY' : 'CC FRIENDS COUNT', $numFriends); return htmlentities($html, ENT_COMPAT, 'UTF-8'); }
/** * * @param JDate $date * */ public static function timeLapse($date) { $now = new JDate(); $dateDiff = CTimeHelper::timeDifference($date->toUnix(), $now->toUnix()); if ($dateDiff['days'] > 0) { $lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['days']) ? 'COM_COMMUNITY_LAPSED_DAY_MANY' : 'COM_COMMUNITY_LAPSED_DAY', $dateDiff['days']); } elseif ($dateDiff['hours'] > 0) { $lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['hours']) ? 'COM_COMMUNITY_LAPSED_HOUR_MANY' : 'COM_COMMUNITY_LAPSED_HOUR', $dateDiff['hours']); } elseif ($dateDiff['minutes'] > 0) { $lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['minutes']) ? 'COM_COMMUNITY_LAPSED_MINUTE_MANY' : 'COM_COMMUNITY_LAPSED_MINUTE', $dateDiff['minutes']); } else { if ($dateDiff['seconds'] == 0) { $lapse = JText::_("COM_COMMUNITY_ACTIVITIES_MOMENT_AGO"); } else { $lapse = JText::sprintf(CStringHelper::isPlural($dateDiff['seconds']) ? 'COM_COMMUNITY_LAPSED_SECOND_MANY' : 'COM_COMMUNITY_LAPSED_SECOND', $dateDiff['seconds']); } } return $lapse; }
function display($data = null) { $mainframe = JFactory::getApplication(); $document =& JFactory::getDocument(); $model = CFactory::getModel('search'); $members = $model->getPeople(); // Prepare feeds // $document->setTitle($title); foreach ($members as $member) { $user = CFactory::getUser($member->id); $friendCount = JText::sprintf(CStringHelper::isPlural($user->getFriendCount()) ? 'CC FRIENDS COUNT MANY' : 'CC FRIENDS COUNT', $user->getFriendCount()); $item = new JFeedItem(); $item->title = $user->getDisplayName(); $item->link = CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id); $item->description = '<img src="' . $user->getThumbAvatar() . '" alt="" /> ' . $friendCount; $item->date = ''; // Make sure url is absolute $item->description = JString::str_ireplace('href="/', 'href="' . JURI::base(), $item->description); $document->addItem($item); } }
</form> <?php } if (!empty($search)) { ?> <div class="cSearch-Result"> <p> <span> <?php echo JText::sprintf('COM_COMMUNITY_SEARCH_RESULT', $search); ?> </span> <span class="cFloat-R"> <?php echo JText::sprintf(CStringHelper::isPlural($videosCount) ? 'COM_COMMUNITY_VIDEOS_SEARCH_RESULT_TOTAL_MANY' : 'COM_COMMUNITY_VIDEOS_SEARCH_RESULT_TOTAL', $videosCount); ?> </span> </p> <?php echo $videosHTML; ?> <?php if (!empty($pagination)) { ?> <div class="cPagination"> <?php echo $pagination; ?>
<?php } ?> <?php echo $sortings; ?> <div class="joms-gap"></div> <?php if ($events) { ?> <div class="joms-alert joms-alert--info"> <?php echo JText::sprintf(CStringHelper::isPlural($count) ? 'COM_COMMUNITY_EVENTS_INVITATION_COUNT_MANY' : 'COM_COMMUNITY_EVENTS_INVITATION_COUNT_SINGLE', $count); ?> </div> <ul class="joms-list--card"> <?php for ($i = 0; $i < count($events); $i++) { $event =& $events[$i]; $user = CFactory::getUser($event->creator); $isGroup = false; if ($event->type == 'group' && $event->contentid) { $isGroup = true; $groupModel = CFactory::getModel('groups'); $groupName = $groupModel->getGroupName($event->contentid); $groupLink = CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $event->contentid); }
* @license GNU/GPL, see LICENSE.php * */ defined('_JEXEC') or die; ?> <?php echo $sortings; ?> <div id="community-events-wrap"> <?php if ($events) { ?> <div> <?php echo JText::sprintf(CStringHelper::isPlural($count) ? 'CC MY EVENTS INVITATION COUNT MANY' : 'CC MY EVENTS INVITATION COUNT', $count); ?> </div> <?php for ($i = 0; $i < count($events); $i++) { $event =& $events[$i]; ?> <div class="community-events-results-item" id="events-invite-<?php echo $event->id; ?> "> <div class="community-events-results-left"> <a href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id); ?> "><img class="avatar" src="<?php
?> " class="joms-alert--info"> <h4 class="joms-alert__head"> <?php echo JText::sprintf('COM_COMMUNITY_GROUPS_INVITATION', $join); ?> </h4> <div class="joms-alert__body"> <div class="joms-alert__content"> <?php echo JText::sprintf('COM_COMMUNITY_GROUPS_YOU_INVITED', $join); ?> <span> <?php echo JText::sprintf(CStringHelper::isPlural($friendsCount) ? 'COM_COMMUNITY_GROUPS_FRIEND' : 'COM_COMMUNITY_GROUPS_FRIEND_MANY', $friendsCount); ?> </span> </div> <div class="joms-alert__actions"> <a href="javascript:void(0);" onclick="jax.call('community','groups,ajaxRejectInvitation','<?php echo $group->id; ?> ');" class="joms-button--neutral joms-button--small"> <?php echo JText::_('COM_COMMUNITY_EVENTS_REJECT'); ?> </a> <a href="javascript:void(0);" onclick="jax.call('community','groups,ajaxAcceptInvitation','<?php
<?php if ($config->get('creatediscussion')) { ?> <li> <svg class="joms-icon" viewBox="0 0 18 18"> <use xlink:href="<?php echo CRoute::getURI(); ?> #joms-icon-bubbles"/> </svg> <a href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussions&groupid=' . $group->id); ?> "> <?php echo JText::sprintf(CStringHelper::isPlural($group->discusscount) ? 'COM_COMMUNITY_GROUPS_DISCUSSION_COUNT_MANY' : 'COM_COMMUNITY_GROUPS_DISCUSSION_COUNT', $group->discusscount); ?> <a/> </li> <?php } ?> <?php if ($showVideo) { ?> <li> <svg class="joms-icon" viewBox="0 0 16 16"> <use xlink:href="<?php echo CRoute::getURI(); ?> #joms-icon-film"/>
<a href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=viewmembers&groupid=' . $group->id); ?> "><?php echo JText::sprintf(CStringHelper::isPlural($group->membercount) ? 'CC MEMBERS COUNT MANY' : 'CC MEMBERS COUNT', $group->membercount); ?> </a> </span> <span class="icon-discuss" style="margin-right: 5px;"> <?php echo JText::sprintf(CStringHelper::isPlural($group->discusscount) ? 'CC GROUP DISCUSS COUNT MANY' : 'CC GROUP DISCUSS COUNT', $group->discusscount); ?> </span> <span class="icon-wall" style="margin-right: 5px;"> <?php echo JText::sprintf(CStringHelper::isPlural($group->wallcount) ? 'CC GROUP WALL COUNT MANY' : 'CC GROUP WALL COUNT', $group->wallcount); ?> </span> <?php if ($isCommunityAdmin && $showFeatured) { if (!in_array($group->id, $featuredList)) { ?> <span class="icon-addfeatured" style="margin-right: 5px;"> <a onclick="joms.featured.add('<?php echo $group->id; ?> ','groups');" href="javascript:void(0);"> <?php echo JText::_('CC MAKE FEATURED'); ?> </a>
</div><!--action-button--> <!--VIDEO PLAYER--> <div class="video-player"> <?php echo $video->getPlayerHTML(); ?> </div> <!--end: VIDEO PLAYER--> <div class="cLayout"> <div class="cSidebar"> <div class="hits"> <strong> <?php if (CStringHelper::isPlural($video->getHits())) { echo JText::sprintf('COM_COMMUNITY_VIDEOS_HITS_COUNT', $video->getHits()); } else { echo JText::sprintf('COM_COMMUNITY_VIDEOS_HITS_COUNT_SINGULAR', $video->getHits()); } ?> </strong> </div> <div id="like-container"> <?php echo $likesHTML; ?> </div><!--like-container-->
* @subpackage Template * @copyright (C) 2008 by Slashes & Dots Sdn Bhd - All rights reserved! * @license GNU/GPL, see LICENSE.php * * @param groups Array Array of groups object * @param total integer total number of groups * @param user CFactory User object */ defined('_JEXEC') or die; ?> <div class="appsBoxTitle"><?php echo JText::_('CC PROFILE GROUPS'); ?> </div> <div class="small"><?php echo JText::sprintf(CStringHelper::isPlural($total) ? 'CC GROUPS COUNT MANY' : 'CC GROUPS COUNT', $total); ?> </div> <ul class="friend-right-info"> <?php for ($i = 0; $i < 12 && $i < count($groups); $i++) { $row =& $groups[$i]; ?> <li> <a href="<?php echo $row->link; ?> "> <img title="<?php echo $this->escape($row->name); ?>
</td> <?php } ?> <td align="center" valign="top" style="width: 20%"> <div class="number"> <?php if (!$totalactivities == '' or $totalactivities > 0) { echo $totalactivities; } else { echo 0; } ?> </div> <div class="text"><?php echo JText::sprintf(CStringHelper::isPlural($totalactivities) ? 'COM_COMMUNITY_ACTIVITIES' : 'COM_COMMUNITY_ACTIVITY'); ?> </div> </td> </tr> </table> <?php echo $about; ?> <div class="cModule" style="clear: left; padding-top: 20px"> <h3><?php echo JText::sprintf('COM_COMMUNITY_FRONTPAGE_RECENT_ACTIVITIES');
/** * */ public function inviteend() { $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; // If $_POST['ids'] contains value, FB connect has successfully send some invite if ($jinput->get('ids', NULL, 'NONE') != null) { $mainframe->enqueueMessage(JText::sprintf(CStringHelper::isPlural(count($_POST['ids'])) ? 'COM_COMMUNITY_INVITE_EMAIL_SENT_MANY' : 'COM_COMMUNITY_INVITE_EMAIL_SENT', count($_POST['ids']))); } // Queue the message back. // This method is similar to $mainframe->redirect(); $_messageQueue = $mainframe->getMessageQueue(); if (count($_messageQueue)) { $session = JFactory::getSession(); $session->set('application.queue', $_messageQueue); } echo '<script>window.opener.location.reload();</script>'; echo '<script>window.close();</script>'; exit; }
</div> <div class="joms-stream__meta"> <a class="joms-stream__user" href="<?php echo CUrlHelper::userLink($user->id); ?> "><?php echo $user->getDisplayName(); ?> </a> <?php // If we're using new stream style or has old style data (which contains {multiple} ) if ($act->params->get('style') == COMMUNITY_STREAM_STYLE || strpos($act->title, '{multiple}')) { // New style $count = $act->params->get('count', $act->params->get('count', 1)); if (CStringHelper::isPlural($count)) { if ($act->groupid) { $group = JTable::getInstance('Group', 'CTable'); $group->load($act->groupid); $this->set('group', $group); echo JText::sprintf('COM_COMMUNITY_ACTIVITY_GROUP_PHOTOS_UPLOAD_TITLE', $count, CUrlHelper::groupLink($group->id), CStringHelper::escape($group->name)); } else { echo JText::sprintf('COM_COMMUNITY_ACTIVITY_PHOTO_UPLOAD_TITLE_MANY', $count, $album->getURI(), CStringHelper::escape($album->name)); } } else { if ($act->groupid) { $group = JTable::getInstance('Group', 'CTable'); $group->load($act->groupid); $this->set('group', $group); echo JText::sprintf('COM_COMMUNITY_ACTIVITY_GROUP_PHOTO_UPLOAD_TITLE', CUrlHelper::groupLink($group->id), CStringHelper::escape($group->name)); } else {
/** * The default method that will display the output of this view which is called by * Joomla * * @param string template Template file name **/ public function display($tpl = null) { $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $model = $this->getModel('Activities'); $activities = $model->getActivities(); foreach ($activities as $key => $activity) { $param = new CParameter($activity->params); switch ($activity->app) { case 'users.featured': $user = CFactory::getUser($param->get('userid')); $activities[$key]->title = JText::sprintf('COM_COMMUNITY_MEMBER_IS_FEATURED', '<a href="' . CRoute::_(JUri::root() . $param->get('owner_url')) . '" class="cStream-Author">' . $user->getDisplayName() . '</a>'); break; case 'events.wall': case 'groups.wall': case 'profile': $user = CFactory::getUser($activity->actor); $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> '; if ($activity->eventid) { $event = JTable::getInstance('Event', 'cTable'); $event->load($activity->eventid); $html .= '➜ <a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id . '">' . $event->title . '</a>'; } elseif ($activity->groupid) { $group = JTable::getInstance('Group', 'cTable'); $group->load($activity->groupid); $html .= '➜ <a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id . '">' . $group->name . '</a>'; } elseif (!empty($activity->target) && $activity->target != $activity->actor) { $target = CFactory::getUser($activity->target); $html .= '➜ <a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $target->id . '">' . $target->getDisplayName() . '</a> '; $html .= CActivities::format($activity->title); } else { $html .= ' posted: "' . CActivities::format($activity->title) . '"'; } $activities[$key]->title = $html; break; case 'groups.avatar.upload': $user = CFactory::getUser($activity->actor); $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> '; $html .= JText::_('COM_COMMUNITY_ACTIVITIES_NEW_GROUP_AVATAR'); $activities[$key]->title = $html; break; case 'profile.avatar.upload': $user = CFactory::getUser($activity->actor); $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> '; $html .= JText::_('COM_COMMUNITY_ACTIVITIES_NEW_AVATAR'); $activities[$key]->title = $html; break; case 'albums.comment': case 'albums': $album = JTable::getInstance('Album', 'CTable'); $album->load($activity->cid); $user = CFactory::getUser($activity->actor); $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> '; $html .= JText::sprintf('COM_COMMUNITY_ACTIVITIES_WALL_POST_ALBUM', CRoute::_($album->getURI()), $this->escape($album->name)); $activities[$key]->title = $html; break; case 'profile.like': case 'groups.like': case 'events.like': case 'photo.like': case 'videos.like': case 'album.like': $actors = $param->get('actors'); $user = CFactory::getUser($activity->actor); $users = explode(',', $actors); $userCount = count($users); switch ($activity->app) { case 'profile.like': $cid = CFactory::getUser($activity->cid); $urlLink = JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $cid->id; $name = $cid->getDisplayName(); $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_PROFILE'; break; case 'groups.like': $cid = JTable::getInstance('Group', 'CTable'); $cid->load($activity->groupid); $urlLink = JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $cid->id; $name = $cid->name; $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_GROUP'; break; case 'events.like': $cid = JTable::getInstance('Event', 'CTable'); $cid->load($activity->eventid); $urlLink = JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $cid->id; $name = $cid->title; $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_EVENT'; break; case 'photo.like': $cid = JTable::getInstance('Photo', 'CTable'); $cid->load($activity->cid); $urlLink = JUri::root() . 'index.php?option=com_community&view=photos&task=photo&albumid=' . $cid->albumid . '&userid=' . $cid->creator . '&photoid=' . $cid->id; $name = $cid->caption; $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_PHOTO'; break; case 'videos.like': $cid = JTable::getInstance('Video', 'CTable'); $cid->load($activity->cid); $urlLink = JURI::root() . 'index.php?option=com_community&view=videos&task=video&userid=' . $cid->creator . '&videoid=' . $cid->id; $name = $cid->getTitle(); $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_VIDEO'; break; case 'album.like': $cid = JTable::getInstance('Album', 'CTable'); $cid->load($activity->cid); $urlLink = Juri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $cid->id . '&userid=' . $cid->creator; $name = $cid->name; $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_ALBUM'; break; } $slice = 2; if ($userCount > 2) { $slice = 1; } $users = array_slice($users, 0, $slice); $actorsHTML = array(); foreach ($users as $actor) { $user = CFactory::getUser($actor); $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>'; } $others = ''; if ($userCount > 2) { $others = JText::sprintf('COM_COMMUNITY_STREAM_OTHERS_JOIN_GROUP', $userCount - 1); } $jtext = $userCount > 1 ? 'COM_COMMUNITY_STREAM_LIKES_PLURAL' : 'COM_COMMUNITY_STREAM_LIKES_SINGULAR'; $activities[$key]->title = implode(' ' . JText::_('COM_COMMUNITY_AND') . ' ', $actorsHTML) . $others . JText::sprintf($jtext, $urlLink, $name, JText::_($element)); break; case 'cover.upload': $user = CFactory::getUser($activity->actor); $type = $param->get('type'); $extraMessage = ''; if (strtolower($type) !== 'profile') { $id = strtolower($type . 'id'); $cTable = JTable::getInstance(ucfirst($type), 'CTable'); $cTable->load($activity->{$id}); if ($type == 'group') { $extraMessage = ', <a target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $cTable->id . '">' . $cTable->name . '</a>'; } if ($type == 'event') { $extraMessage = ', <a target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $cTable->id . '">' . $cTable->title . '</a>'; } } $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> '; if ($type == 'profile') { $html .= JText::_('COM_COMMUNITY_PHOTOS_COVER_UPLOAD_PROFILE'); } else { $html .= JText::sprintf('COM_COMMUNITY_PHOTOS_COVER_UPLOAD', strtolower(Jtext::_('COM_COMMUNITY_COVER_' . strtoupper($type)))) . $extraMessage; } $activities[$key]->title = $html; break; case 'events.attend': case 'events': $user = CFactory::getUser($activity->actor); $action = $param->get('action'); $event = JTable::getInstance('Event', 'CTable'); $event->load($activity->eventid); switch ($action) { case 'events.create': $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> -'; $html .= JText::sprintf('COM_COMMUNITY_EVENTS_ACTIVITIES_NEW_EVENT', JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id, $event->title); $activities[$key]->title = $html; break; case 'events.attendence.attend': $users = explode(',', $param->get('actors')); $actorsHTML = array(); foreach ($users as $actor) { if (!$actor) { $actor = $activity->actor; } $user = CFactory::getUser($actor); $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>'; } $activities[$key]->title = implode(', ', $actorsHTML) . ' - ' . JText::sprintf('COM_COMMUNITY_ACTIVITIES_EVENT_ATTEND', JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id, $event->title); break; } break; case 'friends.connect': $user1 = CFactory::getUser($activity->actor); $user2 = CFactory::getUser($activity->target); $html = JText::sprintf('COM_COMMUNITY_STREAM_OTHER_FRIENDS', $user1->getDisplayName(), $user2->getDisplayName(), JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user1->id, JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user2->id); $activities[$key]->title = $html; break; case 'groups.bulletin': $user = CFactory::getUser($activity->actor); $bulletin = JTable::getInstance('Bulletin', 'CTable'); $bulletin->load($activity->cid); $group = JTable::getInstance('Group', 'CTable'); $group->load($bulletin->groupid); $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_NEW_GROUP_NEWS', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewbulletin&groupid=' . $group->id . '&bulletinid=' . $bulletin->id), $bulletin->title); $activities[$key]->title = $html; break; case 'groups.discussion': $user = CFactory::getUser($activity->actor); $discussion = JTable::getInstance('Discussion', 'CTable'); $discussion->load($activity->cid); $discussionLink = CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $discussion->groupid . '&topicid=' . $discussion->id); $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_NEW_GROUP_DISCUSSION', $discussionLink, $discussion->title); $activities[$key]->title = $html; break; case 'groups.discussion.reply': $user = CFactory::getUser($activity->actor); $discussion = JTable::getInstance('Discussion', 'CTable'); $discussion->load($activity->cid); $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_REPLY_DISCUSSION', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $discussion->groupid . '&topicid=' . $discussion->id), $discussion->title); $activities[$key]->title = $html; break; case 'groups.join': $user = CFactory::getUser($activity->actor); $users = explode(',', $param->get('actors')); $userCount = count($users); $group = JTable::getInstance('Group', 'CTable'); $group->load($activity->cid); $slice = 2; if ($userCount > 2) { $slice = 1; } $users = array_slice($users, 0, $slice); $actorsHTML = array(); foreach ($users as $actor) { $user = CFactory::getUser($actor); $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>'; } $others = ''; if ($userCount > 2) { $others = JText::sprintf('COM_COMMUNITY_STREAM_OTHERS_JOIN_GROUP', $userCount - 1); } $html = implode(' ' . JText::_('COM_COMMUNITY_AND') . ' ', $actorsHTML) . $others . JText::sprintf('COM_COMMUNITY_GROUPS_GROUP_JOIN', JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id, $group->name); $activities[$key]->title = $html; break; case 'groups.update': $user = CFactory::getUser($activity->actor); $group = JTable::getInstance('Group', 'CTable'); $group->load($activity->cid); $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> - ' . JText::sprintf('COM_COMMUNITY_GROUPS_GROUP_UPDATED', JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id, $group->name); $activities[$key]->title = $html; break; case 'photos': $user = CFactory::getUser($activity->actor); $album = JTable::getInstance('Album', 'CTable'); $album->load($activity->cid); $html = ''; if ($activity->groupid) { $group = JTable::getInstance('Group', 'CTable'); $group->load($activity->groupid); $html .= '<a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id . '">' . $group->name . '</a> -'; } $html .= ' <a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>'; $count = $param->get('count', 1); $url = Juri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $album->id . '&userid=' . $user->id; if (CStringHelper::isPlural($count)) { $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_PHOTO_UPLOAD_TITLE_MANY', $count, $url, CStringHelper::escape($album->name)); } else { $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_PHOTO_UPLOAD_TITLE', $url, CStringHelper::escape($album->name)); } $activities[$key]->title = $html; break; case 'photos.comment': $user = CFactory::getUser($activity->actor); $wall = JTable::getInstance('Wall', 'CTable'); $wall->load($param->get('wallid')); $photo = JTable::getInstance('Photo', 'CTable'); $photo->load($activity->cid); $url = JUri::root() . 'index.php?option=com_community&view=photos&task=photo&albumid=' . $photo->albumid . '&userid=' . $photo->creator . '&photoid=' . $photo->id; $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ' . JText::sprintf('COM_COMMUNITY_ACTIVITIES_WALL_POST_PHOTO', $url, $this->escape($photo->caption)); $activities[$key]->title = $html; break; case 'system.message': case 'system.videos.popular': case 'system.photos.popular': case 'system.members.popular': case 'system.photos.total': case 'system.groups.popular': case 'system.members.registered': $action = $param->get('action'); switch ($action) { case 'registered_users': $usersModel = CFactory::getModel('user'); $now = new JDate(); $date = CTimeHelper::getDate(); $users = $usersModel->getLatestMember(10); $totalRegistered = count($users); $title = JText::sprintf('COM_COMMUNITY_TOTAL_USERS_REGISTERED_THIS_MONTH_ACTIVITY_TITLE', $totalRegistered, $date->monthToString($now->format('%m'))); $activities[$key]->title = $title; break; case 'total_photos': $photosModel = CFactory::getModel('photos'); $total = $photosModel->getTotalSitePhotos(); $activities[$key]->title = JText::sprintf('COM_COMMUNITY_TOTAL_PHOTOS_ACTIVITY_TITLE', CRoute::_(JURI::root() . 'index.php?option=com_community&view=photos'), $total); break; case 'top_videos': $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_VIDEOS'); break; case 'top_photos': $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_PHOTOS'); break; case 'top_users': $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_MEMBERS'); break; case 'top_groups': $groupsModel = $this->getModel('groups'); $activeGroup = $groupsModel->getMostActiveGroup(); if (is_null($activeGroup)) { $title = JText::_('COM_COMMUNITY_GROUPS_NONE_CREATED'); } else { $title = JText::sprintf('COM_COMMUNITY_MOST_POPULAR_GROUP_ACTIVITY_TITLE', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $activeGroup->id), $activeGroup->name); } $activities[$key]->title = $title; break; case 'message': break; } break; case 'videos.linking': case 'videos': $video = JTable::getInstance('Video', 'CTable'); $video->load($activity->cid); $actor = CFactory::getUser($activity->actor); $html = $this->_getUserLink($activity->actor); $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_VIDEO_SHARE_TITLE', JUri::root() . $video->getViewURI(false), $this->escape($video->title)); $activities[$key]->title = $html; break; case 'videos.featured': $video = JTable::getInstance('Video', 'CTable'); $video->load($activity->cid); $activities[$key]->title = JText::sprintf('COM_COMMUNITY_VIDEOS_IS_FEATURED', '<a href="' . CRoute::_(JUri::root() . 'index.php?option=com_community&view=videos&task=video&userid=' . $video->creator . '&videoid=' . $video->id) . '" class="cStream-Title">' . $this->escape($video->title) . '</a>'); break; case 'albums.featured': $album = JTable::getInstance('Album', 'CTable'); $album->load($activity->cid); $activities[$key]->title = JText::sprintf('COM_COMMUNITY_ALBUM_IS_FEATURED', '<a href="' . CRoute::_(JUri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $album->id . '&userid=' . $album->creator) . '" class="cStream-Title">' . $this->escape($album->name) . '</a>'); break; } } //exit; $userModel = $this->getModel('Users', false); $currentUser = $jinput->request->get('actor', JText::_('COM_COMMUNITY_ACTIVITIES_ENTER_NAME_VALUE'), 'NONE'); $currentArchived = $jinput->request->get('archived', 0, 'NONE'); $currentApp = $jinput->request->get('app', 'none', 'NONE'); $filterApps = $model->getFilterApps(); $this->assignRef('filterApps', $filterApps); $this->assignRef('currentApp', $currentApp); $this->assignRef('currentUser', $currentUser); $this->assignRef('currentArchive', $currentArchived); $this->assignRef('pagination', $model->getPagination()); $this->assignRef('activities', $activities); parent::display($tpl); }
</a> </div> <div> <i class="com-icon-wall"></i> <span> <?php echo JText::sprintf(CStringHelper::isPlural($group->discusscount) ? 'COM_COMMUNITY_GROUPS_DISCUSSION_COUNT_MANY' : 'COM_COMMUNITY_GROUPS_DISCUSSION_COUNT', $group->discusscount); ?> </span> </div> <div> <i class="com-icon-comment"></i> <span> <?php echo JText::sprintf(CStringHelper::isPlural($group->wallcount) ? 'COM_COMMUNITY_GROUPS_WALL_COUNT_MANY' : 'COM_COMMUNITY_GROUPS_WALL_COUNT', $group->wallcount); ?> </span> </div> </div> <div id="group-invite-notice"></div> </div> <div class="community-groups-pending-actions pull-right"> <a class="btn" href="javascript:void(0);" onclick="joms.groups.invitation.reject('<?php echo $group->id; ?> ');"><?php echo JText::_('COM_COMMUNITY_EVENTS_REJECT'); ?> </a>
</a> </div> <div class="joms-gallery__body"> <a href="<?php echo $albumURL; ?> " class="joms-gallery__title"> <?php echo $this->escape($others->name); ?> </a> <div class="joms-gallery__count"> <small> <?php if (CStringHelper::isPlural($others->count)) { echo JText::sprintf('COM_COMMUNITY_PHOTOS_COUNTER', $others->count); } else { echo JText::sprintf('COM_COMMUNITY_PHOTOS_COUNTER_SINGULAR', $others->count); } ?> </small> </div> </div> </li> <?php } ?> </ul>
<!-- Event Top: Event Left --> <!-- Event Top: Event Main --> <div class="event-main"> <!-- Event Approval --> <div class="event-approval"> <?php if (($isMine || $isAdmin || $isCommunityAdmin) && $unapproved > 0) { ?> <div class="info"> <a class="friend" href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=viewguest&type=' . COMMUNITY_EVENT_STATUS_REQUESTINVITE . '&eventid=' . $event->id); ?> "> <?php echo JText::sprintf(CStringHelper::isPlural($unapproved) ? 'CC EVENT INVITE REQUEST PENDING MANY' : 'CC EVENT INVITE REQUEST PENDING', $unapproved); ?> </a> </div> <?php } ?> <?php if ($waitingApproval) { ?> <div class="info"> <span class="icon-waitingapproval"><?php echo JText::_('CC EVENT AWAITING APPROVAL USER'); ?> </span>
<div class="group-discussion-title"> <a href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $groupId . '&topicid=' . $row->id); ?> "> <?php echo $row->title; ?> </a> <div class="group-discussion-replies"> <a 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) ? 'CC TOTAL REPLIES MANY' : 'CC TOTAL REPLIES', $row->count); ?> </a> </div> </div> <?php if ($row->lastmessage) { ?> <div class="clr"></div> <div class="group-discussion-introtext small"><?php echo $this->escape($row->lastmessage); ?> </div> <?php } ?>
</td> </tr> </table> </form> </div> <!--SEARCH FORM--> <?php if ($posted) { ?> <!--SEARCH DETAIL--> <div class="group-search-detail"> <span class="search-detail-left"> <?php echo JText::sprintf('CC SEARCH RESULT', $search); ?> </span> <span class="search-detail-right"> <?php echo JText::sprintf(CStringHelper::isPlural($groupsCount) ? 'CC SEARCH RESULT TOTAL MANY' : 'CC SEARCH RESULT TOTAL', $groupsCount); ?> </span> <div style="clear:both;"></div> </div> <!--SEARCH DETAIL--> <?php echo $groupsHTML; ?> <?php } ?> </div>
?> "><strong><?php echo $row->user->getDisplayName(); ?> </strong></a> </h3> <div class="mini-profile-details-status" style="padding-bottom:30px;"><?php echo $this->escape($row->user->getStatus()); ?> </div> <div class="mini-profile-details-action jsAbs jsFriendAction"> <span class="icon-group"> <?php echo JText::sprintf(CStringHelper::isPlural($row->user->friendsCount) ? 'CC FRIENDS COUNT MANY' : 'CC FRIENDS COUNT', $row->user->friendsCount); ?> </span> <?php if ($my->id != $row->user->id && $config->get('enablepm')) { ?> <span class="icon-write"> <a onclick="joms.messaging.loadComposeWindow(<?php echo $row->user->id; ?> )" href="javascript:void(0);"> <?php echo JText::_('CC WRITE MESSAGE'); ?> </a>
echo $row->profileLink; ?> "><strong><?php echo $row->user->getDisplayName(); ?> </strong></a> </h3> <div class="mini-profile-details-status"><?php echo $row->user->getStatus(); ?> </div> <div class="mini-profile-details-action"> <div class="jsLft"> <span class="jsIcon1 icon-group"> <?php echo JText::sprintf(CStringHelper::isPlural($row->friendsCount) ? 'COM_COMMUNITY_FRIENDS_COUNT_MANY' : 'COM_COMMUNITY_FRIENDS_COUNT', $row->friendsCount); ?> </span> <?php if ($config->get('enablepm') && $my->id != $row->user->id) { ?> <span class="jsIcon1 icon-write"> <a onclick="<?php echo CMessaging::getPopup($row->user->id); ?> " href="javascript:void(0);"> <?php echo JText::_('COM_COMMUNITY_INBOX_SEND_MESSAGE'); ?> </a>
?> <a href="<?php echo $event->getGuestLink(COMMUNITY_EVENT_STATUS_ATTEND); ?> "><?php echo JText::sprintf(CStringHelper::isPlural($event->confirmedcount) ? 'COM_COMMUNITY_EVENTS_COUNT_MANY_PAST' : 'COM_COMMUNITY_EVENTS_COUNT_PAST', $event->confirmedcount); ?> </a> <?php } else { ?> <a href="<?php echo $event->getGuestLink(COMMUNITY_EVENT_STATUS_ATTEND); ?> "><?php echo JText::sprintf(CStringHelper::isPlural($event->confirmedcount) ? 'COM_COMMUNITY_EVENTS_MANY_GUEST_COUNT' : 'COM_COMMUNITY_EVENTS_GUEST_COUNT', $event->confirmedcount); ?> </a> <?php } ?> </div> <?php if ($isCommunityAdmin && $showFeatured) { if (!in_array($event->id, $featuredList)) { ?> <div class="action"> <a onclick="joms.featured.add('<?php echo $event->id; ?> ','events');" href="javascript:void(0);"><?php
<?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); ?> </a> </div> </div> </div> <?php } ?> <?php } else { ?> <p> <?php echo sprintf(JText::_('COM_COMMUNITY_GROUPS_DISCUSSION_EMPTY_WARNING'), CRoute::_('index.php?option=com_community&view=groups&groupid=' . $input->get('groupid') . '&task=adddiscussion'));
<?php } ?> <div class="group-top"> <!-- Group Approval --> <div class="group-approval"> <?php if (($isMine || $isAdmin || $isSuperAdmin) && $unapproved > 0) { ?> <div class="info"> <a class="friend" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=viewmembers&approve=1&groupid=' . $group->id); ?> "> <?php echo JText::sprintf(CStringHelper::isPlural($unapproved) ? 'COM_COMMUNITY_GROUPS_APPROVAL_NOTIFICATION_MANY' : 'COM_COMMUNITY_GROUPS_APPROVAL_NOTIFICATION', $unapproved); ?> </a> </div> <?php } ?> <?php if ($waitingApproval) { ?> <div class="info"> <span class="jsIcon1 icon-waitingapproval"><?php echo JText::_('COM_COMMUNITY_GROUPS_APPROVAL_PENDING'); ?> </span>
/** * * @param JDate $date * */ public static function timeLapse($date, $showFull = true) { $now = JFactory::getDate(); $html = ''; $diff = CTimeHelper::timeDifference($date->toUnix(), $now->toUnix()); if (!empty($diff['days'])) { $days = $diff['days']; $months = ceil($days / 30); switch ($days) { case $days == 1: // @rule: Something that happened yesterday $html .= JText::_('COM_COMMUNITY_LAPSED_YESTERDAY'); break; case $days > 1 && $days <= 7 && $days < 30: // @rule: Something that happened within the past 7 days $html .= JText::sprintf('COM_COMMUNITY_LAPSED_DAYS', $days) . ' '; break; case $days > 1 && $days > 7 && $days < 30: // @rule: Something that happened within the month but after a week $weeks = round($days / 7); $html .= JText::sprintf(CStringHelper::isPlural($weeks) ? 'COM_COMMUNITY_LAPSED_WEEK_MANY' : 'COM_COMMUNITY_LAPSED_WEEK', $weeks) . ' '; break; case $days >= 30 && $days < 365: // @rule: Something that happened months ago $months = round($days / 30); $html .= JText::sprintf(CStringHelper::isPlural($months) ? 'COM_COMMUNITY_LAPSED_MONTH_MANY' : 'COM_COMMUNITY_LAPSED_MONTH', $months) . ' '; break; case $days > 365: // @rule: Something that happened years ago $years = round($days / 365); $html .= JText::sprintf(CStringHelper::isPlural($years) ? 'COM_COMMUNITY_LAPSED_YEAR_MANY' : 'COM_COMMUNITY_LAPSED_YEAR', $years) . ' '; break; } } else { // We only show he hours if it is less than 1 day if (!empty($diff['hours'])) { if (!empty($diff['minutes'])) { if ($diff['hours'] == 1) { $html .= JText::sprintf('COM_COMMUNITY_LAPSED_HOUR', $diff['hours']) . ' '; } else { $html .= JText::sprintf('COM_COMMUNITY_LAPSED_HOURS', $diff['hours']) . ' '; } } else { $html .= JText::sprintf('COM_COMMUNITY_LAPSED_HOURS_AGO', $diff['hours']) . ' '; } } if ($showFull && !empty($diff['hours']) || empty($diff['hours'])) { if (!empty($diff['minutes'])) { if ($diff['minutes'] == 1) { $html .= JText::sprintf('COM_COMMUNITY_LAPSED_MINUTE', $diff['minutes']) . ' '; } else { $html .= JText::sprintf('COM_COMMUNITY_LAPSED_MINUTES', $diff['minutes']) . ' '; } } } } if (empty($html)) { $html .= JText::_('COM_COMMUNITY_LAPSED_LESS_THAN_A_MINUTE'); } return $html; }
/** * 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; }
echo $activeGroup->getThumbAvatar(); ?> " alt="<?php echo $this->escape($activeGroup->name); ?> " > </div> <div class="joms-stream__meta"> <a href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $activeGroup->id); ?> "> <h4 class="reset-gap"><?php echo $this->escape($activeGroup->name); ?> </h4> </a> <p > <?php echo JText::sprintf(CStringHelper::isPlural($memberCount) ? 'COM_COMMUNITY_GROUPS_MEMBER_COUNT_MANY' : 'COM_COMMUNITY_GROUPS_MEMBER_COUNT', $memberCount); ?> </p> </div> </div> <?php } ?> </div>
<!-- Group Top: Group Left --> <!-- Group Top: Group Main --> <div class="group-main"> <!-- Group Approval --> <div class="group-approval"> <?php if (($isMine || $isAdmin || $isSuperAdmin) && $unapproved > 0) { ?> <div class="info"> <a class="friend" href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=viewmembers&approve=1&groupid=' . $group->id); ?> "> <?php echo JText::sprintf(CStringHelper::isPlural($unapproved) ? 'CC AWAITING APPROVAL MANY' : 'CC AWAITING APPROVAL', $unapproved); ?> </a> </div> <?php } ?> <?php if ($waitingApproval) { ?> <div class="info"> <span class="icon-waitingapproval"><?php echo JText::_('CC AWAITING APPROVAL USER'); ?> </span>