Ejemplo n.º 1
0
 public function __construct(&$subject, $config)
 {
     // Do not load if Kunena version is not supported or Kunena is offline
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('3.0') && KunenaForum::installed())) {
         return;
     }
     $app = JFactory::getApplication();
     // Do not load if CommunityBuilder is not installed
     $path = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
     if (!is_file($path)) {
         return;
     }
     require_once $path;
     cbimport('cb.database');
     cbimport('cb.tables');
     cbimport('language.front');
     cbimport('cb.tabs');
     cbimport('cb.field');
     global $ueConfig;
     parent::__construct($subject, $config);
     $this->loadLanguage('plg_kunena_comprofiler.sys', JPATH_ADMINISTRATOR) || $this->loadLanguage('plg_kunena_comprofiler.sys', KPATH_ADMIN);
     require_once __DIR__ . "/integration.php";
     if ($app->isAdmin() && (!isset($ueConfig['version']) || version_compare($ueConfig['version'], $this->minCBVersion) < 0)) {
         $app->enqueueMessage(JText::sprintf('PLG_KUNENA_COMPROFILER_WARN_VERSION', $this->minCBVersion), 'notice');
     }
 }
Ejemplo n.º 2
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     if (!class_exists('KunenaForum') || !KunenaForum::installed()) {
         echo '<a href="index.php?option=com_kunena">PLEASE COMPLETE KUNENA INSTALLATION</a>';
         return;
     }
     KunenaFactory::loadLanguage('com_kunena');
     $none = $node->attributes('none');
     $options = array();
     foreach ($node->children() as $option) {
         $options[] = JHTML::_('select.option', $option->attributes('value'), JText::_($option->data()));
     }
     $ctrl = $control_name . '[' . $name . ']';
     $size = $node->attributes('size');
     $class = $node->attributes('class');
     $attribs = ' ';
     if ($size) {
         $attribs .= 'size="' . $size . '"';
     }
     if ($class) {
         $attribs .= 'class="' . $class . '"';
     } else {
         $attribs .= 'class="inputbox"';
     }
     if ($node->attributes('multiple')) {
         $attribs .= ' multiple="multiple"';
         $ctrl .= '[]';
     }
     return JHTML::_('kunenaforum.categorylist', $ctrl, 0, $options, $node->attributes(), $attribs, 'value', 'text', $value);
 }
Ejemplo n.º 3
0
 /**
  * Gets the model description for CB Forums
  *
  * @return stdClass
  */
 public static function getModel()
 {
     global $_CB_framework;
     static $cache = array();
     $plugin = cbforumsClass::getPlugin();
     $forum = $plugin->params->get('forum_model', 1);
     if (!isset($cache[$forum])) {
         $path = $_CB_framework->getCfg('absolute_path');
         $model = new stdClass();
         if (in_array($forum, array(1, 3, 4, 5, 6)) && file_exists($path . '/administrator/components/com_kunena/api.php')) {
             /** @noinspection PhpIncludeInspection */
             require_once $path . '/administrator/components/com_kunena/api.php';
             if (!class_exists('KunenaForum') || !KunenaForum::installed()) {
                 $model->file = null;
             } else {
                 KunenaForum::setup();
                 $model->file = $plugin->absPath . '/models/kunena20.php';
             }
             $model->detected = $forum == 6 ? CBTxt::T('Kunena 3.x') : CBTxt::T('Kunena 2.x');
             $model->type = $forum == 6 ? 6 : 5;
         } else {
             $model->file = null;
             $model->detected = CBTxt::T('None');
             $model->type = 0;
         }
         if ($model->file) {
             /** @noinspection PhpIncludeInspection */
             require_once $model->file;
             $model->class = new cbforumsModel();
         }
         $cache[$forum] = $model;
     }
     return $cache[$forum];
 }
 public function __construct(&$subject, $config)
 {
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed())) {
         return;
     }
     parent::__construct($subject, $config);
 }
Ejemplo n.º 5
0
	/**
	 * @param object $subject
	 * @param array  $config
	 */
	public function __construct(&$subject, $config)
	{
		// Do not load if Kunena version is not supported or Kunena is offline
		if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('4.0') && KunenaForum::installed()))
		{
			return;
		}

		KunenaFactory::loadLanguage('plg_kunena_uddeim.sys', 'admin');
		$path = JPATH_SITE . "/components/com_uddeim/uddeim.api.php";

		if (!is_file($path))
		{
			return;
		}

		include_once($path);

		$uddeim = new uddeIMAPI();
		if ($uddeim->version() < 1)
		{
			return;
		}

		parent::__construct($subject, $config);

		$this->loadLanguage('plg_kunena_uddeim.sys', JPATH_ADMINISTRATOR) || $this->loadLanguage('plg_kunena_uddeim.sys', KPATH_ADMIN);
	}
Ejemplo n.º 6
0
	/**
	 * @param object $subject
	 * @param array  $config
	 */
	function __construct(&$subject, $config)
	{
		// Check if Kunena API exists
		$api = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
		if (!is_file ($api))
		{
			return;
		}

		jimport ( 'joomla.application.component.helper' );
		// Check if Kunena component is installed/enabled
		if (!JComponentHelper::isEnabled ( 'com_kunena', true ))
		{
			return;
		}

		// Load Kunena API
		require_once $api;

		// Do not load if Kunena version is not supported or Kunena is not installed
		if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('4.0') && KunenaForum::installed()))
		{
			return;
		}

		parent::__construct ( $subject, $config );

		// ! Always load language after parent::construct else the name of plugin isn't yet set
		$this->loadLanguage('plg_system_kunena.sys');
	}
