当前位置: 首页>>代码示例>>PHP>>正文


PHP JCommentsFactory::getConfig方法代码示例

本文整理汇总了PHP中JCommentsFactory::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP JCommentsFactory::getConfig方法的具体用法?PHP JCommentsFactory::getConfig怎么用?PHP JCommentsFactory::getConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JCommentsFactory的用法示例。


在下文中一共展示了JCommentsFactory::getConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 public function save()
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $base64 = $app->input->get('base64', '');
     if (!empty($base64)) {
         $base64 = base64_decode(urldecode($base64));
         parse_str($base64, $data);
         foreach ($data as $k => $v) {
             $app->input->post->set($k, $v);
         }
     }
     $model = $this->getModel();
     $data = $app->input->post->get('jform', array(), 'array');
     $language = $app->input->post->get('language', '', 'string');
     $model->setState($model->getName() . '.language', $language);
     if ($model->save($data) === false) {
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_jcomments&view=settings', false));
         return false;
     }
     if (!extension_loaded('gd') || !function_exists('imagecreatefrompng')) {
         $config = JCommentsFactory::getConfig();
         if ($config->get('captcha_engine', 'kcaptcha') != 'recaptcha') {
             JFactory::getApplication()->enqueueMessage(JText::_('A_WARNINGS_PHP_GD'), 'warning');
         }
     }
     $cache = JFactory::getCache('com_jcomments');
     $cache->clean();
     $this->setMessage(JText::_('A_SETTINGS_SAVED'));
     $this->setRedirect(JRoute::_('index.php?option=com_jcomments&view=settings', false));
     return true;
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:34,代码来源:settings.php

示例2: applyConfig

 /**
  * Set Jcomments config for the actual product, and the value of $comments_enabled
  * 
  * @author Florian Voutzinos
  * @param object $product virtuemart product object
  * @param array	$excludedCatIds Ids of excluded category from plugin params
  * @return void
  */
 public static function applyConfig($product, $excludedCatIds)
 {
     $config = JCommentsFactory::getConfig();
     // {Jcomments} tag domines Excluded categories !
     // and {Jcomments OFF} domines everything
     // if {Jcomments OFF} tag found we disable comments by force
     if (self::isDisabled($product)) {
         $config->set('comments_on', 0);
         $config->set('comments_off', 1);
         self::$comments_enabled = false;
     } elseif (self::isEnabled($product)) {
         $config->set('comments_on', 1);
         $config->set('comments_off', 0);
         self::$comments_enabled = true;
     } else {
         // we enable comments if the product category is enabled
         if (self::isCategoryProductEnabled($product, $excludedCatIds)) {
             $config->set('comments_on', 1);
             $config->set('comments_off', 0);
             self::$comments_enabled = true;
         } else {
             $config->set('comments_on', 0);
             $config->set('comments_off', 1);
             self::$comments_enabled = false;
         }
     }
     $config->set('comments_locked', (int) self::isLocked($product));
 }
开发者ID:romuland,项目名称:khparts,代码行数:36,代码来源:plugin.php

示例3: getList

 public static function getList($params)
 {
     $db = JFactory::getDBO();
     $db->setQuery("SELECT * FROM #__jcomments ORDER BY date DESC", 0, $params->get('count'));
     $items = $db->loadObjectList();
     if (!is_array($items)) {
         $items = array();
     }
     if (count($items)) {
         $config = JCommentsFactory::getConfig();
         $bbcode = JCommentsFactory::getBBCode();
         $limit_comment_text = (int) $params->get('limit_comment_text', 0);
         foreach ($items as &$item) {
             $item->link = 'index.php?option=com_jcomments&&view=comment&layout=edit&id=' . $item->id;
             $item->author = JComments::getCommentAuthorName($item);
             $text = JCommentsText::censor($item->comment);
             $text = $bbcode->filter($text, true);
             $text = JCommentsText::cleanText($text);
             if ($limit_comment_text && JString::strlen($text) > $limit_comment_text) {
                 $text = self::truncateText($text, $limit_comment_text - 1);
             }
             $item->comment = $text;
         }
     }
     return $items;
 }
