本文整理汇总了PHP中KunenaForum类的典型用法代码示例。如果您正苦于以下问题:PHP KunenaForum类的具体用法?PHP KunenaForum怎么用?PHP KunenaForum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KunenaForum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(&$subject, $config)
{
if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed())) {
return;
}
parent::__construct($subject, $config);
}
示例2: 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];
}
示例3: 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);
}
示例4: shKUGetVersion
function shKUGetVersion()
{
static $version = null;
if (is_null($version)) {
// Make sure that Kunena API has been loaded
$api = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
if (is_file($api)) {
require_once $api;
}
if (class_exists('KunenaForum')) {
$version = KunenaForum::versionMajor();
// Initialize Kunena 2.0 support
kimport('kunena.forum.category');
kimport('kunena.forum.topic');
} elseif (class_exists('Kunena')) {
$version = '1.6';
// Initialize Kunena 1.6 support
require_once KUNENA_PATH . '/router.php';
KunenaRouter::loadCategories();
} elseif (is_file(JPATH_ROOT . '/components/com_kunena/lib/kunena.defines.php')) {
$version = '1.5';
} elseif (is_file(JPATH_ROOT . '/components/com_kunena/lib/kunena.version.php')) {
$version = '1.0';
} else {
$version = false;
}
}
return $version;
}
示例5: display
/**
* Display module contents.
*/
public final function display()
{
// Load CSS only once
if (static::$css) {
$this->document->addStyleSheet(JURI::root(true) . static::$css);
static::$css = null;
}
// Use caching also for registered users if enabled.
if ($this->params->get('owncache', 0)) {
/** @var $cache JCacheControllerOutput */
$cache = JFactory::getCache('com_kunena', 'output');
$me = KunenaFactory::getUser();
$cache->setLifeTime($this->params->get('cache_time', 180));
$hash = md5(serialize($this->params));
if ($cache->start("display.{$me->userid}.{$hash}", 'mod_kunenalatest')) {
return;
}
}
// Initialize Kunena.
KunenaForum::setup();
// Display module.
$this->_display();
// Store cached page.
if (isset($cache)) {
$cache->end();
}
}
示例6: __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');
}
}
示例7: 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'));
}
}
示例8: __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);
}
示例9: 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);
}
示例10: parseKunenaInstallFile
public static function parseKunenaInstallFile($path) {
$xml = simplexml_load_file($path);
if (!$xml || $xml->getName() != 'kinstall') {
return false;
}
$data = new stdClass();
$data->name = (string) $xml->name;
$data->type = (string) $xml->attributes()->type;
$data->creationdate = (string) $xml->creationDate;
$data->author = (string) $xml->author;
$data->copyright = (string) $xml->copyright;
$data->authorEmail = (string) $xml->authorEmail;
$data->authorUrl = (string) $xml->authorUrl;
$data->version = (string) $xml->version;
$data->description = (string) $xml->description;
$data->thumbnail = (string) $xml->thumbnail;
if ($data->version == '@kunenaversion@') $data->version = KunenaForum::version();
if ($data->creationdate == '@kunenaversiondate@') $data->creationdate = KunenaForum::versionDate();
if (!$data->version) $data->version = JText::_('Unknown');
if (!$data->creationdate) $data->creationdate = JText::_('Unknown');
if (!$data->author) $data->author = JText::_('Unknown');
return $data;
}
示例11: getModel
/**
* Returns the forum model instance
*
* @return null|ModelInterface
*/
static public function getModel()
{
global $_CB_framework, $_PLUGINS;
static $model = null;
if ( ! $model ) {
static $params = null;
if ( ! $params ) {
$plugin = $_PLUGINS->getLoadedPlugin( 'user/plug_cbgroupjive/plugins', 'cbgroupjiveforums' );
$params = $_PLUGINS->getPluginParams( $plugin );
}
switch( $params->get( 'groups_forums_model', 'kunena' ) ) {
case 'kunena':
$api = $_CB_framework->getCfg( 'absolute_path' ) . '/administrator/components/com_kunena/api.php';
if ( file_exists( $api ) ) {
require_once( $api );
if ( class_exists( 'KunenaForum' ) ) {
\KunenaForum::setup();
}
$model = new Model\Kunena\Model();
}
break;
}
}
return $model;
}
示例12: __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);
}
示例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;
parent::__construct ( $subject, $config );
$this->loadLanguage ( 'plg_kunena_joomla.sys', JPATH_ADMINISTRATOR ) || $this->loadLanguage ( 'plg_kunena_joomla.sys', KPATH_ADMIN );
}
示例14: _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);
}
示例15: __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';
}