Exemple #1
1
 /**
  * Do a batch send
  */
 function send($total = 100)
 {
     $mailqModel = CFactory::getModel('mailq');
     $userModel = CFactory::getModel('user');
     $mails = $mailqModel->get($total);
     $jconfig = JFactory::getConfig();
     $mailer = JFactory::getMailer();
     $config = CFactory::getConfig();
     $senderEmail = $jconfig->getValue('mailfrom');
     $senderName = $jconfig->getValue('fromname');
     if (empty($mails)) {
         return;
     }
     CFactory::load('helpers', 'string');
     foreach ($mails as $row) {
         // @rule: only send emails that is valid.
         // @rule: make sure recipient is not blocked!
         $userid = $userModel->getUserFromEmail($row->recipient);
         $user = CFactory::getUser($userid);
         if (!$user->isBlocked() && !JString::stristr($row->recipient, 'foo.bar')) {
             $mailer->setSender(array($senderEmail, $senderName));
             $mailer->addRecipient($row->recipient);
             $mailer->setSubject($row->subject);
             $tmpl = new CTemplate();
             $raw = isset($row->params) ? $row->params : '';
             $params = new JParameter($row->params);
             $base = $config->get('htmlemail') ? 'email.html' : 'email.text';
             if ($config->get('htmlemail')) {
                 $row->body = JString::str_ireplace(array("\r\n", "\r", "\n"), '<br />', $row->body);
                 $mailer->IsHTML(true);
             } else {
                 //@rule: Some content might contain 'html' tags. Strip them out since this mail should never contain html tags.
                 $row->body = CStringHelper::escape(strip_tags($row->body));
             }
             $tmpl->set('content', $row->body);
             $tmpl->set('template', rtrim(JURI::root(), '/') . '/components/com_community/templates/' . $config->get('template'));
             $tmpl->set('sitename', $config->get('sitename'));
             $row->body = $tmpl->fetch($base);
             // Replace any occurences of custom variables within the braces scoe { }
             if (!empty($row->body)) {
                 preg_match_all("/{(.*?)}/", $row->body, $matches, PREG_SET_ORDER);
                 foreach ($matches as $val) {
                     $replaceWith = $params->get($val[1], null);
                     //if the replacement start with 'index.php', we can CRoute it
                     if (strpos($replaceWith, 'index.php') === 0) {
                         $replaceWith = CRoute::getExternalURL($replaceWith);
                     }
                     if (!is_null($replaceWith)) {
                         $row->body = JString::str_ireplace($val[0], $replaceWith, $row->body);
                     }
                 }
             }
             unset($tmpl);
             $mailer->setBody($row->body);
             $mailer->send();
         }
         $mailqModel->markSent($row->id);
         $mailer->ClearAllRecipients();
     }
 }