Ejemplo n.º 7
0
 /**
  * @return string
  */
 protected function getInput()
 {
     if (!class_exists('KunenaForum') || !KunenaForum::installed()) {
         echo '<a href="index.php?option=com_kunena">PLEASE COMPLETE KUNENA INSTALLATION</a>';
         return '';
     }
     KunenaFactory::loadLanguage('com_kunena');
     $size = $this->element['size'];
     $class = $this->element['class'];
     $attribs = ' ';
     if ($size) {
         $attribs .= 'size="' . $size . '"';
     }
     if ($class) {
         $attribs .= 'class="' . $class . '"';
     } else {
         $attribs .= 'class="inputbox"';
     }
     if (!empty($this->element['multiple'])) {
         $attribs .= ' multiple="multiple"';
     }
     // Get the field options.
     $options = $this->getOptions();
     return JHtml::_('kunenaforum.categorylist', $this->name, 0, $options, $this->element, $attribs, 'value', 'text', $this->value);
 }
Ejemplo n.º 8
0
 public function __construct(&$subject, $config)
 {
     // Do not load if Kunena version is not supported or Kunena is offline
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('3.0') && KunenaForum::installed())) {
         return;
     }
     parent::__construct($subject, $config);
 }
Ejemplo n.º 9
0
	public function __construct(&$subject, $config) {
		// Do not load if Kunena version is not supported or Kunena is offline
		if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('3.0') && KunenaForum::installed())) return;

		parent::__construct ( $subject, $config );

		$this->loadLanguage ( 'plg_kunena_joomla.sys', JPATH_ADMINISTRATOR ) || $this->loadLanguage ( 'plg_kunena_joomla.sys', KPATH_ADMIN );
	}
 public function __construct(&$subject, $config)
 {
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed())) {
         return;
     }
     JLoader::register('KunenaAvatarWoW_Avatar', __DIR__ . '/avatar.php');
     parent::__construct($subject, $config);
 }
Ejemplo n.º 11
0
 public function __construct(&$subject, $config)
 {
     // Do not load if Kunena version is not supported or Kunena is offline
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed())) {
         return;
     }
     parent::__construct($subject, $config);
     $this->loadLanguage('plg_kunena_gravatar.sys', JPATH_ADMINISTRATOR) || $this->loadLanguage('plg_kunena_gravatar.sys', KPATH_ADMIN);
     $this->path = dirname(__FILE__) . '/gravatar';
 }
Ejemplo n.º 12
0
	public function __construct(&$subject, $config) {
		// Do not load if Kunena version is not supported or Kunena is offline
		if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('4.0') && KunenaForum::installed())) return;

		// Do not load if JomSocial is not installed
		$path = JPATH_ROOT . '/components/com_community/libraries/core.php';
		if (!is_file ( $path )) return;
		include_once ($path);

		parent::__construct ( $subject, $config );

		$this->loadLanguage ( 'plg_kunena_community.sys', JPATH_ADMINISTRATOR ) || $this->loadLanguage ( 'plg_kunena_community.sys', KPATH_ADMIN );
	}
Ejemplo n.º 13
0
 /**
  * Construct plugin.
  *
  * @param object $subject
  * @param array $config
  */
 public function __construct(&$subject, $config)
 {
     // Do not enable plugin in administration.
     if (JFactory::getApplication()->isAdmin()) {
         return;
     }
     // Do not load if Kunena version is not supported or Kunena is not installed
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('4.0') && KunenaForum::installed())) {
         return;
     }
     parent::__construct($subject, $config);
     $this->loadLanguage('plg_content_kunena.sys');
 }
Ejemplo n.º 14
0
 public function __construct(&$subject, $config)
 {
     // Do not load if Kunena version is not supported or Kunena is offline
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('3.0') && KunenaForum::installed())) {
         return true;
     }
     // Check if easysocial exists
     if (!$this->exists()) {
         return true;
     }
     parent::__construct($subject, $config);
     $this->loadLanguage('plg_kunena_community.sys', JPATH_ADMINISTRATOR) || $this->loadLanguage('plg_kunena_community.sys', KPATH_ADMIN);
 }
Ejemplo n.º 15
0
	public function __construct(&$subject, $config) {
		// Do not load if Kunena version is not supported or Kunena is offline
		if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('3.0') && KunenaForum::installed())) return;

		$aup = JPATH_SITE . '/components/com_alphauserpoints/helper.php';
		if (! file_exists ( $aup ))
			return;
		require_once ($aup);

		parent::__construct ( $subject, $config );

		$this->loadLanguage ( 'plg_kunena_alphauserpoints.sys', JPATH_ADMINISTRATOR ) || $this->loadLanguage ( 'plg_kunena_alphauserpoints.sys', KPATH_ADMIN );
	}
