public function __construct(&$subject, $config)
 {
     if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed())) {
         return;
     }
     parent::__construct($subject, $config);
 }
Example #2
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');
	}
Example #3
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');
     }
 }
Example #4
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);
	}
Example #5
0
 /**
  * @param object $subject
  * @param array  $params
  */
 public function __construct(&$subject, $params)
 {
     $this->app = JFactory::getApplication();
     // Do not register plug-in in administration.
     if ($this->app->isAdmin()) {
         return;
     }
     // If scope isn't articles or Kunena, do not register plug-in.
     if ($this->app->scope != 'com_content' && $this->app->scope != 'com_kunena') {
         return;
     }
     // Kunena detection and version check
     $minKunenaVersion = '3.0';
     if (!class_exists('KunenaForum') || !KunenaForum::isCompatible($minKunenaVersion)) {
         $this->loadLanguage();
         $this->app->enqueueMessage(JText::sprintf('PLG_KUNENADISCUSS_DEPENDENCY_FAIL', $minKunenaVersion));
         return;
     }
     // Kunena online check
     if (!KunenaForum::enabled()) {
         return;
     }
     // Initialize variables
     $this->db = JFactory::getDbo();
     $this->user = KunenaFactory::getUser();
     $this->config = KunenaFactory::getConfig();
     // Initialize plugin
     parent::__construct($subject, $params);
     $this->debug("Constructor called in {$this->app->scope}");
 }
Example #6
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 );
	}
Example #7
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);
 }
 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);
 }
Example #9
0
 protected static function kunenaInstalled()
 {
     // Kunena detection and version check
     $minKunenaVersion = '2.0';
     if (!class_exists('KunenaForum') || !KunenaForum::isCompatible($minKunenaVersion)) {
         return false;
     }
     return true;
 }
Example #10
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';
 }
Example #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('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 );
	}
Example #12
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');
 }
Example #13
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);
 }
	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 );
	}
Example #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;
     }
     // 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);
 }
Example #16
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';
	}
Example #17
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;
 }
Example #18
0
	/**
	 * @param string $type
	 * @param JInstallerFile $parent
	 * @return bool
	 */
	public function preflight($type, $parent) {
		if (!in_array($type, array('install', 'update'))) return true;

		$app = JFactory::getApplication();

		// Do not install if Kunena doesn't exist.
		if (!class_exists('KunenaForum') || !KunenaForum::isCompatible('4.0')) {
			$app->enqueueMessage(sprintf ( 'Kunena %s has not been installed, aborting!', '4.0' ), 'notice');
			return false;
		}
		if (KunenaForum::isDev()) {
			$app->enqueueMessage(sprintf ( 'You have installed Kunena from GitHub, aborting!' ), 'notice');
			return false;
		}

		// Get list of languages to be installed.
		$source = $parent->getParent()->getPath('source').'/language';
		$languages = JFactory::getLanguage()->getKnownLanguages();
		/** @var SimpleXMLElement $files */
		$files = $parent->manifest->files;
		foreach ($languages as $language) {
			$name = "com_kunena_{$language['tag']}";
			$search = JFolder::files($source, $name);
			if (empty($search)) continue;
			// Generate <file type="file" client="site" id="fi-FI">com_kunena_fi-FI_v2.0.0-BETA2-DEV2.zip</file>
			$file = $files->addChild('file', array_pop($search));
			$file->addAttribute('type', 'file');
			$file->addAttribute('client', 'site');
			$file->addAttribute('id', $name);
			echo sprintf('Installing language %s - %s ...', $language['tag'], $language['name']) . '<br />';
		}
		if (empty($files)) {
			$app->enqueueMessage(sprintf ( 'Your site is English only. There\'s no need to install Kunena language pack.' ), 'notice');
			return false;
		}

		// Remove old K1.7 style language pack.
		$table = JTable::getInstance('extension');
		$id = $table->find(array('type'=>'file', 'element'=>"kunena_language_pack"));
		if ($id) {
			$installer = new JInstaller();
			$installer->uninstall ( 'file', $id );
		}

		return true;
	}
Example #19
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);
 }
Example #20
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;
 }
Example #21
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();
Example #22
0
 **/