Exemple #2
0
 function export($event)
 {
     CFactory::load('helpers', 'event');
     $handler = CEventHelper::getHandler($event);
     if (!$handler->showExport()) {
         echo JText::_('CC ACCESS FORBIDDEN');
         return;
     }
     header('Content-type: text/Calendar');
     header('Content-Disposition: attachment; filename="calendar.ics"');
     $creator = CFactory::getUser($event->creator);
     $offset = $creator->getUtcOffset();
     $date = new JDate($event->startdate);
     $dtstart = $date->toFormat('%Y%m%dT%H%M%S');
     $date = new JDate($event->enddate);
     $dtend = $date->toFormat('%Y%m%dT%H%M%S');
     $url = $handler->getFormattedLink('index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id, false, true);
     $tmpl = new CTemplate();
     $tmpl->set('dtstart', $dtstart);
     $tmpl->set('dtend', $dtend);
     $tmpl->set('url', $url);
     $tmpl->set('event', $event);
     $raw = $tmpl->fetch('events.ical');
     unset($tmpl);
     echo $raw;
     exit;
 }
Exemple #3
0
 public function showGroupMiniHeader($groupId)
 {
     CMiniHeader::load();
     $option = JRequest::getVar('option', '', 'REQUEST');
     JFactory::getLanguage()->load('com_community');
     CFactory::load('models', 'groups');
     $group =& JTable::getInstance('Group', 'CTable');
     $group->load($groupId);
     $my = CFactory::getUser();
     // @rule: Test if the group is unpublished, don't display it at all.
     if (!$group->published) {
         return '';
     }
     if (!empty($group->id) && $group->id != 0) {
         $isMember = $group->isMember($my->id);
         $config = CFactory::getConfig();
         $tmpl = new CTemplate();
         $tmpl->set('my', $my);
         $tmpl->set('group', $group);
         $tmpl->set('isMember', $isMember);
         $tmpl->set('config', $config);
         $showMiniHeader = $option == 'com_community' ? $tmpl->fetch('groups.miniheader') : '<div id="community-wrap" style="min-height:50px;">' . $tmpl->fetch('groups.miniheader') . '</div>';
         return $showMiniHeader;
     }
 }
Exemple #4
0
 /**
  * Renders the provided elements into their respective HTML formats.
  *
  * @param	Array	formElements	An array of CFormElement objects.
  * @param	string	position		The position of the field 'before' will be loaded before the rest of the form and 'after' will be loaded after the rest of the form loaded.
  *
  * returns	string	html			Contents of generated CFormElements.
  **/
 public static function renderElements($formElements, $position)
 {
     $tmpl = new CTemplate();
     $tmpl->set('formElements', $formElements);
     $tmpl->set('position', $position);
     $html = $tmpl->fetch('form.elements');
     return trim($html);
 }
Exemple #5
0
 static function getActivityContentHTML($act)
 {
     // Ok, the activity could be an upload OR a wall comment. In the future, the content should
     // indicate which is which
     $html = '';
     $param = new JParameter($act->params);
     $action = $param->get('action', false);
     $photoid = $param->get('photoid', 0);
     CFactory::load('models', 'photos');
     $url = $param->get('url', false);
     CFactory::load('helpers', 'albums');
     if ($action == 'wall') {
         // unfortunately, wall post can also have 'photo' as its $act->apps. If the photo id is availble
         // for (newer activity stream, inside the param), we will show the photo snippet as well. Otherwise
         // just print out the wall content
         // Version 1.6 onwards, $params will contain photoid information
         // older version would have #photoid in the $title, since we link it to the photo
         $photoid = $param->get('photoid', false);
         if ($photoid) {
             $photo = JTable::getInstance('Photo', 'CTable');
             $photo->load($act->cid);
             $helper = new CAlbumsHelper($photo->albumid);
             if ($helper->showActivity()) {
                 $tmpl = new CTemplate();
                 $tmpl->set('url', $url);
                 $tmpl->set('photo', $photo);
                 $tmpl->set('param', $param);
                 $tmpl->set('act', $act);
                 return $tmpl->fetch('activity.photos.wall');
             }
         }
         return '';
     } elseif ($action == 'upload' && $photoid > 0) {
         $albumsHelper = new CAlbumsHelper($act->cid);
         if ($albumsHelper->isPublic()) {
             // If content has link to image, we could assume it is "upload photo" action
             // since old content add this automatically.
             // The $act->cid will be the album id, Retrive the recent photos uploaded
             // If $act->activities has data, that means this is an aggregated content
             // display some of them
             $photoModel = CFactory::getModel('photos');
             $album = JTable::getInstance('Album', 'CTable');
             $album->load($act->cid);
             if (empty($act->activities)) {
                 $acts[] = $act;
             } else {
                 $acts = $act->activities;
             }
             $tmpl = new CTemplate();
             $tmpl->set('album', $album);
             $tmpl->set('acts', $acts);
             return $tmpl->fetch('activity.photos.upload');
         }
     }
     return $html;
 }
Exemple #6
0
 static function getEventSummary($eventid, $param)
 {
     $model = CFactory::getModel('events');
     $event =& JTable::getInstance('Event', 'CTable');
     $event->load($eventid);
     $tmpl = new CTemplate();
     $tmpl->set('event', $event);
     $tmpl->set('param', $param);
     return $tmpl->fetch('activity.events.update');
 }
Exemple #7
0
 function invite()
 {
     CFactory::load('libraries', 'facebook');
     $facebook = new CFacebook();
     $config = CFactory::getConfig();
     $tmpl = new CTemplate();
     $tmpl->set('facebook', $facebook);
     $tmpl->set('config', $config);
     echo $tmpl->fetch('facebook.invite');
 }
Exemple #8
0
 public function showSwitcher()
 {
     $uri = JFactory::getURI();
     // Will see if there's a nicer solution to this
     $query = $uri->getQuery(true);
     unset($query['screen']);
     $query = $uri->buildQuery($query);
     $uri->setQuery($query);
     $uri = $uri->toString();
     // Build links
     $link = array('mobile' => $uri . '&screen=mobile', 'desktop' => $uri . '&screen=desktop');
     $tmpl = new CTemplate();
     $tmpl->set('link', $link);
     $tmpl->set('viewtype', JRequest::setVar('screen'));
     echo $tmpl->fetch('mobile.switcher');
 }
 static function getActivityContentHTML($act)
 {
     // Ok, the activity could be an upload OR a wall comment. In the future, the content should
     // indicate which is which
     $html = '';
     $param = new CParameter($act->params);
     $action = $param->get('action', false);
     $count = $param->get('count', false);
     $config = CFactory::getConfig();
     switch ($action) {
         case CAdminstreamsAction::TOP_USERS:
             $model = CFactory::getModel('user');
             $members = $model->getPopularMember($count);
             $html = '';
             //Get Template Page
             $tmpl = new CTemplate();
             $html = $tmpl->set('members', $members)->fetch('activity.members.popular');
             return $html;
             break;
         case CAdminstreamsAction::TOP_PHOTOS:
             $model = CFactory::getModel('photos');
             $photos = $model->getPopularPhotos($count, 0);
             $tmpl = new CTemplate();
             $html = $tmpl->set('photos', $photos)->fetch('activity.photos.popular');
             return $html;
             break;
         case CAdminstreamsAction::TOP_VIDEOS:
             $model = CFactory::getModel('videos');
             $videos = $model->getPopularVideos($count);
             $tmpl = new CTemplate();
             $html = $tmpl->set('videos', $videos)->fetch('activity.videos.popular');
             return $html;
             break;
     }
 }
Exemple #10
0
 function onActivityContentDisplay($args)
 {
     $model =& CFactory::getModel('Wall');
     $wall =& JTable::getInstance('Wall', 'CTable');
     $my = CFactory::getUser();
     if (empty($args->content)) {
         return '';
     }
     $wall->load($args->cid);
     CFactory::load('libraries', 'privacy');
     CFactory::load('libraries', 'comment');
     $comment = CComment::stripCommentData($wall->comment);
     $config = CFactory::getConfig();
     $commentcut = false;
     if (strlen($comment) > $config->getInt('streamcontentlength')) {
         $origcomment = $comment;
         $comment = JString::substr($comment, 0, $config->getInt('streamcontentlength')) . ' ...';
         $commentcut = true;
     }
     if (CPrivacy::isAccessAllowed($my->id, $args->target, 'user', 'privacyProfileView')) {
         CFactory::load('helpers', 'videos');
         CFactory::load('libraries', 'videos');
         CFactory::load('libraries', 'wall');
         $videoContent = '';
         $params = new CParameter($args->params);
         $videoLink = $params->get('videolink');
         $image = $params->get('url');
         // For older activities that does not have videoLink , we need to process it the old way.
         if (!$videoLink) {
             $html = CWallLibrary::_processWallContent($comment);
             $tmpl = new CTemplate();
             $html = CStringHelper::escape($html);
             if ($commentcut) {
                 //add read more/less link for content
                 $html .= '<br /><br /><a href="javascript:void(0)" onclick="jQuery(\'#shortcomment_' . $args->cid . '\').hide(); jQuery(\'#origcomment_' . $args->cid . '\').show();" >' . JText::_('COM_COMMUNITY_READ_MORE') . '</a>';
                 $html = '<div id="shortcomment_' . $args->cid . '">' . $html . '</div>';
                 $html .= '<div id="origcomment_' . $args->cid . '" style="display:none;">' . $origcomment . '<br /><br /><a href="javascript:void(0);" onclick="jQuery(\'#shortcomment_' . $args->cid . '\').show(); jQuery(\'#origcomment_' . $args->cid . '\').hide();" >' . JText::_('COM_COMMUNITY_READ_LESS') . '</a></div>';
             }
             $tmpl->set('comment', $html);
             $html = $tmpl->fetch('activity.wall.post');
         } else {
             $html = '<ul class ="cDetailList clrfix">';
             $html .= '<li>';
             $image = !$image ? rtrim(JURI::root(), '/') . '/components/com_community/assets/playvideo.gif' : $image;
             $videoLib = new CVideoLibrary();
             $provider = $videoLib->getProvider($videoLink);
             $html .= '<!-- avatar --><div class="avatarWrap"><a href="javascript:void(0);" onclick="joms.activities.showVideo(\'' . $args->id . '\');"><img width="64" src="' . $image . '" class="cAvatar"/></a></div><!-- avatar -->';
             $videoPlayer = $provider->getViewHTML($provider->getId(), '300', '300');
             $comment = CString::str_ireplace($videoLink, '', $comment);
             $html .= '<!-- details --><div class="detailWrap alpha">' . $comment . '</div><!-- details -->';
             if (!empty($videoPlayer)) {
                 $html .= '<div style="display: none;clear: both;padding-top: 5px;" class="video-object">' . $videoPlayer . '</div>';
             }
             $html .= '</li>';
             $html .= '</ul>';
         }
         return $html;
     }
 }
Exemple #11
0
 /**
  *
  * @param string $tag the tag to seach for
  * @return string HTML code of item listing
  */
 public function getItemsHTML($tag)
 {
     $items = $this->getItems($tag);
     $tmpl = new CTemplate();
     $tmpl->set('items', $items);
     $html = $tmpl->fetch('tag.list');
     return $html;
 }
Exemple #12
0
 public function ajaxInvite()
 {
     CFactory::load('libraries', 'facebook');
     $facebook = new CFacebook();
     $config = CFactory::getConfig();
     $tmpl = new CTemplate();
     echo $tmpl->set('facebook', $facebook)->set('config', $config)->set('sitename', $config->get('sitename'))->fetch('facebook.inviteframe');
 }
Exemple #13
0
 public static function getHTML($url, $sortItems = array(), $defaultSort = '', $filterItems = array(), $defaultFilter = '')
 {
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $cleanURL = $url;
     $uri = JFactory::getURI();
     $queries = $_REQUEST;
     $allow = array('option', 'view', 'browse', 'task');
     foreach ($queries as $key => $value) {
         if (!in_array($key, $allow)) {
             unset($queries[$key]);
         }
     }
     $selectedSort = $jinput->get->get('sort', $defaultSort, 'STRING');
     $selectedFilter = $jinput->get->get('filter', $defaultFilter, 'STRING');
     $tmpl = new CTemplate();
     $tmpl->set('queries', $queries);
     $tmpl->set('selectedSort', $selectedSort);
     $tmpl->set('selectedFilter', $selectedFilter);
     $tmpl->set('sortItems', $sortItems);
     $tmpl->set('uri', $uri);
     $tmpl->set('filterItems', $filterItems);
     $tmpl->set('jinput', $jinput);
     return $tmpl->fetch('filterbar.html');
 }
Exemple #14
0
 function getHTML()
 {
     $config = CFactory::getConfig();
     if ($config->get('enablesharethis')) {
         $tmpl = new CTemplate();
         $tmpl->set('uri', $this->currentURI);
         return $tmpl->fetch('bookmarks');
     } else {
         return '';
     }
 }
Exemple #15
0
 public function getHTML($url, $sortItems = array(), $defaultSort = '', $filterItems = array(), $defaultFilter = '')
 {
     $cleanURL = $url;
     $uri =& JFactory::getURI();
     $queries = JRequest::get('GET');
     // If there is Itemid in the querystring, we need to unset it so that CRoute
     // will generate it's correct Itemid
     if (isset($queries['Itemid'])) {
         unset($queries['Itemid']);
     }
     // Force link to start with first page
     if (isset($queries['limitstart'])) {
         unset($queries['limitstart']);
     }
     if (isset($queries['start'])) {
         unset($queries['start']);
     }
     $selectedSort = JRequest::getVar('sort', $defaultSort, 'GET');
     $selectedFilter = JRequest::getVar('filter', $defaultFilter, 'GET');
     $tmpl = new CTemplate();
     $tmpl->set('queries', $queries);
     $tmpl->set('selectedSort', $selectedSort);
     $tmpl->set('selectedFilter', $selectedFilter);
     $tmpl->set('sortItems', $sortItems);
     $tmpl->set('uri', $uri);
     $tmpl->set('filterItems', $filterItems);
     return $tmpl->fetch('filterbar.html');
 }
Exemple #16
0
 /**
  * Responsible to return necessary contents to the Invitation library
  * so that it can add the mails into the queue
  **/
 public function inviteUsers($cid, $users, $emails, $message)
 {
     CFactory::load('libraries', 'invitation');
     $group =& JTable::getInstance('Group', 'CTable');
     $group->load($cid);
     $content = '';
     $text = '';
     $title = JText::sprintf('COM_COMMUNITY_GROUPS_JOIN_INVITATION_MESSAGE', $group->name);
     $params = '';
     $my = CFactory::getUser();
     if (!$my->authorise('community.view', 'groups.invite.' . $cid, $group)) {
         return false;
     }
     $params = new CParameter('');
     $params->set('url', 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id);
     $params->set('groupname', $group->name);
     CFactory::load('helpers', 'owner');
     if ($users) {
         foreach ($users as $id) {
             $groupInvite =& JTable::getInstance('GroupInvite', 'CTable');
             $groupInvite->groupid = $group->id;
             $groupInvite->userid = $id;
             $groupInvite->creator = $my->id;
             $groupInvite->store();
         }
     }
     $htmlTemplate = new CTemplate();
     $htmlTemplate->set('groupname', $group->name);
     $htmlTemplate->set('url', CRoute::getExternalURL('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id));
     $htmlTemplate->set('message', $message);
     $html = $htmlTemplate->fetch('email.groups.invite.html');
     $textTemplate = new CTemplate();
     $textTemplate->set('groupname', $group->name);
     $textTemplate->set('url', CRoute::getExternalURL('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id));
     $textTemplate->set('message', $message);
     $text = $textTemplate->fetch('email.groups.invite.text');
     return new CInvitationMail($html, $text, $title, $params);
 }
Exemple #17
0
 public static function getHTML($nameAttribute, $selectedAccess = 0, $buttonType = COMMUNITY_PRIVACY_BUTTON_SMALL, $access = array(), $type = '')
 {
     $template = new CTemplate();
     $config = CFactory::getConfig();
     // Initialize default options to show
     if (empty($access)) {
         $access['public'] = true;
         $access['members'] = true;
         $access['friends'] = true;
         $access['self'] = true;
     }
     $classAttribute = $buttonType == COMMUNITY_PRIVACY_BUTTON_SMALL ? 'js_PriContainer' : 'js_PriContainer js_PriContainerLarge';
     return $template->set('classAttribute', $classAttribute)->set('access', $access)->set('nameAttribute', $nameAttribute)->set('selectedAccess', $selectedAccess)->set('type', $type)->fetch('privacy');
 }
Exemple #18
0
 /**
  * Responsible to return necessary contents to the Invitation library
  * so that it can add the mails into the queue
  **/
 public function inviteUsers($cid, $users, $emails, $message)
 {
     CFactory::load('libraries', 'invitation');
     $group =& JTable::getInstance('Group', 'CTable');
     $group->load($cid);
     $content = '';
     $text = '';
     $title = JText::sprintf('CC INVITED TO JOIN GROUP', $group->name);
     $params = '';
     $my = CFactory::getUser();
     if (!$group->isMember($my->id) && !COwnerHelper::isCommunityAdmin()) {
         return false;
     }
     $params = new JParameter('');
     $params->set('url', 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id);
     $params->set('groupname', $group->name);
     CFactory::load('helpers', 'owner');
     if ($users) {
         foreach ($users as $id) {
             $groupInvite =& JTable::getInstance('GroupInvite', 'CTable');
             $groupInvite->groupid = $group->id;
             $groupInvite->userid = $id;
             $groupInvite->creator = $my->id;
             $groupInvite->store();
         }
     }
     $htmlTemplate = new CTemplate();
     $htmlTemplate->set('groupname', $group->name);
     $htmlTemplate->set('message', $message);
     $html = $htmlTemplate->fetch('email.groups.invite.html');
     $textTemplate = new CTemplate();
     $textTemplate->set('groupname', $group->name);
     $textTemplate->set('message', $message);
     $text = $textTemplate->fetch('email.groups.invite.text');
     return new CInvitationMail($html, $text, $title, $params);
 }
Exemple #19
0
 public static function searchEventsAjax()
 {
     // Location.
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $location = $jinput->request->get('location', '', 'STRING');
     $module = JModuleHelper::getModule('mod_community_search_nearbyevents');
     $params = new JRegistry($module->params);
     $advance = array();
     $advance['radius'] = $params->get('event_nearby_radius');
     if ($params->get('eventradiusmeasure') == COMMUNITY_EVENT_UNIT_KM) {
         //find out if radius is in km or miles
         $advance['radius'] = $advance['radius'] * 0.621371192;
     }
     $advance['fromlocation'] = $location;
     $model = CFactory::getModel('events');
     $objs = $model->getEvents(null, null, null, null, null, null, null, $advance);
     $events = array();
     $tmpl = new CTemplate();
     if ($objs) {
         foreach ($objs as $row) {
             $event = JTable::getInstance('Event', 'CTable');
             $event->bind($row);
             $events[] = $event;
         }
         unset($objs);
     }
     // Get list of nearby events
     $tmpl->set('events', $events);
     $tmpl->set('radius', $params->get('event_nearby_radius'));
     $tmpl->set('measurement', $params->get('eventradiusmeasure'));
     $tmpl->set('location', $location);
     $html = $tmpl->fetch('events.nearbylist');
     $json = array('success' => true, 'html' => $html);
     die(json_encode($json));
 }
Exemple #20
0
 public function ajaxIphoneFriends()
 {
     $objResponse = new JAXResponse();
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $view =& $this->getView('friends', '', $viewType);
     $html = '';
     ob_start();
     $this->display();
     $content = ob_get_contents();
     ob_end_clean();
     $tmpl = new CTemplate();
     $tmpl->set('toolbar_active', 'friends');
     $simpleToolbar = $tmpl->fetch('toolbar.simple');
     $objResponse->addAssign('social-content', 'innerHTML', $simpleToolbar . $content);
     return $objResponse->sendResponse();
 }
Exemple #21
0
 public function getFileHTML($type = NULL, $id = NULL)
 {
     //CFactory::load( 'models' , 'files' );
     $model = CFactory::getModel('files');
     $data = $model->getFileList($type, $id);
     $my = CFactory::getUser();
     if (!empty($data)) {
         foreach ($data as $key => $_data) {
             $data[$key] = $this->convertToMb($_data);
             $data[$key]->deleteable = $this->checkDeleteable($type, $_data, $my);
             $data[$key]->user = CFactory::getUser($_data->creator);
         }
     }
     $permission = $my->authorise('community.add', 'files.' . $type, $id);
     $tmpl = new CTemplate();
     $tmpl->set('type', $type)->set('id', $id)->set('data', $data)->set('permission', $permission);
     return $tmpl->fetch('files.list');
 }
Exemple #22
0
 public function ajaxBrowse($data)
 {
     $mainframe =& JFactory::getApplication();
     $my = CFactory::getUser();
     // Get application's favicon
     $addedAppCount = 0;
     foreach ($data->applications as $appData) {
         if (JFile::exists(CPluginHelper::getPluginPath('community', $appData->name) . DS . $appData->name . DS . 'favicon_64.png')) {
             $appData->favicon['64'] = rtrim(JURI::root(), '/') . CPluginHelper::getPluginURI('community', $appData->name) . '/' . $appData->name . '/favicon_64.png';
         } else {
             $appData->favicon['64'] = rtrim(JURI::root(), '/') . '/components/com_community/assets/app_avatar.png';
         }
         // Get total added applications
         //$addedAppCount	= $appData->added == 1 ? $addedAppCount+1 : $addedAppCount;
     }
     $tmpl = new CTemplate();
     echo $tmpl->set('apps', $data->applications)->set('itemType', 'browse')->fetch('application.item');
 }
Exemple #23
0
 public function ajaxShowBookmarks($uri)
 {
     $filter = JFilterInput::getInstance();
     $uri = $filter->clean($uri, 'string');
     $config = CFactory::getConfig();
     $shareviaemail = $config->get('shareviaemail');
     //CFactory::load( 'libraries' , 'bookmarks' );
     $bookmarks = new CBookmarks($uri);
     //CFactory::load( 'libraries' , 'apps' );
     $appsLib = CAppPlugins::getInstance();
     $appsLib->loadApplications();
     // @onLoadBookmarks deprecated.
     // since 1.5
     $appsLib->triggerEvent('onLoadBookmarks', array($bookmarks));
     $tmpl = new CTemplate();
     $tmpl->set('config', $config)->set('bookmarks', $bookmarks->getBookmarks());
     $json = array('title' => JText::_('COM_COMMUNITY_SHARE_THIS'), 'html' => $tmpl->fetch('bookmarks.list'), 'btnShare' => JText::_('COM_COMMUNITY_SHARE_BUTTON'), 'btnCancel' => JText::_('COM_COMMUNITY_CANCEL_BUTTON'), 'viaEmail' => $shareviaemail ? true : false);
     die(json_encode($json));
 }
Exemple #24
0
 public function ajaxShowBookmarks($uri)
 {
     $filter = JFilterInput::getInstance();
     $uri = $filter->clean($uri, 'string');
     CFactory::load('libraries', 'bookmarks');
     $bookmarks = new CBookmarks($uri);
     CFactory::load('libraries', 'apps');
     $appsLib =& CAppPlugins::getInstance();
     $appsLib->loadApplications();
     // @onLoadBookmarks deprecated.
     // since 1.5
     $appsLib->triggerEvent('onLoadBookmarks', array($bookmarks));
     $response = new JAXResponse();
     $tmpl = new CTemplate();
     $tmpl->set('bookmarks', $bookmarks->getBookmarks());
     $html = $tmpl->fetch('bookmarks.list');
     $total = $bookmarks->getTotalBookmarks();
     $height = $total * 10;
     $actions = '<input type="button" class="button" onclick="joms.bookmarks.email(\'' . $uri . '\');" value="' . JText::_('COM_COMMUNITY_SHARE_BUTTON') . '"/>';
     $actions .= '<input type="button" class="button" onclick="cWindowHide();" value="' . JText::_('COM_COMMUNITY_CANCEL_BUTTON') . '"/>';
     $response->addAssign('cwin_logo', 'innerHTML', JText::_('COM_COMMUNITY_SHARE_THIS'));
     $response->addScriptCall('cWindowAddContent', $html, $actions);
     return $response->sendResponse();
 }
Exemple #25
0
 /**
  * Displays single photo view
  *
  * */
 public function photo()
 {
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $document = JFactory::getDocument();
     $albumId = $jinput->get('albumid', '', 'INT');
     $photoId = $jinput->get('photoid', '', 'INT');
     $userId = JRequest::getInt('userid', '');
     $user = CFactory::getUser($userId);
     $my = CFactory::getUser();
     echo $this->showSubmenu();
     $photo = JTable::getInstance('Photo', 'CTable');
     $photo->load($photoId);
     $album = JTable::getInstance('Album', 'CTable');
     $album->load($photo->albumid);
     CHeadHelper::addOpengraph('og:image', JUri::root() . $photo->image, true);
     $tmpl = new CTemplate();
     echo $tmpl->set('album', $album)->set('photo', $photo)->set('my', $my)->fetch('photos/single');
 }
Exemple #26
0
 /**
  * Display like/dislike for public
  * @return string
  */
 public function getHtmlPublic($element, $itemId)
 {
     $config = CFactory::getConfig();
     $likesModel =& CFactory::getModel('Like');
     $info = $likesModel->getInfo($element, $itemId);
     $likes = 0;
     $dislikes = 0;
     if ($info) {
         $like =& JTable::getInstance('Like', 'CTable');
         $like->load($info->id);
         $likesInArray = array();
         $dislikesInArray = array();
         if ($like) {
             $likesInArray = explode(',', $like->like);
             $dislikesInArray = explode(',', $like->dislike);
         }
         $likes = count($likesInArray) - 1;
         $dislikes = count($dislikesInArray) - 1;
     }
     $tmpl = new CTemplate();
     $tmpl->set('likes', $likes);
     $tmpl->set('dislikes', $dislikes);
     if ($config->get('show_like_public')) {
         return $tmpl->fetch('like.public');
     }
 }
Exemple #27
0
 /**
  * Return formatted comment given the wall item
  */
 public static function formatComment($wall)
 {
     $config = CFactory::getConfig();
     $my = CFactory::getUser();
     $actModel = CFactory::getModel('activities');
     $like = new CLike();
     $likeCount = $like->getLikeCount('comment', $wall->id);
     $isLiked = $like->userLiked('comment', $wall->id, $my->id);
     $user = CFactory::getUser($wall->post_by);
     // Censor if the user is banned
     if ($user->block) {
         $wall->comment = $origComment = JText::_('COM_COMMUNITY_CENSORED');
     } else {
         // strip out the comment data
         $CComment = new CComment();
         $wall->comment = $CComment->stripCommentData($wall->comment);
         // Need to perform basic formatting here
         // 1. support nl to br,
         // 2. auto-link text
         $CTemplate = new CTemplate();
         $wall->comment = $origComment = $CTemplate->escape($wall->comment);
         $wall->comment = CStringHelper::autoLink($wall->comment);
     }
     $commentsHTML = '';
     $commentsHTML .= '<div class="cComment wall-coc-item" id="wall-' . $wall->id . '"><a href="' . CUrlHelper::userLink($user->id) . '"><img src="' . $user->getThumbAvatar() . '" alt="" class="wall-coc-avatar" /></a>';
     $date = new JDate($wall->date);
     $commentsHTML .= '<a class="wall-coc-author" href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a> ';
     $commentsHTML .= $wall->comment;
     $commentsHTML .= '<span class="wall-coc-time">' . CTimeHelper::timeLapse($date);
     $cid = isset($wall->contentid) ? $wall->contentid : null;
     $activity = $actModel->getActivity($cid);
     $ownPost = $my->id == $wall->post_by;
     $allowRemove = $my->authorise('community.delete', 'walls', $wall);
     $canEdit = $config->get('wallediting') && $my->id == $wall->post_by || COwnerHelper::isCommunityAdmin();
     // only poster can edit
     if ($allowRemove) {
         $commentsHTML .= ' <span class="wall-coc-remove-link">&#x2022; <a href="#removeComment">' . JText::_('COM_COMMUNITY_WALL_REMOVE') . '</a></span>';
     }
     $commentsHTML .= '</span>';
     $commentsHTML .= '</div>';
     $editHTML = '';
     if ($config->get('wallediting') && $ownPost || COwnerHelper::isCommunityAdmin()) {
         $editHTML .= '<a href="javascript:" class="joms-button--edit">';
         $editHTML .= '<svg viewBox="0 0 16 16" class="joms-icon"><use xlink:href="' . CRoute::getURI() . '#joms-icon-pencil"></use></svg>';
         $editHTML .= '<span>' . JText::_('COM_COMMUNITY_EDIT') . '</span>';
         $editHTML .= '</a>';
     }
     $removeHTML = '';
     if ($allowRemove) {
         $removeHTML .= '<a href="javascript:" class="joms-button--remove">';
         $removeHTML .= '<svg viewBox="0 0 16 16" class="joms-icon"><use xlink:href="' . CRoute::getURI() . '#joms-icon-remove"></use></svg>';
         $removeHTML .= '<span>' . JText::_('COM_COMMUNITY_WALL_REMOVE') . '</span>';
         $removeHTML .= '</a>';
     }
     $removeTagHTML = '';
     if (CActivitiesHelper::hasTag($my->id, $wall->comment)) {
         $removeTagHTML = '<span><a data-action="remove-tag" data-id="' . $wall->id . '" href="javascript:">' . JText::_('COM_COMMUNITY_WALL_REMOVE_TAG') . '</a></span>';
     }
     /* user deleted */
     if ($user->guest == 1) {
         $userLink = '<span class="cStream-Author">' . $user->getDisplayName() . '</span> ';
     } else {
         $userLink = '<a class="cStream-Avatar cStream-Author cFloat-L" href="' . CUrlHelper::userLink($user->id) . '"> <img class="cAvatar" src="' . $user->getThumbAvatar() . '"> </a> ';
     }
     $params = $wall->params;
     $paramsHTML = '';
     $image = (array) $params->get('image');
     $photoThumbnail = false;
     if ($params->get('attached_photo_id') > 0) {
         $photo = JTable::getInstance('Photo', 'CTable');
         $photo->load($params->get('attached_photo_id'));
         $photoThumbnail = $photo->getThumbURI();
         $paramsHTML .= '<div style="padding: 5px 0"><img class="joms-stream-thumb" src="' . $photoThumbnail . '" /></div>';
     } else {
         if ($params->get('title')) {
             $video = self::detectVideo($params->get('url'));
             if (is_object($video)) {
                 $paramsHTML .= '<div class="joms-media--video joms-js--video"';
                 $paramsHTML .= ' data-type="' . $video->type . '"';
                 $paramsHTML .= ' data-id="' . $video->id . '"';
                 $paramsHTML .= ' data-path="' . ($video->type === 'file' ? JURI::root(true) . '/' : '') . $video->path . '"';
                 $paramsHTML .= ' style="margin-top:10px;">';
                 $paramsHTML .= '<div class="joms-media__thumbnail">';
                 $paramsHTML .= '<img src="' . $video->getThumbnail() . '">';
                 $paramsHTML .= '<a href="javascript:" class="mejs-overlay mejs-layer mejs-overlay-play joms-js--video-play joms-js--video-play-' . $wall->id . '">';
                 $paramsHTML .= '<div class="mejs-overlay-button"></div>';
                 $paramsHTML .= '</a>';
                 $paramsHTML .= '</div>';
                 $paramsHTML .= '<div class="joms-media__body">';
                 $paramsHTML .= '<h4 class="joms-media__title">' . JHTML::_('string.truncate', $video->title, 50, true, false) . '</h4>';
                 $paramsHTML .= '<p class="joms-media__desc">' . JHTML::_('string.truncate', $video->description, $config->getInt('streamcontentlength'), true, false) . '</p>';
                 $paramsHTML .= '</div>';
                 $paramsHTML .= '</div>';
             } else {
                 $paramsHTML .= '<div class="joms-gap"></div>';
                 $paramsHTML .= '<div class="joms-media--album joms-relative joms-js--comment-preview">';
                 if ($user->id == $my->id || COwnerHelper::isCommunityAdmin()) {
                     $paramsHTML .= '<span class="joms-media__remove" data-action="remove-preview" onClick="joms.api.commentRemovePreview(\'' . $wall->id . '\');"><svg viewBox="0 0 16 16" class="joms-icon"><use xlink:href="#joms-icon-remove"></use></svg></span>';
                 }
                 if ($params->get('image')) {
                     $paramsHTML .= $params->get('link');
                     $paramsHTML .= '<div class="joms-media__thumbnail">';
                     $paramsHTML .= '<a href="' . $params->get('link') ? $params->get('link') : '#' . '">';
                     $paramsHTML .= '<img src="' . array_shift($image) . '" />';
                     $paramsHTML .= '</a>';
                     $paramsHTML .= '</div>';
                 }
                 $url = $params->get('url') ? $params->get('url') : '#';
                 $paramsHTML .= '<div class="joms-media__body">';
                 $paramsHTML .= '<a href="' . $url . '">';
                 $paramsHTML .= '<h4 class="joms-media__title">' . $params->get('title') . '</h4>';
                 $paramsHTML .= '<p class="joms-media__desc reset-gap">' . CStringHelper::trim_words($params->get('description')) . '</p>';
                 if ($params->get('link')) {
                     $paramsHTML .= '<span class="joms-text--light"><small>' . preg_replace('#^https?://#', '', $params->get('link')) . '</small></span>';
                 }
                 $paramsHTML .= '</a></div></div>';
             }
         }
     }
     if (!$params->get('title') && $params->get('url')) {
         $paramsHTML .= '<div class="joms-gap"></div>';
         $paramsHTML .= '<div class="joms-media--album">';
         $paramsHTML .= '<a href="' . $params->get('url') . '">';
         $paramsHTML .= '<img class="joms-stream-thumb" src="' . $params->get('url') . '" />';
         $paramsHTML .= '</a>';
         $paramsHTML .= '</div>';
     }
     $wall->comment = nl2br($wall->comment);
     $wall->comment = CUserHelper::replaceAliasURL($wall->comment);
     $wall->comment = CStringHelper::getEmoticon($wall->comment);
     $wall->comment = CStringHelper::converttagtolink($wall->comment);
     // convert to hashtag
     $template = new CTemplate();
     $template->set('wall', $wall)->set('originalComment', $origComment)->set('date', $date)->set('isLiked', $isLiked)->set('likeCount', $likeCount)->set('canRemove', $allowRemove)->set('canEdit', $canEdit)->set('canRemove', $allowRemove)->set('user', $user)->set('photoThumbnail', $photoThumbnail)->set('paramsHTML', $paramsHTML);
     $commentsHTML = $template->fetch('stream/single-comment');
     return $commentsHTML;
 }
Exemple #28
0
 /**
  * @todo: check permission and message ownership
  */
 public function ajaxCompose($id)
 {
     $filter = JFilterInput::getInstance();
     $id = $filter->clean($id, 'int');
     if (!COwnerHelper::isRegisteredUser()) {
         return $this->ajaxBlockUnregister();
     }
     $objResponse = new JAXResponse();
     $config = CFactory::getConfig();
     $user = CFactory::getUser($id);
     $my = CFactory::getUser();
     if ($my->id == 0) {
         return $this->ajaxBlockUnregister();
     }
     //CFactory::load( 'helpers' , 'owner' );
     //CFactory::load( 'libraries' , 'block' );
     $getBlockStatus = new blockUser();
     // Block banned users
     if ($getBlockStatus->isUserBlocked($id, 'inbox') && !COwnerHelper::isCommunityAdmin()) {
         $this->ajaxblock();
     }
     $inboxModel = $this->getModel('inbox');
     $lastSent = $inboxModel->getLastSentTime($my->id);
     $dateNow = new JDate();
     // We need to make sure that this guy are not spamming other people inbox
     // by checking against his last message time. Make sure it doesn't exceed
     // pmFloodLimit config (in seconds).
     if ($dateNow->toUnix() - $lastSent->toUnix() < $config->get('floodLimit') && !COwnerHelper::isCommunityAdmin()) {
         $json = array();
         $json['title'] = JText::_('COM_COMMUNITY_NOTICE');
         $json['error'] = JText::sprintf('COM_COMMUNITY_PLEASE_WAIT_BEFORE_SENDING_MESSAGE', $config->get('floodLimit'));
         die(json_encode($json));
     }
     // Check if user exceeded daily limit.
     $maxSent = $config->get('pmperday');
     $totalSent = $inboxModel->getTotalMessageSent($my->id);
     if ($totalSent >= $maxSent && $maxSent != 0) {
         $json = array();
         $json['title'] = JText::_('COM_COMMUNITY_NOTICE');
         $json['error'] = JText::_('COM_COMMUNITY_PM_LIMIT_REACHED');
         die(json_encode($json));
     }
     //====================================
     $tmpl = new CTemplate();
     $tmpl->set('user', $user);
     $json = array('title' => JText::_('COM_COMMUNITY_INBOX_TITLE_WRITE'), 'html' => $tmpl->fetch('inbox.ajaxcompose'), 'btnSend' => JText::_('COM_COMMUNITY_SEND_BUTTON'), 'btnCancel' => JText::_('COM_COMMUNITY_CANCEL_BUTTON'));
     die(json_encode($json));
 }
Exemple #29
0
 public function addSubmenus($view)
 {
     $config = CFactory::getConfig();
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $task = $jinput->get->get('task', '');
     //JRequest::getVar( 'task' , '' , 'GET' );
     $backLink = array('invitefriends', 'viewguest', 'uploadavatar', 'edit', 'sendmail', 'app');
     $categoryId = JRequest::getInt('categoryid', 0);
     if (in_array($task, $backLink)) {
         $eventid = $jinput->get->get('eventid', '', 'INT');
         //JRequest::getVar( 'eventid' , '' , 'GET' );
         $view->addSubmenuItem('index.php?option=com_community&view=events&task=viewevent&eventid=' . $eventid, JText::_('COM_COMMUNITY_EVENTS_BACK_BUTTON'));
     } else {
         $view->addSubmenuItem('index.php?option=com_community&view=events&task=display', JText::_('COM_COMMUNITY_EVENTS_ALL'));
         if (COwnerHelper::isRegisteredUser()) {
             $view->addSubmenuItem('index.php?option=com_community&view=events&task=myevents&userid=' . $this->my->id, JText::_('COM_COMMUNITY_EVENTS_MINE'));
             $view->addSubmenuItem('index.php?option=com_community&view=events&task=myinvites&userid=' . $this->my->id, JText::_('COM_COMMUNITY_EVENTS_PENDING_INVITATIONS'));
         }
         // Even guest should be able to view old events
         $view->addSubmenuItem('index.php?option=com_community&view=events&task=pastevents', JText::_('COM_COMMUNITY_EVENTS_PAST_TITLE'));
         $my = CFactory::getUser();
         if (COwnerHelper::isRegisteredUser() && $config->get('createevents') && $my->canCreateEvents() || COwnerHelper::isCommunityAdmin()) {
             //$view->addSubmenuItem('index.php?option=com_community&view=events&task=create', JText::_('COM_COMMUNITY_EVENTS_CREATE') , '' , SUBMENU_RIGHT );
             if ($config->get('event_import_ical')) {
                 $view->addSubmenuItem('index.php?option=com_community&view=events&task=import', JText::_('COM_COMMUNITY_EVENTS_IMPORT'), '', SUBMENU_RIGHT);
             }
         }
         if (!$config->get('enableguestsearchevents') && COwnerHelper::isRegisteredUser() || $config->get('enableguestsearchevents')) {
             $tmpl = new CTemplate();
             $tmpl->set('url', CRoute::_('index.php?option=com_community&view=events&task=search'));
             $html = $tmpl->fetch('events.search.submenu');
             //$view->addSubmenuItem('index.php?option=com_community&view=events&task=search', JText::_('COM_COMMUNITY_EVENTS_SEARCH'), 'joms.events.toggleSearchSubmenu(this)', false, $html);
         }
     }
 }
Exemple #30
0
 public function advanceSearch()
 {
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $document = JFactory::getDocument();
     //load calendar behavior
     JHtml::_('behavior.calendar');
     JHtml::_('behavior.tooltip');
     /**
      * Opengraph
      */
     CHeadHelper::setType('website', JText::_('COM_COMMUNITY_TITLE_CUSTOM_SEARCH'));
     //$this->showSubMenu();
     $this->addPathway(JText::_('COM_COMMUNITY_TITLE_CUSTOM_SEARCH'));
     $profileType = $jinput->get('profiletype', 0, 'INT');
     $my = CFactory::getUser();
     $config = CFactory::getConfig();
     $result = null;
     $fields = CAdvanceSearch::getFields($profileType);
     $data = new stdClass();
     $post = JRequest::get('GET');
     $keyList = isset($post['key-list']) ? $post['key-list'] : '';
     $avatarOnly = $jinput->get('avatar', '', 'NONE');
     if (JString::strlen($keyList) > 0) {
         //formatting the assoc array
         $filter = array();
         $key = explode(',', $keyList);
         $joinOperator = isset($post['operator']) ? $post['operator'] : '';
         foreach ($key as $idx) {
             $obj = new stdClass();
             $obj->field = $post['field' . $idx];
             $obj->condition = $post['condition' . $idx];
             $obj->fieldType = $post['fieldType' . $idx];
             if ($obj->fieldType == 'email') {
                 $obj->condition = 'equal';
             }
             // we need to check whether the value contain start and end kind of values.
             // if yes, make them an array.
             if (isset($post['value' . $idx . '_2'])) {
                 if ($obj->fieldType == 'date') {
                     $startDate = empty($post['value' . $idx]) ? '01/01/1970' : $post['value' . $idx];
                     $endDate = empty($post['value' . $idx . '_2']) ? '01/01/1970' : $post['value' . $idx . '_2'];
                     // Joomla 1.5 uses "/"
                     // Joomla 1.6 uses "-"
                     $delimeter = '-';
                     if (strpos($startDate, '/')) {
                         $delimeter = '/';
                     }
                     $sdate = explode($delimeter, $startDate);
                     $edate = explode($delimeter, $endDate);
                     if (isset($sdate[2]) && isset($edate[2])) {
                         $obj->value = array($sdate[0] . '-' . $sdate[1] . '-' . $sdate[2] . ' 00:00:00', $edate[0] . '-' . $edate[1] . '-' . $edate[2] . ' 23:59:59');
                     } else {
                         $obj->value = array(0, 0);
                     }
                 } else {
                     $obj->value = array($post['value' . $idx], $post['value' . $idx . '_2']);
                 }
             } else {
                 if ($obj->fieldType == 'date') {
                     $startDate = empty($post['value' . $idx]) ? '01/01/1970' : $post['value' . $idx];
                     $delimeter = '-';
                     if (strpos($startDate, '/')) {
                         $delimeter = '/';
                     }
                     $sdate = explode($delimeter, $startDate);
                     if (isset($sdate[2])) {
                         $obj->value = $sdate[2] . '-' . $sdate[1] . '-' . $sdate[0] . ' 00:00:00';
                     } else {
                         $obj->value = 0;
                     }
                 } else {
                     if ($obj->fieldType == 'checkbox') {
                         if (empty($post['value' . $idx])) {
                             //this mean user didnot check any of the option.
                             $obj->value = '';
                         } else {
                             $obj->value = isset($post['value' . $idx]) ? implode(',', $post['value' . $idx]) : '';
                         }
                     } else {
                         $obj->value = isset($post['value' . $idx]) ? $post['value' . $idx] : '';
                     }
                 }
             }
             $filter[] = $obj;
         }
         $data->search = CAdvanceSearch::getResult($filter, $joinOperator, $avatarOnly, '', $profileType);
         $data->filter = $post;
     }
     $rows = !empty($data->search) ? $data->search->result : array();
     $pagination = !empty($data->search) ? $data->search->pagination : '';
     $filter = !empty($data->filter) ? $data->filter : array();
     $resultRows = array();
     $friendsModel = CFactory::getModel('friends');
     for ($i = 0; $i < count($rows); $i++) {
         $row = $rows[$i];
         //filter the user profile type
         if ($profileType && $row->_profile_id != $profileType) {
             continue;
         }
         $obj = new stdClass();
         $obj->user = $row;
         $obj->friendsCount = $row->getFriendCount();
         $obj->profileLink = CRoute::_('index.php?option=com_community&view=profile&userid=' . $row->id);
         $isFriend = CFriendsHelper::isConnected($row->id, $my->id);
         $obj->addFriend = !$isFriend && $my->id != 0 && $my->id != $row->id ? true : false;
         $resultRows[] = $obj;
     }
     if (class_exists('Services_JSON')) {
         $json = new Services_JSON();
     } else {
         require_once AZRUL_SYSTEM_PATH . '/pc_includes/JSON.php';
         $json = new Services_JSON();
     }
     $tmpl = new CTemplate();
     $multiprofileArr = array();
     $hasMultiprofile = false;
     //let see if we have any multiprofile enabled
     if ($config->get('profile_multiprofile')) {
         $hasMultiprofile = true;
         //lets get the available profile
         $profileModel = CFactory::getModel('Profile');
         $profiles = $profileModel->getProfileTypes();
         if ($profiles) {
             $multiprofileArr[] = array('url' => CRoute::_('index.php?option=com_community&view=search&task=advancesearch'), 'name' => JText::_('COM_COMMUNITY_ALL_PROFILE'), 'selected' => !$profileType ? 1 : 0);
             foreach ($profiles as $profile) {
                 $multiprofileArr[] = array('url' => CRoute::_('index.php?option=com_community&view=search&task=advancesearch&profiletype=' . $profile->id), 'name' => $profile->name, 'selected' => $profile->id == $profileType ? 1 : 0);
             }
         }
     }
     $searchForm = $tmpl->set('fields', $fields)->set('hasMultiprofile', $hasMultiprofile)->set('multiprofileArr', $multiprofileArr)->set('keyList', $keyList)->set('profileType', $profileType)->set('avatarOnly', $avatarOnly)->set('filterJson', $json->encode($filter))->set('postresult', isset($post['key-list']))->set('submenu', $this->showSubmenu(false))->fetch('search.advancesearch');
     if (isset($post['key-list'])) {
         //result template
         $tmplResult = new CTemplate();
         $featured = new CFeatured(FEATURED_USERS);
         $featuredList = $featured->getItemIds();
         $tmpl->set('featuredList', $featuredList);
         $searchForm .= $tmplResult->set('my', $my)->set('showFeaturedList', false)->set('multiprofileArr', $multiprofileArr)->set('featuredList', $featuredList)->set('data', $resultRows)->set('isAdvanceSearch', true)->set('hasMultiprofile', $hasMultiprofile)->set('sortings', '')->set('pagination', $pagination)->set('filter', $filter)->set('featuredList', $featuredList)->set('isCommunityAdmin', COwnerHelper::isCommunityAdmin())->fetch('people.browse');
     }
     echo $searchForm;
 }