Example #1
0
 public function display($cachable = false, $urlparams = false)
 {
     // Redirect profile to integrated component if profile integration is turned on
     $redirect = 1;
     $active = $this->app->getMenu()->getActive();
     if (!empty($active)) {
         $params = $active->params;
         $redirect = $params->get('integration', 1);
     }
     if ($redirect && JRequest::getCmd('format', 'html') == 'html') {
         $profileIntegration = KunenaFactory::getProfile();
         $layout = JRequest::getCmd('layout', 'default');
         if ($profileIntegration instanceof KunenaProfileKunena) {
             // Continue
         } elseif ($layout == 'default') {
             $url = $this->me->getUrl(false);
         } elseif ($layout == 'list') {
             $url = $profileIntegration->getUserListURL('', false);
         }
         if (!empty($url)) {
             $this->setRedirect($url);
             return;
         }
     }
     $layout = JRequest::getCmd('layout', 'default');
     if ($layout == 'list') {
         if (KunenaFactory::getConfig()->userlist_allowed && JFactory::getUser()->guest) {
             $this->redirectBack();
         }
     }
     parent::display();
 }
Example #2
0
 public function display($cachable = false, $urlparams = false)
 {
     // Redirect profile to integrated component if profile integration is turned on
     $redirect = 1;
     $active = $this->app->getMenu()->getActive();
     if (!empty($active)) {
         if (version_compare(JVERSION, '1.6', '>')) {
             // Joomla 1.6+
             $params = $active->params;
         } else {
             // Joomla 1.5
             $params = new JParameter($active->params);
         }
         $redirect = $params->get('integration', 1);
     }
     if ($redirect && JRequest::getCmd('format') == 'html') {
         $profileIntegration = KunenaFactory::getProfile();
         if ($profileIntegration instanceof KunenaProfileKunena) {
             // Continue
         } elseif (JRequest::getCmd('layout', 'default') == 'default') {
             $url = $this->me->getUrl(false);
         } elseif (JRequest::getCmd('layout') == 'list') {
             $url = $profileIntegration->getUserListURL('', false);
         }
         if (!empty($url)) {
             $this->setRedirect($url);
             return;
         }
     }
     parent::display();
 }
Example #3
0
 public function display($cachable = false, $urlparams = false)
 {
     $db = JFactory::getDbo();
     // Enable Kunena updates if they were disabled (but only every 6 hours or logout/login).
     $now = time();
     $timestamp = $this->app->getUserState('pkg_kunena.updateCheck', 0);
     if ($timestamp < $now) {
         $query = $db->getQuery(true)->update($db->quoteName('#__update_sites'))->set($db->quoteName('enabled') . '=1')->where($db->quoteName('location') . ' LIKE ' . $db->quote('http://update.kunena.org/%'));
         $db->setQuery($query);
         $db->execute();
         $this->app->setUserState('pkg_kunena.updateCheck', $now + 60 * 60 * 6);
     }
     parent::display($cachable, $urlparams);
 }
Example #4
0
	public function display() {
		// Redirect profile to integrated component if profile integration is turned on
		$redirect = 1;
		$active = JFactory::getApplication ()->getMenu ()->getActive ();
		if (!empty($active)) {
			$params = new JParameter($active->params);
			$redirect = $params->get('integration');
		}
		if ($redirect) {
			$profileIntegration = KunenaFactory::getProfile();
			if (!($profileIntegration instanceof KunenaProfileKunena)) {
				$url = CKunenaLink::GetProfileURL(KunenaFactory::getUser()->userid, false);
				if ($url) {
					$this->setRedirect($url);
					return;
				}
			}
		}
		parent::display();
	}