/**
  * Method to get the field input markup for a spacer.
  * The spacer does not have accept input.
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getInput()
 {
     $apiHelper = new mauticApiHelper();
     $settings = $apiHelper->getApiSettings();
     $url = Juri::root() . 'administrator/?plugin=mautic';
     $text = 'PLG_MAUTIC_AUTHORIZE_BTN';
     if (!empty($settings['accessToken'])) {
         $url .= '&reauthorize=true';
         $text = 'PLG_MAUTIC_REAUTHORIZE_BTN';
     } else {
         $url .= '&authorize=true';
     }
     if (!empty($settings['clientKey']) && !empty($settings['clientSecret'])) {
         // Note: style is added for Joomla 2.5
         $btn = Jhtml::link($url, JText::_($text), array('class' => 'btn btn-small btn-success', 'style' => 'float: left;'));
         if (!empty($settings['accessToken'])) {
             $resetUrl = Juri::root() . 'administrator/?plugin=mautic&reset=true';
             $btn .= ' <span style="float: left;  padding: 0 4px;">|</span> ';
             $btn .= Jhtml::link($resetUrl, JText::_('PLG_MAUTIC_RESET_BTN'), array('class' => 'btn btn-small btn-default pull-right', 'style' => 'float: left;'));
         }
         return $btn;
     } else {
         return JText::_('PLG_MAUTIC_SAVE_KEYS_FIRST');
     }
 }
Exemplo n.º 2
0
 /**
  * Get the necessary data for our stats report
  *
  * @return array
  */
 public function getData()
 {
     $data = array();
     $db = JFactory::getDbo();
     $data['php'] = phpversion();
     $data['mysql'] = $db->getVersion() . ' ' . $db->name;
     $data['domain'] = Juri::root();
     $data['joomla'] = JVERSION;
     $data['os'] = php_uname();
     $data['server'] = $_SERVER['SERVER_SOFTWARE'] . ' ' . (function_exists('php_sapi_name') ? php_sapi_name() : '');
     $data['language'] = implode(',', array_keys(JLanguage::getKnownLanguages(JPATH_BASE)));
     $data['timezone'] = JFactory::getConfig()->get('offset');
     $data['extension'] = $this->extension;
     $data['version'] = CompojoomComponentHelper::getManifest($this->extension)->get('version');
     $data['config'] = $this->getConfig();
     $customData = $this->getCustomExtensionData();
     if ($customData) {
         $data = array_merge($data, $customData);
     }
     return $data;
 }
Exemplo n.º 3
0
    protected function getInput()
    {
        $template = basename(dirname(dirname(dirname(__FILE__))));
        $directory = basename($this->element['directory']);
        $viewonclick = "if (document.getElementById('" . $this->id . "').value) { SqueezeBox.open('" . Juri::root() . 'templates/' . $template . '/images/' . $directory . "/'+document.getElementById('" . $this->id . "').value); };";
        $clearonclick = "document.getElementById('" . $this->id . "').value='';";
        $html = '<div class="input-prepend input-append">
			<a class="btn" title="View image" href="javascript:void(0);" onclick="' . $viewonclick . '" >
				<i class="icon-eye"> </i>
			</a>
			<input type="text" class="input-small" name="' . $this->name . '" id="' . $this->id . '" value="' . $this->value . '" />
			&nbsp;
			<a class="modal btn" title="Select an image"
				 href="index.php?option=com_jxtc&view=files&tmpl=component&fld=' . $this->id . '&id=' . JRequest::getInt('id') . '&f=' . $directory . '" 
				 rel="{handler: \'iframe\', size: {x: 755, y: 495}}">' . JText::_('JSELECT') . '
		  </a>';
        if (!$this->element['hide_none']) {
            $html .= '<a class="btn btn-danger" title="' . JText::_('JLIB_FORM_BUTTON_CLEAR') . '" href="javascript:void(0);" onclick="' . $clearonclick . '">
				<i class="icon-remove icon-white"></i>
			</a>';
        }
        $html .= '</div>';
        return $html;
    }
Exemplo n.º 4
0
 /**
  * The default method that will display the output of this view which is called by
  * Joomla
  *
  * @param	string template	Template file name
  **/
 public function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $model = $this->getModel('Activities');
     $activities = $model->getActivities();
     foreach ($activities as $key => $activity) {
         $param = new CParameter($activity->params);
         switch ($activity->app) {
             case 'users.featured':
                 $user = CFactory::getUser($param->get('userid'));
                 $activities[$key]->title = JText::sprintf('COM_COMMUNITY_MEMBER_IS_FEATURED', '<a href="' . CRoute::_(JUri::root() . $param->get('owner_url')) . '" class="cStream-Author">' . $user->getDisplayName() . '</a>');
                 break;
             case 'events.wall':
             case 'groups.wall':
             case 'profile':
                 $user = CFactory::getUser($activity->actor);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ';
                 if ($activity->eventid) {
                     $event = JTable::getInstance('Event', 'cTable');
                     $event->load($activity->eventid);
                     $html .= '➜ <a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id . '">' . $event->title . '</a>';
                 } elseif ($activity->groupid) {
                     $group = JTable::getInstance('Group', 'cTable');
                     $group->load($activity->groupid);
                     $html .= '➜ <a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id . '">' . $group->name . '</a>';
                 } elseif (!empty($activity->target) && $activity->target != $activity->actor) {
                     $target = CFactory::getUser($activity->target);
                     $html .= '➜ <a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $target->id . '">' . $target->getDisplayName() . '</a> ';
                     $html .= CActivities::format($activity->title);
                 } else {
                     $html .= ' posted: "' . CActivities::format($activity->title) . '"';
                 }
                 $activities[$key]->title = $html;
                 break;
             case 'groups.avatar.upload':
                 $user = CFactory::getUser($activity->actor);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ';
                 $html .= JText::_('COM_COMMUNITY_ACTIVITIES_NEW_GROUP_AVATAR');
                 $activities[$key]->title = $html;
                 break;
             case 'profile.avatar.upload':
                 $user = CFactory::getUser($activity->actor);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ';
                 $html .= JText::_('COM_COMMUNITY_ACTIVITIES_NEW_AVATAR');
                 $activities[$key]->title = $html;
                 break;
             case 'albums.comment':
             case 'albums':
                 $album = JTable::getInstance('Album', 'CTable');
                 $album->load($activity->cid);
                 $user = CFactory::getUser($activity->actor);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ';
                 $html .= JText::sprintf('COM_COMMUNITY_ACTIVITIES_WALL_POST_ALBUM', CRoute::_($album->getURI()), $this->escape($album->name));
                 $activities[$key]->title = $html;
                 break;
             case 'profile.like':
             case 'groups.like':
             case 'events.like':
             case 'photo.like':
             case 'videos.like':
             case 'album.like':
                 $actors = $param->get('actors');
                 $user = CFactory::getUser($activity->actor);
                 $users = explode(',', $actors);
                 $userCount = count($users);
                 switch ($activity->app) {
                     case 'profile.like':
                         $cid = CFactory::getUser($activity->cid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $cid->id;
                         $name = $cid->getDisplayName();
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_PROFILE';
                         break;
                     case 'groups.like':
                         $cid = JTable::getInstance('Group', 'CTable');
                         $cid->load($activity->groupid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $cid->id;
                         $name = $cid->name;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_GROUP';
                         break;
                     case 'events.like':
                         $cid = JTable::getInstance('Event', 'CTable');
                         $cid->load($activity->eventid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $cid->id;
                         $name = $cid->title;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_EVENT';
                         break;
                     case 'photo.like':
                         $cid = JTable::getInstance('Photo', 'CTable');
                         $cid->load($activity->cid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=photos&task=photo&albumid=' . $cid->albumid . '&userid=' . $cid->creator . '&photoid=' . $cid->id;
                         $name = $cid->caption;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_PHOTO';
                         break;
                     case 'videos.like':
                         $cid = JTable::getInstance('Video', 'CTable');
                         $cid->load($activity->cid);
                         $urlLink = JURI::root() . 'index.php?option=com_community&view=videos&task=video&userid=' . $cid->creator . '&videoid=' . $cid->id;
                         $name = $cid->getTitle();
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_VIDEO';
                         break;
                     case 'album.like':
                         $cid = JTable::getInstance('Album', 'CTable');
                         $cid->load($activity->cid);
                         $urlLink = Juri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $cid->id . '&userid=' . $cid->creator;
                         $name = $cid->name;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_ALBUM';
                         break;
                 }
                 $slice = 2;
                 if ($userCount > 2) {
                     $slice = 1;
                 }
                 $users = array_slice($users, 0, $slice);
                 $actorsHTML = array();
                 foreach ($users as $actor) {
                     $user = CFactory::getUser($actor);
                     $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                 }
                 $others = '';
                 if ($userCount > 2) {
                     $others = JText::sprintf('COM_COMMUNITY_STREAM_OTHERS_JOIN_GROUP', $userCount - 1);
                 }
                 $jtext = $userCount > 1 ? 'COM_COMMUNITY_STREAM_LIKES_PLURAL' : 'COM_COMMUNITY_STREAM_LIKES_SINGULAR';
                 $activities[$key]->title = implode(' ' . JText::_('COM_COMMUNITY_AND') . ' ', $actorsHTML) . $others . JText::sprintf($jtext, $urlLink, $name, JText::_($element));
                 break;
             case 'cover.upload':
                 $user = CFactory::getUser($activity->actor);
                 $type = $param->get('type');
                 $extraMessage = '';
                 if (strtolower($type) !== 'profile') {
                     $id = strtolower($type . 'id');
                     $cTable = JTable::getInstance(ucfirst($type), 'CTable');
                     $cTable->load($activity->{$id});
                     if ($type == 'group') {
                         $extraMessage = ', <a target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $cTable->id . '">' . $cTable->name . '</a>';
                     }
                     if ($type == 'event') {
                         $extraMessage = ', <a target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $cTable->id . '">' . $cTable->title . '</a>';
                     }
                 }
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ';
                 if ($type == 'profile') {
                     $html .= JText::_('COM_COMMUNITY_PHOTOS_COVER_UPLOAD_PROFILE');
                 } else {
                     $html .= JText::sprintf('COM_COMMUNITY_PHOTOS_COVER_UPLOAD', strtolower(Jtext::_('COM_COMMUNITY_COVER_' . strtoupper($type)))) . $extraMessage;
                 }
                 $activities[$key]->title = $html;
                 break;
             case 'events.attend':
             case 'events':
                 $user = CFactory::getUser($activity->actor);
                 $action = $param->get('action');
                 $event = JTable::getInstance('Event', 'CTable');
                 $event->load($activity->eventid);
                 switch ($action) {
                     case 'events.create':
                         $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> -';
                         $html .= JText::sprintf('COM_COMMUNITY_EVENTS_ACTIVITIES_NEW_EVENT', JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id, $event->title);
                         $activities[$key]->title = $html;
                         break;
                     case 'events.attendence.attend':
                         $users = explode(',', $param->get('actors'));
                         $actorsHTML = array();
                         foreach ($users as $actor) {
                             if (!$actor) {
                                 $actor = $activity->actor;
                             }
                             $user = CFactory::getUser($actor);
                             $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                         }
                         $activities[$key]->title = implode(', ', $actorsHTML) . ' - ' . JText::sprintf('COM_COMMUNITY_ACTIVITIES_EVENT_ATTEND', JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id, $event->title);
                         break;
                 }
                 break;
             case 'friends.connect':
                 $user1 = CFactory::getUser($activity->actor);
                 $user2 = CFactory::getUser($activity->target);
                 $html = JText::sprintf('COM_COMMUNITY_STREAM_OTHER_FRIENDS', $user1->getDisplayName(), $user2->getDisplayName(), JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user1->id, JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user2->id);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.bulletin':
                 $user = CFactory::getUser($activity->actor);
                 $bulletin = JTable::getInstance('Bulletin', 'CTable');
                 $bulletin->load($activity->cid);
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($bulletin->groupid);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_NEW_GROUP_NEWS', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewbulletin&groupid=' . $group->id . '&bulletinid=' . $bulletin->id), $bulletin->title);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.discussion':
                 $user = CFactory::getUser($activity->actor);
                 $discussion = JTable::getInstance('Discussion', 'CTable');
                 $discussion->load($activity->cid);
                 $discussionLink = CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $discussion->groupid . '&topicid=' . $discussion->id);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_NEW_GROUP_DISCUSSION', $discussionLink, $discussion->title);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.discussion.reply':
                 $user = CFactory::getUser($activity->actor);
                 $discussion = JTable::getInstance('Discussion', 'CTable');
                 $discussion->load($activity->cid);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_REPLY_DISCUSSION', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $discussion->groupid . '&topicid=' . $discussion->id), $discussion->title);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.join':
                 $user = CFactory::getUser($activity->actor);
                 $users = explode(',', $param->get('actors'));
                 $userCount = count($users);
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($activity->cid);
                 $slice = 2;
                 if ($userCount > 2) {
                     $slice = 1;
                 }
                 $users = array_slice($users, 0, $slice);
                 $actorsHTML = array();
                 foreach ($users as $actor) {
                     $user = CFactory::getUser($actor);
                     $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                 }
                 $others = '';
                 if ($userCount > 2) {
                     $others = JText::sprintf('COM_COMMUNITY_STREAM_OTHERS_JOIN_GROUP', $userCount - 1);
                 }
                 $html = implode(' ' . JText::_('COM_COMMUNITY_AND') . ' ', $actorsHTML) . $others . JText::sprintf('COM_COMMUNITY_GROUPS_GROUP_JOIN', JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id, $group->name);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.update':
                 $user = CFactory::getUser($activity->actor);
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($activity->cid);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> - ' . JText::sprintf('COM_COMMUNITY_GROUPS_GROUP_UPDATED', JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id, $group->name);
                 $activities[$key]->title = $html;
                 break;
             case 'photos':
                 $user = CFactory::getUser($activity->actor);
                 $album = JTable::getInstance('Album', 'CTable');
                 $album->load($activity->cid);
                 $html = '';
                 if ($activity->groupid) {
                     $group = JTable::getInstance('Group', 'CTable');
                     $group->load($activity->groupid);
                     $html .= '<a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id . '">' . $group->name . '</a> -';
                 }
                 $html .= ' <a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                 $count = $param->get('count', 1);
                 $url = Juri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $album->id . '&userid=' . $user->id;
                 if (CStringHelper::isPlural($count)) {
                     $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_PHOTO_UPLOAD_TITLE_MANY', $count, $url, CStringHelper::escape($album->name));
                 } else {
                     $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_PHOTO_UPLOAD_TITLE', $url, CStringHelper::escape($album->name));
                 }
                 $activities[$key]->title = $html;
                 break;
             case 'photos.comment':
                 $user = CFactory::getUser($activity->actor);
                 $wall = JTable::getInstance('Wall', 'CTable');
                 $wall->load($param->get('wallid'));
                 $photo = JTable::getInstance('Photo', 'CTable');
                 $photo->load($activity->cid);
                 $url = JUri::root() . 'index.php?option=com_community&view=photos&task=photo&albumid=' . $photo->albumid . '&userid=' . $photo->creator . '&photoid=' . $photo->id;
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ' . JText::sprintf('COM_COMMUNITY_ACTIVITIES_WALL_POST_PHOTO', $url, $this->escape($photo->caption));
                 $activities[$key]->title = $html;
                 break;
             case 'system.message':
             case 'system.videos.popular':
             case 'system.photos.popular':
             case 'system.members.popular':
             case 'system.photos.total':
             case 'system.groups.popular':
             case 'system.members.registered':
                 $action = $param->get('action');
                 switch ($action) {
                     case 'registered_users':
                         $usersModel = CFactory::getModel('user');
                         $now = new JDate();
                         $date = CTimeHelper::getDate();
                         $users = $usersModel->getLatestMember(10);
                         $totalRegistered = count($users);
                         $title = JText::sprintf('COM_COMMUNITY_TOTAL_USERS_REGISTERED_THIS_MONTH_ACTIVITY_TITLE', $totalRegistered, $date->monthToString($now->format('%m')));
                         $activities[$key]->title = $title;
                         break;
                     case 'total_photos':
                         $photosModel = CFactory::getModel('photos');
                         $total = $photosModel->getTotalSitePhotos();
                         $activities[$key]->title = JText::sprintf('COM_COMMUNITY_TOTAL_PHOTOS_ACTIVITY_TITLE', CRoute::_(JURI::root() . 'index.php?option=com_community&view=photos'), $total);
                         break;
                     case 'top_videos':
                         $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_VIDEOS');
                         break;
                     case 'top_photos':
                         $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_PHOTOS');
                         break;
                     case 'top_users':
                         $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_MEMBERS');
                         break;
                     case 'top_groups':
                         $groupsModel = $this->getModel('groups');
                         $activeGroup = $groupsModel->getMostActiveGroup();
                         if (is_null($activeGroup)) {
                             $title = JText::_('COM_COMMUNITY_GROUPS_NONE_CREATED');
                         } else {
                             $title = JText::sprintf('COM_COMMUNITY_MOST_POPULAR_GROUP_ACTIVITY_TITLE', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $activeGroup->id), $activeGroup->name);
                         }
                         $activities[$key]->title = $title;
                         break;
                     case 'message':
                         break;
                 }
                 break;
             case 'videos.linking':
             case 'videos':
                 $video = JTable::getInstance('Video', 'CTable');
                 $video->load($activity->cid);
                 $actor = CFactory::getUser($activity->actor);
                 $html = $this->_getUserLink($activity->actor);
                 $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_VIDEO_SHARE_TITLE', JUri::root() . $video->getViewURI(false), $this->escape($video->title));
                 $activities[$key]->title = $html;
                 break;
             case 'videos.featured':
                 $video = JTable::getInstance('Video', 'CTable');
                 $video->load($activity->cid);
                 $activities[$key]->title = JText::sprintf('COM_COMMUNITY_VIDEOS_IS_FEATURED', '<a href="' . CRoute::_(JUri::root() . 'index.php?option=com_community&view=videos&task=video&userid=' . $video->creator . '&videoid=' . $video->id) . '" class="cStream-Title">' . $this->escape($video->title) . '</a>');
                 break;
             case 'albums.featured':
                 $album = JTable::getInstance('Album', 'CTable');
                 $album->load($activity->cid);
                 $activities[$key]->title = JText::sprintf('COM_COMMUNITY_ALBUM_IS_FEATURED', '<a href="' . CRoute::_(JUri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $album->id . '&userid=' . $album->creator) . '" class="cStream-Title">' . $this->escape($album->name) . '</a>');
                 break;
         }
     }
     //exit;
     $userModel = $this->getModel('Users', false);
     $currentUser = $jinput->request->get('actor', JText::_('COM_COMMUNITY_ACTIVITIES_ENTER_NAME_VALUE'), 'NONE');
     $currentArchived = $jinput->request->get('archived', 0, 'NONE');
     $currentApp = $jinput->request->get('app', 'none', 'NONE');
     $filterApps = $model->getFilterApps();
     $this->assignRef('filterApps', $filterApps);
     $this->assignRef('currentApp', $currentApp);
     $this->assignRef('currentUser', $currentUser);
     $this->assignRef('currentArchive', $currentArchived);
     $this->assignRef('pagination', $model->getPagination());
     $this->assignRef('activities', $activities);
     parent::display($tpl);
 }