Ejemplo n.º 16
0
 /**
  * Display Kunena backend icon in Joomla 2.5+
  *
  * @param string $context
  */
 public function onGetIcons($context)
 {
     if (!$context == 'mod_quickicon' || !JFactory::getUser()->authorise('core.manage', 'com_kunena')) {
         return;
     }
     KunenaFactory::loadLanguage('com_kunena.sys', 'admin');
     if (KunenaForum::installed() && KunenaFactory::getConfig()->version_check && JFactory::getUser()->authorise('core.manage', 'com_installer')) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true)->select($db->qn('params'))->from($db->qn('#__extensions'))->where($db->qn('type') . ' = ' . $db->q('component'))->where($db->qn('element') . ' = ' . $db->q('com_kunena'));
         $db->setQuery($query);
         $cparams = new JRegistry((string) $db->loadResult());
         //$cparams = JComponentHelper::getParams('com_kunena');
         $liveupdate = new JRegistry($cparams->get('liveupdate', null));
         $lastCheck = $liveupdate->get('lastcheck', 0);
         $updateInfo = json_decode(trim((string) $liveupdate->get('updatedata', ''), '"'));
         $valid = abs(time() - $lastCheck) <= 24 * 3600;
         // 24 hours
         if (!$valid) {
             // If information is not valid, update it asynchronously.
             $ajax_url = JURI::base() . 'index.php?option=com_kunena&view=liveupdate&task=ajax';
             $script = "window.addEvent('domready', function() {\n\tvar com_kunena_updatecheck_ajax_structure = {\n\t\tonSuccess: function(msg, responseXML) {\n\t\t\tvar updateInfo = JSON.decode(msg, true);\n\t\t\tif (updateInfo.html) {\n\t\t\t\tdocument.id('com_kunena_icon').getElement('img').setProperty('src',updateInfo.img);\n\t\t\t\tdocument.id('com_kunena_icon').getElement('span').set('html', updateInfo.html);\n\t\t\t\tdocument.id('com_kunena_icon').getElement('a').set('href', updateInfo.link);\n\t\t\t}\n\t\t},\n\t\turl: '{$ajax_url}'\n\t};\n\tajax_object = new Request(com_kunena_updatecheck_ajax_structure);\n\tajax_object.send();\n});";
             $document = JFactory::getDocument();
             $document->addScriptDeclaration($script);
         }
     }
     $link = 'index.php?option=com_kunena';
     if (!KunenaForum::installed()) {
         // Not fully installed
         $img = 'kunena/icons/icon-48-kupdate-alert-white.png';
         $text = JText::_('PLG_QUICKICON_KUNENA_COMPLETE_INSTALLATION');
     } elseif (empty($updateInfo->supported)) {
         // Unsupported
         $img = 'kunena/icons/kunena-logo-48-white.png';
         $text = JText::_('COM_KUNENA');
     } elseif ($updateInfo->stuck) {
         // Stuck
         $img = 'kunena/icons/icon-48-kupdate-alert-white.png';
         $text = JText::_('COM_KUNENA') . '<br />' . JText::_('PLG_QUICKICON_KUNENA_UPDATE_CRASH');
     } elseif (version_compare(KunenaForum::version(), $updateInfo->version, '<')) {
         // Has updates
         $img = 'kunena/icons/icon-48-kupdate-update-white.png';
         $text = 'Kunena ' . $updateInfo->version . '<br />' . JText::_('PLG_QUICKICON_KUNENA_UPDATE_AVAILABLE');
         $link .= '&view=liveupdate';
     } else {
         // Already in the latest release
         $img = 'kunena/icons/icon-48-kupdate-good-white.png';
         $text = JText::_('COM_KUNENA');
     }
     return array(array('link' => JRoute::_($link), 'image' => $img, 'text' => $text, 'access' => array('core.manage', 'com_kunena'), 'id' => 'com_kunena_icon'));
 }
Ejemplo n.º 17
0
 public function __construct(&$subject, $config)
 {
     // Do not load if Kunena version is not supported or Kunena is offline
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('3.0') && KunenaForum::installed())) {
         return;
     }
     // Do not load if Easyblog is not installed
     $path = JPATH_ADMINISTRATOR . '/components/com_easyblog/includes/easyblog.php';
     if (!is_file($path)) {
         return;
     }
     include_once $path;
     parent::__construct($subject, $config);
     $this->loadLanguage('plg_kunena_easyblog.sys', JPATH_ADMINISTRATOR) || $this->loadLanguage('plg_kunena_easyblog.sys', KPATH_ADMIN);
 }
Ejemplo n.º 18
0
 protected static function kunenaOnline()
 {
     // Kunena detection and version check
     $minKunenaVersion = '2.0';
     if (!class_exists('KunenaForum') || !KunenaForum::isCompatible($minKunenaVersion)) {
         JFactory::getApplication()->enqueueMessage(JText::sprintf('PLG_COMMUNITY_KUNENAGROUPS_KUNENA_NOT_INSTALLED', $minKunenaVersion), 'notice');
         return false;
     }
     // Kunena installed check
     if (!KunenaForum::installed()) {
         JFactory::getApplication()->enqueueMessage(JText::_('PLG_COMMUNITY_KUNENAGROUPS_KUNENA_OFFLINE'), 'notice');
         return false;
     }
     KunenaForum::setup();
     return true;
 }
Ejemplo n.º 19
0
	public function __construct(&$subject, $config) {
		// Do not load if Kunena version is not supported or Kunena is offline
		if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed())) return;

		// Do not load if jomwall is not installed
		$path = JPATH_ROOT . '/components/com_awdwall/models/wall.php';
		if (!is_file ( $path )) return;
		include_once ($path);
		include_once (JPATH_ROOT . '/components/com_awdwall/helpers/user.php');

		parent::__construct ( $subject, $config );

		$this->loadLanguage ( 'plg_kunena_jomwall.sys', JPATH_ADMINISTRATOR ) || $this->loadLanguage ( 'plg_kunena_jomwall.sys', KPATH_ADMIN );

		$this->path = dirname ( __FILE__ ) . '/jomwall';
	}
Ejemplo n.º 20
0
 function __construct(&$subject, $config)
 {
     // Check if Kunena API exists
     $api = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
     if (!is_file($api)) {
         return false;
     }
     jimport('joomla.application.component.helper');
     // Check if Kunena component is installed/enabled
     if (!JComponentHelper::isEnabled('com_kunena', true)) {
         return false;
     }
     // Load Kunena API
     require_once $api;
     // Do not load if Kunena version is not supported or Kunena is not installed
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed())) {
         return false;
     }
     $this->loadLanguage('plg_system_kunena.sys', JPATH_ADMINISTRATOR) || $this->loadLanguage('plg_system_kunena.sys', KPATH_ADMIN);
     if (version_compare(JVERSION, '1.6', '<')) {
         // Joomla 1.5: Fix bugs and bad performance
         $lang = JFactory::getLanguage();
         if (JFactory::getApplication()->isAdmin()) {
             // Load the missing language files in administration
             $lang->load('com_kunena.menu', JPATH_ADMINISTRATOR) || $lang->load('com_kunena.menu', KPATH_ADMIN);
             $lang->load('com_kunena.sys', JPATH_ADMINISTRATOR) || $lang->load('com_kunena.sys', KPATH_ADMIN);
             if (JRequest::getCmd('option') == 'com_plugins' && JRequest::getCmd('view') == 'plugin' && JRequest::getCmd('task') == 'edit') {
                 // Support for J!1.7 .sys language files
                 $cid = JRequest::getVar('cid', array(0), '', 'array');
                 $row = JTable::getInstance('plugin');
                 $row->load((int) $cid[0]);
                 $lang->load('plg_' . trim($row->folder) . '_' . trim($row->element) . '.sys', JPATH_ADMINISTRATOR) || $lang->load('plg_' . trim($row->folder) . '_' . trim($row->element) . '.sys', KPATH_ADMIN);
             }
         } else {
             // Never load language file
             $filename = JLanguage::getLanguagePath(JPATH_BASE, $lang->_lang) . "/{$lang->_lang}.com_kunena.ini";
             $lang->_paths['com_kunena'][$filename] = 1;
         }
     }
     parent::__construct($subject, $config);
 }
