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


PHP KunenaFactory::getConfig方法代码示例

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


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

示例1: populateState

	protected function populateState() {
		$layout = $this->getCmd ( 'layout', 'default' );
		$this->setState ( 'layout', $layout );

		// Administrator state
		if ($layout == 'manage' || $layout == 'create' || $layout == 'edit') {
			return parent::populateState();
		}

		$app = JFactory::getApplication ();
		$this->config = KunenaFactory::getConfig ();
		$this->me = KunenaUserHelper::get();

		$active = $app->getMenu ()->getActive ();
		$active = $active ? (int) $active->id : 0;
		$catid = $this->getInt ( 'catid', 0 );
		$this->setState ( 'item.id', $catid );

		// List state information
		$value = $this->getUserStateFromRequest ( "com_kunena.category{$catid}_list_limit", 'limit', 0, 'int' );
		if ($value < 1) $value = $this->config->threads_per_page;
		$this->setState ( 'list.limit', $value );

		$value = $this->getUserStateFromRequest ( "com_kunena.category{$catid}_{$active}_list_ordering", 'filter_order', 'time', 'cmd' );
		//$this->setState ( 'list.ordering', $value );

		$value = $this->getUserStateFromRequest ( "com_kunena.category{$catid}_list_start", 'limitstart', 0, 'int' );
		$this->setState ( 'list.start', $value );

		$value = $this->getUserStateFromRequest ( "com_kunena.category{$catid}_{$active}_list_direction", 'filter_order_Dir', 'desc', 'word' );
		if ($value != 'asc')
			$value = 'desc';
		$this->setState ( 'list.direction', $value );
	}
开发者ID:rich20,项目名称:Kunena,代码行数:34,代码来源:category.php

示例2: _getURL

 /**
  * @param $user
  * @param $sizex
  * @param $sizey
  *
  * @return string
  */
 protected function _getURL($user, $sizex, $sizey)
 {
     $user = KunenaFactory::getUser($user);
     $avatar = $user->avatar;
     $config = KunenaFactory::getConfig();
     $path = KPATH_MEDIA . "/avatars";
     $origPath = "{$path}/{$avatar}";
     if (!is_file($origPath)) {
         // If avatar does not exist use default image.
         if ($sizex <= 90) {
             $avatar = 's_nophoto.jpg';
         } else {
             $avatar = 'nophoto.jpg';
         }
         // Search from the template.
         $template = KunenaFactory::getTemplate();
         $origPath = JPATH_SITE . '/' . $template->getAvatarPath($avatar);
         $avatar = $template->name . '/' . $avatar;
     }
     $dir = dirname($avatar);
     $file = basename($avatar);
     if ($sizex == $sizey) {
         $resized = "resized/size{$sizex}/{$dir}";
     } else {
         $resized = "resized/size{$sizex}x{$sizey}/{$dir}";
     }
     // TODO: make timestamp configurable?
     $timestamp = '';
     if (!is_file("{$path}/{$resized}/{$file}")) {
         KunenaImageHelper::version($origPath, "{$path}/{$resized}", $file, $sizex, $sizey, intval($config->avatarquality), KunenaImage::SCALE_INSIDE, intval($config->avatarcrop));
         $timestamp = '?' . round(microtime(true));
     }
     return KURL_MEDIA . "avatars/{$resized}/{$file}{$timestamp}";
 }
开发者ID:Ruud68,项目名称:Kunena-Forum,代码行数:41,代码来源:avatar.php

