本文整理汇总了PHP中KunenaForum::installed方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaForum::installed方法的具体用法?PHP KunenaForum::installed怎么用?PHP KunenaForum::installed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaForum
的用法示例。
在下文中一共展示了KunenaForum::installed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
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');
}
}
示例2: fetchElement
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);
}
示例3: getModel
/**
* 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];
}
示例4: __construct
public function __construct(&$subject, $config)
{
if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed())) {
return;
}
parent::__construct($subject, $config);
}
示例5: __construct
/**
* @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);
}
示例6: __construct
/**
* @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');
}
示例7: getInput
/**
* @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);
}
示例8: __construct
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 );
}
示例9: __construct
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);
}
示例10: __construct
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';
}
示例11: __construct
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 );
}
示例12: __construct
/**
* 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');
}
示例13: __construct
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);
}
示例14: __construct
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 );
}
示例15: onGetIcons
/**
* 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'));
}