Exemplo n.º 5
0
 /**
  * Get the web path to a file
  *
  * @param   string  $file     - the file name
  * @param   int     $id       - the id
  * @param   bool    $isThumb  - are we dealing with a thumb
  *
  * @return string
  */
 public function getWebFilePath($file, $id, $isThumb = false)
 {
     $params = JComponentHelper::getParams($this->component);
     $path = Juri::root() . $params->get('image_path', 'images') . '/' . $this->typeAlias . '/' . $id;
     if ($isThumb) {
         $path .= '/thumbs';
     }
     $path .= '/' . $file;
     return $path;
 }
Exemplo n.º 6
0
/**
 * @name		Maximenu CK params
 * @package		com_maximenuck
 * @copyright	Copyright (C) 2014. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @author		Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr
 */
defined('_JEXEC') or die;
$path = JPATH_ROOT . '/modules/mod_maximenuck/themes';
$folders = JFolder::folders($path);
natsort($folders);
$i = 1;
echo '<div class="clearfix" style="min-height:35px;margin: 0 5px;">';
foreach ($folders as $folder) {
    $theme_title = "";
    if (file_exists($path . '/' . $folder . '/css/maximenuck.php')) {
        if (file_exists($path . '/' . $folder . '/' . $folder . '.png')) {
            $theme = JUri::root(true) . '/modules/mod_maximenuck/themes/' . $folder . '/' . $folder . '.png';
        } else {
            $theme = Juri::root(true) . '/administrator/components/com_maximenuck/images/what.png" width="110" height="110';
            $theme_title = JText::_('CK_THEME_PREVIEW_NOT_FOUND');
        }
    } else {
        $theme = Juri::root(true) . '/administrator/components/com_maximenuck/images/warning.png" width="110" height="110';
        $theme_title = JText::_('CK_THEME_CSS_NOT_COMPATIBLE');
    }
    echo '<div class="themethumb" data-name="' . $folder . '" onclick="change_theme_stylesheet(\'' . $folder . '\')">' . '<img src="' . $theme . '" style="margin:0;padding:0;" title="' . $theme_title . '" class="hasTip" />' . '<div class="themename">' . $folder . '</div>' . '</div>';
    $i++;
}
echo '</div>';

<?php 
foreach ($condominiums as $key => $condominium) {
    $resourceName = "";
    // BFCHelper::getLanguage($condominium->Name, $this->language);
    //$route = JRoute::_('index.php?option=com_bookingforconnector&view=condominium&ResourceId=' . $condominium->CondominiumId . ':' . BFCHelper::getSlug($resourceName));
    $currUri = $uri . '&resourceId=' . $condominium->CondominiumId . ':' . BFCHelper::getSlug($resourceName);
    if ($itemId != 0) {
        $currUri .= '&Itemid=' . $itemId;
    }
    $route = JRoute::_($currUri);
    $merchantLat = $condominium->XGooglePos;
    $merchantLon = $condominium->YGooglePos;
    $showMerchantMap = $merchantLat != null && $merchantLon != null;
    $merchantImageUrl = Juri::root() . "components/com_bookingforconnector/assets/images/defaults/default-s6.jpeg";
    $routeInfoRequest = JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&layout=contactspopup&tmpl=component&merchantId=' . $condominium->MerchantId . ':' . BFCHelper::getSlug($condominium->MerchantName));
    $currUriMerchant = $uriMerchant . '&merchantId=' . $condominium->MerchantId . ':' . BFCHelper::getSlug($condominium->MerchantName);
    if ($itemIdMerchant != 0) {
        $currUriMerchant .= '&Itemid=' . $itemIdMerchant;
    }
    $routeMerchant = JRoute::_($currUriMerchant);
    ?>
			<div class="<?php 
    echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL;
    ?>
12 com_bookingforconnector-item-col" >
				<div class="com_bookingforconnector-search-merchant com_bookingforconnector-item  <?php 
    echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW;
    ?>
" >
Exemplo n.º 8
0
components/com_javoice/asset/images/rss.gif" alt="RSS help"/>
		</a>
	</div>
</div>
<?php 
} else {
    echo JText::_("PLEASE_CREATE_NEW_FORUM_AND_VOICE_TYPE");
}
?>


<!--< New Loading Image and Text >-->
<!-- Loading -->
<div id="loader">
	<img src="<?php 
echo Juri::root();
?>
components/com_javoice/asset/images/loading.gif" alt="<?php 
echo JText::_("LOADER_TITLE");
?>
"/>
	<?php 
echo '<br>';
?>
	<?php 
echo JText::_('LOADING');
?>
</div>
<!--< End New Loading Image and Text >-->

<div id="jav-msg-loading" style="display:none"></div>
Exemplo n.º 9
0
	<input class="radiobutton ckoption" type="radio" value="horizontal" id="orientationhorizontal" name="orientation" />
	<label class="radiobutton first" for="orientationhorizontal" style="width:auto;" onclick="change_menu_orientation('horizontal')"><?php 
echo JText::_('CK_HORIZONTAL');
?>
	</label><input class="radiobutton ckoption" type="radio" value="vertical" id="orientationvertical" name="orientation" />
	<label class="radiobutton"  for="orientationvertical" style="width:auto;" onclick="change_menu_orientation('vertical')"><?php 