开发者ID:enjoy2000,项目名称:smcd,代码行数:26,代码来源:helper.php

示例4: isEnabled

 public static function isEnabled()
 {
     static $enabled = null;
     if (!isset($enabled)) {
         $app = JFactory::getApplication();
         if ($app->isSite()) {
             $enabled = $app->getLanguageFilter();
         } else {
             $db = JFactory::getDBO();
             $query = $db->getQuery(true);
             $query->select('enabled');
             $query->from($db->quoteName('#__extensions'));
             $query->where($db->quoteName('type') . ' = ' . $db->quote('plugin'));
             $query->where($db->quoteName('folder') . ' = ' . $db->quote('system'));
             $query->where($db->quoteName('element') . ' = ' . $db->quote('languagefilter'));
             $db->setQuery($query);
             $enabled = $db->loadResult();
         }
         JFactory::getConfig()->set('multilingual_support', $enabled);
         if ($enabled) {
             $enabled = JCommentsFactory::getConfig()->get('multilingual_support', $enabled);
         }
     }
     return $enabled;
 }
开发者ID:ForAEdesWeb,项目名称:AEW2,代码行数:25,代码来源:multilingual.php

示例5: check

 public static function check($str)
 {
     static $group = null;
     $str = JCommentsFactory::getConfig()->get($str);
     if (!empty($str)) {
         $user = JFactory::getUser();
         $list = explode(',', $str);
         if ($group === null) {
             if ($user->id) {
                 $db = JFactory::getDbo();
                 // get highest group
                 $query = $db->getQuery(true);
                 $query->select('a.id');
                 $query->from('#__user_usergroup_map AS map');
                 $query->leftJoin('#__usergroups AS a ON a.id = map.group_id');
                 $query->where('map.user_id = ' . (int) $user->id);
                 $query->order('a.lft desc');
                 $db->setQuery($query, 0, 1);
                 $group = $db->loadResult();
             } else {
                 $group = JComponentHelper::getParams('com_users')->get('guest_usergroup', 1);
             }
         }
         if (in_array($group, $list)) {
             return 1;
         }
     }
     return 0;
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:29,代码来源:acl.php

示例6: getSmiliesPath

 public static function getSmiliesPath()
 {
     $config = JCommentsFactory::getConfig();
     $smiliesPath = $config->get('smilies_path', 'components/com_jcomments/images/smilies/');
     $smiliesPath = str_replace(array('//', '\\\\'), '/', $smiliesPath);
     $smiliesPath = trim($smiliesPath, '\\/') . '/';
     return $smiliesPath;
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:8,代码来源:jcomments.php

示例7: CategoryViewsTime

 function CategoryViewsTime($name, $reason = '')
 {
     global $mainframe, $my;
     $config =& JCommentsFactory::getConfig();
     if ($config->get('CategoryGet') != '') {
         $object = new stdClass();
         $object->object_cat = CategoryFactory::getAbs($object->object_cat);
         $commentText = $comment->comment;
     }
 }
开发者ID:neoandrew1000,项目名称:crao_journal,代码行数:10,代码来源:model.php

示例8: JCommentsPagination

 public function JCommentsPagination($object_id, $object_group)
 {
     $config = JCommentsFactory::getConfig();
     $this->commentsPerPage = $config->getInt('comments_per_page');
     $this->commentsPageLimit = $config->getInt('comments_page_limit');
     $this->commentsOrder = $config->get('comments_order');
     if ($this->commentsPerPage > 0) {
         $this->setCommentsCount(JComments::getCommentsCount($object_id, $object_group));
     }
 }
开发者ID:carmerin,项目名称:cesae-web,代码行数:10,代码来源:pagination.php

示例9: checkIsRegisteredEmail

 public static function checkIsRegisteredEmail($email)
 {
     $config = JCommentsFactory::getConfig();
     if ($config->getInt('enable_username_check') == 1) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select('COUNT(*)');
         $query->from($db->quoteName('#__users'));
         $query->where($db->quoteName('email') . ' = ' . $db->Quote($db->escape($email, true)));
         $db->setQuery($query);
         return $db->loadResult() == 0 ? 0 : 1;
     }
     return 0;
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:14,代码来源:security.php

示例10: trigger

 /**
  * Triggers an event by dispatching arguments to all observers that handle
  * the event and returning their return values.
  *
  * @param string $event The event name
  * @param array $args An array of arguments
  * @return array An array of results from each function call
  */
 public static function trigger($event, $args = null)
 {
     static $pluginsLoaded = false;
     $result = array();
     $config = JCommentsFactory::getConfig();
     if ($config->getInt('enable_mambots') == 1) {
         if (!$pluginsLoaded) {
             JPluginHelper::importPlugin('jcomments');
             $pluginsLoaded = true;
         }
         $dispatcher = JDispatcher::getInstance();
         $result = $dispatcher->trigger($event, $args);
     }
     return $result;
 }
开发者ID:sergy444,项目名称:joomla,代码行数:23,代码来源:event.php

示例11: getCommentsList

 function getCommentsList($object_id, $object_group = 'com_content', $limitStart = 0, $limit = 0)
 {
     $acl =& JCommentsFactory::getACL();
     $db =& JCommentsFactory::getDBO();
     $config =& JCommentsFactory::getConfig();
     $options['object_id'] = (int) $object_id;
     $options['object_group'] = trim($object_group);
     $options['published'] = $acl->canPublish() ? null : 1;
     $options['orderBy'] = $config->get('template_view') == 'tree' ? 'c.parent, c.date ASC' : 'c.date ' . $config->get('comments_order');
     $options['limit'] = $limit;
     $options['limitStart'] = $limitStart;
     $db->setQuery(JCommentsModel::_getCommentsQuery($options));
     $rows = $db->loadObjectList();
     return $rows;
 }
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:15,代码来源:jcomments.php

示例12: trigger

 /**
  * Triggers an event by dispatching arguments to all observers that handle
  * the event and returning their return values.
  *
  * @param string $event The event name
  * @param array $args An array of arguments
  * @return array An array of results from each function call
  */
 public static function trigger($event, $args = null)
 {
     static $initialised = false;
     $result = array();
     if (JCommentsFactory::getConfig()->getInt('enable_plugins') == 1) {
         if (!$initialised) {
             JPluginHelper::importPlugin('jcomments');
             $initialised = true;
         }
         if (version_compare(JVERSION, '3.0', 'ge')) {
             $dispatcher = JEventDispatcher::getInstance();
         } else {
             $dispatcher = JDispatcher::getInstance();
         }
         $result = $dispatcher->trigger($event, $args);
     }
     return $result;
 }
开发者ID:ForAEdesWeb,项目名称:AEW2,代码行数:26,代码来源:event.php

示例13: show

 public static function show()
 {
     $app = JCommentsFactory::getApplication('administrator');
     $config = JCommentsFactory::getConfig();
     if ($config->getInt('enable_blacklist') == 0) {
         if (JCOMMENTS_JVERSION != '1.0') {
             JError::raiseWarning(500, JText::_('A_BLACKLIST_WARNING_BLACKLIST_IS_DISABLED'));
         }
     }
     $context = 'com_jcomments.blacklist.';
     $limit = intval($app->getUserStateFromRequest($context . 'limit', 'limit', $app->getCfg('list_limit')));
     $limitstart = intval($app->getUserStateFromRequest($context . 'limitstart', 'limitstart', 0));
     $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'bl.created');
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', 'desc');
     $search = trim($app->getUserStateFromRequest($context . 'search', 'search', ''));
     if (JCOMMENTS_JVERSION == '1.0') {
         $search = strtolower($search);
     } else {
         $search = JString::strtolower($search);
     }
     if ($filter_order == '') {
         $filter_order = 'bl.created';
     }
     if ($filter_order_Dir == '') {
         $filter_order_Dir = 'desc';
     }
     $lists['order'] = $filter_order;
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['search'] = $search;
     $db = JCommentsFactory::getDBO();
     $where = array();
     if ($search != '') {
         $where[] = '(LOWER(bl.ip) like "%' . $db->getEscaped($search, true) . '%")' . ' OR LOWER(bl.reason) like "%' . $db->getEscaped($search, true) . '%"' . ' OR LOWER(bl.notes) like "%' . $db->getEscaped($search, true) . '%"';
     }
     $query = "SELECT COUNT(*)" . " FROM #__jcomments_blacklist AS bl" . (count($where) ? " WHERE " . implode(' AND ', $where) : "");
     $db->setQuery($query);
     $total = $db->loadResult();
     $lists['pageNav'] = JCommentsAdmin::getPagination($total, $limitstart, $limit);
     $query = "SELECT bl.*, u.name AS editor" . " FROM #__jcomments_blacklist AS bl" . " LEFT JOIN #__users AS u ON u.id = bl.checked_out" . (count($where) ? " WHERE " . implode(' AND ', $where) : "") . " ORDER BY " . $filter_order . ' ' . $filter_order_Dir;
     $db->setQuery($query, $lists['pageNav']->limitstart, $lists['pageNav']->limit);
     $lists['rows'] = $db->loadObjectList();
     HTML_JCommentsAdminBlacklistManager::show($lists);
 }
开发者ID:sergy444,项目名称:joomla,代码行数:43,代码来源:admin.jcomments.blacklist.php

示例14: __construct

 public function __construct()
 {
     if (count($this->_replacements) == 0) {
         $config = JCommentsFactory::getConfig();
         $path = JUri::root(true) . '/' . trim(str_replace('\\', '/', $config->get('smilies_path')), '/') . '/';
         $smilies = $config->get('smilies');
         if (!empty($smilies)) {
             $values = explode("\n", $smilies);
             foreach ($values as $value) {
                 list($code, $image) = explode("\t", $value);
                 $this->_smilies[$code] = $image;
             }
         }
         $list = $this->_smilies;
         uksort($list, array($this, 'compare'));
         foreach ($list as $code => $image) {
             $this->_replacements['code'][] = '#(^|\\s|\\n|\\r|\\>)(' . preg_quote($code, '#') . ')(\\s|\\n|\\r|\\<|$)#ismu';
             $this->_replacements['icon'][] = '\\1 \\2 \\3';
             $this->_replacements['code'][] = '#(^|\\s|\\n|\\r|\\>)(' . preg_quote($code, '#') . ')(\\s|\\n|\\r|\\<|$)#ismu';
             $this->_replacements['icon'][] = '\\1<img src="' . $path . $image . '" alt="' . htmlspecialchars($code) . '" />\\3';
         }
     }
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:23,代码来源:smilies.php

示例15: _getDefaultOrder

 /**
  * Returns default order for comments list
  *
  * @return string
  */
 protected static function _getDefaultOrder()
 {
     $config = JCommentsFactory::getConfig();
     if ($config->get('template_view') == 'tree') {
         switch ($config->getInt('comments_tree_order')) {
             case 2:
                 $result = 'threadDate DESC, c.date ASC';
                 break;
             case 1:
                 $result = 'c.parent, c.date DESC';
                 break;
             default:
                 $result = 'c.parent, c.date ASC';
                 break;
         }
     } else {
         $result = 'c.date ' . $config->get('comments_list_order');
     }
     return $result;
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:25,代码来源:jcomments.php


注:本文中的JCommentsFactory::getConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。