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


PHP KunenaFactory类代码示例

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


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

示例1: 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

示例2: getQueryWhere

 public function getQueryWhere()
 {
     $where = '';
     // Hide super admins from the list
     if (!KunenaFactory::getConfig()->superadmin_userlist) {
         $db = JFactory::getDBO();
         $query = "SELECT user_id FROM `#__user_usergroup_map` WHERE group_id =8";
         $db->setQuery($query);
         $superadmins = (array) $db->loadColumn();
         if (!$superadmins) {
             $superadmins = array(0);
         }
         $this->setState('list.exclude', implode(',', $superadmins));
         $where = ' u.id NOT IN (' . $this->getState('list.exclude') . ') AND ';
     }
     if ($this->config->userlist_count_users == '1') {
         $where .= '(u.block=0 OR u.activation="")';
     } elseif ($this->config->userlist_count_users == '2') {
         $where .= '(u.block=0 AND u.activation="")';
     } elseif ($this->config->userlist_count_users == '3') {
         $where .= 'u.block=0';
     } else {
         $where .= '1';
     }
     return $where;
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:26,代码来源:user.php

示例3: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->app = JFactory::getApplication();
     $this->me = KunenaUserHelper::getMyself();
     $this->config = KunenaFactory::getConfig();
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:templates.php

示例4: before

 /**
  * Prepare login display.
  *
  * @return boolean
  */
 protected function before()
 {
     parent::before();
     $login = KunenaLogin::getInstance();
     if (!$login->enabled()) {
         return false;
     }
     $this->me = KunenaUserHelper::getMyself();
     $this->name = $this->me->exists() ? 'Widget/Login/Logout' : 'Widget/Login/Login';
     $this->my = JFactory::getUser();
     if ($this->my->guest) {
         $this->registrationUrl = $login->getRegistrationUrl();
         $this->resetPasswordUrl = $login->getResetUrl();
         $this->remindUsernameUrl = $login->getRemindUrl();
         $this->rememberMe = $login->getRememberMe();
     } else {
         $this->lastvisitDate = KunenaDate::getInstance($this->my->lastvisitDate);
         $private = KunenaFactory::getPrivateMessaging();
         if ($private) {
             $count = $private->getUnreadCount($this->me->userid);
             $this->inboxCount = $count ? JText::sprintf('COM_KUNENA_PMS_INBOX_NEW', $count) : JText::_('COM_KUNENA_PMS_INBOX');
             $this->pm_link = $private->getInboxURL();
         }
         // Display announcements.
         if ($this->me->isModerator()) {
             $this->announcementsUrl = KunenaForumAnnouncementHelper::getUrl('list');
         }
     }
     return true;
 }
开发者ID:Ruud68,项目名称:Kunena-Forum,代码行数:35,代码来源:display.php

示例5: __construct

 public function __construct()
 {
     $this->config = KunenaFactory::getConfig();
     $this->publickey = $this->config->recaptcha_publickey;
     $this->privatekey = $this->config->recaptcha_privatekey;
     $this->host = JRequest::getVar('REMOTE_ADDR', null, 'server');
 }
开发者ID:rich20,项目名称:Kunena-1.6,代码行数:7,代码来源:recaptcha.php

示例6: testGetInstance

 /**
  * Test getInstance()
  *
  * @param KunenaForumCategoryUser $categoryuser
  * @return KunenaForumCategoryUser
  * @depends testCreate
  */
 public function testGetInstance(KunenaForumCategoryUser $categoryuser)
 {
     $admin = KunenaFactory::getUser('admin');
     $categoryuser2 = KunenaForumCategoryUser::getInstance($categoryuser->category_id, $admin->userid);
     $this->assertSame($categoryuser, $categoryuser2);
     return $categoryuser;
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:14,代码来源:KunenaForumCategoryUserTest.php

示例7: 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();
     }
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:30,代码来源:module.php

示例8: testGet

 /**
  * Test get()
  */
 public function testGet()
 {
     $admin = KunenaFactory::getUser('admin');
     $categoryuser = KunenaForumCategoryUserHelper::get(0, $admin->userid);
     $this->assertEquals(0, $categoryuser->category_id);
     $this->assertEquals($admin->userid, $categoryuser->user_id);
 }
开发者ID:OminiaVincit,项目名称:Kunena-Forum,代码行数:10,代码来源:KunenaForumCategoryUserHelperTest.php

示例9: _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

示例10: 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

示例11: _getURL

	protected function _getURL($user, $sizex, $sizey)
	{
		$user = KunenaFactory::getUser($user);
		// Get CUser object
		 $avatar=AwdwallHelperUser::getBigAvatar51($user->userid);
		return $avatar;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:avatar.php

示例12: 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

示例13: 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

示例14: before

 /**
  * Prepare message actions display.
  *
  * @return void
  */
 protected function before()
 {
     parent::before();
     $catid = $this->input->getInt('id');
     $me = KunenaUserHelper::getMyself();
     $this->category = KunenaForumCategory::getInstance($catid);
     $token = JSession::getFormToken();
     $task = "index.php?option=com_kunena&view=category&task=%s&catid={$catid}&{$token}=1";
     $layout = "index.php?option=com_kunena&view=topic&layout=%s&catid={$catid}";
     $this->template = KunenaFactory::getTemplate();
     $this->categoryButtons = new JObject();
     // Is user allowed to post new topic?
     if ($this->category->getNewTopicCategory()->exists()) {
         $this->categoryButtons->set('create', $this->getButton(sprintf($layout, 'create'), 'create', 'topic', 'communication', true));
     }
     // Is user allowed to mark forums as read?
     if ($me->exists()) {
         $this->categoryButtons->set('markread', $this->getButton(sprintf($task, 'markread'), 'markread', 'category', 'user', true));
     }
     // Is user allowed to subscribe category?
     if ($this->category->isAuthorised('subscribe')) {
         $subscribed = $this->category->getSubscribed($me->userid);
         if (!$subscribed) {
             $this->categoryButtons->set('subscribe', $this->getButton(sprintf($task, 'subscribe'), 'subscribe', 'category', 'user', true));
         } else {
             $this->categoryButtons->set('unsubscribe', $this->getButton(sprintf($task, 'unsubscribe'), 'unsubscribe', 'category', 'user', true));
         }
     }
     JPluginHelper::importPlugin('kunena');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onKunenaGetButtons', array('category.action', $this->categoryButtons, $this));
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:37,代码来源:display.php

示例15: testGetInstance

 /**
  * Test getInstance()
  *
  * @param KunenaForumTopicUser $topicuser
  * @return KunenaForumTopicUser
  * @depends testCreate
  */
 public function testGetInstance(KunenaForumTopicUser $topicuser)
 {
     $admin = KunenaFactory::getUser('admin');
     $topicuser2 = KunenaForumTopicUser::getInstance($topicuser->topic_id, $admin->userid);
     $this->assertSame($topicuser, $topicuser2);
     return $topicuser;
 }
开发者ID:OminiaVincit,项目名称:Kunena-Forum,代码行数:14,代码来源:KunenaForumTopicUserTest.php


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