echo JText::_('CK_VERTICAL');
?>
</label>
</div>
<hr />
<?php 
$path = JPATH_ROOT . '/modules/mod_maximenuck/tmpl';
$files = JFolder::files($path, '.php');
natsort($files);
$i = 1;
echo '<div class="clearfix" style="min-height:35px;margin: 0 5px;">';
foreach ($files as $file) {
    $thumb_title = '';
    $file = JFile::stripExt($file);
    if (file_exists($path . '/' . $file . '.png')) {
        $thumb = Juri::root(true) . '/modules/mod_maximenuck/tmpl/' . $file . '.png';
    } else {
        $thumb = Juri::root(true) . '/administrator/components/com_maximenuck/images/what.png style="display:block;margin:0 auto;" width="90 height="90';
        $thumb_title = JText::_('CK_LAYOUT_PREVIEW_NOT_FOUND');
    }
    $active = $layout == $file ? 'selected' : '';
    echo '<div class="layoutthumb ' . $active . '" data-name="' . $file . '" onclick="change_layout(\'' . $file . '\')">' . '<img src="' . $thumb . '" style="margin:0;padding:0;" title="' . $thumb_title . '" class="hasTip" />' . '<div class="layoutname">' . $file . '</div>' . '</div>';
    $i++;
}
echo '</div>';
Exemplo n.º 10
0
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$merchant = $this->item;
$sitename = $this->sitename;
$language = $this->language;
//$this->document->setTitle($this->item->Name);
//$this->document->setDescription( BFCHelper::getLanguage($this->item->Description, $this->language));
$this->document->setTitle(sprintf(JTEXT::_('COM_BOOKINGFORCONNECTOR_VIEW_MERCHANTDETAILS_RESOURCES_TITLE'), $merchant->Name, $sitename));
$db = JFactory::getDBO();
$uri = 'index.php?option=com_bookingforconnector&view=resource';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uri) . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1 LIMIT 1');
//$itemId = ($db->getErrorNum())? 0 : intval($db->loadResult());
$itemId = intval($db->loadResult());
$resourceImageUrl = Juri::root() . "media/com_bookingfor/images/default.png";
$merchantImageUrl = Juri::root() . "media/com_bookingfor/images/DefaultLogoList.jpg";
$resourceLogoPath = BFCHelper::getImageUrlResized('resources', "[img]", 'onsellunit_list_default');
$resourceLogoPathError = BFCHelper::getImageUrl('resources', "[img]", 'onsellunit_list_default');
$merchantLogoPath = BFCHelper::getImageUrlResized('merchant', "[img]", 'resource_list_merchant_logo');
$merchantLogoPathError = BFCHelper::getImageUrl('merchant', "[img]", 'resource_list_merchant_logo');
?>
<script type="text/javascript">
<!--
var cultureCode = '<?php 
echo $language;
?>
';
//-->
</script>
<div class="com_bookingforconnector_merchantdetails com_bookingforconnector_merchantdetails-t<?php 
echo BFCHelper::showMerchantRatingByCategoryId($merchant->MerchantTypeId);
    $rating = $merchant->Rating;
    $routeInfoRequest = JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&layout=contactspopup&tmpl=component&merchantId=' . $merchant->MerchantId . ':' . BFCHelper::getSlug($merchant->Name));
    $currUriMerchant = $uriMerchant . '&merchantId=' . $merchant->MerchantId . ':' . BFCHelper::getSlug($merchant->Name);
    if ($itemIdMerchant != 0) {
        $currUriMerchant .= '&Itemid=' . $itemIdMerchant;
    }
    $routeMerchant = JRoute::_($currUriMerchant);
    $routeRating = JRoute::_($currUriMerchant . '&layout=ratings');
    $routeRatingform = JRoute::_($currUriMerchant . '&layout=rating');
    $httpsPayment = $merchant->PaymentType;
    $counter = 0;
    $merchantLat = $merchant->XGooglePos;
    $merchantLon = $merchant->YGooglePos;
    $showMerchantMap = $merchantLat != null && $merchantLon != null;
    $merchantLogo = Juri::root() . "components/com_bookingforconnector/assets/images/defaults/default-s1.jpeg";
    $merchantLogoError = Juri::root() . "components/com_bookingforconnector/assets/images/defaults/default-s1.jpeg";
    if (!empty($merchant->LogoUrl)) {
        $merchantLogo = BFCHelper::getImageUrlResized('merchant', $merchant->LogoUrl, 'logomedium');
        $merchantLogoError = BFCHelper::getImageUrl('merchant', $merchant->LogoUrl, 'logomedium');
    }
    if (!empty($merchant->ImageUrl)) {
        $merchantImageUrl = BFCHelper::getImageUrlResized('merchant', $merchant->ImageUrl, 'medium');
    }
    ?>
			<div class="<?php 
    echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL;
    ?>
12 com_bookingforconnector-item-col" >
				<div class="com_bookingforconnector-search-merchant com_bookingforconnector-item  <?php 
    echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW;
    ?>
Exemplo n.º 12
0
 public static function getItems($cid, &$params)
 {
     jimport('joomla.filesystem.file');
     $mainframe = JFactory::getApplication();
     $limit = $params->get('itemCount', 5);
     $start = 0;
     //$limit*(JRequest::getInt('page',1)-1);
     $ordering = $params->get('itemsOrdering', '');
     $componentParams = JComponentHelper::getParams('com_k2');
     $limitstart = JRequest::getInt('limitstart');
     $user = JFactory::getUser();
     $db = JFactory::getDBO();
     $jnow = JFactory::getDate();
     $now = $jnow->toSql();
     $nullDate = $db->getNullDate();
     if ($params->get('source') == 'specific') {
         $value = $params->get('items');
         $current = array();
         if (is_string($value) && !empty($value)) {
             $current[] = $value;
         }
         if (is_array($value)) {
             $current = $value;
         }
         $items = array();
         if (count($current) > 0) {
             $query = "SELECT i.*, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams\n\t\t\t\t\t\t\tFROM #__k2_items as i\n\t\t\t\t\t\t\tLEFT JOIN #__k2_categories c ON c.id = i.catid\n\t\t\t\t\t\t\tWHERE i.published = 1 ";
             $query .= " AND i.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ") ";
             $query .= " AND i.trash = 0 AND c.published = 1 ";
             $query .= " AND c.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ") ";
             $query .= " AND c.trash = 0\n\t\t\t\t\t\t\tAND ( i.publish_up = " . $db->Quote($nullDate) . " OR i.publish_up <= " . $db->Quote($now) . " )\n\t\t\t\t\t\t\t\t\tAND ( i.publish_down = " . $db->Quote($nullDate) . " OR i.publish_down >= " . $db->Quote($now) . " )\n\t\t\t\t\t\t\t\t\tAND i.id IN(" . implode(',', $current) . ") ";
             if ($mainframe->getLanguageFilter()) {
                 $languageTag = JFactory::getLanguage()->getTag();
                 $query .= " AND c.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ") AND i.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ")";
             }
             $db->setQuery($query);
             $items = $db->loadObjectList();
         }
     } else {
         $query = "SELECT i.*, CASE WHEN i.modified = 0 THEN i.created ELSE i.modified END as lastChanged, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams";
         if ($ordering == 'best') {
             $query .= ", (r.rating_sum/r.rating_count) AS rating";
         }
         if ($ordering == 'comments') {
             $query .= ", COUNT(comments.id) AS numOfComments";
         }
         $query .= " FROM #__k2_items as i LEFT JOIN #__k2_categories c ON c.id = i.catid";
         if ($ordering == 'best') {
             $query .= " LEFT JOIN #__k2_rating r ON r.itemID = i.id";
         }
         if ($ordering == 'comments') {
             $query .= " LEFT JOIN #__k2_comments comments ON comments.itemID = i.id";
         }
         $query .= " WHERE i.published = 1 AND i.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ") AND i.trash = 0 AND c.published = 1 AND c.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ")  AND c.trash = 0";
         $query .= " AND ( i.publish_up = " . $db->Quote($nullDate) . " OR i.publish_up <= " . $db->Quote($now) . " )";
         $query .= " AND ( i.publish_down = " . $db->Quote($nullDate) . " OR i.publish_down >= " . $db->Quote($now) . " )";
         if (!is_null($cid)) {
             if (is_array($cid)) {
                 if ($params->get('getChildren')) {
                     $itemListModel = K2Model::getInstance('Itemlist', 'K2Model');
                     $categories = $itemListModel->getCategoryTree($cid);
                     $sql = @implode(',', $categories);
                     $query .= " AND i.catid IN ({$sql})";
                 } else {
                     JArrayHelper::toInteger($cid);
                     $query .= " AND i.catid IN(" . implode(',', $cid) . ")";
                 }
             } else {
                 if ($params->get('getChildren')) {
                     $itemListModel = K2Model::getInstance('Itemlist', 'K2Model');
                     $categories = $itemListModel->getCategoryTree($cid);
                     $sql = @implode(',', $categories);
                     $query .= " AND i.catid IN ({$sql})";
                 } else {
                     $query .= " AND i.catid=" . (int) $cid;
                 }
             }
         }
         if ($params->get('FeaturedItems') == '0') {
             $query .= " AND i.featured != 1";
         }
         if ($params->get('FeaturedItems') == '2') {
             $query .= " AND i.featured = 1";
         }
         if ($params->get('videosOnly')) {
             $query .= " AND (i.video IS NOT NULL AND i.video!='')";
         }
         if ($ordering == 'comments') {
             $query .= " AND comments.published = 1";
         }
         if ($mainframe->getLanguageFilter()) {
             $languageTag = JFactory::getLanguage()->getTag();
             $query .= " AND c.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ") AND i.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ")";
         }
         switch ($ordering) {
             case 'date':
                 $orderby = 'i.created ASC';
                 break;
             case 'rdate':
                 $orderby = 'i.created DESC';
                 break;
             case 'alpha':
                 $orderby = 'i.title';
                 break;
             case 'ralpha':
                 $orderby = 'i.title DESC';
                 break;
             case 'order':
                 if ($params->get('FeaturedItems') == '2') {
                     $orderby = 'i.featured_ordering';
                 } else {
                     $orderby = 'i.ordering';
                 }
                 break;
             case 'rorder':
                 if ($params->get('FeaturedItems') == '2') {
                     $orderby = 'i.featured_ordering DESC';
                 } else {
                     $orderby = 'i.ordering DESC';
                 }
                 break;
             case 'hits':
                 if ($params->get('popularityRange')) {
                     $datenow = JFactory::getDate();
                     $date = $datenow->toSql();
                     $query .= " AND i.created > DATE_SUB('{$date}',INTERVAL " . $params->get('popularityRange') . " DAY) ";
                 }
                 $orderby = 'i.hits DESC';
                 break;
             case 'rand':
                 $orderby = 'RAND()';
                 break;
             case 'best':
                 $orderby = 'rating DESC';
                 break;
             case 'comments':
                 if ($params->get('popularityRange')) {
                     $datenow = JFactory::getDate();
                     $date = $datenow->toSql();
                     $query .= " AND i.created > DATE_SUB('{$date}',INTERVAL " . $params->get('popularityRange') . " DAY) ";
                 }
                 $query .= " GROUP BY i.id ";
                 $orderby = 'numOfComments DESC';
                 break;
             case 'modified':
                 $orderby = 'lastChanged DESC';
                 break;
             case 'publishUp':
                 $orderby = 'i.publish_up DESC';
                 break;
             default:
                 $orderby = 'i.id DESC';
                 break;
         }
         $query .= " ORDER BY " . $orderby;
         $db->setQuery($query, $start, $limit);
         $items = $db->loadObjectList();
     }
     $model = K2Model::getInstance('Item', 'K2Model');
     if (count($items)) {
         foreach ($items as $item) {
             $item->event = new stdClass();
             //Clean title
             $item->title = JFilterOutput::ampReplace($item->title);
             //Images
             //Read more link
             $item->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id . ':' . urlencode($item->alias), $item->catid . ':' . urlencode($item->categoryalias))));
             //Tags
             if ($params->get('itemTags')) {
                 $tags = $model->getItemTags($item->id);
                 for ($i = 0; $i < sizeof($tags); $i++) {
                     $tags[$i]->link = JRoute::_(K2HelperRoute::getTagRoute($tags[$i]->name));
                 }
                 $item->tags = $tags;
             }
             //Category link
             if ($params->get('itemCategory')) {
                 $item->categoryLink = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($item->catid . ':' . urlencode($item->categoryalias))));
             }
             //Extra fields
             if ($params->get('itemExtraFields')) {
                 $item->extra_fields = $model->getItemExtraFields($item->extra_fields, $item);
             }
             //Comments counter
             if ($params->get('itemCommentsCounter')) {
                 $item->numOfComments = $model->countItemComments($item->id);
             }
             //Attachments
             if ($params->get('itemAttachments')) {
                 $item->attachments = $model->getItemAttachments($item->id);
             }
             if ($params->get('JPlugins', 0)) {
                 //Import plugins
                 $dispatcher = JDispatcher::getInstance();
                 JPluginHelper::importPlugin('content');
             }
             //Video
             if ($params->get('itemVideo') && $format != 'feed') {
                 $params->set('vfolder', 'media/k2/videos');
                 $params->set('afolder', 'media/k2/audio');
                 $item->text = $item->video;
                 $dispatcher->trigger('onContentPrepare', array('mod_k2_content.', &$item, &$params, $limitstart));
                 $item->video = $item->text;
             }
             // Introtext
             $item->text = '';
             // 					if ($params->get('itemIntroText'))
             // 					{
             $item->text .= self::_cleanText($item->introtext);
             // 					}
             $params->set('parsedInModule', 1);
             // for plugins to know when they are parsed inside this module
             if ($params->get('JPlugins', 0)) {
                 //Plugins
                 $results = $dispatcher->trigger('onBeforeDisplay', array(&$item, &$params, $limitstart));
                 $item->event->BeforeDisplay = trim(implode("\n", $results));
                 $results = $dispatcher->trigger('onAfterDisplay', array(&$item, &$params, $limitstart));
                 $item->event->AfterDisplay = trim(implode("\n", $results));
                 $results = $dispatcher->trigger('onAfterDisplayTitle', array(&$item, &$params, $limitstart));
                 $item->event->AfterDisplayTitle = trim(implode("\n", $results));
                 $results = $dispatcher->trigger('onBeforeDisplayContent', array(&$item, &$params, $limitstart));
                 $item->event->BeforeDisplayContent = trim(implode("\n", $results));
                 $results = $dispatcher->trigger('onAfterDisplayContent', array(&$item, &$params, $limitstart));
                 $item->event->AfterDisplayContent = trim(implode("\n", $results));
                 $dispatcher->trigger('onPrepareContent', array(&$item, &$params, $limitstart));
             }
             //Init K2 plugin events
             $item->event->K2BeforeDisplay = '';
             $item->event->K2AfterDisplay = '';
             $item->event->K2AfterDisplayTitle = '';
             $item->event->K2BeforeDisplayContent = '';
             $item->event->K2AfterDisplayContent = '';
             $item->event->K2CommentsCounter = '';
             if ($params->get('K2Plugins', 0)) {
                 //K2 plugins
                 JPluginHelper::importPlugin('k2');
                 $results = $dispatcher->trigger('onK2BeforeDisplay', array(&$item, &$params, $limitstart));
                 $item->event->K2BeforeDisplay = trim(implode("\n", $results));
                 $results = $dispatcher->trigger('onK2AfterDisplay', array(&$item, &$params, $limitstart));
                 $item->event->K2AfterDisplay = trim(implode("\n", $results));
                 $results = $dispatcher->trigger('onK2AfterDisplayTitle', array(&$item, &$params, $limitstart));
                 $item->event->K2AfterDisplayTitle = trim(implode("\n", $results));
                 $results = $dispatcher->trigger('onK2BeforeDisplayContent', array(&$item, &$params, $limitstart));
                 $item->event->K2BeforeDisplayContent = trim(implode("\n", $results));
                 $results = $dispatcher->trigger('onK2AfterDisplayContent', array(&$item, &$params, $limitstart));
                 $item->event->K2AfterDisplayContent = trim(implode("\n", $results));
                 $dispatcher->trigger('onK2PrepareContent', array(&$item, &$params, $limitstart));
                 if ($params->get('itemCommentsCounter')) {
                     $results = $dispatcher->trigger('onK2CommentsCounter', array(&$item, &$params, $limitstart));
                     $item->event->K2CommentsCounter = trim(implode("\n", $results));
                 }
             }
             // Restore the intotext variable after plugins execution
             $item->displayIntrotext = $item->text;
             //Clean the plugin tags
             $item->displayIntrotext = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $item->displayIntrotext);
             //Author
             if ($params->get('itemAuthor')) {
                 if (!empty($item->created_by_alias)) {
                     $item->author = $item->created_by_alias;
                     $item->authorGender = NULL;
                     $item->authorDescription = NULL;
                     if ($params->get('itemAuthorAvatar')) {
                         $item->authorAvatar = K2HelperUtilities::getAvatar('alias');
                     }
                     $item->authorLink = Juri::root(true);
                 } else {
                     $author = JFactory::getUser($item->created_by);
                     $item->author = $author->name;
                     $query = "SELECT `description`, `gender` FROM #__k2_users WHERE userID=" . (int) $author->id;
                     $db->setQuery($query, 0, 1);
                     $result = $db->loadObject();
                     if ($result) {
                         $item->authorGender = $result->gender;
                         $item->authorDescription = $result->description;
                     } else {
                         $item->authorGender = NULL;
                         $item->authorDescription = NULL;
                     }
                     if ($params->get('itemAuthorAvatar')) {
                         $item->authorAvatar = K2HelperUtilities::getAvatar($author->id, $author->email, $componentParams->get('userImageWidth'));
                     }
                     //Author Link
                     $item->authorLink = JRoute::_(K2HelperRoute::getUserRoute($item->created_by));
                 }
             }
             // Extra fields plugins
             if (is_array($item->extra_fields)) {
                 foreach ($item->extra_fields as $key => $extraField) {
                     if ($extraField->type == 'textarea' || $extraField->type == 'textfield') {
                         $tmp = new JObject();
                         $tmp->text = $extraField->value;
                         if ($params->get('JPlugins', 0)) {
                             $dispatcher->trigger('onPrepareContent', array(&$tmp, &$params, $limitstart));
                         }
                         if ($params->get('K2Plugins', 0)) {
                             $dispatcher->trigger('onK2PrepareContent', array(&$tmp, &$params, $limitstart));
                         }
                         $extraField->value = $tmp->text;
                     }
                 }
             }
             $rows[] = $item;
         }
         return $rows;
     }
 }
