/** * Deletes a discussion * * @since 1.2 * @access public */ public function delete() { // Check for request forgeries FD::checkToken(); // Ensure that the user is logged in. FD::requireLogin(); // Get the discussion object $id = $this->input->get('id', 0, 'int'); $discussion = FD::table('Discussion'); $discussion->load($id); // Get the event object $eventId = $this->input->get('eventId', 0, 'int'); $event = FD::event($eventId); if (!$event->isAdmin() && $discussion->created_by != $this->my->id && !$this->my->isSiteAdmin()) { return $this->redirect($event->getPermalink()); } // Delete the discussion $discussion->delete(); // @points: events.discussion.delete // Deduct points from the discussion creator when the discussion is deleted $points = FD::points(); $points->assign('events.discussion.delete', 'com_easysocial', $discussion->created_by); FD::info()->set(JText::_('APP_EVENT_DISCUSSIONS_DISCUSSION_DELETED_SUCCESS')); // After deleting, we want to redirect to the discussions listing $url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'appId' => $this->getApp()->id), false); // Perform a redirection $this->redirect($url); }
/** * Displays the application output in the canvas. * * @since 1.0 * @access public * @param int The user id that is currently being viewed. */ public function display($eventId = null, $docType = null) { // Load up the event $event = FD::event($eventId); // Get the event params $params = $event->getParams(); // Load up the events model $model = FD::model('Events'); $type = FD::input()->getString('type', 'going'); $options = array(); if ($type === 'going') { $options['state'] = SOCIAL_EVENT_GUEST_GOING; } if ($params->get('allowmaybe') && $type === 'maybe') { $options['state'] = SOCIAL_EVENT_GUEST_MAYBE; } if ($params->get('allownotgoingguest') && $type === 'notgoing') { $options['state'] = SOCIAL_EVENT_GUEST_NOT_GOING; } if ($event->isClosed() && $type === 'pending') { $options['state'] = SOCIAL_EVENT_GUEST_PENDING; } if ($type === 'admin') { $options['admin'] = 1; } $this->set('type', $type); $guests = $model->getGuests($event->id, $options); $pagination = $model->getPagination(); $this->set('event', $event); $this->set('guests', $guests); $eventAlias = $event->getAlias(); $appAlias = $this->app->getAlias(); $permalinks = array('going' => '', 'notgoing' => '', 'maybe' => '', 'admin' => '', 'pending' => ''); // Avoid using $filter because it is a FRoute reserved word foreach ($permalinks as $key => &$value) { $value = FRoute::events(array('layout' => 'item', 'id' => $eventAlias, 'appId' => $appAlias, 'type' => $key)); } $this->set('permalinks', $permalinks); $myGuest = $event->getGuest(); $this->set('myGuest', $myGuest); echo parent::display('events/default'); }
/** * Returns the permalink to the page of this event, depending on the layout. * * @author Jason Rey <*****@*****.**> * @since 1.3 * @access public * @param boolean $xhtml True if permalink is required to be in xhtml format. * @param boolean $external True if permalink is required to be in external format. * @param string $layout The layout of the event page. * @param boolean $sef True if permalink is required to be a SEF link. * @return string The permalink of this event. */ public function getPermalink($xhtml = true, $external = false, $layout = 'item', $sef = true) { $options = array('id' => $this->getAlias(), 'layout' => $layout, 'external' => $external, 'sef' => $sef); return FRoute::events($options, $xhtml); }
<div class="pull-left widget-title"> <?php echo JText::_('APP_USER_EVENTS_WIDGET_EVENTS'); ?> </div> <span class="widget-label">(<?php echo $total; ?> )</span> <?php if ($this->my->id == $user->id) { ?> <div class="pull-right fd-small"> <a href="<?php echo FRoute::events(array('layout' => 'create')); ?> "> <i class="icon-es-add"></i><?php echo JText::_('COM_EASYSOCIAL_NEW_EVENT'); ?> </a> </div> <?php } ?> </div> <div class="es-widget-body"> <?php if ($total > 0) { ?>
echo $event->getCategory()->id; ?> " href="<?php echo FRoute::events(array('layout' => 'category', 'id' => $event->getCategory()->getAlias())); ?> "> <?php echo $event->getCategory()->get('title'); ?> </a> </span> <span> <i class="ies-users"></i> <a href="<?php echo FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'appId' => $guestApp->getAlias())); ?> "><?php echo JText::sprintf(FD::string()->computeNoun('COM_EASYSOCIAL_EVENTS_GUESTS', $event->getTotalGuests()), $event->getTotalGuests()); ?> </a> </span> </div> </div> </div> <?php if ($guest->isParticipant() && !$guest->isPending() || !$guest->isParticipant() && !$event->isOver()) { ?> <div class="list-media-footer fd-cf" data-guest-state-wrap data-id="<?php echo $event->id; ?>
<p><?php echo JText::_('COM_EASYSOCIAL_EVENTS_SELECT_CATEGORY_INFO'); ?> </p> </div> <hr /> <div class="es-create-category-select"> <div class="btn-group" data-bs-toggle="radio-buttons"> <?php foreach ($categories as $category) { ?> <div class="btn-wrap"> <a href="<?php echo FRoute::events(array_merge($categoryRouteBaseOptions, array('category_id' => $category->id))); ?> " class="btn btn-es"> <img src="<?php echo $category->getAvatar(SOCIAL_AVATAR_SQUARE); ?> " class="avatar" /> <span><?php echo $category->get('title'); ?> </span> <div class="es-description fd-small es-muted mt-5"><?php echo $category->get('description'); ?> </div> </a>
echo $this->html('string.truncater', $event->getDescription(), 250); ?> </p> <div class="stream-apps-meta mt-5"> <i class="ies-calendar mr-5"></i> <?php echo $event->getStartEndDisplay(); ?> </div> <ul class="stream-apps-meta ml-0 pl-0"> <li> <span> <a href="<?php echo FRoute::events(array('layout' => 'category', 'id' => $event->getCategory()->getAlias())); ?> "> <i class="ies-database"></i> <?php echo $event->getCategory()->get('title'); ?> </a> </span> </li> <li> <span> <a href="<?php echo FRoute::albums(array('uid' => $event->id, 'type' => SOCIAL_TYPE_EVENT)); ?> "> <i class="ies-picture"></i> <?php
public function deleteFilter($eventId) { $ajax = FD::ajax(); FD::requireLogin(); FD::info()->set($this->getMessage()); $event = FD::event($eventId); $url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias()), false); return $ajax->redirect($url); }
/** * Creates a new notification item * * @since 1.3 * @access public * @param string $action The action associated with the notification. */ public function createNotification($action) { // To prevent unexpected callees in creating notification $allowed = array('going', 'maybe', 'notgoing', 'makeadmin', 'revokeadmin', 'approve', 'reject', 'request', 'withdraw', 'remove'); if (!in_array($action, $allowed)) { return; } // Actor is the guest for: // going // maybe // notgoing // request // withdraw $actor = FD::user($this->uid); // Actor is the current logged in user for: // makeadmin // revokeadmin // reject // approve // remove if (in_array($action, array('makeadmin', 'revokeadmin', 'reject', 'approve', 'remove'))) { $actor = FD::user(); } $event = FD::event($this->cluster_id); // COM_EASYSOCIAL_EMAILS_EVENT_GUEST_MAKEADMIN_SUBJECT // COM_EASYSOCIAL_EMAILS_EVENT_GUEST_REVOKEADMIN_SUBJECT // COM_EASYSOCIAL_EMAILS_EVENT_GUEST_REJECT_SUBJECT // COM_EASYSOCIAL_EMAILS_EVENT_GUEST_APPROVE_SUBJECT // COM_EASYSOCIAL_EMAILS_EVENT_GUEST_REMOVE_SUBJECT // COM_EASYSOCIAL_EMAILS_EVENT_GUEST_GOING_SUBJECT // COM_EASYSOCIAL_EMAILS_EVENT_GUEST_MAYBE_SUBJECT // COM_EASYSOCIAL_EMAILS_EVENT_GUEST_NOTGOING_SUBJECT // COM_EASYSOCIAL_EMAILS_EVENT_GUEST_REQUEST_SUBJECT // COM_EASYSOCIAL_EMAILS_EVENT_GUEST_WITHDRAW_SUBJECT // site/event/guest.makeadmin // site/event/guest.revokeadmin // site/event/guest.reject // site/event/guest.approve // site/event/guest.remove // site/event/guest.going // site/event/guest.maybe // site/event/guest.notgoing // site/event/guest.request // site/event/guest.withdraw $emailOptions = (object) array('title' => 'COM_EASYSOCIAL_EMAILS_EVENT_GUEST_' . strtoupper($action) . '_SUBJECT', 'template' => 'site/event/guest.' . strtolower($action), 'event' => $event->getName(), 'eventAvatar' => $event->getAvatar(), 'eventLink' => $event->getPermalink(false, true), 'response' => $action, 'actor' => $actor->getName(), 'actorLink' => $actor->getPermalink(false, true), 'actorAvatar' => $actor->getAvatar()); $systemOptions = (object) array('uid' => $this->id, 'title' => '', 'actor_id' => $actor->id, 'context_ids' => $this->cluster_id, 'context_type' => SOCIAL_TYPE_EVENT, 'type' => 'events', 'url' => $event->getPermalink(false, false, 'item', false), 'image' => $event->getAvatar(), 'response' => $action, 'eventId' => $event->id); // Special case for request // If action is request, we use a different permalink instead so that the generated system notification is pointing to the guest app // Request email also needs to point to the guest app if ($action === 'request') { // Get the guest app first $guestApp = FD::table('App'); $guestApp->load(array('type' => SOCIAL_TYPE_APPS, 'group' => SOCIAL_TYPE_EVENT, 'element' => 'guests')); $emailOptions->link = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'appId' => $guestApp->getAlias(), 'type' => 'pending', 'external' => true)); $systemOptions->url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'appId' => $guestApp->getAlias(), 'type' => 'pending', 'sef' => false)); } $targets = array(); // If action is makeadmin, revokeadmin, reject, approve, remove, then supposed to notify the guest instead if (in_array($action, array('makeadmin', 'revokeadmin', 'reject', 'approve', 'remove'))) { $targets[] = $this->uid; } else { // Notify the event owner and admins $targets[] = $event->getCreator()->id; $admins = $event->getAdmins(); foreach ($admins as $admin) { $targets[] = $admin->uid; } // Remove self, unique it, and reset the targets array $targets = array_values(array_unique(array_diff($targets, array(FD::user()->id)))); } // Send notification now // events.guest.makeadmin // events.guest.revokeadmin // events.guest.reject // events.guest.approve // events.guest.remove // events.guest.going // events.guest.maybe // events.guest.notgoing // events.guest.request // events.guest.withdraw FD::notify('events.guest.' . $action, $targets, $emailOptions, $systemOptions); }
public function initInfo() { FD::checkToken(); $eventId = JRequest::getInt('eventId'); $event = FD::event($eventId); if (empty($event) || empty($event->id)) { $this->view->setMessage(JText::_('COM_EASYSOCIAL_EVENTS_INVALID_EVENT_ID'), SOCIAL_MSG_ERROR); return $this->view->call(__FUNCTION__); } if (!$event->isPublished()) { $this->view->setMessage(JText::_('COM_EASYSOCIAL_EVENTS_EVENT_UNAVAILABLE'), SOCIAL_MSG_ERROR); return $this->view->call(__FUNCTION__); } $guest = $event->getGuest($this->my->id); if (!$this->my->isSiteAdmin() && !$event->isOpen() && !$guest->isGuest() && (!$event->isGroupEvent() || $event->isGroupEvent() && !$event->getGroup()->isMember())) { $this->view->setMessage(JText::_('COM_EASYSOCIAL_EVENTS_NO_ACCESS_TO_EVENT'), SOCIAL_MSG_ERROR); return $this->view->call(__FUNCTION__); } FD::language()->loadAdmin(); $steps = FD::model('Steps')->getSteps($event->category_id, SOCIAL_TYPE_CLUSTERS, SOCIAL_EVENT_VIEW_DISPLAY); $fieldsLib = FD::fields(); $fieldsLib->init(array('privacy' => false)); $fieldsModel = FD::model('Fields'); $index = 1; foreach ($steps as $step) { $step->fields = $fieldsModel->getCustomFields(array('step_id' => $step->id, 'data' => true, 'dataId' => $event->id, 'dataType' => SOCIAL_TYPE_EVENT, 'visible' => SOCIAL_EVENT_VIEW_DISPLAY)); if (!empty($step->fields)) { $args = array($event); $fieldsLib->trigger('onDisplay', SOCIAL_FIELDS_GROUP_EVENT, $step->fields, $args); } $step->hide = true; foreach ($step->fields as $field) { // As long as one of the field in the step has an output, then this step shouldn't be hidden // If step has been marked false, then no point marking it as false again // We don't break from the loop here because there is other checking going on if (!empty($field->output) && $step->hide === true) { $step->hide = false; } } if ($index === 1) { $step->url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'type' => 'info'), false); } else { $step->url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'type' => 'info', 'infostep' => $index), false); } $step->title = $step->get('title'); $step->active = !$step->hide && $index == 1; if ($step->active) { $theme = FD::themes(); $theme->set('fields', $step->fields); $step->html = $theme->output('site/events/item.info'); } $step->index = $index; $index++; } return $this->view->call(__FUNCTION__, $steps); }
<?php /** * @package EasySocial * @copyright Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * EasySocial is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ defined('_JEXEC') or die('Unauthorized Access'); ?> <li> <a href="<?php echo FRoute::events(array('layout' => 'create', 'group_id' => $group->id)); ?> "><?php echo JText::_('APP_GROUP_EVENTS_CREATE_EVENT'); ?> </a> </li>
if ($params->get('show_apps', true)) { ?> <div class="es-event-menu-apps"> <div class="es-title mt-10"><?php echo JText::_('MOD_EASYSOCIAL_EVENT_MENU_APPLICATIONS'); ?> </div> <ul class="es-menu-list"> <?php foreach ($apps as $application) { ?> <li> <a href="<?php echo FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'appId' => $application->getAlias())); ?> "> <img src="<?php echo $application->getIcon(); ?> " width="16" class="mr-5" /> <?php echo $application->get('title'); ?> </a> </li> <?php } ?> </ul>
<?php if (!empty($activeCategory->description)) { ?> <p class="fd-small"> <?php echo $activeCategory->get('description'); ?> </p> <?php } ?> <div class="mt-15"> <a href="<?php echo FRoute::events(array('layout' => 'category', 'id' => $activeCategory->getAlias())); ?> " class="btn btn-es-primary btn-sm"><?php echo JText::_('COM_EASYSOCIAL_EVENTS_VIEW_CATEGORY'); ?> →</a> </div> </div> </div> <hr /> <?php } ?> <?php
</a> <?php } } ?> </div> <?php if (!empty($days[$dayNumber])) { ?> <div class="event-details"> <div class="event-details-title"> <i class="ies-calendar"></i> <a href="<?php echo FRoute::events(array('filter' => 'date', 'date' => $calendar->year . '-' . $calendar->month . '-' . $dayNumberPadded)); ?> " title="<?php echo JText::sprintf('COM_EASYSOCIAL_PAGE_TITLE_EVENTS_FILTER_DATE', FD::date($calendar->year . '-' . $calendar->month . '-' . $dayNumberPadded)->format(JText::_('COM_EASYSOCIAL_DATE_DMY'))); ?> " data-route data-date="<?php echo $calendar->year . '-' . $calendar->month . '-' . $dayNumberPadded; ?> "> <?php echo FD::date($calendar->year . '-' . $calendar->month . '-' . $dayNumberPadded)->format(JText::_('COM_EASYSOCIAL_DATE_DMY')); ?> </a>
<?php foreach ($categories as $category) { ?> <li data-events-filters-type="category" data-events-filters-categoryid="<?php echo $category->id; ?> " class="<?php echo $activeCategory && $activeCategory->id == $category->id ? 'active' : ''; ?> " > <a href="<?php echo FRoute::events(array('categoryid' => $category->getAlias())); ?> " title="<?php echo $this->html('string.escape', $category->get('title')); ?> "><?php echo $category->get('title'); ?> </a> <span data-total-events="<?php echo $category->getTotalEvents(); ?> " class="es-count-no pull-right"><?php echo $category->getTotalEvents(array('start-after' => $now)); ?> </span>
echo $event->getCategory()->get('title'); ?> </a> </span> <?php echo $this->render('widgets', 'event', 'events', 'afterCategory', array($event)); ?> <?php if ($this->config->get('events.ical', true)) { ?> <span> <i class="ies-download muted"></i> <a href="<?php echo FRoute::events(array('layout' => 'export', 'format' => 'ical', 'id' => $event->getAlias())); ?> " target="_blank"><?php echo JText::_('COM_EASYSOCIAL_EVENTS_EXPORT_TO_ICAL'); ?> </a> </span> <?php } ?> </nav> <div class="mt-5">
private function getGuests($event) { $theme = FD::themes(); $totalGoing = count($event->going); $ids = array(); $goingGuests = array(); if ($totalGoing > 0) { // Guests are already in $event->guests property // Going guests are also in $event->going property // Use php random to pick the id out from $event->going, then map it back to $event->guests $ids = (array) array_rand($event->going, min($totalGoing, 20)); foreach ($ids as $id) { $guest = $event->guests[$event->going[$id]]; $goingGuests[] = $guest; } } $theme->set('event', $event); $theme->set('totalGoing', $totalGoing); $theme->set('goingGuests', $goingGuests); $params = $event->getParams(); $allowMaybe = $params->get('allowmaybe', true); $theme->set('allowMaybe', $allowMaybe); if ($allowMaybe) { $totalMaybe = count($event->maybe); $theme->set('totalMaybe', $totalMaybe); if ($totalMaybe > 0) { $ids = (array) array_rand($event->maybe, min($totalMaybe, 20)); $maybeGuests = array(); foreach ($ids as $id) { $guest = $event->guests[$event->maybe[$id]]; $maybeGuests[] = $guest; } $theme->set('maybeGuests', $maybeGuests); } } $allowNotGoing = $params->get('allownotgoingguest', true); $theme->set('allowNotGoing', $allowNotGoing); if ($allowNotGoing) { $totalNotGoing = count($event->notgoing); $theme->set('totalNotGoing', $totalNotGoing); if ($totalNotGoing > 0) { $ids = (array) array_rand($event->notgoing, min($totalNotGoing, 20)); $notGoingGuests = array(); foreach ($ids as $id) { $guest = $event->guests[$event->notgoing[$id]]; $notGoingGuests[] = $guest; } $theme->set('notGoingGuests', $notGoingGuests); } } $link = FRoute::events(array('id' => $event->getAlias(), 'appId' => $this->app->getAlias(), 'layout' => 'item')); $theme->set('link', $link); echo $theme->output('themes:/apps/event/guests/widgets/widget.guests'); }
if ($events) { ?> <ul class="widget-list fd-nav fd-nav-stacked random-events"> <?php foreach ($events as $event) { ?> <li> <img src="<?php echo $event->getAvatar(); ?> " class="pull-left mr-10 es-avatar" title="<?php echo $this->html('string.escape', $event->getName()); ?> " /> <a href="<?php echo FRoute::events(array('layout' => 'item', 'id' => $event->getAlias())); ?> "><?php echo $event->getName(); ?> </a> <div class="fd-small event-meta"> <i class="ies-users"></i> <?php echo JText::sprintf(FD::string()->computeNoun('COM_EASYSOCIAL_EVENTS_GUESTS', $event->getTotalGuests()), $event->getTotalGuests()); ?> </div> </li> <?php } ?> </ul>
public function itemAction($event = null) { // Check if events is enabled. $this->checkFeature(); $this->info->set($this->getMessage()); $action = $this->input->getString('action'); $from = $this->input->getString('from'); // If action is feature or unfeature, and the action is executed from the item page, then we redirect to the event item page. if (in_array($action, array('unfeature', 'feature')) && $from == 'item' && !empty($event)) { return $this->redirect($event->getPermalink()); } // Else if the action is delete or unpublish, regardless of where is it executed from, we always go back to the listing page. return $this->redirect(FRoute::events()); }
</a> </li> <!-- Progress --> <?php $counter = 1; ?> <?php foreach ($steps as $step) { ?> <?php $customClass = $step->sequence == $currentStep || $currentStep > $step->sequence || $currentStep == SOCIAL_REGISTER_COMPLETED_STEP ? ' active' : ''; $customClass .= $step->sequence < $currentStep || $currentStep == SOCIAL_REGISTER_COMPLETED_STEP ? $customClass . ' past' : ''; if ($stepSession->hasStepAccess($counter)) { // $link = $step->sequence == $currentStep ? 'javascript:void(0);' : FRoute::registration(array('layout' => 'steps', 'step' => $step->sequence)); $link = $step->sequence == $currentStep ? 'javascript:void(0);' : FRoute::events(array('layout' => 'steps', 'step' => $counter)); } else { $link = 'javascript:void(0);'; } ?> <li class="divider-vertical<?php echo $customClass; ?> "></li> <li class="stepItem<?php echo $customClass; ?> " data-original-title="<?php echo JText::_($step->title, true); ?>
/** * Retrieves the new article form * * @since 1.2 * @access public * @return */ public function save() { // Check for request forgeriess FD::checkToken(); // Ensure that the user is logged in. FD::requireLogin(); // Determines if this is an edited news. $id = $this->input->get('newsId', 0, 'int'); // Load up the news obj $news = FD::table('EventNews'); $news->load($id); // Determine the message to display $message = !$news->id ? JText::_('APP_EVENT_NEWS_CREATED_SUCCESSFULLY') : JText::_('APP_EVENT_NEWS_UPDATED_SUCCESSFULLY'); // Load the event object $event = FD::event($this->input->get('cluster_id', 0, 'int')); if (!$event) { return $this->redirect($event->getPermalink(false)); } // Get the app id $app = $this->getApp(); if (!$event->isAdmin()) { $url = FRoute::events($event->getPermalink(false)); return $this->redirect($url); } $options = array(); $options['title'] = $this->input->get('title', '', 'default'); $options['content'] = $this->input->get('news_content', '', 'raw'); $options['comments'] = $this->input->get('comments', true, 'bool'); $options['state'] = SOCIAL_STATE_PUBLISHED; // Only bind this if it's a new item if (!$news->id) { $options['cluster_id'] = $event->id; $options['created_by'] = $this->my->id; $options['hits'] = 0; } // Bind the data $news->bind($options); // Check if there are any errors if (!$news->check()) { FD::info()->set($news->getError(), SOCIAL_MSG_ERROR); $url = FRoute::apps(array('layout' => 'canvas', 'customView' => 'form', 'uid' => $event->getAlias(), 'type' => SOCIAL_TYPE_EVENT, 'id' => $app->getAlias()), false); return $this->redirect($url); } // If everything is okay, bind the data. $news->store(); // If it is a new item, we want to run some other stuffs here. if (!$id) { // @points: events.news.create // Add points to the user that updated the event $points = FD::points(); $points->assign('events.news.create', 'com_easysocial', $this->my->id); } // Redirect to the appropriate page now $url = FRoute::apps(array('layout' => 'canvas', 'customView' => 'item', 'uid' => $event->getAlias(), 'type' => SOCIAL_TYPE_EVENT, 'id' => $app->getAlias(), 'newsId' => $news->id), false); $app = $this->getApp(); $permalink = $app->getPermalink('canvas', array('customView' => 'item', 'eventId' => $event->id, 'newsId' => $news->id)); // Notify users about the news. $options = array('userId' => $this->my->id, 'permalink' => $permalink, 'newsId' => $news->id, 'newsTitle' => $news->title, 'newsContent' => strip_tags($news->content)); $event->notifyMembers('news.create', $options); FD::info()->set($message, SOCIAL_MSG_SUCCESS); // Perform a redirection $this->redirect($url); }
/** * Processes mentions in a stream object * * @since 1.0 * @access public * @param string * @return */ public function formatMentions(SocialStreamItem &$stream) { // Get the current view $view = JRequest::getCmd('view', ''); // Get the stream's content $content = $stream->content; // Get tags for the stream $tags = isset($stream->tags) ? $stream->tags : array(); // If there is no tags, just skip this and escape the content if (!$tags) { return FD::string()->escape($content); } // We need to store the changes in an array and replace it accordingly based on the counter. $items = array(); // We need to merge the mentions and hashtags since we are based on the offset. $i = 0; foreach ($tags as $tag) { if ($tag->type == 'user') { $replace = '<a href="' . $tag->user->getPermalink() . '" data-popbox="module://easysocial/profile/popbox" data-popbox-position="top-left" data-user-id="' . $tag->user->id . '" class="mentions-user">' . $tag->user->getName() . '</a>'; } if ($tag->type == 'hashtag') { // $alias = JFilterOutput::stringURLSafe($tag->title); $alias = $tag->title; $url = ''; if ($view == 'groups') { $clusterReg = FD::registry($stream->params); $object = $clusterReg->get($stream->cluster_type); switch ($stream->cluster_type) { case SOCIAL_TYPE_GROUP: // for now we assume all is group type. $group = new SocialGroup(); $group->bind($object); $url = FRoute::groups(array('layout' => 'item', 'id' => $group->getAlias(), 'tag' => $alias)); break; case SOCIAL_TYPE_EVENT: $event = new SocialEvent(); $event->bind($object); $url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'tag' => $alias)); break; default: FRoute::dashboard(array('layout' => 'hashtag', 'tag' => $alias)); break; } } else { $url = FRoute::dashboard(array('layout' => 'hashtag', 'tag' => $alias)); } $replace = '<a href="' . $url . '" class="mentions-hashtag">#' . $tag->title . '</a>'; } $links[$i] = $replace; $replace = '[si:mentions]' . $i . '[/si:mentions]'; $content = JString::substr_replace($content, $replace, $tag->offset, $tag->length); $i++; } // Once we have the content, escape it $content = FD::string()->escape($content); if ($links) { for ($x = 0; $x < count($links); $x++) { $content = str_ireplace('[si:mentions]' . $x . '[/si:mentions]', $links[$x], $content); } } return $content; }
</a> <h3 class="pull-left"> <a href="<?php echo FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'tag' => $hashtagAlias)); ?> ">#<?php echo $hashtag; ?> </a> </h3> </div> </div> <p class="fd-small"> <?php echo JText::sprintf('COM_EASYSOCIAL_STREAM_HASHTAG_CURRENTLY_FILTERING', '<a href="' . FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'tag' => $hashtagAlias)) . '">#' . $hashtag . '</a>'); ?> </p> </div> <hr /> <?php } ?> <?php echo $stream->html(); ?> <?php } ?>
<?php } ?> <?php if ($params->get('display_member_counter', true)) { ?> <span class="hit-counter"> <i class="ies-users"></i> <?php echo JText::sprintf(FD::string()->computeNoun('MOD_EASYSOCIAL_EVENTS_GUEST_COUNT', $event->getTotalGuests()), $event->getTotalGuests()); ?> </span> <?php } ?> </div> </li> <?php } ?> </ul> <a href="<?php echo FRoute::events(); ?> "><?php echo JText::_('MOD_EASYSOCIAL_EVENTS_ALL_EVENT'); ?> </a> </div>
data-dashboardSidebar-menu data-dashboardFeeds-item data-type="<?php echo SOCIAL_TYPE_EVENT; ?> " data-id="<?php echo $event->id; ?> " data-fid="0" > <a href="<?php echo FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'app' => $filter->alias)); ?> " title="<?php echo $this->html('string.escape', $filter->title); ?> " class="data-dashboardfeeds-item" data-id="<?php echo $filter->alias; ?> " data-filter-app > <span class="es-app-filter"> <?php