function onSystemStart() { if (!self::kunenaInstalled()) { return; } //initialize the toolbar object $toolbar = CFactory::getToolbar(); // Kunena online check if (!Kunena::enabled()) { $toolbar->addGroup('KUNENAMENU', JText::_('PLG_COMMUNITY_KUNENAMENU_KUNENA_OFFLINE'), JRoute::_('index.php?option=com_kunena')); return; } //adding new 'tab' 'Forum Settings' to JomSocial toolbar $toolbar->addGroup('KUNENAMENU', JText::_('PLG_COMMUNITY_KUNENANENU_FORUM'), KunenaRoute::_('index.php?option=com_kunena&func=myprofile')); if ($this->params->get('sh_editprofile')) { $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_EDITPROFILE', JText::_('PLG_COMMUNITY_KUNENAMENU_EDITPROFILE'), KunenaRoute::_('index.php?option=com_kunena&func=myprofile&task=edit')); } if ($this->params->get('sh_myprofile')) { $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_PROFILE', JText::_('PLG_COMMUNITY_KUNENAMENU_PROFILE'), KunenaRoute::_('index.php?option=com_kunena&func=myprofile')); } if ($this->params->get('sh_myposts')) { $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_POSTS', JText::_('PLG_COMMUNITY_KUNENAMENU_POSTS'), KunenaRoute::_('index.php?option=com_kunena&func=latest&do=userposts')); } if ($this->params->get('sh_mysubscriptions')) { $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_SUBSCRIBES', JText::_('PLG_COMMUNITY_KUNENAMENU_SUBSCRIBTIONS'), KunenaRoute::_('index.php?option=com_kunena&func=latest&do=subscriptions')); } if ($this->params->get('sh_myfavorites')) { $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_FAVORITES', JText::_('PLG_COMMUNITY_KUNENAMENU_FAVORITES'), KunenaRoute::_('index.php?option=com_kunena&func=latest&do=favorites')); } }
function _load_rules() { $app = JFactory::getApplication(); $db = JFactory::getDBO(); $total = 0; $filter_category = $app->getUserStateFromRequest('com_alphauserpoints' . '.filter_category', 'filter_category', 'all', 'word'); // Get the pagination request variables $limit = $app->getUserStateFromRequest('com_alphauserpoints.limit', 'limit', $app->getCfg('list_limit'), 'int'); $limitstart = JFactory::getApplication()->input->get('limitstart', 0, 'int'); // In case limit has been changed, adjust limitstart accordingly $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0; if ($filter_category != 'all') { $filter = "WHERE r.category = '{$filter_category}'"; } else { $filter = ""; } // check if Kunena forum is installed to show pre-installed rules for Kunena // Dectects Kunena 2.0+ if (class_exists('KunenaForum') && KunenaForum::enabled()) { $filter != '' ? $filter .= " AND " : ($filter .= "WHERE "); $filter .= "(r.plugin_function!='plgaup_newtopic_kunena' AND r.plugin_function!='plgaup_reply_kunena' )"; // Detects Kunena 1.6 and 1.7 } elseif (class_exists('Kunena') && Kunena::enabled()) { if (substr(Kunena::version(), 0, 3) == '1.7') { $filter != '' ? $filter .= " AND " : ($filter .= "WHERE "); $filter .= "(r.plugin_function!='plgaup_newtopic_kunena' AND r.plugin_function!='plgaup_reply_kunena' )"; } else { $filter != '' ? $filter .= " AND " : ($filter .= "WHERE "); $filter .= "(r.plugin_function!='plgaup_kunena_topic_create' AND r.plugin_function!='plgaup_kunena_topic_reply' AND r.plugin_function!='plgaup_kunena_message_delete' AND r.plugin_function!='plgaup_kunena_message_thankyou')"; } } // end check Kunena pre_installed rules $query = "SELECT r.*, g.title AS groupname FROM #__alpha_userpoints_rules AS r LEFT JOIN #__viewlevels AS g ON g.id=r.access " . $filter . " ORDER BY r.category"; $total = @$this->_getListCount($query); $result = $this->_getList($query, $limitstart, $limit); $lists = array(); $options[] = JHTML::_('select.option', '', JText::_('AUP_NONE')); $options[] = JHTML::_('select.option', 'us', JText::_('AUP_CAT_USER')); $options[] = JHTML::_('select.option', 'co', JText::_('AUP_CAT_COMMUNITY')); $options[] = JHTML::_('select.option', 'ar', JText::_('AUP_CAT_ARTICLE')); $options[] = JHTML::_('select.option', 'li', JText::_('AUP_CAT_LINK')); $options[] = JHTML::_('select.option', 'po', JText::_('AUP_CAT_POLL_QUIZZ')); $options[] = JHTML::_('select.option', 're', JText::_('AUP_CAT_RECOMMEND_INVITE')); $options[] = JHTML::_('select.option', 'fo', JText::_('AUP_CAT_COMMENT_FORUM')); $options[] = JHTML::_('select.option', 'vi', JText::_('AUP_CAT_VIDEO')); $options[] = JHTML::_('select.option', 'ph', JText::_('CAT_CAT_PHOTO')); $options[] = JHTML::_('select.option', 'mu', JText::_('AUP_CAT_MUSIC')); $options[] = JHTML::_('select.option', 'sh', JText::_('AUP_CAT_SHOPPING')); $options[] = JHTML::_('select.option', 'pu', JText::_('AUP_CAT_PURCHASING')); $options[] = JHTML::_('select.option', 'cd', JText::_('AUP_CAT_COUPON_CODE')); $options[] = JHTML::_('select.option', 'su', JText::_('AUP_CAT_SUBSCRIPTION')); $options[] = JHTML::_('select.option', 'sy', JText::_('AUP_CAT_SYSTEM')); $options[] = JHTML::_('select.option', 'ot', JText::_('AUP_CAT_OTHER')); $options[] = JHTML::_('select.option', 'all', JText::_('AUP_ALL')); $lists['filter_category'] = JHTML::_('select.genericlist', $options, 'filter_category', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $filter_category); return array($result, $total, $limit, $limitstart, $lists); }
protected static function kunenaOnline() { // Kunena detection and version check $minKunenaVersion = '1.6.3'; if (!class_exists('Kunena') || Kunena::versionBuild() < 4344) { return false; } // Kunena online check if (!Kunena::enabled()) { return false; } // Initialize session $session = KunenaFactory::getSession(); $session->updateAllowedForums(); return true; }
protected static function kunenaOnline() { // Kunena detection and version check $minKunenaVersion = '1.6.3'; if (!class_exists('Kunena') || Kunena::versionBuild() < 4344) { JFactory::getApplication()->enqueueMessage(JText::sprintf('PLG_COMMUNITY_KUNENAGROUPS_KUNENA_NOT_INSTALLED', $minKunenaVersion), 'notice'); return false; } // Kunena online check if (!Kunena::enabled()) { JFactory::getApplication()->enqueueMessage(JText::_('PLG_COMMUNITY_KUNENAGROUPS_KUNENA_OFFLINE'), 'notice'); return false; } // Initialize session $session = KunenaFactory::getSession(); $session->updateAllowedForums(); kimport('category'); return true; }
function plgContentKunenaDiscuss(&$subject, $params) { $this->_app = JFactory::getApplication ( 'site' ); // If plugin is not enabled in current scope, do not register it if (! $this->enabled ()) return null; $jversion = new JVersion(); if ($jversion->RELEASE != '1.5') { $this->basepath = 'plugins/content/kunenadiscuss'; } else { $this->basepath = 'plugins/content'; } // Load language files $this->loadLanguage ( 'plg_content_kunenadiscuss', JPATH_ADMINISTRATOR ); // Kunena detection and version check $minKunenaVersion = '1.6.3'; if (!class_exists('Kunena') || Kunena::versionBuild() < 4344) { $this->_app->enqueueMessage( JText::sprintf ( 'PLG_KUNENADISCUSS_DEPENDENCY_FAIL', $minKunenaVersion ) ); return null; } // Kunena online check if (!Kunena::enabled()) { return null; } // Initialize session $session = KunenaFactory::getSession (); $session->updateAllowedForums(); // Initialize plugin parent::__construct ( $subject, $params ); // Initialize variables $this->_db = JFactory::getDbo (); $this->_my = JFactory::getUser (); require_once (KUNENA_PATH . DS . 'class.kunena.php'); $this->config = KunenaFactory::getConfig (); // load Kunena main language file so we can leverage language strings from it KunenaFactory::loadLanguage(); // Create plugin table if doesn't exist $query = "SHOW TABLES LIKE '{$this->_db->getPrefix()}kunenadiscuss'"; $this->_db->setQuery ( $query ); if (!$this->_db->loadResult ()) { CKunenaTools::checkDatabaseError (); $query = "CREATE TABLE IF NOT EXISTS `#__kunenadiscuss` (`content_id` int(11) NOT NULL default '0', `thread_id` int(11) NOT NULL default '0', PRIMARY KEY (`content_id`) )"; $this->_db->setQuery ( $query ); $this->_db->query (); CKunenaTools::checkDatabaseError (); $this->debug ( "Created #__kunenadiscuss cross reference table." ); // Migrate data from old FireBoard discussbot if it exists $query = "SHOW TABLES LIKE '{$this->_db->getPrefix()}fb_discussbot'"; $this->_db->setQuery ( $query ); if ($this->_db->loadResult ()) { $query = "REPLACE INTO `#__kunenadiscuss` SELECT `content_id` , `thread_id` FROM `#__fb_discussbot`"; $this->_db->setQuery ( $query ); $this->_db->query (); CKunenaTools::checkDatabaseError (); $this->debug ( "Migrated old data." ); } } $this->debug ( "Constructor called in " . $this->_app->scope ); }
<?php /** * @version $Id$ * KunenaStats Module * @package Kunena Stats * * @Copyright (C) 2010 www.kunena.com All rights reserved * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @link http://www.kunena.com */ defined ( '_JEXEC' ) or die (); // Kunena detection and version check $minKunenaVersion = '1.6.3'; if (! class_exists ( 'Kunena' ) || Kunena::versionBuild () < 4344) { echo JText::sprintf ( 'MOD_KUNENASTATS_KUNENA_NOT_INSTALLED', $minKunenaVersion ); return; } // Kunena online check if (! Kunena::enabled ()) { echo JText::_ ( 'MOD_KUNENASTATS_KUNENA_OFFLINE' ); return; } require_once dirname ( __FILE__ ) . '/class.php'; $params = ( object ) $params; $kstats = new ModuleKunenaStats ( $params ); $kstats->display ();