Exemplo n.º 13
0
</div><?php 
    $processing_html = '<a href="' . $this->ehelper->getExportItemLink($t['tid'], $order_id) . '" id="tid_' . $t['tid'] . '_proc" onclick="' . "javascript:return op_runCmd('sendXml', this);" . '" >' . "<img src='" . Juri::root(true) . "components/com_onepage/assets/images/mootree_loader.gif' alt='" . $status_txt . "' title='" . $status_txt . "' /></a>";
    ?>
<div id="tiddiv_<?php 
    echo $t['tid'];
    ?>
_PROCESSING" <?php 
    if ($status != 'PROCESSING') {
        echo ' style="display: none;" ';
    }
    ?>
><?php 
    echo $processing_html;
    ?>
</div><?php 
    $error_html = '<a href="' . $this->ehelper->getExportItemLink($t['tid'], $order_id) . '" id="tid_' . $t['tid'] . '_err" onclick="' . "javascript:return op_runCmd('sendXml', this);" . '" >' . "<img  src='" . Juri::root(true) . "components/com_onepage/assets/images/remove.png' alt='" . $status_txt . "' title='" . $status_txt . "' /></a>";
    ?>
<div id="tiddiv_<?php 
    echo $t['tid'];
    ?>
_ERROR" <?php 
    if ($status != 'ERROR') {
        echo ' style="display: none;" ';
    }
    ?>
><?php 
    echo $error_html;
    ?>