示例3: getNewTopics

	static public function getNewTopics($catids) {
		$session = KunenaFactory::getSession ();
		if (!$session->userid || !KunenaFactory::getConfig()->shownew) {
			return;
		}
		$readlist = $session->readtopics;
		$prevCheck = $session->lasttime;
		$categories = self::getCategories($catids);
		$catlist = array();
		foreach ($categories as $category) {
			$catlist += $category->getChannels();
			$catlist += $category->getChildren();
		}
		if (empty($catlist)) return;
		$catlist = implode(',', array_keys($catlist));
		$db = JFactory::getDBO ();
		$query = "SELECT DISTINCT(category_id), COUNT(*) AS new
			FROM #__kunena_topics
			WHERE category_id IN ($catlist) AND hold='0' AND last_post_time>{$db->Quote($prevCheck)} AND id NOT IN ({$readlist})
			GROUP BY category_id";
		$db->setQuery ( $query );
		$newlist = (array) $db->loadObjectList ('category_id');
		if (KunenaError::checkDatabaseError()) return;
		if (empty($newlist)) return;
		$new = array();
		foreach ($newlist AS $id=>$item) {
			$new[$id] = (int) $item->new;
		}
		foreach ($categories as $category) {
			$channels = $category->getChannels();
			$channels += $category->getChildren();
			$category->getNewCount(array_sum(array_intersect_key($new, $channels)));
		}
	}
开发者ID:rich20,项目名称:Kunena,代码行数:34,代码来源:helper.php

示例4: displayDefault

	function displayDefault() {
		JToolBarHelper::title ( '&nbsp;', 'kunena.png' );
		$this->config = KunenaFactory::getConfig ();
		$this->versioncheck = $this->get('latestversion');

		$this->display ();
	}
开发者ID:rich20,项目名称:Kunena,代码行数:7,代码来源:view.html.php

示例5: kunena_upgrade_200_configuration

function kunena_upgrade_200_configuration($parent) {
	$config = KunenaFactory::getConfig ();

	if ($config->allowimageupload >= 0) {
		$config->image_upload = 'nobody';
		if ($config->allowimageregupload == 1) {
			$config->image_upload = 'registered';
		}
		if ($config->allowimageupload == 1) {
			$config->image_upload = 'everybody';
		}
		$config->allowimageupload = $config->allowimageregupload = -1;
	}

	if ($config->allowfileupload >= 0) {
		$config->file_upload = 'nobody';
		if ($config->allowfileregupload == 1) {
			$config->file_upload = 'registered';
		}
		if ($config->allowfileupload == 1) {
			$config->file_upload = 'everybody';
		}
		$config->allowfileupload = $config->allowfileregupload = -1;
	}

	// Save configuration
	$config->remove ();
	$config->create ();

	return array ('action' => '', 'name' => JText::_ ( 'COM_KUNENA_INSTALL_200_CONFIGURATION' ), 'success' => true );
}
开发者ID:GoremanX,项目名称:Kunena-2.0,代码行数:31,代码来源:upgrade-2.0.0_configuration.php

示例6: getUserListURL

	public function getUserListURL($action='', $xhtml = true)
	{
		$config = KunenaFactory::getConfig ();
		$my = JFactory::getUser();
		if ( $config->userlist_allowed == 1 && $my->id == 0  ) return false;
		return CRoute::_('index.php?option=com_community&view=search&task=browse', $xhtml);
	}
开发者ID:rich20,项目名称:Kunena,代码行数:7,代码来源:profile.php

示例7: displayList

	function displayList($tpl = null) {
		$this->app = JFactory::getApplication();
		$this->config = KunenaFactory::getConfig();
		$this->assignRef ( 'announcements', $this->get ( 'Announcements' ) );
		$this->assignRef ( 'canEdit', $this->get ( 'CanEdit' ) );
		$this->display();
	}
开发者ID:rich20,项目名称:Kunena,代码行数:7,代码来源:view.html.php

