本文整理汇总了PHP中KunenaForum::enabled方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaForum::enabled方法的具体用法?PHP KunenaForum::enabled怎么用?PHP KunenaForum::enabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaForum
的用法示例。
在下文中一共展示了KunenaForum::enabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onSystemStart
function onSystemStart()
{
if (!self::kunenaInstalled()) {
return;
}
//initialize the toolbar object
$toolbar = CFactory::getToolbar();
$user = JFactory::getUser();
// Kunena online check
if (!KunenaForum::enabled()) {
$toolbar->addGroup('KUNENAMENU', JText::_('PLG_COMMUNITY_KUNENAMENU_KUNENA_OFFLINE'), KunenaRoute::_('index.php?option=com_kunena'));
return;
}
//adding new 'tab' 'Forum Settings' to JomSocial toolbar
$toolbar->addGroup('KUNENAMENU', JText::_('PLG_COMMUNITY_KUNENANENU_FORUM'), 'index.php?option=com_kunena&view=user&layout=default&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=user&layout=default'));
if ($this->params->get('sh_editprofile', 1)) {
$toolbar->addItem('KUNENAMENU', 'KUNENAMENU_EDITPROFILE', JText::_('PLG_COMMUNITY_KUNENAMENU_EDITPROFILE'), 'index.php?option=com_kunena&view=user&layout=edit&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=user&layout=edit'));
}
if ($this->params->get('sh_myprofile', 1)) {
$toolbar->addItem('KUNENAMENU', 'KUNENAMENU_PROFILE', JText::_('PLG_COMMUNITY_KUNENAMENU_PROFILE'), 'index.php?option=com_kunena&view=user&layout=default&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=user&layout=default'));
}
if ($this->params->get('sh_myposts', 1)) {
$toolbar->addItem('KUNENAMENU', 'KUNENAMENU_POSTS', JText::_('PLG_COMMUNITY_KUNENAMENU_POSTS'), 'index.php?option=com_kunena&view=topics&layout=posts&mode=recent&userid=' . $user->id . '&sel=-1&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=topics&layout=posts&mode=recent&userid=' . $user->id . '&sel=-1'));
}
if ($this->params->get('sh_mysubscriptions', 1)) {
$toolbar->addItem('KUNENAMENU', 'KUNENAMENU_SUBSCRIBES', JText::_('PLG_COMMUNITY_KUNENAMENU_SUBSCRIBTIONS'), 'index.php?option=com_kunena&view=topics&layout=user&mode=subscriptions&sel=-1&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=topics&layout=user&mode=subscriptions&sel=-1'));
}
if ($this->params->get('sh_myfavorites', 1)) {
$toolbar->addItem('KUNENAMENU', 'KUNENAMENU_FAVORITES', JText::_('PLG_COMMUNITY_KUNENAMENU_FAVORITES'), 'index.php?option=com_kunena&view=topics&layout=user&mode=favorites&sel=-1&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=topics&layout=user&mode=favorite&sel=-1s'));
}
}
示例2: __construct
/**
* @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}");
}
示例3: _load_rules
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);
}
示例4: defined
<?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();