</div>
	  
	  
Exemplo n.º 14
0
if (!empty($do_not_show_opcregistration)) {
    echo '1';
} else {
    echo '0';
}
?>
" id="do_not_show_opcregistration" />
<?php 
$selected = $opclang = JRequest::getVar('opclang', '');
$flag = '';
if (count($x) > 1) {
    $a1 = explode('-', $opclang);
    if (isset($a1[0])) {
        $cl = strtolower($a1[0]);
        if (file_exists(JPATH_SITE . DS . 'media' . DS . 'mod_languages' . DS . 'images' . DS . $cl . '.gif')) {
            $root = Juri::root() . '/';
            $root = str_replace('/administrator/', '', $root);
            $flag = '<br style="clear:both;"><img src="' . $root . '/media/mod_languages/images/' . $cl . '.gif" alt="' . $opclang . '"/>';
        }
    }
    ?>
    <div class="langtab" style="clear: both; " >
	<label for="opclang"><?php 
    echo JText::_('JFIELD_LANGUAGE_LABEL');
    ?>
</label>
	<select name="opclang" id="opclang" onchange="submitbutton('changelang');">
	 <?php 
    echo '<option ';
    if (empty($selected)) {
        echo 'selected="selected" ';
Exemplo n.º 15
0
    function uploadReplyFile()
    {
        if (!JAVoiceHelpers::checkPermissionAdmin()) {
            $k = 0;
            $object[$k] = new stdClass();
            $object[$k]->id = '#jav-msg-loading';
            $object[$k]->attr = 'html';
            $object[$k]->content = JText::_("SORRY_YOU_DONT_PERMISSION_TO_EDIT_THIS");
            $k++;
            $object[$k] = new stdClass();
            $object[$k]->id = '#jav-msg-loading';
            $object[$k]->attr = 'css';
            $object[$k]->content = 'display,block';
            $helper = new JAVoiceHelpers();
            echo $helper->parse_JSON_new($object);
            exit;
        }
        global $javconfig;
        $helper = new JAVoiceHelpers();
        $maxSize = (int) $helper->getSizeUploadFile("byte");
        if (isset($_FILES['myfile']['name']) && $_FILES['myfile']['size'] > 0 && $_FILES['myfile']['size'] <= $maxSize && $_FILES['myfile']['tmp_name'] != '') {
            jimport('joomla.filesystem.folder');
            jimport('joomla.filesystem.file');
            $deleteSession = JRequest::getInt("deleteSession");
            //echo '<script type="text/javascript">alert("'.$deleteSession.'");</script>';
            if ($deleteSession) {
                unset($_SESSION['javReplyNameFolder']);
                unset($_SESSION['javReplyTemp']);
            }
            $fileexist = 0;
            $img = '';
            $totalFile = 0;
            // Edit upload location here
            $fname = basename($_FILES['myfile']['name']);
            $fname = strtolower(str_replace(' ', '', $fname));
            $folder = time() . rand() . DIRECTORY_SEPARATOR;
            //$folder = JPATH_ROOT.DS."images".DS."stories".DS."ja_voice";
            if (!isset($_SESSION['javReplyNameFolder'])) {
                $_SESSION['javReplyNameFolder'] = $folder;
            } else {
                $folder = $_SESSION['javReplyNameFolder'];
            }
            //echo '<script type="text/javascript">alert("'.str_replace('\\','',$folder).'");</script>';
            $destination_path = JPATH_ROOT . DS . "tmp" . DS . "ja_voice" . DS . $folder;
            if (!isset($_SESSION['javReplyTemp'])) {
                $_SESSION['javReplyTemp'] = $destination_path;
            }
            $target_path = $destination_path . '/' . $fname;
            if (!is_dir($destination_path)) {
                JFolder::create($destination_path);
            }
            $id = JRequest::getInt("responeid", 0);
            $listFiles = JRequest::getVar("listfile");
            if (count($listFiles) < $javconfig['plugin']->get("total_attach_file", 0)) {
                //rebuilt listfile
                foreach ($listFiles as $listFile) {
                    $type = substr(strtolower(trim($listFile)), -3, 3);
                    if ($type == 'ocx') {
                        $type = "doc";
                    }
                    $img .= "<div style='float: left; clear: both;'><span><input type='checkbox' onclick='javCheckTotalFileReply()' name='listfile[]' value='{$listFile}' checked></span>&nbsp;&nbsp;<img src='" . Juri::root() . "components/com_javoice/asset/images/icons/" . $type . ".gif' alt='" . $type . "' /> " . $listFile . "</div>";
                    $totalFile++;
                }
                //load file uncheck
                $listFilesInFolders = JFolder::files($destination_path);
                foreach ($listFilesInFolders as $listFilesInFolder) {
                    if (!in_array($listFilesInFolder, $listFiles)) {
                        $type = substr(strtolower(trim($listFilesInFolder)), -3, 3);
                        if ($type == 'ocx') {
                            $type = "doc";
                        }
                        $img .= "<div style='float: left; clear: both;'><span><input type='checkbox' onclick='javCheckTotalFileReply()' name='listfile[]' value='{$listFilesInFolder}' disabled='disabled'></span>&nbsp;&nbsp;<img src='" . Juri::root() . "components/com_javoice/asset/images/icons/" . $type . ".gif' alt='" . $type . "' /> " . $listFilesInFolder . "</div>";
                        $totalFile++;
                    }
                }
                $listFilesInFolders = JFolder::files(JPATH_ROOT . DS . "images" . DS . "stories" . DS . "ja_voice" . DS . "admin_response" . DS . $id);
                foreach ($listFilesInFolders as $listFilesInFolder) {
                    if (!in_array($listFilesInFolder, $listFiles)) {
                        $type = substr(strtolower(trim($listFilesInFolder)), -3, 3);
                        if ($type == 'ocx') {
                            $type = "doc";
                        }
                        $img .= "<div style='float: left; clear: both;'><span><input type='checkbox' onclick='javCheckTotalFileReply()' name='listfile[]' value='{$listFilesInFolder}' disabled='disabled'></span>&nbsp;&nbsp;<img src='" . Juri::root() . "components/com_javoice/asset/images/icons/" . $type . ".gif' alt='" . $type . "' /> " . $listFilesInFolder . "</div>";
                        $totalFile++;
                    }
                }
                if (file_exists($target_path) || file_exists(JPATH_ROOT . DS . "images" . DS . "stories" . DS . "ja_voice" . DS . "admin_response" . DS . $id . DS . $fname)) {
                    $fileexist = 1;
                } elseif (@move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) {
                    $totalFile++;
                    $type = substr(strtolower(trim($_FILES['myfile']['name'])), -3, 3);
                    if ($type == 'ocx') {
                        $type = "doc";
                    }
                    $img .= "<input type='checkbox' name='listfile[]' onclick='javCheckTotalFileReply()' value='{$fname}' checked>&nbsp;&nbsp;<img src='" . Juri::root() . "components/com_javoice/asset/images/icons/" . $type . ".gif' /> " . $fname . "<br />";
                }
            }
            echo '<script language="javascript" type="text/javascript">
        	   		var par = window.parent.document;			   		
        			function stopUpload(par, listfile, count, totalUpload){					  		  
        				par.getElementById(\'jav_err_myfilereply\').innerHTML = "";   			  					  
        				par.new_reply_item.target = "_self";
        				//par.new_reply_item.task.value = "save";
        				
        				par.getElementById(\'jav_reply_upload_process\').style.display=\'none\';
        				par.getElementById(\'jav_result_reply_upload\').innerHTML = listfile;
        				par.new_reply_item.myfile.value = "";
        				if(eval(count)>=totalUpload){
        						if(1<=totalUpload){
        							par.new_reply_item.myfile.disabled = true;
        							par.getElementById(\'jav_err_myfilereply\').style.display = "block";
        							par.getElementById(\'jav_err_myfilereply\').innerHTML = "' . JText::_("YOU_ADDED") . '" + totalUpload + " ' . JText::_("FILES") . '!";
        						}else{						  		
        							par.new_reply_item.myfile.disabled = true;
        							par.getElementById(\'jav_err_myfilereply\').style.display = "block";
        							par.getElementById(\'jav_err_myfilereply\').innerHTML = "' . JText::_("YOU_ADDED") . '" + totalUpload + " ' . JText::_("FILE") . '!";
        						} 
        				}					  
        				return true;   
        			}
        		</script>';
            if ($fileexist) {
                echo '<script language="javascript" type="text/javascript">								
						var par = window.parent.document;
						par.getElementById(\'jav_err_myfilereply\').style.display = "block";													
						par.getElementById(\'jav_err_myfilereply\').innerHTML = "<span class=\'err\' style=\'color:red\'>' . JText::_("THIS_FILE_EXISTED") . '</span>";									
						par.getElementById("jav_reply_upload_process").style.display="none";
						//par.new_reply_item.task.value = "save";
					  </script>';
            } else {
                echo '<script language="javascript" type="text/javascript">stopUpload(par, "' . $img . '", ' . $totalFile . ', ' . $javconfig['plugin']->get("total_attach_file") . ')</script>';
            }
        } elseif (isset($_FILES['myfile']['name'])) {
            echo '<script type="text/javascript">					
					var par = window.parent.document;
					var content = "";
					if(document.body){
						document.body.innerHTML = "";
					}		
					par.getElementById(\'jav_reply_upload_process\').style.display=\'none\';
					par.new_reply_item.myfile.value = "";
					par.getElementById(\'jav_err_myfilereply\').style.display = "block";
					par.getElementById(\'jav_err_myfilereply\').innerHTML = "' . JText::_("LIMITATION_OF_UPLOAD_IS") . $helper->getSizeUploadFile() . '.";  		
					par.new_reply_item.myfile.focus();			
					//par.new_reply_item.task.value = "save";		
				</script>';
        }
    }
Exemplo n.º 16
0
 public static function getItems($cid, &$params, $counttotal = false)
 {
     jimport('joomla.filesystem.file');
     $mainframe = JFactory::getApplication();
     $app = JFactory::getApplication();
     $appParams = $app->getParams();
     $itemCount = '';
     $limit = 0;
     $limitation = $params->get('itemCount');
     $start = $app->input->getInt('ajax_reslisting_start', 0);
     if (isset($limitation) && (int) $limitation >= 0) {
         $limit = (int) $limitation;
     }
     //$limit = $params->get('itemCount', 5);
     //$cid = $params->get('category_id', NULL);
     $ordering = $params->get('itemsOrdering', '');
     $componentParams = JComponentHelper::getParams('com_k2');
     $limitstart = JRequest::getInt('limitstart');
     $user = JFactory::getUser();
     $aid = $user->get('aid');
     $db = JFactory::getDBO();
     $jnow = JFactory::getDate();
     $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
     $nullDate = $db->getNullDate();
     $query = "SELECT i.*, CASE WHEN i.modified = 0 THEN i.created ELSE i.modified END as lastChanged, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams";
     if ($ordering == 'best') {
         $query .= ", (r.rating_sum/r.rating_count) AS rating";
     }
     if ($ordering == 'comments') {
         $query .= ", COUNT(comments.id) AS numOfComments";
     }
     $query .= " FROM #__k2_items as i RIGHT JOIN #__k2_categories c ON c.id = i.catid";
     if ($ordering == 'best') {
         $query .= " LEFT JOIN #__k2_rating r ON r.itemID = i.id";
     }
     if ($ordering == 'comments') {
         $query .= " LEFT JOIN #__k2_comments comments ON comments.itemID = i.id";
     }
     if (K2_JVERSION != '15') {
         $query .= " WHERE i.published = 1 AND i.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ") AND i.trash = 0 AND c.published = 1 AND c.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ")  AND c.trash = 0";
     } else {
         $query .= " WHERE i.published = 1 AND i.access <= {$aid} AND i.trash = 0 AND c.published = 1 AND c.access <= {$aid} AND c.trash = 0";
     }
     $query .= " AND ( i.publish_up = " . $db->Quote($nullDate) . " OR i.publish_up <= " . $db->Quote($now) . " )";
     $query .= " AND ( i.publish_down = " . $db->Quote($nullDate) . " OR i.publish_down >= " . $db->Quote($now) . " )";
     if (!is_null($cid)) {
         if (is_array($cid)) {
             $catidpreload = $params->get('category_preload');
             $list = self::getCategoriesFull($cid, $params);
             $catids = array();
             if (!empty($list)) {
                 foreach ($list as $item) {
                     $catids[] = $item->id;
                 }
             }
             if (in_array($catidpreload, $catids)) {
                 array_unshift($catids, $catidpreload);
             }
             $cids = array_unique($catids);
             JArrayHelper::toInteger($cids);
             $query .= " AND i.catid IN(" . implode(',', $cids) . ")";
         }
     }
     if ($params->get('FeaturedItems') == '0') {
         $query .= " AND i.featured != 1";
     }
     if ($params->get('FeaturedItems') == '2') {
         $query .= " AND i.featured = 1";
     }
     if ($params->get('videosOnly')) {
         $query .= " AND (i.video IS NOT NULL AND i.video!='')";
     }
     if ($ordering == 'comments') {
         $query .= " AND comments.published = 1";
     }
     if (K2_JVERSION != '15') {
         if ($mainframe->getLanguageFilter()) {
             $languageTag = JFactory::getLanguage()->getTag();
             $query .= " AND c.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ") AND i.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ")";
         }
     }
     switch ($ordering) {
         case 'date':
             $orderby = 'i.created ASC';
             break;
         case 'rdate':
             $orderby = 'i.created DESC';
             break;
         case 'alpha':
             $orderby = 'i.title';
             break;
         case 'ralpha':
             $orderby = 'i.title DESC';
             break;
         case 'order':
             if ($params->get('FeaturedItems') == '2') {
                 $orderby = 'i.featured_ordering';
             } else {
                 $orderby = 'i.ordering';
             }
             break;
         case 'rorder':
             if ($params->get('FeaturedItems') == '2') {
                 $orderby = 'i.featured_ordering DESC';
             } else {
                 $orderby = 'i.ordering DESC';
             }
             break;
         case 'hits':
             if ($params->get('popularityRange')) {
                 $datenow = JFactory::getDate();
                 $date = K2_JVERSION == '15' ? $datenow->toMySQL() : $datenow->toSql();
                 $query .= " AND i.created > DATE_SUB('{$date}',INTERVAL " . $params->get('popularityRange') . " DAY) ";
             }
             $orderby = 'i.hits DESC';
             break;
         case 'rand':
             $orderby = 'RAND()';
             break;
         case 'best':
             $orderby = 'rating DESC';
             break;
         case 'comments':
             if ($params->get('popularityRange')) {
                 $datenow = JFactory::getDate();
                 $date = K2_JVERSION == '15' ? $datenow->toMySQL() : $datenow->toSql();
                 $query .= " AND i.created > DATE_SUB('{$date}',INTERVAL " . $params->get('popularityRange') . " DAY) ";
             }
             $query .= " GROUP BY i.id ";
             $orderby = 'numOfComments DESC';
             break;
         case 'modified':
             $orderby = 'lastChanged DESC';
             break;
         case 'publishUp':
             $orderby = 'i.publish_up DESC';
             break;
         default:
             $orderby = 'i.id DESC';
             break;
     }
     $query .= " ORDER BY " . $orderby;
     if ($counttotal) {
         $db->setQuery($query);
         $items = $db->loadObjectList();
         return count($items);
     } else {
         $db->setQuery($query, $start, $limit);
         $items = $db->loadObjectList();
     }
     $model = K2Model::getInstance('Item', 'K2Model');
     if (count($items)) {
         foreach ($items as $item) {
             $item->event = new stdClass();
             //Clean title
             $item->title = JFilterOutput::ampReplace($item->title);
             //Images
             if ($params->get('itemImage')) {
                 $date = JFactory::getDate($item->modified);
                 $timestamp = '?t=' . $date->toUnix();
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_XS.jpg')) {
                     $item->imageXSmall = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_XS.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageXSmall .= $timestamp;
                     }
                 }
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_S.jpg')) {
                     $item->imageSmall = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_S.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageSmall .= $timestamp;
                     }
                 }
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_M.jpg')) {
                     $item->imageMedium = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_M.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageMedium .= $timestamp;
                     }
                 }
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_L.jpg')) {
                     $item->imageLarge = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_L.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageLarge .= $timestamp;
                     }
                 }
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_XL.jpg')) {
                     $item->imageXLarge = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_XL.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageXLarge .= $timestamp;
                     }
                 }
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_Generic.jpg')) {
                     $item->imageGeneric = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_Generic.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageGeneric .= $timestamp;
                     }
                 }
                 $image = 'image' . $params->get('itemImgSize', 'Small');
                 if (isset($item->{$image})) {
                     $item->image = $item->{$image};
                 }
             }
             //Read more link
             $item->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id . ':' . urlencode($item->alias), $item->catid . ':' . urlencode($item->categoryalias))));
             //Tags
             if ($params->get('itemTags')) {
                 $tags = $model->getItemTags($item->id);
                 for ($i = 0; $i < sizeof($tags); $i++) {
                     $tags[$i]->link = JRoute::_(K2HelperRoute::getTagRoute($tags[$i]->name));
                 }
                 $item->tags = $tags;
             }
             //Category link
             //if ($params->get('itemCategory'))
             $item->categoryLink = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($item->catid . ':' . urlencode($item->categoryalias))));
             //Extra fields
             if ($params->get('itemExtraFields')) {
                 $item->extra_fields = $model->getItemExtraFields($item->extra_fields, $item);
             }
             //Comments counter
             //if ($params->get('itemCommentsCounter'))
             $item->numOfComments = $model->countItemComments($item->id);
             $item->rating = $model->getRating($item->id);
             //Attachments
             if ($params->get('itemAttachments')) {
                 $item->attachments = $model->getItemAttachments($item->id);
             }
             //Import plugins
             // if ($format != 'feed')
             // {
             // $dispatcher = JDispatcher::getInstance();
             // JPluginHelper::importPlugin('content');
             // }
             //Video
             if ($params->get('itemVideo') && $format != 'feed') {
                 $params->set('vfolder', 'media/k2/videos');
                 $params->set('afolder', 'media/k2/audio');
                 $item->text = $item->video;
                 if (K2_JVERSION == '15') {
                     $dispatcher->trigger('onPrepareContent', array(&$item, &$params, $limitstart));
                 } else {
                     $dispatcher->trigger('onContentPrepare', array('mod_k2_content.', &$item, &$params, $limitstart));
                 }
                 $item->video = $item->text;
             }
             // Introtext
             $item->text = $item->introtext;
             // if ($params->get('itemIntroText'))
             // {
             // // Word limit
             // if ($params->get('itemIntroTextWordLimit'))
             // {
             // $item->text .= K2HelperUtilities::wordLimit($item->introtext, $params->get('itemIntroTextWordLimit'));
             // }
             // else
             // {
             // $item->text .= $item->introtext;
             // }
             // }
             // if ($format != 'feed')
             // {
             // $params->set('parsedInModule', 1);
             // // for plugins to know when they are parsed inside this module
             // if ($params->get('JPlugins', 1))
             // {
             // //Plugins
             // if (K2_JVERSION != '15')
             // {
             // $item->event->BeforeDisplay = '';
             // $item->event->AfterDisplay = '';
             // $dispatcher->trigger('onContentPrepare', array('mod_k2_content', &$item, &$params, $limitstart));
             // $results = $dispatcher->trigger('onContentAfterTitle', array('mod_k2_content', &$item, &$params, $limitstart));
             // $item->event->AfterDisplayTitle = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onContentBeforeDisplay', array('mod_k2_content', &$item, &$params, $limitstart));
             // $item->event->BeforeDisplayContent = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onContentAfterDisplay', array('mod_k2_content', &$item, &$params, $limitstart));
             // $item->event->AfterDisplayContent = trim(implode("\n", $results));
             // }
             // else
             // {
             // $results = $dispatcher->trigger('onBeforeDisplay', array(&$item, &$params, $limitstart));
             // $item->event->BeforeDisplay = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onAfterDisplay', array(&$item, &$params, $limitstart));
             // $item->event->AfterDisplay = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onAfterDisplayTitle', array(&$item, &$params, $limitstart));
             // $item->event->AfterDisplayTitle = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onBeforeDisplayContent', array(&$item, &$params, $limitstart));
             // $item->event->BeforeDisplayContent = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onAfterDisplayContent', array(&$item, &$params, $limitstart));
             // $item->event->AfterDisplayContent = trim(implode("\n", $results));
             // $dispatcher->trigger('onPrepareContent', array(&$item, &$params, $limitstart));
             // }
             // }
             // //Init K2 plugin events
             // $item->event->K2BeforeDisplay = '';
             // $item->event->K2AfterDisplay = '';
             // $item->event->K2AfterDisplayTitle = '';
             // $item->event->K2BeforeDisplayContent = '';
             // $item->event->K2AfterDisplayContent = '';
             // $item->event->K2CommentsCounter = '';
             // if ($params->get('K2Plugins', 1))
             // {
             // //K2 plugins
             // JPluginHelper::importPlugin('k2');
             // $results = $dispatcher->trigger('onK2BeforeDisplay', array(&$item, &$params, $limitstart));
             // $item->event->K2BeforeDisplay = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onK2AfterDisplay', array(&$item, &$params, $limitstart));
             // $item->event->K2AfterDisplay = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onK2AfterDisplayTitle', array(&$item, &$params, $limitstart));
             // $item->event->K2AfterDisplayTitle = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onK2BeforeDisplayContent', array(&$item, &$params, $limitstart));
             // $item->event->K2BeforeDisplayContent = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onK2AfterDisplayContent', array(&$item, &$params, $limitstart));
             // $item->event->K2AfterDisplayContent = trim(implode("\n", $results));
             // $dispatcher->trigger('onK2PrepareContent', array(&$item, &$params, $limitstart));
             // if ($params->get('itemCommentsCounter'))
             // {
             // $results = $dispatcher->trigger('onK2CommentsCounter', array(&$item, &$params, $limitstart));
             // $item->event->K2CommentsCounter = trim(implode("\n", $results));
             // }
             // }
             // }
             // Restore the intotext variable after plugins execution
             $item->introtext = $item->text;
             //Clean the plugin tags
             $item->introtext = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $item->introtext);
             //Author
             if ($params->get('itemAuthor')) {
                 if (!empty($item->created_by_alias)) {
                     $item->author = $item->created_by_alias;
                     $item->authorGender = NULL;
                     $item->authorDescription = NULL;
                     if ($params->get('itemAuthorAvatar')) {
                         $item->authorAvatar = K2HelperUtilities::getAvatar('alias');
                     }
                     $item->authorLink = Juri::root(true);
                 } else {
                     $author = JFactory::getUser($item->created_by);
                     $item->author = $author->name;
                     $query = "SELECT `description`, `gender` FROM #__k2_users WHERE userID=" . (int) $author->id;
                     $db->setQuery($query, 0, 1);
                     $result = $db->loadObject();
                     if ($result) {
                         $item->authorGender = $result->gender;
                         $item->authorDescription = $result->description;
                     } else {
                         $item->authorGender = NULL;
                         $item->authorDescription = NULL;
                     }
                     if ($params->get('itemAuthorAvatar')) {
                         $item->authorAvatar = K2HelperUtilities::getAvatar($author->id, $author->email, $componentParams->get('userImageWidth'));
                     }
                     //Author Link
                     $item->authorLink = JRoute::_(K2HelperRoute::getUserRoute($item->created_by));
                 }
             }
             // Extra fields plugins
             if (is_array($item->extra_fields)) {
                 foreach ($item->extra_fields as $key => $extraField) {
                     if ($extraField->type == 'textarea' || $extraField->type == 'textfield') {
                         $tmp = new JObject();
                         $tmp->text = $extraField->value;
                         if ($params->get('JPlugins', 1)) {
                             if (K2_JVERSION != '15') {
                                 $dispatcher->trigger('onContentPrepare', array('mod_k2_content', &$tmp, &$params, $limitstart));
                             } else {
                                 $dispatcher->trigger('onPrepareContent', array(&$tmp, &$params, $limitstart));
                             }
                         }
                         if ($params->get('K2Plugins', 1)) {
                             $dispatcher->trigger('onK2PrepareContent', array(&$tmp, &$params, $limitstart));
                         }
                         $extraField->value = $tmp->text;
                     }
                 }
             }
             $rows[] = $item;
         }
         return $rows;
     }
 }
