/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. **/ public function reportVideo($link, $message, $id) { CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $config =& CFactory::getConfig(); $my = CFactory::getUser(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } // Pass the link and the reported message $report->createReport(JText::_('CC BAD VIDEO'), $link, $message); // Add the action that needs to be called. $action = new stdClass(); $action->label = 'Delete video'; $action->method = 'videos,deleteVideo'; $action->parameters = array($id, 0); $action->defaultAction = false; $report->addActions(array($action)); return JText::_('CC REPORT SUBMITTED'); }
/** * 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'); }
/** * View method to display specific discussion from a group * @since 2.4 * @access public * @param Object Data object passed from controller */ public function viewdiscussion() { $mainframe =& JFactory::getApplication(); $document = JFactory::getDocument(); $jconfig = JFactory::getConfig(); $config = CFactory::getConfig(); // Load window library CFactory::load('libraries', 'window'); // Load necessary window css / javascript headers. CWindow::load(); // Get necessary variables CFactory::load('models', 'groups'); CFactory::load('models', 'discussions'); $my = CFactory::getUser(); $groupId = JRequest::getInt('groupid', '', 'GET'); $topicId = JRequest::getInt('topicid', '', 'GET'); // Load necessary library and objects $groupModel = CFactory::getModel('groups'); $group =& JTable::getInstance('Group', 'CTable'); $discussion =& JTable::getInstance('Discussion', 'CTable'); $group->load($groupId); $discussion->load($topicId); $isBanned = $group->isBanned($my->id); $document->addCustomTag('<link rel="image_src" href="' . $group->getThumbAvatar() . '" />'); // @rule: Test if the group is unpublished, don't display it at all. if (!$group->published) { $this->_redirectUnpublishGroup(); return; } $feedLink = CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussion&topicid=' . $topicId . '&format=feed'); $feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('COM_COMMUNITY_GROUPS_LATEST_FEED') . '" href="' . $feedLink . '"/>'; $document->addCustomTag($feed); CFactory::load('helpers', 'owner'); if ($group->approvals == 1 && !$group->isMember($my->id) && !COwnerHelper::isCommunityAdmin()) { $this->noAccess(JText::_('COM_COMMUNITY_GROUPS_PRIVATE_NOTICE')); return; } // Execute discussion onDisplay filter $appsLib =& CAppPlugins::getInstance(); $appsLib->loadApplications(); $args = array(); $args[] =& $discussion; $appsLib->triggerEvent('onDiscussionDisplay', $args); // Get the discussion creator info $creator = CFactory::getUser($discussion->creator); // Format the date accordingly. //$discussion->created = CTimeHelper::getDate( $discussion->created ); $dayinterval = ACTIVITY_INTERVAL_DAY; $timeFormat = $config->get('activitiestimeformat'); $dayFormat = $config->get('activitiesdayformat'); if ($config->get('activitydateformat') == COMMUNITY_DATE_FIXED) { $discussion->created = CTimeHelper::getDate($discussion->created)->toFormat(JText::_('DATE_FORMAT_LC2'), true); } else { $discussion->created = CTimeHelper::timeLapse(CTimeHelper::getDate($discussion->created)); } // Set page title $document->setTitle(JText::sprintf('COM_COMMUNITY_GROUPS_DISCUSSION_TITTLE', $discussion->title)); // Add pathways $this->_addGroupInPathway($group->id); $this->addPathway(JText::_('COM_COMMUNITY_GROUPS_DISCUSSION'), CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussions&groupid=' . $group->id)); $this->addPathway(JText::sprintf('COM_COMMUNITY_GROUPS_DISCUSSION_TITTLE', $discussion->title)); CFactory::load('helpers', 'owner'); $isGroupAdmin = $groupModel->isAdmin($my->id, $group->id); if ($my->id == $creator->id || $isGroupAdmin || COwnerHelper::isCommunityAdmin()) { $title = JText::_('COM_COMMUNITY_DELETE_DISCUSSION'); $titleLock = $discussion->lock ? JText::_('COM_COMMUNITY_UNLOCK_DISCUSSION') : JText::_('COM_COMMUNITY_LOCK_DISCUSSION'); $actionLock = $discussion->lock ? JText::_('COM_COMMUNITY_UNLOCK') : JText::_('COM_COMMUNITY_LOCK'); $this->addSubmenuItem('', $actionLock, "joms.groups.lockTopic('" . $titleLock . "','" . $group->id . "','" . $discussion->id . "');", SUBMENU_RIGHT); $this->addSubmenuItem('', JText::_('COM_COMMUNITY_DELETE'), "joms.groups.removeTopic('" . $title . "','" . $group->id . "','" . $discussion->id . "');", SUBMENU_RIGHT); $this->addSubmenuItem('index.php?option=com_community&view=groups&task=editdiscussion&groupid=' . $group->id . '&topicid=' . $discussion->id, JText::_('COM_COMMUNITY_EDIT'), '', SUBMENU_RIGHT); } $this->showSubmenu(); CFactory::load('libraries', 'wall'); $wallContent = CWallLibrary::getWallContents('discussions', $discussion->id, $isGroupAdmin, $jconfig->get('list_limit'), 0, 'wall.content', 'groups,discussion'); $wallCount = CWallLibrary::getWallCount('discussions', $discussion->id); $viewAllLink = CRoute::_('index.php?option=com_community&view=groups&task=discussapp&topicid=' . $discussion->id . '&app=walls'); $wallContent .= CWallLibrary::getViewAllLinkHTML($viewAllLink, $wallCount); // Test if the current browser is a member of the group $isMember = $group->isMember($my->id); $waitingApproval = false; // If I have tried to join this group, but not yet approved, display a notice if ($groupModel->isWaitingAuthorization($my->id, $group->id)) { $waitingApproval = true; } $wallForm = ''; $config = CFactory::getConfig(); // Only get the wall form if user is really allowed to see it. if (!$config->get('lockgroupwalls') || $config->get('lockgroupwalls') && $isMember && !$isBanned && !$waitingApproval || COwnerHelper::isCommunityAdmin()) { $outputLock = '<div class="warning">' . JText::_('COM_COMMUNITY_DISCUSSION_LOCKED_NOTICE') . '</div>'; $outputUnLock = CWallLibrary::getWallInputForm($discussion->id, 'groups,ajaxSaveDiscussionWall', 'groups,ajaxRemoveReply'); $wallForm = '<div class="wall-tittle">' . JText::_('COM_COMMUNITY_REPLIES') . '</div>'; $wallForm .= $discussion->lock ? $outputLock : $outputUnLock; } if (empty($wallForm)) { //user must join in order to see this page $tmpl = new CTemplate(); $wallForm = $tmpl->set('groupid', $groupId)->fetch('groups.joingroup'); $outputLock = '<div class="warning">' . JText::_('COM_COMMUNITY_DISCUSSION_LOCKED_NOTICE') . '</div>'; $outputUnLock = CWallLibrary::getWallInputForm($discussion->id, 'groups,ajaxSaveDiscussionWall', 'groups,ajaxRemoveReply'); $wallForm2 = '<div class="wall-tittle">' . JText::_('COM_COMMUNITY_REPLIES') . '</div>'; $wallForm2 .= $discussion->lock ? $outputLock : $outputUnLock; $wallForm = $wallForm . '<div style="display:none" class="reply-form">' . $wallForm2 . '</div>'; } $config = CFactory::getConfig(); // Get creator link $creatorLink = CRoute::_('index.php?option=com_community&view=profile&userid=' . $creator->id); // Get reporting html CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $reportHTML = $report->getReportingHTML(JText::_('COM_COMMUNITY_GROUPS_DISCUSSION_REPORT'), 'groups,reportDiscussion', array($discussion->id)); CFactory::load('libraries', 'bookmarks'); $bookmarks = new CBookmarks(CRoute::getExternalURL('index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $group->id . '&topicid=' . $discussion->id)); $bookmarksHTML = $bookmarks->getHTML(); $tmpl = new CTemplate(); echo $tmpl->set('bookmarksHTML', $bookmarksHTML)->set('discussion', $discussion)->set('creator', $creator)->set('wallContent', $wallContent)->set('wallForm', $wallForm)->set('creatorLink', $creatorLink)->set('reportHTML', $reportHTML)->set('groupid', $groupId)->fetch('groups.viewdiscussion'); }
public function _groupVideo() { $mainframe = JFactory::getApplication(); $document = JFactory::getDocument(); // Get necessary properties and load the libraries CFactory::load('models', 'videos'); $my = CFactory::getUser(); $model = CFactory::getModel('videos'); $videoId = JRequest::getVar('videoid', '', 'GET'); $groupId = JRequest::getVar('groupid', '', 'GET'); $video = JTable::getInstance('Video', 'CTable'); $video->load($videoId); $video->loadExtra(); CFactory::load('helpers', 'owner'); $user = CFactory::getUser($video->creator); $blocked = $user->isBlocked(); if ($blocked && !COwnerHelper::isCommunityAdmin()) { $tmpl = new CTemplate(); echo $tmpl->fetch('profile.blocked'); return; } if (empty($videoId)) { $url = CRoute::_('index.php?option=com_community&view=videos', false); $mainframe->redirect($url, JText::_('COM_COMMUNITY_VIDEOS_ID_ERROR'), 'warning'); } CFactory::load('helpers', 'group'); // Check permission if (!CGroupHelper::allowViewMedia($groupId)) { // Set document title $document->setTitle(JText::_('COM_COMMUNITY_RESTRICTED_ACCESS')); $mainframe->enqueueMessage(JText::_('COM_COMMUNITY_RESTRICTED_ACCESS', 'notice')); echo JText::_('COM_COMMUNITY_GROUPS_VIDEO_MEMBER_PERMISSION'); } else { // Get extra properties $video->player = $video->getViewHTML($video->getWidth(), $video->getHeight()); $video->hit(); // Get reporting html $reportHTML = ''; CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $reportHTML = $report->getReportingHTML(JText::_('COM_COMMUNITY_VIDEOS_REPORT_VIDEOS'), 'videos,reportVideo', array($video->id)); // Set pathway $pathway =& $mainframe->getPathway(); $pathway->addItem('Video', CRoute::_('index.php?option=com_community&view=videos')); $pathway->addItem($video->title, ''); // Set the current user's active profile CFactory::setActiveProfile($video->creator); // Set document title $document->setTitle($video->title); CFactory::load('libraries', 'bookmarks'); $bookmarks = new CBookmarks($video->permalink); $bookmarksHTML = $bookmarks->getHTML(); $tmpl = new CTemplate(); // Get the walls CFactory::load('libraries', 'wall'); $wallContent = CWallLibrary::getWallContents('videos', $video->id, COwnerHelper::isCommunityAdmin() || $my->id == $video->creator && $my->id != 0, 10, 0); $wallForm = ''; $viewAllLink = false; if (JRequest::getVar('task', '', 'REQUEST') != 'app') { $viewAllLink = CRoute::_('index.php?option=com_community&view=videos&task=app&videoid=' . $video->id . '&app=walls'); } $wallForm = CWallLibrary::getWallInputForm($video->id, 'videos,ajaxSaveWall', 'videos,ajaxRemoveWall', $viewAllLink); $redirectUrl = CRoute::getURI(false); $tmpl->set('redirectUrl', $redirectUrl); $tmpl->set('wallForm', $wallForm); $tmpl->set('wallContent', $wallContent); $tmpl->set('bookmarksHTML', $bookmarksHTML); $tmpl->set('reportHTML', $reportHTML); $tmpl->set('video', $video); echo $tmpl->fetch('videos.video'); } }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. * */ public function reportProfile($link, $message, $id) { $report = new CReportingLibrary(); $config = CFactory::getConfig(); $my = CFactory::getUser(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } $report->createReport(JText::_('COM_COMMUNITY_REPORT_BAD_USER'), $link, $message); $action = new stdClass(); $action->label = 'COM_COMMUNITY_BLOCK_USER'; $action->method = 'profile,blockProfile'; $action->parameters = $id; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. **/ public function reportEvent($link, $message, $eventId) { CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $report->createReport(JText::_('COM_COMMUNITY_EVENTS_BAD'), $link, $message); $action = new stdClass(); $action->label = 'Unpublish event'; $action->method = 'events,unpublishEvent'; $action->parameters = $eventId; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }
/** * Displays the viewing profile page. * * @access public * @param array An associative array to display the fields */ function profile(&$data) { $mainframe =& JFactory::getApplication(); $my = CFactory::getUser(); $config = CFactory::getConfig(); $userid = JRequest::getVar('userid', $my->id); $user = CFactory::getUser($userid); $userId = JRequest::getVar('userid', '', 'GET'); if ($my->id != 0 && empty($userId)) { CFactory::setActiveProfile($my->id); $user = $my; } // Display breadcrumb regardless whether the user is blocked or not $pathway =& $mainframe->getPathway(); $pathway->addItem($user->getDisplayName(), ''); // Get profile video information $params = $user->getParams(); $videoid = $params->get('profileVideo', 0); CFactory::load('helpers', 'owner'); $blocked = $user->isBlocked(); if ($blocked && !COwnerHelper::isCommunityAdmin()) { $tmpl = new CTemplate(); echo $tmpl->fetch('profile.blocked'); return; } // If the current browser is a site admin, display some notice that user is blocked. if ($blocked) { $this->addWarning(JText::_('CC USER ACCOUNT BANNED')); } // access check if (!$this->accessAllowed('privacyProfileView')) { return; } require_once JPATH_COMPONENT . DS . 'libraries' . DS . 'userpoints.php'; $appsLib =& CAppPlugins::getInstance(); $appsLib->loadApplications(); CFactory::load('helpers', 'string'); $document =& JFactory::getDocument(); $status = $user->getStatus(COMMUNITY_RAW_STATUS); $status = empty($status) ? '' : ' : ' . $status; $document->setTitle($user->getDisplayName(COMMUNITY_RAW_STATUS) . $status); $document->setMetaData('description', JText::sprintf('CC PROFILE META DESCRIPTION', $user->getDisplayName(), $config->get('sitename'), CStringHelper::escape($status))); $feedLink = CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id . '&format=feed'); $feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('CC SUBSCRIBE TO USER FEEDS') . '" href="' . $feedLink . '"/>'; $mainframe->addCustomHeadTag($feed); $feedLink = CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id . '&showfriends=true&format=feed'); $feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('CC SUBSCRIBE TO USER FRIENDS FEEDS') . '" href="' . $feedLink . '"/>'; $mainframe->addCustomHeadTag($feed); $feedLink = CRoute::_('index.php?option=com_community&view=photos&task=myphotos&userid=' . $user->id . '&format=feed'); $feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('CC SUBSCRIBE TO USER PHOTO FEEDS') . '" href="' . $feedLink . '"/>'; $mainframe->addCustomHeadTag($feed); $feedLink = CRoute::_('index.php?option=com_community&view=videos&userid=' . $user->id . '&format=feed'); $feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('CC SUBSCRIBE TO USER VIDEO FEEDS') . '" href="' . $feedLink . '"/>'; $mainframe->addCustomHeadTag($feed); // Get profile video information $params = $user->getParams(); $data->videoid = $params->get('profileVideo', 0); // Show profile header $headerHTML = $this->_showHeader($data); // Load user application $apps = $data->apps; // Load community applications plugin $app =& CAppPlugins::getInstance(); $appsModel = CFactory::getModel('apps'); $tmpAppData = $app->triggerEvent('onProfileDisplay', '', true); $appData = array(); // @rule: Only display necessary apps. $count = count($tmpAppData); for ($i = 0; $i < $count; $i++) { $app =& $tmpAppData[$i]; $privacy = $appsModel->getPrivacy($user->id, $app->name); if ($this->appPrivacyAllowed($privacy)) { $appData[] = $app; } } unset($tmpAppData); // Split the apps into different list for different positon $appsInPositions = array(); foreach ($appData as &$app) { $appsInPositions[$app->position][] = $app; } $tmpl = new CTemplate(); $contenHTML = array(); $contenHTML['content'] = ''; $contenHTML['sidebar-top'] = ''; $contenHTML['sidebar-bottom'] = ''; $jscript = ''; foreach ($appsInPositions as $position => $appData) { ob_start(); foreach ($appData as $app) { // If the apps content is empty, we ignore this app from showing // the header in profile page. if (JString::trim($app->data) == "") { continue; } $tmpl->set('app', $app); $tmpl->set('isOwner', COwnerHelper::isMine($my->id, $user->id)); switch ($position) { case 'sidebar-top': case 'sidebar-bottom': echo $tmpl->fetch('application.widget'); break; default: echo $tmpl->fetch('application.box'); } } $contenHTML[$position] = ob_get_contents(); ob_end_clean(); } // Get the config $config = CFactory::getConfig(); // get total group $groupsModel = CFactory::getModel('groups'); $totalgroups = $groupsModel->getGroupsCount($user->id); // get total friend $friendsModel = CFactory::getModel('friends'); $totalfriends = $user->getFriendCount(); // get total photos $photosModel = CFactory::getModel('photos'); $totalphotos = $photosModel->getPhotosCount($user->id); // get total activities $activitiesModel = CFactory::getModel('activities'); $totalactivities = $activitiesModel->getActivityCount($user->id); $isMine = COwnerHelper::isMine($my->id, $user->id); $isCommunityAdmin = COwnerHelper::isCommunityAdmin($user->id); // Get reporting html CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $reportHTML = $isMine ? '' : $report->getReportingHTML(JText::_('CC REPORT BAD USER'), 'profile,reportProfile', array($user->id)); // Check if user is blocked $blockUserModel = CFactory::getModel('block'); $isBlocked = $blockUserModel->getBlockStatus($user->id, $my->id); // Get block user html CFactory::load('helpers', 'user'); $blockUserHTML = $isMine || $isCommunityAdmin ? '' : CUserHelper::getBlockUserHTML($user->id, $isBlocked); CFactory::load('libraries', 'bookmarks'); $bookmarks = new CBookmarks(CRoute::getExternalURL('index.php?option=com_community&view=profile&userid=' . $user->id)); $bookmarksHTML = $bookmarks->getHTML(); // Get like // cater for buble, blueface template $likesHTML = ''; if ($user->getParams()->get('profileLikes', true)) { CFactory::load('libraries', 'like'); $likes = new CLike(); $likesHTML = $my->id == 0 ? $likes->getHtmlPublic('profile', $user->id) : $likes->getHTML('profile', $user->id, $my->id); } $tmpl = new CTemplate(); $tmpl->set('blockUserHTML', $blockUserHTML); $tmpl->set('bookmarksHTML', $bookmarksHTML); $tmpl->set('profileOwnerName', $user->getDisplayName()); $tmpl->set('totalgroups', $totalgroups); $tmpl->set('totalfriends', $totalfriends); $tmpl->set('totalphotos', $totalphotos); $tmpl->set('totalactivities', $totalactivities); $tmpl->set('reportsHTML', $reportHTML); $tmpl->set('mainframe', $mainframe); $tmpl->set('config', $config); $tmpl->set('about', $this->_getProfileHTML($data->profile)); $tmpl->set('friends', $this->_getFriendsHTML()); $tmpl->set('groups', $this->_getGroupsHTML()); $tmpl->set('newsfeed', $this->_getNewsfeedHTML()); $tmpl->set('header', $headerHTML); $tmpl->set('adminControlHTML', $this->_getAdminControlHTML($user->id)); $tmpl->set('content', $contenHTML['content']); $tmpl->set('sidebarTop', $contenHTML['sidebar-top']); $tmpl->set('sidebarBottom', $contenHTML['sidebar-bottom']); $tmpl->set('isMine', $isMine); $tmpl->set('jscript', ''); // maintain for 1.8.0 template compatibility $tmpl->setRef('user', $user); $tmpl->set('my', $my); $tmpl->set('videoid', $data->videoid); $tmpl->set('likesHTML', $likesHTML); $html = $tmpl->fetch('profile.index'); echo $html; }
/** * Method to display video * **/ public function video() { $mainframe =& JFactory::getApplication(); $document = JFactory::getDocument(); $config = CFactory::getConfig(); $my = CFactory::getUser(); $videoId = JRequest::getVar('videoid', '', 'GET'); $groupId = JRequest::getVar('groupid', '', 'GET'); // Get show video location map by default $videoMapsDefault = $config->get('videosmapdefault'); // Load window library CFactory::load('libraries', 'window'); // Load necessary window css / javascript headers. CWindow::load(); // Load the video table // Load string helper CFactory::load('helpers', 'string'); $video =& JTable::getInstance('Video', 'CTable'); if (empty($videoId)) { $url = CRoute::_('index.php?option=com_community&view=videos', false); $mainframe->redirect($url, JText::_('COM_COMMUNITY_VIDEOS_ID_ERROR'), 'warning'); } if (!$video->load($videoId)) { $url = CRoute::_('index.php?option=com_community&view=videos', false); $mainframe->redirect($url, JText::_('COM_COMMUNITY_VIDEOS_NOT_AVAILABLE'), 'warning'); } // Setting up the sub menu CFactory::load('helpers', 'owner'); if (COwnerHelper::isCommunityAdmin() || $my->id == $video->creator && $my->id != 0) { $this->addSubmenuItem('', JText::_('COM_COMMUNITY_VIDEOS_FETCH_THUMBNAIL'), 'joms.videos.fetchThumbnail(\'' . $video->id . '\')', true); // Only add the set as profile video for video owner if ($my->id == $video->creator) { $this->addSubmenuItem('', JText::_('COM_COMMUNITY_VIDEOS_SET_AS_PROFILE'), 'joms.videos.linkConfirmProfileVideo(\'' . $video->id . '\')', true); } $redirectUrl = CRoute::getURI(false); $this->addSubmenuItem('', JText::_('COM_COMMUNITY_EDIT'), 'joms.videos.showEditWindow(\'' . $video->id . '\',\'' . $redirectUrl . '\');', true); $this->addSubmenuItem('', JText::_('COM_COMMUNITY_DELETE'), 'joms.videos.deleteVideo(\'' . $video->id . '\')', true); } $this->_addSubmenu(); $this->showSubmenu(); // Show the mini header when viewing other's photos if ($video->creator_type == VIDEO_USER_TYPE && $my->id != $video->creator) { $this->attachMiniHeaderUser($video->creator); } // Check permission $user = CFactory::getUser($video->creator); $blocked = $user->isBlocked(); if ($blocked && !COwnerHelper::isCommunityAdmin()) { $tmpl = new CTemplate(); echo $tmpl->fetch('profile.blocked'); return; } $sorted = JRequest::getVar('sort', 'latest'); $limit = JRequest::getVar('limitstart', 6); $permissions = $my->id == 0 ? 0 : 20; $cat_id = JRequest::getVar('cat_id', ''); $model = CFactory::getModel('videos'); if ($video->creator_type == VIDEO_GROUP_TYPE) { CFactory::load('helpers', 'group'); if (!CGroupHelper::allowViewMedia($groupId)) { $document->setTitle(JText::_('COM_COMMUNITY_RESTRICTED_ACCESS')); $mainframe->enqueueMessage(JText::_('COM_COMMUNITY_RESTRICTED_ACCESS', 'notice')); echo JText::_('COM_COMMUNITY_GROUPS_VIDEO_MEMBER_PERMISSION'); return; } $group =& JTable::getInstance('Group', 'CTable'); $group->load($groupId); // Set pathway $pathway =& $mainframe->getPathway(); $pathway->addItem(JText::_('COM_COMMUNITY_GROUPS'), CRoute::_('index.php?option=com_community&view=groups')); $pathway->addItem($group->name, CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $groupId)); $pathway->addItem(JText::_('COM_COMMUNITY_VIDEOS'), CRoute::_('index.php?option=com_community&view=videos&groupid=' . $groupId)); $pathway->addItem($video->getTitle(), ''); $otherVideos = $model->getGroupVideos($groupId, $cat_id, $limit); } else { if (!$this->isPermitted($my->id, $video->creator, $video->permissions)) { $document->setTitle(JText::_('COM_COMMUNITY_RESTRICTED_ACCESS')); $mainframe->enqueueMessage(JText::_('COM_COMMUNITY_RESTRICTED_ACCESS', 'notice')); switch ($video->permissions) { case '40': $this->noAccess(JText::_('COM_COMMUNITY_VIDEOS_OWNER_ONLY', 'notice')); break; case '30': $owner = CFactory::getUser($video->creator); $this->noAccess(JText::sprintf('COM_COMMUNITY_VIDEOS_FRIEND_PERMISSION_MESSAGE', $owner->getDisplayName())); break; default: $this->noAccess(); break; } return; } // Set pathway $pathway =& $mainframe->getPathway(); $pathway->addItem('Video', CRoute::_('index.php?option=com_community&view=videos')); $pathway->addItem($video->getTitle(), ''); $filters = array('status' => 'ready', 'category_id' => $cat_id, 'creator' => $user->id, 'permissions' => $permissions, 'or_group_privacy' => 0, 'sorting' => $sorted, 'limit' => $limit); $otherVideos = $model->getVideos($filters); } //var_dump($otherVideos); // Set the current user's active profile CFactory::setActiveProfile($video->creator); // Hit counter + 1 $video->hit(); // Get reporting html $reportHTML = ''; CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $reportHTML = $report->getReportingHTML(JText::_('COM_COMMUNITY_VIDEOS_REPORT_VIDEOS'), 'videos,reportVideo', array($video->id)); // Get bookmark html CFactory::load('libraries', 'bookmarks'); $bookmarks = new CBookmarks($video->getPermalink()); $bookmarksHTML = $bookmarks->getHTML(); // Get the walls CFactory::load('libraries', 'wall'); $wallContent = CWallLibrary::getWallContents('videos', $video->id, COwnerHelper::isCommunityAdmin() || $my->id == $video->creator && $my->id != 0, 10, 0); $wallCount = CWallLibrary::getWallCount('videos', $video->id); $viewAllLink = false; if (JRequest::getVar('task', '', 'REQUEST') != 'app') { $viewAllLink = CRoute::_('index.php?option=com_community&view=videos&task=app&videoid=' . $video->id . '&app=walls'); } $wallContent .= CWallLibrary::getViewAllLinkHTML($viewAllLink, $wallCount); $wallForm = ''; if ($this->isPermitted($my->id, $video->creator, PRIVACY_FRIENDS) || !$config->get('lockvideoswalls')) { $wallForm = CWallLibrary::getWallInputForm($video->id, 'videos,ajaxSaveWall', 'videos,ajaxRemoveWall', $viewAllLink); } $redirectUrl = CRoute::getURI(false); // Get like CFactory::load('libraries', 'like'); $likes = new CLike(); $likesHTML = $likes->getHTML('videos', $video->id, $my->id); $tmpl = new CTemplate(); if ($video->creator_type == VIDEO_GROUP_TYPE) { $group =& JTable::getInstance('Group', 'CTable'); $group->load($groupId); $document = JFactory::getDocument(); $document->addHeadLink($group->getThumbAvatar(), 'image_src', 'rel'); } if ($video->location !== '' && $videoMapsDefault == 1) { CFactory::load('libraries', 'mapping'); $zoomableMap = CMapping::drawZoomableMap($video->location, 220, 150); } else { $zoomableMap = ""; } echo $tmpl->setMetaTags('video', $video)->set('user', $user)->set('zoomableMap', $zoomableMap)->set('likesHTML', $likesHTML)->set('redirectUrl', $redirectUrl)->set('wallForm', $wallForm)->set('wallContent', $wallContent)->set('bookmarksHTML', $bookmarksHTML)->set('reportHTML', $reportHTML)->set('video', $video)->set('otherVideos', $otherVideos)->fetch('videos.video'); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. **/ public function reportProfile($link, $message, $id) { CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $config =& CFactory::getConfig(); $my = CFactory::getUser(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } $report->createReport(JText::_('Bad user'), $link, $message); $action = new stdClass(); $action->label = 'Block User'; $action->method = 'profile,blockProfile'; $action->parameters = $id; $action->defaultAction = false; $report->addActions(array($action)); return JText::_('CC REPORT SUBMITTED'); }
/** * Method to display video * @return void */ public function video() { $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $document = JFactory::getDocument(); $config = CFactory::getConfig(); $my = CFactory::getUser(); $requestUser = CFactory::getRequestUser(); $videoId = $jinput->get('videoid', '', 'INT'); $task = $jinput->getCmd('task'); // Get show video location map by default $videoMapsDefault = $config->get('videosmapdefault'); // Load window library CWindow::load(); $video = JTable::getInstance('Video', 'CTable'); if (empty($videoId)) { if ($jinput->get('videoid', '', 'INT')) { $videoId = $jinput->get('videoid', '', 'INT'); } else { $url = CRoute::_('index.php?option=com_community&view=videos', false); $mainframe->redirect($url, JText::_('COM_COMMUNITY_VIDEOS_ID_ERROR'), 'warning'); } } if (!$video->load($videoId)) { $url = CRoute::_('index.php?option=com_community&view=videos', false); $mainframe->redirect($url, JText::_('COM_COMMUNITY_VIDEOS_NOT_AVAILABLE'), 'warning'); } if ($video->groupid) { JRequest::setVar('groupid', $video->groupid); } elseif ($video->eventid) { JRequest::setVar('eventid', $video->eventid); } // Setting up the sub menu if (COwnerHelper::isCommunityAdmin() || $my->id == $video->creator && $my->id != 0) { $this->addSubmenuItem('', JText::_('COM_COMMUNITY_VIDEOS_FETCH_THUMBNAIL'), "joms.api.videoFetchThumbnail('" . $video->id . "');", true); // Only add the set as profile video for video owner if ($my->id == $video->creator && $config->get('enableprofilevideo')) { $this->addSubmenuItem('', JText::_('COM_COMMUNITY_VIDEOS_SET_AS_PROFILE'), "joms.api.videoLinkToProfile('" . $video->id . "');", true); } $redirectUrl = CRoute::getURI(false); $this->addSubmenuItem('', JText::_('COM_COMMUNITY_EDIT'), "joms.api.videoEdit('" . $video->id . "');", true); $this->addSubmenuItem('', JText::_('COM_COMMUNITY_DELETE'), "joms.api.videoRemove('" . $video->id . "');", true); } $this->_addSubmenu(); // Show the mini header when viewing other's photos if ($video->creator_type == VIDEO_USER_TYPE && $my->id != $video->creator) { // $this->attachMiniHeaderUser($video->creator); } // Check permission $user = CFactory::getUser($video->creator); $blocked = $user->isBlocked(); if ($blocked && !COwnerHelper::isCommunityAdmin()) { $tmpl = new CTemplate(); echo $tmpl->fetch('profile.blocked'); return; } $sorted = $jinput->get('sort', 'latest', 'STRING'); $limit = $jinput->get('limitstart', 6, 'INT'); $permissions = $my->id == 0 ? 0 : 20; $cat_id = $jinput->get('cat_id', '', 'INT'); $model = CFactory::getModel('videos'); /* We get groupid from video table instead user input */ $groupId = $video->groupid; if ($video->creator_type == VIDEO_GROUP_TYPE) { if (!CGroupHelper::allowViewMedia($groupId)) { /** * Opengraph */ CHeadHelper::setType('website', JText::_('COM_COMMUNITY_RESTRICTED_ACCESS')); $mainframe->enqueueMessage(JText::_('COM_COMMUNITY_RESTRICTED_ACCESS', 'notice')); echo JText::_('COM_COMMUNITY_GROUPS_VIDEO_MEMBER_PERMISSION'); return; } $group = JTable::getInstance('Group', 'CTable'); $group->load($groupId); // Set pathway $pathway = $mainframe->getPathway(); $pathway->addItem(JText::_('COM_COMMUNITY_GROUPS'), CRoute::_('index.php?option=com_community&view=groups')); $pathway->addItem($group->name, CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $groupId)); $pathway->addItem(JText::_('COM_COMMUNITY_VIDEOS'), CRoute::_('index.php?option=com_community&view=videos&task=display&groupid=' . $groupId)); $pathway->addItem($video->getTitle(), ''); $otherVideos = $model->getGroupVideos($groupId, $cat_id, $limit); } else { if (!$this->isPermitted($my->id, $video->creator, $video->permissions)) { /** * Opengraph */ CHeadHelper::setType('website', JText::_('COM_COMMUNITY_RESTRICTED_ACCESS')); $mainframe->enqueueMessage(JText::_('COM_COMMUNITY_RESTRICTED_ACCESS', 'notice')); switch ($video->permissions) { case '40': $this->noAccess(JText::_('COM_COMMUNITY_VIDEOS_OWNER_ONLY', 'notice')); break; case '30': $owner = CFactory::getUser($video->creator); $this->noAccess(JText::sprintf('COM_COMMUNITY_VIDEOS_FRIEND_PERMISSION_MESSAGE', $owner->getDisplayName())); break; default: $this->noAccess(); break; } return; } // Set pathway $pathway = $mainframe->getPathway(); $pathway->addItem('Video', CRoute::_('index.php?option=com_community&view=videos')); $pathway->addItem($video->getTitle(), ''); $filters = array('status' => 'ready', 'category_id' => $cat_id, 'creator' => $user->id, 'permissions' => $permissions, 'or_group_privacy' => 0, 'sorting' => $sorted, 'limit' => $limit); $otherVideos = $model->getVideos($filters); } // Set the current user's active profile CFactory::setActiveProfile($video->creator); // Hit counter + 1 $video->hit(); // Get reporting html $reportHTML = ''; $report = new CReportingLibrary(); if ($user->id != $my->id) { $reportHTML = $report->getReportingHTML(JText::_('COM_COMMUNITY_VIDEOS_REPORT_VIDEOS'), 'videos,reportVideo', array($video->id)); } // Get bookmark html $bookmarks = new CBookmarks($video->getPermalink()); $bookmarksHTML = $bookmarks->getHTML(); // Get the walls $wallContent = CWallLibrary::getWallContents('videos', $video->id, COwnerHelper::isCommunityAdmin() || $my->id == $video->creator && $my->id != 0, $config->get('stream_default_comments'), 0, 'wall/content', 'videos,video'); $wallCount = CWallLibrary::getWallCount('videos', $video->id); $viewAllLink = CRoute::_('index.php?option=com_community&view=videos&task=app&videoid=' . $video->id . '&app=walls'); $wallViewAll = ''; if ($wallCount > $config->get('stream_default_comments')) { $wallViewAll = CWallLibrary::getViewAllLinkHTML($viewAllLink, $wallCount); } $wallForm = ''; if ($this->isPermitted($my->id, $video->creator, PRIVACY_FRIENDS) || !$config->get('lockvideoswalls')) { $wallForm = CWallLibrary::getWallInputForm($video->id, 'videos,ajaxSaveWall', 'videos,ajaxRemoveWall', $viewAllLink); } $redirectUrl = CRoute::getURI(false); // Get like information. $like = new CLike(); $likeCount = $like->getLikeCount('videos', $video->id); $likeLiked = $like->userLiked('videos', $video->id, $my->id) === COMMUNITY_LIKE; $tmpl = new CTemplate(); if ($video->creator_type == VIDEO_GROUP_TYPE) { $group = JTable::getInstance('Group', 'CTable'); $group->load($groupId); $document = JFactory::getDocument(); $document->addHeadLink($group->getThumbAvatar(), 'image_src', 'rel'); } if ($video->location !== '' && $videoMapsDefault) { $zoomableMap = CMapping::drawZoomableMap($video->location, 220, 150, $video->longitude, $video->latitude); } else { $zoomableMap = ""; } //friend list for video tag $tagging = new CVideoTagging(); $taggedList = $tagging->getTaggedList($video->id); for ($t = 0; $t < count($taggedList); $t++) { $tagItem = $taggedList[$t]; $tagUser = CFactory::getUser($tagItem->userid); $canRemoveTag = 0; // 1st we check the tagged user is the video owner. // If yes, canRemoveTag == true. // If no, then check on user is the tag creator or not. // If yes, canRemoveTag == true // If no, then check on user whether user is being tagged if (COwnerHelper::isMine($my->id, $video->creator) || COwnerHelper::isMine($my->id, $tagItem->created_by) || COwnerHelper::isMine($my->id, $tagItem->userid)) { $canRemoveTag = 1; } $tagItem->user = $tagUser; $tagItem->canRemoveTag = $canRemoveTag; } if ($video->type == "file") { $storage = CStorage::getStorage($video->storage); $video->path = $storage->getURI($video->path); } $config = CFactory::getConfig(); $canSearch = 1; if ($my->id == 0 && !$config->get('enableguestsearchvideos')) { $canSearch = 0; } CHeadHelper::addOpengraph('og:image', JUri::root() . $video->thumb, true); CHeadHelper::setType('website', $video->title); $video->tagged = $taggedList; echo $tmpl->setMetaTags('video', $video)->set('user', $user)->set('zoomableMap', $zoomableMap)->set('likeCount', $likeCount)->set('canSearch', $canSearch)->set('likeLiked', $likeLiked)->set('redirectUrl', $redirectUrl)->set('wallContent', $wallContent)->set('wallForm', $wallForm)->set('wallCount', $wallCount)->set('wallViewAll', $wallViewAll)->set('bookmarksHTML', $bookmarksHTML)->set('reportHTML', $reportHTML)->set('video', $video)->set('otherVideos', $otherVideos)->set('videoMapsDefault', $videoMapsDefault)->set('wallCount', $wallCount)->set('isGroup', $groupId ? true : false)->set('groupId', $groupId ? $groupId : null)->set('submenu', $this->showSubmenu(false))->fetch('videos/single'); }
/** * Trigger any necessary items that needs to be changed when the photo * is changed. **/ public function ajaxSwitchPhotoTrigger($photoId) { $filter = JFilterInput::getInstance(); $photoId = $filter->clean($photoId, 'int'); $response = new JAXResponse(); // Load the default photo CFactory::load('models', 'photos'); $photo =& JTable::getInstance('Photo', 'CTable'); $photo->load($photoId); $my = CFactory::getUser(); $config = CFactory::getConfig(); $album =& JTable::getInstance('Album', 'CTable'); $album->load($photo->albumid); // Since the only way for us to get the id is through the AJAX call, // we can only increment the hit when the ajax loads $photo->hit(); // Update the hits each time the photo is switched $response->addAssign('photo-hits', 'innerHTML', $photo->hits); // Show creator $creator = CFactory::getUser($photo->creator); $creatorHTML = JText::sprintf('COM_COMMUNITY_UPLOADED_BY', CRoute::_('index.php?option=com_community&view=profile&userid=' . $creator->id), $creator->getDisplayName()); $response->addAssign('uploadedBy', 'innerHTML', $creatorHTML); // Get the wall form $wallInput = $this->_getWallFormHTML($photoId); $response->addAssign('community-photo-walls', 'innerHTML', $wallInput); // Get the wall contents $wallContents = ''; $wallContents = $this->showWallContents($photoId); $response->addAssign('wallContent', 'innerHTML', $wallContents); $response->addScriptCall("joms.utils.textAreaWidth('#wall-message');"); //$photo =& JTable::getInstance( 'Photo' , 'CTable' ); //$photo->load( $photoId ); // When a photo is navigated, the sharing should also be updated. CFactory::load('libraries', 'bookmarks'); $bookmarks = new CBookmarks($photo->getPhotoLink(true)); // Get the reporting data CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); // Add tagging code /* $tagsHTML = ''; if($config->get('tags_photos')){ CFactory::load('libraries', 'tags'); $tags = new CTags(); // @todo: permission checking might be wrong here $tagsHTML = $tags->getHTML('photos', $photoId, $photo->creator == $my->id || COwnerHelper::isCommunityAdmin()); }*/ $reportHTML = $report->getReportingHTML(JText::_('COM_COMMUNITY_REPORT_BAD_PHOTO'), 'photos,reportPhoto', array($photoId)); // $response->addAssign('tag-photo', 'innerHTML', $tagsHTML); $response->addScriptCall('joms.gallery.updatePhotoReport', $reportHTML); $response->addScriptCall('joms.gallery.updatePhotoBookmarks', $bookmarks->getHTML()); $response->addScriptCall('joms.jQuery("body").focus();'); $response->addScriptCall('joms.gallery.bindFocus();'); // Get the likes / dislikes item CFactory::load('libraries', 'like'); $like = new CLike(); $likeHTML = $like->getHTML('photo', $photoId, $my->id); $response->addScriptCall('__callback', $likeHTML); return $response->sendResponse(); }
public function modProfileUserinfo() { jimport('joomla.utilities.arrayhelper'); $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $my = CFactory::getUser(); $userid = $jinput->get('userid', $my->id, 'INT'); $user = CFactory::getUser($userid); $params = $user->getParams(); $userModel = CFactory::getModel('user'); $profileModel = CFactory::getModel('profile'); //Reassign needed variable $data = new stdClass(); $data->user = $user; $data->profile = $profileModel->getViewableProfile($userid, $user->getProfileType()); $data->videoid = $params->get('profileVideo', 0); CFactory::load('libraries', 'messaging'); $isMine = COwnerHelper::isMine($my->id, $user->id); // Get the admin controls HTML data $adminControlHTML = ''; $tmpl = new CTemplate(); // get how many unread message $filter = array(); $inboxModel = CFactory::getModel('inbox'); $filter['user_id'] = $my->id; $unread = $inboxModel->countUnRead($filter); // get how many pending connection $friendModel = CFactory::getModel('friends'); $pending = $friendModel->countPending($my->id); $profile = JArrayHelper::toObject($data->profile); $profile->largeAvatar = $user->getAvatar(); $profile->defaultAvatar = $user->isDefaultAvatar(); $profile->status = $user->getStatus(); $profile->defaultCover = $user->isDefaultCover(); $profile->cover = $user->getCover(); $profile->coverPostion = $params->get('coverPosition', ''); if (strpos($profile->coverPostion, '%') === false) { $profile->coverPostion = 0; } $groupmodel = CFactory::getModel('groups'); $profile->_groups = $groupmodel->getGroupsCount($profile->id); $eventmodel = CFactory::getModel('events'); $profile->_events = $eventmodel->getEventsCount($profile->id); $profile->_friends = $user->_friendcount; $videoModel = CFactory::getModel('Videos'); $profile->_videos = $videoModel->getVideosCount($profile->id); $photosModel = CFactory::getModel('photos'); $profile->_photos = $photosModel->getPhotosCount($profile->id); if ($profile->status !== '') { $postedOn = new JDate($user->_posted_on); $postedOn = CActivityStream::_createdLapse($postedOn); $profile->posted_on = $user->_posted_on == '0000-00-00 00:00:00' ? '' : $postedOn; } else { $profile->posted_on = ''; } /* is featured */ $modelFeatured = CFactory::getModel('Featured'); $profile->featured = $modelFeatured->isExists(FEATURED_USERS, $profile->id); // Assign videoId $profile->profilevideo = $data->videoid; $video = JTable::getInstance('Video', 'CTable'); $video->load($profile->profilevideo); $profile->profilevideoTitle = $video->getTitle(); $addbuddy = "joms.api.friendAdd('{$profile->id}')"; $sendMsg = CMessaging::getPopup($profile->id); $config = CFactory::getConfig(); $jConfig = JFactory::getConfig(); $lastLogin = JText::_('COM_COMMUNITY_PROFILE_NEVER_LOGGED_IN'); if ($user->lastvisitDate != '0000-00-00 00:00:00') { $userLastLogin = new JDate($user->lastvisitDate); $lastLogin = CActivityStream::_createdLapse($userLastLogin); } // @todo : beside checking the owner, maybe we want to check for a cookie, // say every few hours only the hit get increment by 1. if (!$isMine) { $user->viewHit(); } // @rule: myblog integrations $showBlogLink = false; $myblog = CMyBlog::getInstance(); if ($config->get('enablemyblogicon') && $myblog) { if ($myblog->userCanPost($user->id)) { $showBlogLink = true; } $tmpl->set('blogItemId', $myblog->getItemId()); } $photoEnabled = $config->get('enablephotos') ? true : false; $eventEnabled = $config->get('enableevents') ? true : false; $groupEnabled = $config->get('enablegroups') ? true : false; $videoEnabled = $config->get('enablevideos') ? true : false; $isSEFEnabled = $jConfig->get('sef') ? true : false; $multiprofile = JTable::getInstance('MultiProfile', 'CTable'); $multiprofile->load($user->getProfileType()); CFactory::load('libraries', 'like'); $like = new Clike(); $isLikeEnabled = $like->enabled('profile') && $params->get('profileLikes', 1) ? 1 : 0; $isUserLiked = $like->userLiked('profile', $user->id, $my->id); /* likes count */ $likes = $like->getLikeCount('profile', $user->id); /* User status */ $status = new CUserStatus($user->id, 'profile'); //respect wall setting if ($my->id && (!$config->get('lockprofilewalls') || $config->get('lockprofilewalls') && CFriendsHelper::isConnected($my->id, $profile->id)) || COwnerHelper::isCommunityAdmin()) { // Add default status box CUserHelper::addDefaultStatusCreator($status); } //$isblocked = $user->isBlocked(); $isMine = COwnerHelper::isMine($my->id, $user->id); $isCommunityAdmin = COwnerHelper::isCommunityAdmin($user->id); // Check if user is blocked $getBlockStatus = new blockUser(); $isblocked = $getBlockStatus->isUserBlocked($user->id, 'profile'); // Get block user html //$blockUserHTML = $isMine || $isCommunityAdmin ? '' : CUserHelper::getBlockUserHTML($user->id, $isBlocked); $isMine = COwnerHelper::isMine($my->id, $user->id); $isCommunityAdmin = COwnerHelper::isCommunityAdmin($user->id); // Get reporting html $report = new CReportingLibrary(); $reportsHTML = $isMine ? '' : $report->getReportingHTML(JText::_('COM_COMMUNITY_REPORT_USER'), 'profile,reportProfile', array($user->id)); $tmpl = new CTemplate(); echo $tmpl->set('karmaImgUrl', CUserPoints::getPointsImage($user))->set('reportsHTML', $reportsHTML)->set('isMine', $isMine)->set('lastLogin', $lastLogin)->set('addBuddy', $addbuddy)->set('sendMsg', $sendMsg)->set('config', $config)->set('multiprofile', $multiprofile)->set('showBlogLink', $showBlogLink)->set('isFriend', CFriendsHelper::isConnected($user->id, $my->id) && $user->id != $my->id)->set('isWaitingApproval', CFriendsHelper::isWaitingApproval($my->id, $user->id))->set('isWaitingResponse', CFriendsHelper::isWaitingApproval($user->id, $my->id))->set('isBlocked', $isblocked)->set('profile', $profile)->set('unread', $unread)->set('pending', $pending)->set('registerDate', $user->registerDate)->set('adminControlHTML', $adminControlHTML)->set('userstatus', $status)->set('user', $user)->set('isUserLiked', $isUserLiked)->set('likes', $likes)->set('isLikeEnabled', $isLikeEnabled)->set('photoEnabled', $photoEnabled)->set('eventEnabled', $eventEnabled)->set('groupEnabled', $groupEnabled)->set('videoEnabled', $videoEnabled)->set('about', $this->_getProfileHTML($data->profile))->set('isSEFEnabled', $isSEFEnabled)->set('blocked', $user->isBlocked())->fetch('profile/focus'); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. **/ public function reportGroup($link, $message, $groupId) { CFactory::load('libraries', 'reporting'); $config =& CFactory::getConfig(); $my = CFactory::getUser(); $report = new CReportingLibrary(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } $report->createReport(JText::_('Bad group'), $link, $message); $action = new stdClass(); $action->label = 'Unpublish group'; $action->method = 'groups,unpublishGroup'; $action->parameters = $groupId; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('CC REPORT SUBMITTED'); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. **/ public function reportGroup($link, $message, $groupId) { CFactory::load('libraries', 'reporting'); $config =& CFactory::getConfig(); $my = CFactory::getUser(); $report = new CReportingLibrary(); if (!$my->authorise('community.view', 'groups.report')) { return ''; } $report->createReport(JText::_('Bad group'), $link, $message); $action = new stdClass(); $action->label = 'Unpublish group'; $action->method = 'groups,unpublishGroup'; $action->parameters = $groupId; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }
public function reportActivities($link, $message, $id) { $report = new CReportingLibrary(); $config = CFactory::getConfig(); $my = CFactory::getUser(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } if (strpos($link, 'actid') === false) { $link = $link . '&actid=' . $id; } if (strpos($link, '&actid') && !strpos($link, '?')) { $link = str_replace('&actid', '?actid', $link); } $report->createReport(JText::_('COM_COMMUNITY_REPORT_ACTIVITY_CONTAIN'), $link, $message); $action = new stdClass(); $action->label = 'COM_COMMUNITY_ACTVITIES_REMOVE'; $action->method = 'activities,deleteStream'; $action->parameters = $id; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }
/** * Trigger any necessary items that needs to be changed when the photo * is changed. **/ public function ajaxSwitchPhotoTrigger($photoId) { $response = new JAXResponse(); // Load the default photo CFactory::load('models', 'photos'); $photo =& JTable::getInstance('Photo', 'CTable'); $photo->load($photoId); $my = CFactory::getUser(); // Since the only way for us to get the id is through the AJAX call, // we can only increment the hit when the ajax loads $photo->hit(); // Update the hits each time the photo is switched $response->addAssign('photo-hits', 'innerHTML', $photo->hits); // Show creator $creator = CFactory::getUser($photo->creator); $creatorHTML = JText::sprintf('CC UPLOADED BY', CRoute::_('index.php?option=com_community&view=profile&userid=' . $creator->id), $creator->getDisplayName()); $response->addAssign('uploadedBy', 'innerHTML', $creatorHTML); // Get the wall form $wallInput = $this->showWallForm($photoId); $response->addAssign('community-photo-walls', 'innerHTML', $wallInput); // Get the wall contents $wallContents = $this->showWallContents($photoId); $response->addAssign('wallContent', 'innerHTML', $wallContents); $response->addScriptCall("joms.utils.textAreaWidth('#wall-message');"); $photo =& JTable::getInstance('Photo', 'CTable'); $photo->load($photoId); // When a photo is navigated, the sharing should also be updated. CFactory::load('libraries', 'bookmarks'); $bookmarks = new CBookmarks($photo->getPhotoLink(true)); // Get the reporting data CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $reportHTML = $report->getReportingHTML(JText::_('CC REPORT BAD PHOTO'), 'photos,reportPhoto', array($photoId)); $response->addScriptCall('joms.gallery.updatePhotoReport', $reportHTML); $response->addScriptCall('joms.gallery.updatePhotoBookmarks', $bookmarks->getHTML()); $response->addScriptCall('joms.jQuery("body").focus();'); $response->addScriptCall('joms.gallery.bindFocus();'); // Get the likes / dislikes item CFactory::load('libraries', 'like'); $like = new CLike(); $likeHTML = $like->getHTML('photo', $photoId, $my->id); $response->addScriptCall('__callback', $likeHTML); return $response->sendResponse(); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. * */ public function reportPhoto($link, $message, $id) { $report = new CReportingLibrary(); $config = CFactory::getConfig(); $my = CFactory::getUser(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } // Pass the link and the reported message $report->createReport(JText::_('COM_COMMUNITY_BAD_PHOTO'), $link, $message); // Add the action that needs to be called. $action = new stdClass(); $action->label = 'COM_COMMUNITY_PHOTOS_UNPUBLISH'; $action->method = 'photos,unpublishPhoto'; $action->parameters = $id; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }
/** * Responsible for displaying the event page. **/ public 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'); CFactory::load('libraries', 'activities'); CFactory::load('libraries', 'events'); CWindow::load(); $eventLib = new CEvents(); $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::_('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->published) { echo JText::_('COM_COMMUNITY_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::_('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)); } $this->addPathway(JText::_('COM_COMMUNITY_EVENTS'), CRoute::_('index.php?option=com_community&view=events')); $this->addPathway($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); $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, 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 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::_('COM_COMMUNITY_EVENTS_REPORT'), '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::_('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 = 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); } // 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; // 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->toFormat('%Y-%m-%d') == $endDate->toFormat('%Y-%m-%d') && $startDate->toFormat('%H:%M:%S') == '00:00:00' && $endDate->toFormat('%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); CFactory::load('libraries', 'invitation'); $inviteHTML = CInvitation::getHTML(null, 'events,inviteUsers', $event->id, CInvitation::SHOW_FRIENDS, CInvitation::SHOW_EMAIL); CFactory::load('libraries', 'userstatus'); $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'); } } // Output to template echo $tmpl->setMetaTags('event', $event)->set('status', $status)->set('streamHTML', $streamHTML)->set('timezone', CTimeHelper::getTimezone($event->offset))->set('handler', $handler)->set('likesHTML', $likesHTML)->set('inviteHTML', $inviteHTML)->set('guestStatus', $event->getUserStatus($my->id))->set('event', $event)->set('radioList', $radioList)->set('bookmarksHTML', $bookmarksHTML)->set('reportHTML', $reportHTML)->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('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)->fetch('events.viewevent'); }