Ejemplo n.º 21
0
<?php

/**
 * Kunena Menu Module
 * @package Kunena.Modules
 * @subpackage Menu
 *
 * @copyright (C) 2008 - 2012 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined('_JEXEC') or die;
// Kunena detection and version check
$minKunenaVersion = '2.0';
if (!class_exists('KunenaForum') || !KunenaForum::installed() || !KunenaForum::isCompatible($minKunenaVersion)) {
    return;
}
// Include the class only once
require_once dirname(__FILE__) . '/class.php';
$params = (object) $params;
$menu = new modKunenaMenu($params);
$menu->display();
Ejemplo n.º 22
0
 public function detect()
 {
     // Kunena detection and version check
     $minKunenaVersion = '2.0.0-RC2';
     if (!class_exists('KunenaForum') || !KunenaForum::isCompatible($minKunenaVersion) || !KunenaForum::installed()) {
         $this->addMessage('<div>Kunena version: <b style="color:red">FAILED</b></div>');
         $this->addMessage('<br /><div><b>You need to install Kunena ' . $minKunenaVersion . '!</b></div>');
         $this->error = 'Kunena not detected!';
         return false;
     }
     $this->addMessage('<div>Kunena version: <b style="color:green">' . KunenaForum::version() . '</b></div>');
     if (get_class($this) == __CLASS__) {
         $this->addMessage('<br /><div><b>Please select forum software!</b></div>');
         $this->error = 'Forum not selected!';
         return false;
     }
     if ($this->external) {
         if (is_dir($this->basepath)) {
             $this->relpath = JPath::clean($this->relpath);
             $this->addMessage('<div>Using relative path: <b style="color:green">' . $this->relpath . '</b></div>');
         } else {
             $this->error = $this->exttitle . " not found from {$this->basepath}";
             $this->addMessage('<div>Using relative path: <b style="color:red">' . $this->relpath . '</b></div>');
             $this->addMessage('<div><b>Error:</b> ' . $this->error . '</div>');
             return false;
         }
     }
     if (!$this->detectComponent()) {
         $this->error = $this->exttitle . ' has not been installed into your system!';
         $this->addMessage('<div>Detecting ' . $this->exttitle . ': <b style="color:red">FAILED</b></div>');
         $this->addMessage('<br /><div><b>Error:</b> ' . $this->error . '</div>');
         return false;
     }
     $this->addMessage('<div>Detecting ' . $this->exttitle . ': <b style="color:green">OK</b></div>');
     if (JError::isError($this->ext_database)) {
         $this->error = $this->ext_database->toString();
     } elseif (!$this->ext_database) {
         $this->error = 'Database not configured.';
     }
     if ($this->error) {
         $this->addMessage('<div>Database connection: <b style="color:red">FAILED</b></div>');
         $this->addMessage('<br /><div><b>Please check that your external database settings are correct!</b></div><div><b>Error:</b> ' . $this->error . '</div>');
         return false;
     }
     $this->addMessage('<div>Database connection: <b style="color:green">OK</b></div>');
     // Check if version is compatible with importer
     $this->version = $this->getVersion();
     if (!$this->isCompatible($this->version)) {
         $this->error = "Unsupported forum: {$this->exttitle} {$this->version}";
         $this->addMessage('<div>' . $this->exttitle . ' version: <b style="color:red">' . $this->version . '</b></div>');
         $this->addMessage('<div><b>Error:</b> ' . $this->error . '</div>');
         return false;
     }
     $this->addMessage('<div>' . $this->exttitle . ' version: <b style="color:green">' . $this->version . '</b></div>');
     return true;
 }
Ejemplo n.º 23
0
<?php

/**
 * Kunena Menu Module
 * @package Kunena.Modules
 * @subpackage Menu
 *
 * @copyright (C) 2008 - 2015 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined('_JEXEC') or die;
// Kunena detection and version check
if (!class_exists('KunenaForum') || !KunenaForum::isCompatible('4.0') || !KunenaForum::installed()) {
    return;
}
// Include the class only once
require_once __DIR__ . '/class.php';
// @var object $params
$menu = new modKunenaMenu($params);
$menu->display();
Ejemplo n.º 24
0
function uddeIMgetPicOnly($ofanid, $config, $noanchor=false) {		// PIC only
	$mosConfig_lang = uddeIMgetLang(); 
	$database = uddeIMgetDatabase();
	$gimmeback = "";

	$grsize = 80;
	if ($config->avatarw)
		$grsize = $config->avatarw;

	$picstyle = "";
	if ($config->avatarw || $config->avatarh) {
		$picstyle = " style='";
		if ($config->avatarw)
			$picstyle .= "max-width: ".$config->avatarw."px; ";
		if ($config->avatarh)
			$picstyle .= "max-height: ".$config->avatarh."px; ";
		$picstyle .= "'";
	}

	if ($config->showcbpic==1) {	// CB

		if (is_dir(uddeIMgetPath('absolute_path')."/components/com_comprofiler/plugin/language/".$mosConfig_lang."/images"))
			$fileLang=$mosConfig_lang;
		else
			$fileLang="default_language";

		$sql="SELECT avatar FROM #__comprofiler WHERE user_id=".(int)$ofanid." LIMIT 1";
		$database->setQuery($sql);
		$ofanavatar=$database->loadResult();

		$filenamelocal  = "/images/comprofiler/tn".$ofanavatar;									// Thumbnail
		$filenamelive   = uddeIMgetPath('live_site')    ."/images/comprofiler/tn".$ofanavatar;	// Thumbnail

		$filenameglocal = "/images/comprofiler/".$ofanavatar;									// Gallery
		$filenameglive  = uddeIMgetPath('live_site')    ."/images/comprofiler/".$ofanavatar;	// Gallery

		// NOPHOTO for CB
		$filename2local = "/components/com_comprofiler/plugin/language/".$fileLang."/images/tnnophoto.jpg";
		$filename2live  = uddeIMgetPath('live_site')    ."/components/com_comprofiler/plugin/language/".$fileLang."/images/tnnophoto.jpg";

		// NOPHOTO for CBE
		$filename3local = "/images/".$fileLang."/tnnophoto.jpg";
		$filename3live  = uddeIMgetPath('live_site')    ."/images/".$fileLang."/tnnophoto.jpg";

		// NOPHOTO for CB 2.0
		$filename4local = "/components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_n.png";
		$filename4live  = uddeIMgetPath('live_site')    ."/components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_n.png";


		// CB 2.0
//		$cbUser =& CBuser::getInstance( $ofanid );
//		if ( !$cbUser )
//			$cbUser =& CBuser::getInstance( null );
//		$avatar = $cbUser->getField( 'avatar', null, 'html', 'none', 'list' );

		
		if (uddeIMfileExists($filenamelocal)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenamelive."' alt='' />";
		} elseif (uddeIMfileExists($filenameglocal) && $config->CBgallery) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />";
		} elseif ($config->gravatar) {
			$email = uddeIMgetEMailFromID((int)$ofanid, $config);
			$grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr);
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />";
		} elseif (uddeIMfileExists($filename4local)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename4live."' alt='' />";
		} elseif (uddeIMfileExists($filename2local)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename2live."' alt='' />";
		} elseif (uddeIMfileExists($filename3local)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename3live."' alt='' />";
		} else {
			$imgurl = "NOPHOTO";
		}
		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	} elseif ($config->showcbpic==2) {		// FB

		$sql="SELECT avatar FROM #__fb_users WHERE userid=".(int)$ofanid." LIMIT 1";
		$database->setQuery($sql);
		$ofanavatar=$database->loadResult();

		$filenameglocal = "/images/fbfiles/avatars/".$ofanavatar;									// Gallery
		$filenameglive  = uddeIMgetPath('live_site')    ."/images/fbfiles/avatars/".$ofanavatar;	// Gallery

		$filename2local = "/images/fbfiles/avatars/s_nophoto.jpg";
		$filename2live  = uddeIMgetPath('live_site')    ."/images/fbfiles/avatars/s_nophoto.jpg";

		if (uddeIMfileExists($filenameglocal)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />";
		} elseif ($config->gravatar) {
			$email = uddeIMgetEMailFromID((int)$ofanid, $config);
			$grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr);
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />";
		} elseif (uddeIMfileExists($filename2local)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename2live."' alt='' />";
		}

		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	} elseif ($config->showcbpic==3) {		// Agora
//		$database->setQuery("UPDATE #__agora_config SET conf_value=$conf_value WHERE conf_name='$conf_name'");
//		$dbresult = $database->query();

		$adir = "";
		$useavatars = 0;
		if (uddeIMfileExists("/components/com_agora/cache/cache_config.php")) {
			include(uddeIMgetPath('absolute_path')."/components/com_agora/cache/cache_config.php");
			if (isset($agora_config['o_avatars_dir'])) {
				$adir = $agora_config['o_avatars_dir'];
			}
			if (isset($agora_config['o_avatars'])) {
				$useavatars = $agora_config['o_avatars'];
			}
		}
		if (!$adir)
			return $gimmeback;

		$sql = "SELECT id, show_avatars FROM #__agora_users WHERE jos_id=".(int)$ofanid;
		$database->setQuery($sql);

		$results = $database->loadObjectList();
		if (!$results) {
			$agoraid = "notfound";
			$showavatars = 0;
		} else {
			foreach($results as $result) {
				$agoraid 	 = $result->id;
				$showavatars = $result->show_avatars;
			}
		}
//		$value = NULL;
//		if ($database->loadObject($value)) {
//			$agoraid = $value->id;
//			$showavatars = $value->show_avatars;
//		} else {
//			$agoraid = "notfound";
//			$showavatars = 0;
//		}

		$pic1 = "/".$agoraid.".gif";
		$pic2 = "/".$agoraid.".jpg";
		$pic3 = "/".$agoraid.".png";
		
		$filename1local = "/".$adir.$pic1;
		$filename1live  = uddeIMgetPath('live_site')    ."/".$adir.$pic1;
		$filename2local = "/".$adir.$pic2;
		$filename2live  = uddeIMgetPath('live_site')    ."/".$adir.$pic2;
		$filename3local = "/".$adir.$pic3;
		$filename3live  = uddeIMgetPath('live_site')    ."/".$adir.$pic3;
		$filename4local = "/".$adir."/noavatar_sm.gif";
		$filename4live  = uddeIMgetPath('live_site')    ."/".$adir."/noavatar_sm.gif";

		if (uddeIMfileExists($filename1local) && $useavatars && $showavatars) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename1live."' alt='' />";
		} elseif (uddeIMfileExists($filename2local) && $useavatars && $showavatars) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename2live."' alt='' />";
		} elseif (uddeIMfileExists($filename3local) && $useavatars && $showavatars) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename3live."' alt='' />";
		} elseif ($config->gravatar) {
			$email = uddeIMgetEMailFromID((int)$ofanid, $config);
			$grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr);
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />";
		} elseif (uddeIMfileExists($filename4local)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename4live."' alt='' />";
		}

		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	} elseif ($config->showcbpic==4) {	// CBE (new)

		if (is_dir(uddeIMgetPath('absolute_path')."/components/com_cbe/plugin/language/".$mosConfig_lang."/images"))
			$fileLang=$mosConfig_lang;
		else
			$fileLang="default_language";

		$sql="SELECT avatar FROM #__cbe WHERE user_id=".(int)$ofanid." LIMIT 1";
		$database->setQuery($sql);
		$ofanavatar=$database->loadResult();

		$filenamelocal  = "/images/cbe/tn".$ofanavatar;									// Thumbnail
		$filenamelive   = uddeIMgetPath('live_site')    ."/images/cbe/tn".$ofanavatar;	// Thumbnail

		$filenameglocal = "/images/cbe/".$ofanavatar;									// Gallery
		$filenameglive  = uddeIMgetPath('live_site')    ."/images/cbe/".$ofanavatar;	// Gallery

		// NOPHOTO for CBE new
		$filename3local = "/components/com_cbe/images/".$fileLang."/tnnophoto.jpg";
		$filename3live  = uddeIMgetPath('live_site')    ."/components/com_cbe/images/".$fileLang."/tnnophoto.jpg";

		if (uddeIMfileExists($filenamelocal)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenamelive."' alt='' />";
		} elseif (uddeIMfileExists($filenameglocal) && $config->CBgallery) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />";
		} elseif ($config->gravatar) {
			$email = uddeIMgetEMailFromID((int)$ofanid, $config);
			$grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr);
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />";
		} elseif (uddeIMfileExists($filename3local)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename3live."' alt='' />";
		}

		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	} elseif ($config->showcbpic==5) {		// KUNENA

		$sql="SELECT avatar FROM #__fb_users WHERE userid=".(int)$ofanid." LIMIT 1";
		$database->setQuery($sql);
		$ofanavatar=$database->loadResult();

		$filenameglocal = "/images/fbfiles/avatars/".$ofanavatar;									// Gallery
		$filenameglive  = uddeIMgetPath('live_site')    ."/images/fbfiles/avatars/".$ofanavatar;	// Gallery

		$filename2local = "/images/fbfiles/avatars/s_nophoto.jpg";
		$filename2live  = uddeIMgetPath('live_site')    ."/images/fbfiles/avatars/s_nophoto.jpg";

		if (uddeIMfileExists($filenameglocal)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />";
		} elseif ($config->gravatar) {
			$email = uddeIMgetEMailFromID((int)$ofanid, $config);
			$grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr);
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />";
		} elseif (uddeIMfileExists($filename2local)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename2live."' alt='' />";
		}

		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	} elseif ($config->showcbpic==6) {		// JOMSOCIAL, no gravatar

		if (class_exists('CFactory')) {
			$jsuser = CFactory::getUser((int)$ofanid);
			$filenameglive = $jsuser->getThumbAvatar();
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />";
		}

		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	} elseif ($config->showcbpic==7) {		// AUP, no gravatar

		$api_AUP = JPATH_SITE.'/components/com_alphauserpoints/helper.php';
		if ( file_exists($api_AUP) ) {
			require_once($api_AUP);
			if ($config->avatarw && $config->avatarh)
				$avatar = AlphaUserPointsHelper::getAupAvatar($ofanid, 0, $config->avatarw, $config->avatarh);
			else
				$avatar = AlphaUserPointsHelper::getAupAvatar($ofanid, 0);	// [int $width], [int $height]
			$imgurl = $avatar;
		}

		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	} elseif ($config->showcbpic==8) {		// JooCM

		$avatarFile = "";
		$sql = "SELECT a.* FROM #__joocm_avatars AS a INNER JOIN #__joocm_users AS u ON u.id_avatar = a.id WHERE u.id = ".(int)$ofanid;
		$database->setQuery($sql);
		$avatar = $database->loadObject();
		if (is_object($avatar)) {
			$pos = strpos($avatar->avatar_file, 'http://');
			if ($pos === false) {
				if ($avatar->avatar_file) {
					$avatarFile = uddeIMgetPath('live_site')."/media/joocm/avatars/";
					if ($avatar->id_user) {
						$avatarFile .= $avatar->id_user.'/'.$avatar->avatar_file;
					} else {
						$avatarFile .= 'standard/'.$avatar->avatar_file;
					}
				}
			} else {
				$avatarFile = $avatar->avatar_file;
			}
		}
		if (!$avatarFile) {
			if ($config->gravatar) {
				$email = uddeIMgetEMailFromID((int)$ofanid, $config);
				$avatarFile = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr);
			} else {
				$avatarFile = uddeIMgetPath('live_site').'/media/joocm/avatars/standard/_cm_noavatar.png';
			}
		}

		if ($avatarFile) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$avatarFile."' alt='' />";
		}

		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	} elseif ($config->showcbpic==9) {		// KUNENA 1.6+

		// $api_KUN = JPATH_SITE.'/components/com_kunena/lib/kunena.config.class.php';
		// if ( file_exists($api_KUN) ) {
		// 	require_once($api_KUN);
		// 	$kcfg = KunenaFactory::getConfig();
		//}
		
		$sql="SELECT avatar FROM #__kunena_users WHERE userid=".(int)$ofanid." LIMIT 1";
		$database->setQuery($sql);
		$ofanavatar=$database->loadResult();

		$filenameglocal = "/media/kunena/avatars/".$ofanavatar;
		$filenameglive  = uddeIMgetPath('live_site')    ."/media/kunena/avatars/".$ofanavatar;

		$filename2local = "/media/kunena/avatars/s_nophoto.jpg";
		$filename2live  = uddeIMgetPath('live_site')    ."/media/kunena/avatars/s_nophoto.jpg";

		if (uddeIMfileExists($filenameglocal)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />";
		} elseif ($config->gravatar) {
			$email = uddeIMgetEMailFromID((int)$ofanid, $config);
			$grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr);
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />";
		} elseif (uddeIMfileExists($filename2local)) {
			$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename2live."' alt='' />";
		}

		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	} elseif ($config->showcbpic==10) {		// NINJABOARD

		// $filenameglocal = "/media/com_ninjaboard/images/avatars/".$ofanid."/avatar.png";
		// $filenameglive  = uddeIMgetPath('live_site')    ."/media/com_ninjaboard/images/avatars/".$ofanid."/avatar.png";

		// if (uddeIMfileExists($filenameglocal)) {
		// 	$gimmeback = uddeIMgetLinkOnly($ofanid, "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />", $config);
		// }

		$filenameglive  = uddeIMgetPath('live_site')    ."/index.php?view=avatar&id=".$ofanid."&thumbnail=large";
		$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />";

		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	} elseif ($config->showcbpic==11 || $config->showcbpic==12) {		// KUNENA 2.0+, 3.0+

		$sizex = $sizey = $grsize;
		$class = 'avatar';
		
		KunenaForum::setup();
	    $isInstalled = KunenaForum::installed ();
		if ($isInstalled) {

			$user = KunenaUserHelper::get($ofanid);        
			// $user = KunenaFactory::getUser();
	 
			// Get avatar URL "/media/kunena/avatars/path/file.jpg"
			$avatarUrl = $user->getAvatarURL($sizex, $sizey);
			// Get avatar <img> tag
			$avatarHtml = $user->getAvatarImage($class, $sizex, $sizey);
			// Get profile link with avatar pointing to profile page
			$userLink = $user->getLink(null, $avatarHtml);

			$filenameglocal = $avatarUrl;
			$filenameglive  = $avatarHtml;

	  		if (!empty($avatarUrl)) {			
				$imgurl = $filenameglive;
			} elseif ($config->gravatar) {
				$email = uddeIMgetEMailFromID((int)$ofanid, $config);
				$grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr);
				$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />";
			} else {
				$imgurl = "";
			}

			if ($noanchor)
				$gimmeback = $imgurl;
			else
				$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

		}

	} elseif ($config->showcbpic==0 && $config->gravatar) {		// disabled, but gravatar enabled
		$email = uddeIMgetEMailFromID((int)$ofanid, $config);
		$grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr);
		$imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />";

		if ($noanchor)
			$gimmeback = $imgurl;
		else
			$gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config);

	}
	return $gimmeback;
}
Ejemplo n.º 25
0
function KunenaParseRoute($segments)
{
    // If Kunena Forum isn't installed do nothing
    if (!class_exists('KunenaForum') || !KunenaForum::isCompatible('3.0') || !KunenaForum::installed()) {
        return array();
    }
    $profiler = JProfiler::getInstance('Application');
    KUNENA_PROFILER ? $profiler->mark('kunenaRoute') : null;
    $starttime = $profiler->getmicrotime();
    // Get current menu item and get query variables from it
    $active = JFactory::getApplication()->getMenu()->getActive();
    $vars = isset($active->query) ? $active->query : array('view' => 'home');
    if (empty($vars['view']) || $vars['view'] == 'home' || $vars['view'] == 'entrypage') {
        $vars['view'] = '';
    }
    // Use category SEF feature?
    $sefcats = isset(KunenaRoute::$sefviews[$vars['view']]) && empty($vars['id']);
    // Handle all segments
    while (($segment = array_shift($segments)) !== null) {
        // Skip //
        if (!$segment) {
            continue;
        }
        if ($sefcats && class_exists('KunenaRoute') && method_exists('KunenaRoute', 'resolveAlias')) {
            // Find out if we have SEF alias (category, view or layout)
            $alias = strtr($segment, ':', '-');
            $variables = KunenaRoute::resolveAlias($alias);
            if ($variables) {
                $sefcats = false;
                $vars = $variables + $vars;
                continue;
            }
        }
        $sefcats = false;
        // Generate variable and value
        $seg = explode(':', $segment);
        $var = array_shift($seg);
        $value = array_shift($seg);
        if (empty($var) && empty($value)) {
            // Skip /-/
            continue;
        }
        if (is_numeric($var)) {
            // Handle variables starting by number
            $value = (int) $var;
            if ($vars['view'] == 'user') {
                // Special case: User view
                $var = 'userid';
            } elseif (empty($vars['catid'])) {
                // First number is always category
                $var = 'catid';
                $vars['view'] = 'category';
            } elseif (empty($vars['id'])) {
                // Second number is always topic
                $var = 'id';
                $vars['view'] = 'topic';
                $sefcats = false;
            } elseif (empty($vars['mesid'])) {
                // Third number is always message
                $var = 'mesid';
                $vars['view'] = 'topic';
            } else {
                // Invalid parameter, skip it
                continue;
            }
        } elseif ($value === null) {
            // Simple variable without value is always either view or layout
            $value = $var;
            if (empty($vars['view']) || $value == 'topic' && $vars['view'] == 'category') {
                // View
                $var = 'view';
            } elseif (empty($vars['layout'])) {
                // Layout
                $var = 'layout';
            } elseif (!empty($vars['view'])) {
                // Unknown parameter: skip
                if (!empty($vars['view'])) {
                    continue;
                }
            } else {
                // Unknown view or non-existing category
                $var = 'view';
            }
        }
        $vars[$var] = $value;
    }
    if (empty($vars['layout'])) {
        $vars['layout'] = 'default';
    }
    KunenaRoute::$time = $profiler->getmicrotime() - $starttime;
    foreach ($vars as $var => $value) {
        KunenaRoute::$current->setVar($var, $value);
    }
    return $vars;
}
Ejemplo n.º 26
0
function uddeIMcheckKU() {
	$k1 = uddeIMfileExists("/components/com_kunena/kunena.php");
	$k2 = class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed();
	return $k1 || $k2;
}
Ejemplo n.º 27
0
 /**
  * Method to setup the indexer to be run.
  *
  * @return  boolean  True on success.
  *
  * @since   2.5
  */
 protected function setup()
 {
     // Initialize CLI
     $api = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
     if (is_file($api)) {
         require_once $api;
     }
     // Check if Kunena has been installed.
     if (!class_exists('KunenaForum') || !KunenaForum::isCompatible('4.0') || !KunenaForum::installed()) {
         return false;
     }
     KunenaForum::setup();
     return true;
 }