Exemplo n.º 17
0
 function getUrl()
 {
     static $myurl;
     if (!empty($myurl)) {
         return $myurl;
     }
     if (!class_exists('VmConfig')) {
         require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
     }
     VmConfig::loadConfig();
     $useSSL = VmConfig::get('useSSL', 0);
     $root = Juri::root();
     if (substr($root, -1) != '/') {
         $root .= '/';
     }
     $root = str_replace('administrator/', '', $root);
     if ($useSSL) {
         $root = str_replace('http:', 'https:', $root);
     }
     $myurl = $root;
     return $root;
 }
Exemplo n.º 18
0
 public static function getTitle($activities)
 {
     foreach ($activities as $key => $activity) {
         $param = new CParameter($activity->params);
         switch ($activity->app) {
             case 'users.featured':
                 $user = CFactory::getUser($param->get('userid'));
                 $activities[$key]->title = JText::sprintf('COM_COMMUNITY_MEMBER_IS_FEATURED', '<a href="' . CRoute::_(JUri::root() . $param->get('owner_url')) . '" class="cStream-Author">' . $user->getDisplayName() . '</a>');
                 break;
             case 'events.wall':
             case 'groups.wall':
             case 'profile':
                 //$user = CFactory::getUser($activity->actor);
                 $html = '';
                 if ($activity->eventid) {
                     $event = JTable::getInstance('Event', 'cTable');
                     $event->load($activity->eventid);
                     $html .= '<a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id . '">' . $event->title . '</a>';
                 } elseif ($activity->groupid) {
                     $group = JTable::getInstance('Group', 'cTable');
                     $group->load($activity->groupid);
                     $html .= '<a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id . '">' . $group->name . '</a>';
                 } elseif (!empty($activity->target) && $activity->target != $activity->actor) {
                     $target = CFactory::getUser($activity->target);
                     $html .= '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $target->id . '">' . $target->getDisplayName() . '</a> ';
                     $html .= CActivities::format($activity->title);
                 } else {
                     $html .= JText::_('COM_COMMUNITY_STREAM_POSTED') . ' "' . CActivities::format($activity->title) . '"';
                 }
                 $activities[$key]->title = $html;
                 break;
             case 'profile.avatar.upload':
                 //$user = CFactory::getUser($activity->actor);
                 //$html = '<a class="cStream-Author" target="_blank" href="'.JUri::root().'index.php?option=com_community&view=profile&userid='.$user->id.'">'.$user->getDisplayName().'</a> ';
                 $html = JText::_('COM_COMMUNITY_ACTIVITIES_NEW_AVATAR');
                 $activities[$key]->title = $html;
                 break;
             case 'albums.comment':
             case 'albums':
                 $album = JTable::getInstance('Album', 'CTable');
                 $album->load($activity->cid);
                 $user = CFactory::getUser($activity->actor);
                 //$html = '<a class="cStream-Author" target="_blank" href="'.JUri::root().'index.php?option=com_community&view=profile&userid='.$user->id.'">'.$user->getDisplayName().'</a> ';
                 $html = JText::sprintf('COM_COMMUNITY_ACTIVITIES_WALL_POST_ALBUM', CRoute::_($album->getURI()), CStringHelper::escape($album->name));
                 $activities[$key]->title = $html;
                 break;
             case 'profile.like':
             case 'groups.like':
             case 'events.like':
             case 'photo.like':
             case 'videos.like':
             case 'album.like':
                 $actors = $param->get('actors');
                 $user = CFactory::getUser($activity->actor);
                 $users = explode(',', $actors);
                 $userCount = count($users);
                 switch ($activity->app) {
                     case 'profile.like':
                         $cid = CFactory::getUser($activity->cid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $cid->id;
                         $name = $cid->getDisplayName();
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_PROFILE';
                         break;
                     case 'groups.like':
                         $cid = JTable::getInstance('Group', 'CTable');
                         $cid->load($activity->groupid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $cid->id;
                         $name = $cid->name;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_GROUP';
                         break;
                     case 'events.like':
                         $cid = JTable::getInstance('Event', 'CTable');
                         $cid->load($activity->eventid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $cid->id;
                         $name = $cid->title;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_EVENT';
                         break;
                     case 'photo.like':
                         $cid = JTable::getInstance('Photo', 'CTable');
                         $cid->load($activity->cid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=photos&task=photo&albumid=' . $cid->albumid . '&userid=' . $cid->creator . '&photoid=' . $cid->id;
                         $name = $cid->caption;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_PHOTO';
                         break;
                     case 'videos.like':
                         $cid = JTable::getInstance('Video', 'CTable');
                         $cid->load($activity->cid);
                         $urlLink = JURI::root() . 'index.php?option=com_community&view=videos&task=video&userid=' . $cid->creator . '&videoid=' . $cid->id;
                         $name = $cid->getTitle();
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_VIDEO';
                         break;
                     case 'album.like':
                         $cid = JTable::getInstance('Album', 'CTable');
                         $cid->load($activity->cid);
                         $urlLink = Juri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $cid->id . '&userid=' . $cid->creator;
                         $name = $cid->name;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_ALBUM';
                         break;
                 }
                 $slice = 2;
                 if ($userCount > 2) {
                     $slice = 1;
                 }
                 $users = array_slice($users, 0, $slice);
                 $actorsHTML = array();
                 foreach ($users as $actor) {
                     $user = CFactory::getUser($actor);
                     $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                 }
                 $others = '';
                 if ($userCount > 2) {
                     $others = JText::sprintf('COM_COMMUNITY_STREAM_OTHERS_JOIN_GROUP', $userCount - 1);
                 }
                 $jtext = $userCount > 1 ? 'COM_COMMUNITY_STREAM_LIKES_PLURAL' : 'COM_COMMUNITY_STREAM_LIKES_SINGULAR';
                 $activities[$key]->title = implode(' ' . JText::_('COM_COMMUNITY_AND') . ' ', $actorsHTML) . $others . JText::sprintf($jtext, $urlLink, $name, JText::_($element));
                 break;
             case 'cover.upload':
                 $user = CFactory::getUser($activity->actor);
                 $type = $param->get('type');
                 $extraMessage = '';
                 if (strtolower($type) !== 'profile') {
                     $id = strtolower($type . 'id');
                     $cTable = JTable::getInstance(ucfirst($type), 'CTable');
                     $cTable->load($activity->{$id});
                     if ($type == 'group') {
                         $extraMessage = ', <a target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $cTable->id . '">' . $cTable->name . '</a>';
                     }
                     if ($type == 'event') {
                         $extraMessage = ', <a target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $cTable->id . '">' . $cTable->title . '</a>';
                     }
                 }
                 //$html = '<a class="cStream-Author" target="_blank" href="'.JUri::root().'index.php?option=com_community&view=profile&userid='.$user->id.'">'.$user->getDisplayName().'</a> ';
                 if ($type == 'profile') {
                     $html = JText::_('COM_COMMUNITY_PHOTOS_COVER_UPLOAD_PROFILE');
                 } else {
                     $html = JText::sprintf('COM_COMMUNITY_PHOTOS_COVER_UPLOAD', strtolower(Jtext::_('COM_COMMUNITY_COVER_' . strtoupper($type)))) . $extraMessage;
                 }
                 $activities[$key]->title = $html;
                 break;
             case 'events.attend':
             case 'events':
                 $user = CFactory::getUser($activity->actor);
                 $action = $param->get('action');
                 $event = JTable::getInstance('Event', 'CTable');
                 $event->load($activity->eventid);
                 switch ($action) {
                     case 'events.create':
                         //$html = '<a class="cStream-Author" target="_blank" href="'.JUri::root().'index.php?option=com_community&view=profile&userid='.$user->id.'">'.$user->getDisplayName().'</a> -';
                         $html = JText::sprintf('COM_COMMUNITY_EVENTS_ACTIVITIES_NEW_EVENT', JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id, $event->title);
                         $activities[$key]->title = $html;
                         break;
                     case 'events.attendence.attend':
                         $users = explode(',', $param->get('actors'));
                         $actorsHTML = array();
                         foreach ($users as $actor) {
                             if (!$actor) {
                                 $actor = $activity->actor;
                             }
                             $user = CFactory::getUser($actor);
                             $actorsHTML[] = '<a class="cStream-Author" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                         }
                         $activities[$key]->title = implode(', ', $actorsHTML) . ' - ' . JText::sprintf('COM_COMMUNITY_ACTIVITIES_EVENT_ATTEND', JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id, $event->title);
                         break;
                 }
                 break;
             case 'friends.connect':
                 $user1 = CFactory::getUser($activity->actor);
                 $user2 = CFactory::getUser($activity->target);
                 $html = JText::sprintf('COM_COMMUNITY_STREAM_OTHER_FRIENDS', $user1->getDisplayName(), $user2->getDisplayName(), JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user1->id, JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user2->id);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.bulletin':
                 $user = CFactory::getUser($activity->actor);
                 $bulletin = JTable::getInstance('Bulletin', 'CTable');
                 $bulletin->load($activity->cid);
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($bulletin->groupid);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_NEW_GROUP_NEWS', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewbulletin&groupid=' . $group->id . '&bulletinid=' . $bulletin->id), $bulletin->title);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.discussion':
                 $user = CFactory::getUser($activity->actor);
                 $discussion = JTable::getInstance('Discussion', 'CTable');
                 $discussion->load($activity->cid);
                 $discussionLink = CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $discussion->groupid . '&topicid=' . $discussion->id);
                 $html = JText::sprintf('COM_COMMUNITY_GROUPS_NEW_GROUP_DISCUSSION', $discussionLink, $discussion->title);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.discussion.reply':
                 $user = CFactory::getUser($activity->actor);
                 $discussion = JTable::getInstance('Discussion', 'CTable');
                 $discussion->load($activity->cid);
                 $html = JText::sprintf('COM_COMMUNITY_GROUPS_REPLY_DISCUSSION', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $discussion->groupid . '&topicid=' . $discussion->id), $discussion->title);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.join':
                 $user = CFactory::getUser($activity->actor);
                 $users = explode(',', $param->get('actors'));
                 $userCount = count($users);
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($activity->cid);
                 $slice = 2;
                 if ($userCount > 2) {
                     $slice = 1;
                 }
                 $users = array_slice($users, 0, $slice);
                 $actorsHTML = array();
                 foreach ($users as $actor) {
                     $user = CFactory::getUser($actor);
                     $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                 }
                 $others = '';
                 if ($userCount > 2) {
                     $others = JText::sprintf('COM_COMMUNITY_STREAM_OTHERS_JOIN_GROUP', $userCount - 1);
                 }
                 $html = implode(' ' . JText::_('COM_COMMUNITY_AND') . ' ', $actorsHTML) . $others . JText::sprintf('COM_COMMUNITY_GROUPS_GROUP_JOIN', JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id, $group->name);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.update':
                 $user = CFactory::getUser($activity->actor);
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($activity->cid);
                 $html = JText::sprintf('COM_COMMUNITY_GROUPS_GROUP_UPDATED', JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id, $group->name);
                 $activities[$key]->title = $html;
                 break;
             case 'photos':
                 $user = CFactory::getUser($activity->actor);
                 $album = JTable::getInstance('Album', 'CTable');
                 $album->load($activity->cid);
                 $html = '';
                 if ($activity->groupid) {
                     $group = JTable::getInstance('Group', 'CTable');
                     $group->load($activity->groupid);
                     $html .= '<a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id . '">' . $group->name . '</a> -';
                 }
                 //$html .= ' <a class="cStream-Author" target="_blank" href="'.JUri::root().'index.php?option=com_community&view=profile&userid='.$user->id.'">'.$user->getDisplayName().'</a>';
                 $count = $param->get('count', 1);
                 $url = Juri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $album->id . '&userid=' . $user->id;
                 if (CStringHelper::isPlural($count)) {
                     $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_PHOTO_UPLOAD_TITLE_MANY', $count, $url, CStringHelper::escape($album->name));
                 } else {
                     $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_PHOTO_UPLOAD_TITLE', $url, CStringHelper::escape($album->name));
                 }
                 $activities[$key]->title = $html;
                 break;
             case 'photos.comment':
                 $user = CFactory::getUser($activity->actor);
                 $wall = JTable::getInstance('Wall', 'CTable');
                 $wall->load($param->get('wallid'));
                 $photo = JTable::getInstance('Photo', 'CTable');
                 $photo->load($activity->cid);
                 $url = JUri::root() . 'index.php?option=com_community&view=photos&task=photo&albumid=' . $photo->albumid . '&userid=' . $photo->creator . '&photoid=' . $photo->id;
                 $html = JText::sprintf('COM_COMMUNITY_ACTIVITIES_WALL_POST_PHOTO', $url, CStringHelper::escape($photo->caption));
                 $activities[$key]->title = $html;
                 break;
             case 'system.message':
             case 'system.videos.popular':
             case 'system.photos.popular':
             case 'system.members.popular':
             case 'system.photos.total':
             case 'system.groups.popular':
             case 'system.members.registered':
                 $action = $param->get('action');
                 switch ($action) {
                     case 'registered_users':
                         $usersModel = CFactory::getModel('user');
                         $now = new JDate();
                         $date = CTimeHelper::getDate();
                         $users = $usersModel->getLatestMember(10);
                         $totalRegistered = count($users);
                         $title = JText::sprintf('COM_COMMUNITY_TOTAL_USERS_REGISTERED_THIS_MONTH_ACTIVITY_TITLE', $totalRegistered, $date->monthToString($now->format('%m')));
                         $activities[$key]->title = $title;
                         break;
                     case 'total_photos':
                         $photosModel = CFactory::getModel('photos');
                         $total = $photosModel->getTotalSitePhotos();
                         $activities[$key]->title = JText::sprintf('COM_COMMUNITY_TOTAL_PHOTOS_ACTIVITY_TITLE', CRoute::_(JURI::root() . 'index.php?option=com_community&view=photos'), $total);
                         break;
                     case 'top_videos':
                         $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_VIDEOS');
                         break;
                     case 'top_photos':
                         $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_PHOTOS');
                         break;
                     case 'top_users':
                         $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_MEMBERS');
                         break;
                     case 'top_groups':
                         $groupsModel = CFactory::getModel('groups');
                         $activeGroup = $groupsModel->getMostActiveGroup();
                         if (is_null($activeGroup)) {
                             $title = JText::_('COM_COMMUNITY_GROUPS_NONE_CREATED');
                         } else {
                             $title = JText::sprintf('COM_COMMUNITY_MOST_POPULAR_GROUP_ACTIVITY_TITLE', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $activeGroup->id), $activeGroup->name);
                         }
                         $activities[$key]->title = $title;
                         break;
                     case 'message':
                         break;
                 }
                 break;
             case 'videos':
                 $video = JTable::getInstance('Video', 'CTable');
                 $video->load($activity->cid);
                 $actor = CFactory::getUser($activity->actor);
                 //$html = self::_getUserLink($activity->actor);
                 $html = JText::sprintf('COM_COMMUNITY_ACTIVITY_VIDEO_SHARE_TITLE', JUri::root() . $video->getViewURI(false), $video->title);
                 $activities[$key]->title = $html;
                 break;
             case 'videos.featured':
                 $video = JTable::getInstance('Video', 'CTable');
                 $video->load($activity->cid);
                 $activities[$key]->title = JText::sprintf('COM_COMMUNITY_VIDEOS_IS_FEATURED', '' . CStringHelper::escape($video->title) . '</a>');
                 break;
             case 'albums.featured':
                 $album = JTable::getInstance('Album', 'CTable');
                 $album->load($activity->cid);
                 $activities[$key]->title = JText::sprintf('COM_COMMUNITY_ALBUM_IS_FEATURED', '' . CStringHelper::escape($album->name) . '</a>');
                 break;
         }
         $activities[$key]->title = CString::str_ireplace('{target}', self::_getUserLink($activities[$key]->target), $activities[$key]->title);
         $activities[$key]->title = preg_replace('/\\{multiple\\}(.*)\\{\\/multiple\\}/i', '', $activities[$key]->title);
         $search = array('{single}', '{/single}');
         $activities[$key]->title = CString::str_ireplace($search, '', $activities[$key]->title);
         $activities[$key]->title = CString::str_ireplace('{actor}', self::_getUserLink($activities[$key]->actor), $activities[$key]->title);
         $activities[$key]->title = CString::str_ireplace('{app}', $activities[$key]->app, $activities[$key]->title);
         //strip out _QQQ_
         $activities[$key]->title = CString::str_ireplace('_QQQ_', '', $activities[$key]->title);
         preg_match_all("/{(.*?)}/", $activities[$key]->title, $matches, PREG_SET_ORDER);
         if (!empty($matches)) {
             //$params = new CParameter( $row->params );
             foreach ($matches as $val) {
                 $replaceWith = $param->get($val[1], null);
                 //if the replacement start with 'index.php', we can CRoute it
                 if (strpos($replaceWith, 'index.php') === 0) {
                     $replaceWith = JURI::root() . $replaceWith;
                 }
                 if (!is_null($replaceWith)) {
                     $activities[$key]->title = CString::str_ireplace($val[0], $replaceWith, $activities[$key]->title);
                 }
             }
         }
         $activities[$key]->title = preg_replace('/(<a href[^<>]+)>/is', '\\1 target="_blank">', $activities[$key]->title);
     }
     return $activities;
 }