示例8: displayEdit

	function displayEdit() {
		$this->setToolBarEdit();
		$this->config = KunenaFactory::getConfig ();
		$this->user = $this->get('user');
		$this->sub = $this->get('subscriptions');
		$this->subscatslist = $this->get('catsubcriptions');
		$this->ipslist = $this->get('IPlist');

		$avatarint = KunenaFactory::getAvatarIntegration();
		$this->editavatar = is_a($avatarint, 'KunenaAvatarKunena') ? true : false;
		$this->avatar = $avatarint->getLink($this->user, '', 'profile');

		// make the select list for the moderator flag
		$yesnoMod [] = JHTML::_ ( 'select.option', '1', JText::_('COM_KUNENA_ANN_YES') );
		$yesnoMod [] = JHTML::_ ( 'select.option', '0', JText::_('COM_KUNENA_ANN_NO') );
		// build the html select list
		$this->selectMod = JHTML::_ ( 'select.genericlist', $yesnoMod, 'moderator', 'class="inputbox" size="2"', 'value', 'text', $this->user->moderator );
		// make the select list for the moderator flag
		$yesnoOrder [] = JHTML::_ ( 'select.option', '0', JText::_('COM_KUNENA_USER_ORDER_ASC') );
		$yesnoOrder [] = JHTML::_ ( 'select.option', '1', JText::_('COM_KUNENA_USER_ORDER_DESC') );
		// build the html select list
		$this->selectOrder = JHTML::_ ( 'select.genericlist', $yesnoOrder, 'neworder', 'class="inputbox" size="2"', 'value', 'text', $this->user->ordering );
		$this->modCats = $this->get('listmodcats');
		$this->selectRank = $this->get('listuserranks');
		$this->display();
	}
开发者ID:rich20,项目名称:Kunena,代码行数:26,代码来源:view.html.php

示例9: warning

 function warning($msg, $where = 'default')
 {
     if (JDEBUG || KunenaFactory::getConfig()->debug) {
         $app = JFactory::getApplication();
         $app->enqueueMessage(JText::sprintf('COM_KUNENA_WARNING_' . strtoupper($where), $msg), 'notice');
     }
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:7,代码来源:error.php

示例10: __construct

 function __construct()
 {
     $this->_db =& JFactory::getDBO();
     $this->_my =& JFactory::getUser();
     $this->_config = KunenaFactory::getConfig();
     $this->_session = KunenaFactory::getSession();
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:7,代码来源:kunena.attachments.class.php

示例11: isDefault

	public static function isDefault($template)
	{
		$config = KunenaFactory::getConfig ();
		$defaultemplate = $config->template;

		return $defaultemplate == $template ? 1 : 0;
	}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:7,代码来源:helper.php

示例12: enabled

	public static function enabled() {
		if (!JComponentHelper::isEnabled ( 'com_kunena', true )) {
			return false;
		}
		$config = KunenaFactory::getConfig ();
		return !$config->board_offline;
	}
开发者ID:GoremanX,项目名称:Kunena-2.0,代码行数:7,代码来源:forum.php

示例13: getRSS

	/**
	 * Method to get the RSS URL link with image
	 *
	 * @return string
	 */
	protected function getRSS()
	{
		$config = KunenaFactory::getConfig();

		if ($config->enablerss)
		{
			$mode = $config->rss_type;

			switch ($mode)
			{
				case 'topic' :
					$rss_type = 'mode=topics';
					break;
				case 'recent' :
					$rss_type = 'mode=replies';
					break;
				case 'post' :
					$rss_type = 'layout=posts';
					break;
			}

			return '<a href="' . KunenaRoute::_("index.php?option=com_kunena&view=topics&format=feed&layout=default&{$rss_type}", true) . '"><span class="icon-feed" title="' . JText::_('COM_KUNENA_CATEGORIES_LABEL_GETRSS') . '"></span></a>';
		}
		else
		{
			return null;
		}
	}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:33,代码来源:footer.php

示例14: __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}");
 }
开发者ID:810,项目名称:Kunena-Addons,代码行数:34,代码来源:kunenadiscuss.php

示例15: getTopHits

 public function getTopHits($limit = 0)
 {
     if (!$limit) {
         $limit = KunenaFactory::getConfig()->popusercount;
     }
     return (array) $this->_getTopHits($limit);
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:7,代码来源:profile.php


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