Ejemplo n.º 28
0
 /**
  * Display Kunena backend icon in Joomla 2.5+
  *
  * @param string $context
  *
  * @return array|null
  */
 public function onGetIcons($context)
 {
     if ($context != $this->params->get('context', 'mod_quickicon') || !JFactory::getUser()->authorise('core.manage', 'com_kunena')) {
         return null;
     }
     KunenaFactory::loadLanguage('com_kunena.sys', 'admin');
     $updateInfo = null;
     if (KunenaForum::installed() && JFactory::getUser()->authorise('core.manage', 'com_installer')) {
         $updateSite = 'http://update.kunena.org/%';
         $db = JFactory::getDbo();
         $query = $db->getQuery(true)->select('*')->from($db->qn('#__updates'))->where($db->qn('extension_id') . ' > 0')->where($db->qn('detailsurl') . ' LIKE ' . $db->q($updateSite));
         $db->setQuery($query);
         $list = (array) $db->loadObjectList();
         if ($list) {
             $updateInfo = new stdClass();
             $updateInfo->addons = 0;
             $updateInfo->version = 0;
             foreach ($list as $item) {
                 if ($item->element == 'pkg_kunena') {
                     $updateInfo->version = $item->version;
                 } else {
                     $updateInfo->addons++;
                 }
             }
         } else {
             $query = $db->getQuery(true)->select('update_site_id')->from($db->qn('#__update_sites'))->where($db->qn('enabled') . ' = 0')->where($db->qn('location') . ' LIKE ' . $db->q($updateSite));
             $db->setQuery($query);
             $updateInfo = !$db->loadResult();
         }
     }
     $link = 'index.php?option=com_kunena';
     $useIcons = version_compare(JVERSION, '3.0', '>');
     if (!KunenaForum::installed()) {
         // Not fully installed
         $img = $useIcons ? 'warning' : 'kunena/icons/icon-48-kupdate-alert-white.png';
         $icon = 'kunena/icons/icon-48-kupdate-alert-white.png';
         $text = JText::_('PLG_QUICKICON_KUNENA_COMPLETE_INSTALLATION');
     } elseif ($updateInfo === null) {
         // Unsupported
         $img = $useIcons ? 'remove' : 'kunena/icons/kunena-logo-48-white.png';
         $icon = 'kunena/icons/kunena-logo-48-white.png';
         $text = JText::_('COM_KUNENA');
     } elseif ($updateInfo === false) {
         // Disabled
         $img = $useIcons ? 'minus' : 'kunena/icons/icon-48-kupdate-alert-white.png';
         $icon = 'kunena/icons/icon-48-kupdate-alert-white.png';
         $text = JText::_('COM_KUNENA') . '<br />' . JText::_('PLG_QUICKICON_KUNENA_UPDATE_DISABLED');
     } elseif (!empty($updateInfo->version) && version_compare(KunenaForum::version(), $updateInfo->version, '<')) {
         // Has updates
         $img = $useIcons ? 'download' : 'kunena/icons/icon-48-kupdate-update-white.png';
         $icon = 'kunena/icons/icon-48-kupdate-update-white.png';
         $text = 'Kunena ' . $updateInfo->version . '<br />' . JText::_('PLG_QUICKICON_KUNENA_UPDATE_NOW');
         $link = 'index.php?option=com_installer&view=update&filter_search=kunena';
     } elseif (!empty($updateInfo->addons)) {
         // Has updated add-ons
         $img = $useIcons ? 'download' : 'kunena/icons/icon-48-kupdate-update-white.png';
         $icon = 'kunena/icons/icon-48-kupdate-update-white.png';
         $text = JText::_('COM_KUNENA') . '<br />' . JText::sprintf('PLG_QUICKICON_KUNENA_UPDATE_ADDONS', $updateInfo->addons);
         $link = 'index.php?option=com_installer&view=update&filter_search=kunena';
     } else {
         // Already in the latest release
         $img = $useIcons ? 'comments' : 'kunena/icons/icon-48-kupdate-good-white.png';
         $icon = 'kunena/icons/icon-48-kupdate-good-white.png';
         $text = JText::_('COM_KUNENA');
     }
     // Use one line in J!3.0.
     if (version_compare(JVERSION, '3.0', '>')) {
         $text = preg_replace('|<br />|', ' - ', $text);
     }
     return array(array('link' => JRoute::_($link), 'image' => $img, 'text' => $text, 'icon' => $icon, 'access' => array('core.manage', 'com_kunena'), 'id' => 'com_kunena_icon'));
 }
Ejemplo n.º 29
0
 /**
  * A private function that is used to initialize kunena app
  * 
  * @return boolean true if success, false if not compatible kunena installation found
  */
 private static function _initialize_kunena()
 {
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed())) {
         return false;
     }
     KunenaForum::setup();
     return true;
 }