Exemplo n.º 19
0
 * @license   GNU General Public License version 3, or later
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.modal', 'a.boxed');
$activeMenu = JFactory::getApplication()->getMenu()->getActive();
$language = $this->language;
$results = $this->items;
$language = $this->language;
$listsId = array();
//$resourceImageUrl = Juri::base() . "images/default.jpg";
//$merchantImageUrl = Juri::base() . "images/DefaultLogoList.jpg";
//$resourceLogoPath = BFCHelper::getImageUrl('onsellunits',"[img]", 'onsellunit_list_default');
//$merchantLogoPath = BFCHelper::getImageUrl('merchant',"[img]", 'resource_list_merchant_logo');
$resourceImageUrl = Juri::root() . "images/default.png";
$merchantImageUrl = Juri::root() . "images/DefaultLogoList.jpg";
$resourceLogoPath = BFCHelper::getImageUrlResized('onsellunits', "[img]", 'onsellunit_list_default');
$resourceLogoPathError = BFCHelper::getImageUrl('onsellunits', "[img]", 'onsellunit_list_default');
$merchantLogoPath = BFCHelper::getImageUrlResized('merchant', "[img]", 'resource_list_merchant_logo');
$merchantLogoPathError = BFCHelper::getImageUrl('merchant', "[img]", 'resource_list_merchant_logo');
//-------------------pagina per i l redirect di tutte le risorsein vendita
$db = JFactory::getDBO();
$uri = 'index.php?option=com_bookingforconnector&view=onsellunit';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uri) . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1  LIMIT 1');
$itemId = $db->getErrorNum() ? 0 : intval($db->loadResult());
//-------------------pagina per i l redirect di tutte le risorsein vendita
//-------------------pagina per il redirect di tutti i merchant
$uriMerchant = 'index.php?option=com_bookingforconnector&view=merchantdetails';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uriMerchant . '%') . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1  LIMIT 1');
$itemIdMerchant = $db->getErrorNum() ? 0 : intval($db->loadResult());
//-------------------pagina per il redirect di tutti i merchant
Exemplo n.º 20
0
 function file($path, &$tagparams)
 {
     $thumbw = isset($tagparams[1]) && $tagparams[1] ? $tagparams[1] : $this->params->get('thumbw', 120);
     $thumbh = isset($tagparams[2]) && $tagparams[2] ? $tagparams[2] : $this->params->get('thumbh', 90);
     $single = isset($tagparams[3]) && $tagparams[3] ? $tagparams[3] : $this->params->get('single', 1);
     $zoom = $this->params->get('zoom', 0);
     $forcepng = $this->params->get('forcepng', 1);
     $thumbbkg = $this->params->get('thumbbkg', '#FFFFFF');
     $title = $this->params->get('title', 1);
     $description = $this->params->get('description', 1);
     $image = $this->getImageInfo($path);
     if (!$image) {
         return;
     }
     $this->loadLabels($image->folder);
     if ($image->title) {
         $image->title = isset($this->labels[$image->filename]) ? $this->labels[$image->filename]['title'] : '';
     }
     if ($image->description) {
         $image->description = isset($this->labels[$image->filename]) ? $this->labels[$image->filename]['description'] : '';
     }
     $image->url = Juri::root() . $image->folder . '/' . $image->filename;
     $image->thumbUrl = $this->getCacheUrl('imagegallery', $image, $thumbw, $thumbh, $zoom, $forcepng, $thumbbkg);
     $titleString = '';
     if ($title == 2) {
         $image->title = $image->filename;
     }
     if ($title && $image->title) {
         $titleString .= '<b>' . $image->title . '</b>';
     }
     if ($description && $image->description) {
         $titleString .= empty($titleString) ? $image->description : "<br/>" . $image->description;
     }
     $html = '<a class="imagegalleryplg" href="' . $image->url . '" title="' . htmlentities($titleString) . '"><img alt="" title=" " src="' . $image->thumbUrl . '" /></a>';
     return $html;
 }
    $itemId = $itemIdMerchant;
}
$uriFav = 'index.php?option=com_bookingforconnector&view=resources&layout=favorites';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uriFav) . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1 LIMIT 1');
//$itemIdFav = ($db->getErrorNum())? 0 : intval($db->loadResult());
$itemIdFav = intval($db->loadResult());
//-------------------pagina per i l redirect di tutte le risorsein vendita
if ($itemIdFav != 0) {
    $routeFav = JRoute::_($uriFav . '&Itemid=' . $itemIdFav);
} else {
    $routeFav = JRoute::_($uriFav);
}
$img = JURI::root() . "/media/com_bookingfor/images/default.png";
$imgError = JURI::root() . "/media/com_bookingfor/images/default.png";
$merchantLogo = Juri::root() . "/media/com_bookingfor/images/default.png";
$offersDefault = Juri::root() . "/media/com_bookingfor/images/offertDefault.jpg";
$merchantLogoPath = BFCHelper::getImageUrlResized('merchant', "[img]", 'merchant_list_default');
$merchantLogoPathError = BFCHelper::getImageUrl('merchant', "[img]", 'merchant_list_default');
?>
<form action="<?php 
echo htmlspecialchars(JFactory::getURI()->toString());
?>
" method="post" name="bookingforsearchForm" id="bookingforsearchForm">
<script type="text/javascript">
<!--
var urlCheck = "<?php 
echo JRoute::_('index.php?option=com_bookingforconnector');
?>
";	
var cultureCode = '<?php 
echo $language;
Exemplo n.º 22
0
body,#main{
	margin:0 !important;
	padding:0 !important;
	min-height:250px !important;
}
.sc-error {
    background-color: #DA2929;
    border: 1px solid #D1D2D5;
    border-radius: 3px;
    overflow: hidden;
    padding: 0 0 0 40px;
}

.sc-icon-error {
    background-image: url(<?php 
echo Juri::root() . '/components/com_bt_socialconnect/images/error.png';
?>
);
    background-repeat: no-repeat;
    background-size: auto auto;
    display: inline-block;
    height: 26px;
    width: 26px;
	float: left;
    margin: 9px 0 0 -29px;	
    height: 18px;
    width: 18px;
}