defined('_JEXEC') or die;
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_kunena')) {
    throw new KunenaExceptionAuthorise(JText::_('COM_KUNENA_NO_ACCESS'), 404);
}
// Check if installation hasn't been completed.
if (is_file(__DIR__ . '/install.php')) {
    require_once __DIR__ . '/install.php';
    if (class_exists('KunenaControllerInstall')) {
        return;
    }
}
$app = JFactory::getApplication();
// Safety check to prevent fatal error if 'System - Kunena Forum' plug-in has been disabled.
if ($app->input->getCmd('view') == 'install' || !class_exists('KunenaForum') || !KunenaForum::isCompatible('4.0')) {
    // Run installer instead..
    require_once __DIR__ . '/install/controller.php';
    $controller = new KunenaControllerInstall();
    // TODO: execute special task that checks what's wrong
    $controller->execute($app->input->getCmd('task'));
    $controller->redirect();
    return;
}
if ($app->input->getCmd('view') == 'uninstall') {
    $allowed = $app->getUserState('com_kunena.uninstall.allowed');
    if ($allowed) {
        require_once __DIR__ . '/install/controller.php';
        $controller = new KunenaControllerInstall();
        $controller->execute('uninstall');
        $controller->redirect();
<?php

/**
 * Kunena Statistics Module
 * @package Kunena.mod_kunenastats
 *
 * @copyright (C) 2008 - 2013 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 = '3.0';
if (!class_exists('KunenaForum') || !KunenaForum::isCompatible($minKunenaVersion)) {
    echo JText::sprintf('MOD_KUNENASTATS_KUNENA_NOT_INSTALLED', $minKunenaVersion);
    return;
}
// Kunena online check
if (!KunenaForum::enabled()) {
    echo JText::_('MOD_KUNENASTATS_KUNENA_OFFLINE');
    return;
}
require_once __DIR__ . '/class.php';
/** @var stdClass $module */
/** @var JRegistry $params */
$instance = new ModuleKunenaStats($module, $params);
$instance->display();
Example #24
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;
}
Example #25
0
function uddeIMcheckKU() {
	$k1 = uddeIMfileExists("/components/com_kunena/kunena.php");
	$k2 = class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed();
	return $k1 || $k2;
}
<?php

/**
 * @version		2.0 beta
 * @package		zKunenaLatest
 * @author		Aaron Gilbert {@link http://www.nzambi.braineater.ca}
 * @author		Created on Feb-14 2012
 * @copyright	Copyright (C) 2009 - 2012 Aaron Gilbert. All rights reserved.
 * @license		GNU/GPL, see http://www.gnu.org/licenses/gpl-2.0.html
 *
 */
//-- No direct access
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.framework', true);
// CHECK if Kunena NOT installed or Kunena version is not supported
if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0'))) {
    echo JText::_('MOD_ZKUENALATEST_NOKUNENA');
    return;
}
if (!KunenaForum::enabled()) {
    // Kunena online check
    if ($params->get('showOffline', 1)) {
        echo JText::_('MOD_ZKUENALATEST_OFFLINE');
    }
    return;
}
require_once dirname(__FILE__) . DS . 'helper.php';
require_once KPATH_SITE . '/lib/kunena.link.class.php';
//Initialize  the Kunena Framework
KunenaForum::setup();
KunenaFactory::loadLanguage();
 protected function checkDependencies()
 {
     // Test if Kunena is installed and if the minimum version requirement is met
     $minKunenaVersion = '2.0.1';
     if (!class_exists('KunenaForum') || !KunenaForum::isCompatible($minKunenaVersion)) {
         JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_KUNENAIMPORTER_DEPENDENCY_FAIL', $minKunenaVersion), 'error');
         return false;
     }
     KunenaForum::setup();
     return true;
 }
Example #28
0
 * @link http://www.kunena.org
 **/
defined('_JEXEC') or die;
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_kunena')) {
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
// Check if installation hasn't been completed.
if (file_exists(__DIR__ . '/install.php')) {
    require_once __DIR__ . '/install.php';
    if (class_exists('KunenaControllerInstall')) {
        return;
    }
}
// Safety check to prevent fatal error if 'System - Kunena Forum' plug-in has been disabled.
if (JRequest::getCmd('view') == 'install' || !class_exists('KunenaForum') || !KunenaForum::isCompatible('3.0')) {
    // Run installer instead..
    require_once __DIR__ . '/install/controller.php';
    $controller = new KunenaControllerInstall();
    // TODO: execute special task that checks what's wrong
    $controller->execute(JRequest::getCmd('task'));
    $controller->redirect();
    return;
}
// Initialize Kunena Framework.
KunenaForum::setup();
// Initialize custom error handlers.
KunenaError::initialize();
// Kunena has been successfully installed: Load our main controller.
$controller = KunenaController::getInstance();
$controller->execute(JRequest::getCmd('task'));
Example #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;
 }
Example #30
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;
 }