.sc-infoerror {
    font-size: 14px;
Exemplo n.º 23
0
 public static function getListItems($cid, &$params)
 {
     $mainframe = JFactory::getApplication();
     $limit = $params->get('itemCount', 5);
     $ordering = $params->get('itemsOrdering', '');
     $user = JFactory::getUser();
     $aid = $user->get('aid');
     $db = JFactory::getDBO();
     $jnow = JFactory::getDate();
     $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
     $nullDate = $db->getNullDate();
     $query = "SELECT i.*, CASE WHEN i.modified = 0 THEN i.created ELSE i.modified END as lastChanged, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams";
     if ($ordering == 'best') {
         $query .= ", (r.rating_sum/r.rating_count) AS rating";
     }
     if ($ordering == 'comments') {
         $query .= ", COUNT(comments.id) AS numOfComments";
     }
     $query .= " FROM #__k2_items as i RIGHT JOIN #__k2_categories c ON c.id = i.catid";
     if ($ordering == 'best') {
         $query .= " LEFT JOIN #__k2_rating r ON r.itemID = i.id";
     }
     if ($ordering == 'comments') {
         $query .= " LEFT JOIN #__k2_comments comments ON comments.itemID = i.id";
     }
     if (K2_JVERSION != '15') {
         $query .= " WHERE i.published = 1 AND i.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ") AND i.trash = 0 AND c.published = 1 AND c.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ")  AND c.trash = 0";
     } else {
         $query .= " WHERE i.published = 1 AND i.access <= {$aid} AND i.trash = 0 AND c.published = 1 AND c.access <= {$aid} AND c.trash = 0";
     }
     $query .= " AND ( i.publish_up = " . $db->Quote($nullDate) . " OR i.publish_up <= " . $db->Quote($now) . " )";
     $query .= " AND ( i.publish_down = " . $db->Quote($nullDate) . " OR i.publish_down >= " . $db->Quote($now) . " )";
     if (!is_null($cid)) {
         if (is_array($cid)) {
             if ($params->get('getChildren')) {
                 $itemListModel = K2Model::getInstance('Itemlist', 'K2Model');
                 $categories = $itemListModel->getCategoryTree($cid);
                 $sql = @implode(',', $categories);
                 $query .= " AND i.catid IN ({$sql})";
             } else {
                 JArrayHelper::toInteger($cid);
                 $query .= " AND i.catid IN(" . implode(',', $cid) . ")";
             }
         } else {
             if ($params->get('getChildren')) {
                 $itemListModel = K2Model::getInstance('Itemlist', 'K2Model');
                 $categories = $itemListModel->getCategoryTree($cid);
                 $sql = @implode(',', $categories);
                 $query .= " AND i.catid IN ({$sql})";
             } else {
                 $query .= " AND i.catid=" . (int) $cid;
             }
         }
     }
     if ($params->get('FeaturedItems') == '0') {
         $query .= " AND i.featured != 1";
     }
     if ($params->get('FeaturedItems') == '2') {
         $query .= " AND i.featured = 1";
     }
     if ($params->get('videosOnly')) {
         $query .= " AND (i.video IS NOT NULL AND i.video!='')";
     }
     if ($ordering == 'comments') {
         $query .= " AND comments.published = 1";
     }
     if (K2_JVERSION != '15') {
         if ($mainframe->getLanguageFilter()) {
             $languageTag = JFactory::getLanguage()->getTag();
             $query .= " AND c.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ") AND i.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ")";
         }
     }
     switch ($ordering) {
         case 'date':
             $orderby = 'i.created ASC';
             break;
         case 'rdate':
             $orderby = 'i.created DESC';
             break;
         case 'alpha':
             $orderby = 'i.title';
             break;
         case 'ralpha':
             $orderby = 'i.title DESC';
             break;
         case 'order':
             if ($params->get('FeaturedItems') == '2') {
                 $orderby = 'i.featured_ordering';
             } else {
                 $orderby = 'i.ordering';
             }
             break;
         case 'rorder':
             if ($params->get('FeaturedItems') == '2') {
                 $orderby = 'i.featured_ordering DESC';
             } else {
                 $orderby = 'i.ordering DESC';
             }
             break;
         case 'hits':
             if ($params->get('popularityRange')) {
                 $datenow = JFactory::getDate();
                 $date = K2_JVERSION == '15' ? $datenow->toMySQL() : $datenow->toSql();
                 $query .= " AND i.created > DATE_SUB('{$date}',INTERVAL " . $params->get('popularityRange') . " DAY) ";
             }
             $orderby = 'i.hits DESC';
             break;
         case 'rand':
             $orderby = 'RAND()';
             break;
         case 'best':
             $orderby = 'rating DESC';
             break;
         case 'comments':
             if ($params->get('popularityRange')) {
                 $datenow = JFactory::getDate();
                 $date = K2_JVERSION == '15' ? $datenow->toMySQL() : $datenow->toSql();
                 $query .= " AND i.created > DATE_SUB('{$date}',INTERVAL " . $params->get('popularityRange') . " DAY) ";
             }
             $query .= " GROUP BY i.id ";
             $orderby = 'numOfComments DESC';
             break;
         case 'modified':
             $orderby = 'lastChanged DESC';
             break;
         case 'publishUp':
             $orderby = 'i.publish_up DESC';
             break;
         default:
             $orderby = 'i.id DESC';
             break;
     }
     $query .= " ORDER BY " . $orderby;
     $db->setQuery($query, 0, $limit);
     $items = $db->loadObjectList();
     $model = K2Model::getInstance('Item', 'K2Model');
     $show_introtext = $params->get('item_desc_display', 0);
     $introtext_limit = $params->get('item_desc_max_characs', 100);
     $show_title = $params->get('item_title_display', 1);
     $title_limit = $params->get('item_title_max_characs', 20);
     $item_title_ending_char = $params->get('item_title_ending_char', '');
     $item_desc_ending_char = $params->get('item_desc_ending_char', '');
     $show_other_title = $params->get('other_title_display', 1);
     $other_title_limit = $params->get('other_title_max_characs', 20);
     $other_item_title_ending_char = $params->get('other_item_title_ending_char', '');
     if (count($items)) {
         foreach ($items as $item) {
             //Clean title
             $item->title = JFilterOutput::ampReplace($item->title);
             $item->displaytitle = $show_title ? self::truncate($item->title, $title_limit, $item_title_ending_char) : '';
             //Read more link
             $item->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id . ':' . urlencode($item->alias), $item->catid . ':' . urlencode($item->categoryalias))));
             //Author
             if (!empty($item->created_by_alias)) {
                 $item->author = $item->created_by_alias;
                 $item->authorGender = NULL;
                 $item->authorDescription = NULL;
                 if ($params->get('itemAuthorAvatar')) {
                     $item->authorAvatar = K2HelperUtilities::getAvatar('alias');
                 }
                 $item->authorLink = Juri::root(true);
             } else {
                 $author = JFactory::getUser($item->created_by);
                 $item->author = $author->name;
                 $query = "SELECT `description`, `gender` FROM #__k2_users WHERE userID=" . (int) $author->id;
                 $db->setQuery($query, 0, 1);
                 $result = $db->loadObject();
                 if ($result) {
                     $item->authorGender = $result->gender;
                     $item->authorDescription = $result->description;
                 } else {
                     $item->authorGender = NULL;
                     $item->authorDescription = NULL;
                 }
                 if ($params->get('itemAuthorAvatar')) {
                     $item->authorAvatar = K2HelperUtilities::getAvatar($author->id, $author->email, $componentParams->get('userImageWidth'));
                 }
                 //Author Link
                 $item->authorLink = JRoute::_(K2HelperRoute::getUserRoute($item->created_by));
             }
             //Tags
             $item->tags = '';
             if ($params->get('item_tags_display')) {
                 $tags = $model->getItemTags($item->id);
                 for ($i = 0; $i < sizeof($tags); $i++) {
                     $tags[$i]->link = JRoute::_(K2HelperRoute::getTagRoute($tags[$i]->name));
                 }
                 $item->tags = $tags;
             }
             // Restore the intotext variable after plugins execution
             self::getK2Images($item, $params);
             //Clean the plugin tags
             $item->introtext = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $item->introtext);
             if ($item->fulltext != '') {
                 $item->fulltext = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $item->fulltext);
                 $item->_introtext = self::_cleanText($item->introtext . $item->fulltext);
             } else {
                 $item->_introtext = self::_cleanText($item->introtext);
             }
             $item->displayIntrotext = $show_introtext ? self::truncate($item->_introtext, $introtext_limit, $item_desc_ending_char) : '';
             $item->othertitle = self::truncate($item->title, $other_title_limit, $other_item_title_ending_char);
             $rows[] = $item;
         }
         return $rows;
     }
 }
    /**
     * Save user registration request_id
     * @access public
     * @return type
     */
    public function onBeforeCompileHead()
    {
        $document = JFactory::getDocument();
        $app = JFactory::getApplication();
        if ($app->isAdmin()) {
            if (!version_compare(JVERSION, '3', 'ge')) {
                $buf = $document->getHeadData();
                $is_jquery = false;
                foreach ($buf['scripts'] as $key => $value) {
                    if (stripos($key, 'jquery') !== false) {
                        $is_jquery = true;
                    }
                }
                if (!$is_jquery) {
                    $document->addScript(Juri::root() . "plugins/system/antispambycleantalk/jquery-1.11.2.min.js");
                }
                $document->addScriptDeclaration("jQuery.noConflict();");
                $document->addScriptDeclaration("var ct_joom25=true;");
            } else {
                JHtml::_('jquery.framework');
                $document->addScriptDeclaration("var ct_joom25=false;");
            }
            $plugin = JPluginHelper::getPlugin('system', 'antispambycleantalk');
            $jparam = new JRegistry($plugin->params);
            $show_notice = $jparam->get('show_notice', 0);
            $document->addStyleDeclaration('.cleantalk_auto_key{-webkit-border-bottom-left-radius: 5px;-webkit-border-bottom-right-radius: 5px;-webkit-border-radius: 5px;-webkit-border-top-left-radius: 5px;-webkit-border-top-right-radius: 5px;background: #3399FF;border-radius: 5px;box-sizing: border-box;color: #FFFFFF;font: normal normal 400 14px/16.2px "Open Sans";padding:3px;border:0px none;cursor:pointer;display:block;width:250px;height:30px;text-align:center;}');
            $document->addStyleDeclaration('#jform_params_autokey-lbl{width:240px;}');
            $config = JFactory::getConfig();
            $adminmail = $config->get('mailfrom');
            $document->addScriptDeclaration('var cleantalk_domain="' . $_SERVER['HTTP_HOST'] . '";
	var cleantalk_mail="' . $adminmail . '";
	var ct_register_message="' . JText::_('PLG_SYSTEM_CLEANTALK_REGISTER_MESSAGE') . $adminmail . '";
	var ct_register_error="' . addslashes(JText::_('PLG_SYSTEM_CLEANTALK_PARAM_GETAPIKEY')) . '";
	var ct_register_notice="' . JText::_('PLG_SYSTEM_CLEANTALK_PARAM_NOTICE1') . $adminmail . JText::_('PLG_SYSTEM_CLEANTALK_PARAM_NOTICE2') . '";
	');
            $document->addScript(JURI::root(true) . "/plugins/system/antispambycleantalk/cleantalk.js");
            $cfg = $this->getCTConfig();
            $document->addScriptDeclaration('var ct_user_token="' . $cfg['user_token'] . '";');
            $document->addScriptDeclaration('var ct_stat_link="' . JText::_('PLG_SYSTEM_CLEANTALK_STATLINK') . '";');
            if ($show_notice == 1 && @isset($_SESSION['__default']['user']->id) && $_SESSION['__default']['user']->id > 0) {
                $document->addScriptDeclaration('var ct_show_feedback=true;');
                $document->addScriptDeclaration('var ct_show_feedback_mes="' . JText::_('PLG_SYSTEM_CLEANTALK_FEEDBACKLINK') . '";');
            } else {
                $document->addScriptDeclaration('var ct_show_feedback=false;');
            }
        }
        if ($app->isAdmin()) {
            return;
        }
        $session = JFactory::getSession();
        $username = $session->get("register_username");
        $email = $session->get("register_email");
        $ct_request_id = $session->get("ct_request_id");
        if ($username != '' && $email != '') {
            self::initTables();
            $session->set("register_username", null);
            $session->set("register_email", null);
            $session->set("ct_request_id", null);
            $db = JFactory::getDBO();
            $db->setQuery("SELECT * FROM `#__users` WHERE username='******' AND email='" . $email . "'");
            $user = $db->loadRowList();
            if (!empty($user)) {
                $user_id = $user[0][0];
                $db->setQuery("UPDATE `#__users` SET ct_request_id='" . $ct_request_id . "' WHERE id='" . $user_id . "'");
                $db->query("UPDATE `#__users` SET ct_request_id='" . $ct_request_id . "' WHERE id='" . $user_id . "'");
            }
        }
    }
Exemplo n.º 25
0
<?php

defined('_JEXEC') or die;
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
require JModuleHelper::getLayoutPath('mod_grandsocial', $params->get('layout', 'default'));
// Add Params
$app = JFactory::getApplication();
$params = $app->getParams();
// Add Style
$doc = JFactory::getDocument();
$doc->AddStyleSheet(Juri::root() . 'modules/mod_grandsocial/css/font-awesome.min.css');
$doc->AddStyleSheet(Juri::root() . 'modules/mod_grandsocial/css/grand.css');
Exemplo n.º 26
0
 * @var   string   $userName        The user name
 * @var   mixed    $groups          The filtering groups (null means no filtering)
 * @var   mixed    $exclude         The users to exclude from the list of users
 */
// Set the link for the user selection page
$link = 'index.php?option=com_users&amp;view=users&amp;layout=modal&amp;tmpl=component&amp;required=' . ($required ? 1 : 0) . '&amp;field={field-user-id}' . (isset($groups) ? '&amp;groups=' . base64_encode(json_encode($groups)) : '') . (isset($excluded) ? '&amp;excluded=' . base64_encode(json_encode($excluded)) : '');
//~ // Invalidate the input value if no user selected
//~ if (JText::_('JLIB_FORM_SELECT_USER') == htmlspecialchars($userName, ENT_COMPAT, 'UTF-8'))
//~ {
//~ $userName = "";
//~ }
/*##mygruz20160510033514 { Also below replaced al field-user with field-users
It was:
JHtml::script('jui/fielduser.min.js', false, true, false, false, true);
It became:*/
JHtml::script(Juri::root() . '/libraries/gjfields/js/fieldusers.js', false, true, false, false, true);
/*##mygruz20160510033514 } */
// Create a dummy text field with the user name.
?>
<div class="field-users-wrapper"
	data-url="<?php 
echo $link;
?>
"
	data-modal=".modal"
	data-modal-width="100%"
	data-modal-height="400px"
	data-input=".field-users-input"
	data-input-name=".field-users-input-name"
	data-button-select=".button-select"
	>