• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP KunenaFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: kunena_160_2010_05_30_timezone

function kunena_160_2010_05_30_timezone($parent)
{
    $result = null;
    $config = KunenaFactory::getConfig();
    $db = JFactory::getDbo();
    // We need to fix all timestamps to UTC (if not already done)
    if ($config->get('board_ofset', '0.00') != '0.00') {
        $timeshift = (double) date('Z') + (double) $config->get('board_ofset') * 3600;
        $db->setQuery("UPDATE #__kunena_categories SET time_last_msg = time_last_msg - {$timeshift}");
        $db->query();
        if ($db->getErrorNum()) {
            throw new KunenaInstallerException($db->getErrorMsg(), $db->getErrorNum());
        }
        $db->setQuery("UPDATE #__kunena_sessions SET lasttime = lasttime - {$timeshift}, currvisit  = currvisit  - {$timeshift}");
        $db->query();
        if ($db->getErrorNum()) {
            throw new KunenaInstallerException($db->getErrorMsg(), $db->getErrorNum());
        }
        $db->setQuery("UPDATE #__kunena_whoisonline SET time = time - {$timeshift}");
        $db->query();
        if ($db->getErrorNum()) {
            throw new KunenaInstallerException($db->getErrorMsg(), $db->getErrorNum());
        }
        $db->setQuery("UPDATE #__kunena_messages SET time = time - {$timeshift}, modified_time = modified_time - {$timeshift}");
        $db->query();
        if ($db->getErrorNum()) {
            throw new KunenaInstallerException($db->getErrorMsg(), $db->getErrorNum());
        }
        unset($config->board_ofset);
        $result = array('action' => '', 'name' => JText::sprintf('COM_KUNENA_INSTALL_160_TIMEZONE', sprintf('%+d:%02d', $timeshift / 3600, $timeshift / 60 % 60)), 'success' => true);
    }
    // Save configuration
    $config->save();
    return $result;
}
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:35,代码来源:1.6.0-2010-05-30_timezone.php


示例17: displayEdit

	public function displayEdit()
	{
		$this->setToolBarEdit();
		$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 = ($avatarint instanceof KunenaAvatarKunena) ? true : false;
		$this->avatar     = $avatarint->getLink($this->user, '', 'users');

		// make the select list for the moderator flag
		$yesnoMod [] = JHtml::_('select.option', '1', JText::_('COM_KUNENA_YES'));
		$yesnoMod [] = JHtml::_('select.option', '0', JText::_('COM_KUNENA_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:BillVGN,项目名称:PortalPRP,代码行数:29,代码来源:view.html.php


示例18: onUserAfterSave

	public function onUserAfterSave($user, $isnew, $success, $msg) {
		//Don't continue if the user wasn't stored succesfully
		if (! $success) {
			return false;
		}
		if ($isnew) {
			$user = KunenaFactory::getUser(intval($user ['id']));
			$user->save();
		}

		/*
		// See: http://www.kunena.org/forum/159-k-16-common-questions/63438-category-subscriptions-default-subscribed#63554
		// TODO: Subscribe user to every category if he is new and Kunena is configured to do so
		if ($isnew) {
			$subscribedCategories = '1,2,3,4,5,6,7,8,9,10';
			$db = Jfactory::getDBO();
			$query = "INSERT INTO #__kunena_user_categories (user_id,category_id)
				SELECT {$user->userid} AS user_id, c.id as category_id
				FROM #__kunena_categories AS c
				LEFT JOIN #__kunena_user_categories AS s ON c.id=s.category_id AND s.user_id={$user->userid}
				WHERE c.parent>0 AND c.id IN ({$subscribedCategories}) AND s.user_id IS NULL";
			$db->setQuery ( $query );
			$db->query ();
			KunenaError::checkDatabaseError();

			// Here's also query to subscribe all users (including blocked) to all existing cats:
			$query = "INSERT INTO #__kunena_user_categories (user_id,category_id)
				SELECT u.id AS user_id, c.id AS category_id
				FROM #__users AS u
				JOIN #__kunena_categories AS c ON c.parent>0
				LEFT JOIN #__kunena_user_categories AS s ON u.id=s.user_id
				WHERE c.id IN ({$subscribedCategories}) AND s.user_id IS NULL";
		}
		*/
	}
开发者ID:rich20,项目名称:Kunena,代码行数:35,代码来源:kunena.php


示例19: testGet

 /**
  * Test get()
  */
 public function testGet()
 {
     $admin = KunenaFactory::getUser('admin');
     $topicuser = KunenaForumTopicUserHelper::get();
     $this->assertEquals(null, $topicuser->topic_id);
     $this->assertEquals(0, $topicuser->user_id);
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:10,代码来源:KunenaForumTopicUserHelperTest.php


示例20: displayDefault

 function displayDefault($tpl = null)
 {
     if (!$this->config->enablerss) {
         JError::raiseError(404, JText::_('COM_KUNENA_RSS_DISABLED'));
     }
     KunenaHtmlParser::$relative = false;
     $this->category = $this->get('Category');
     if (!$this->category->authorise('read')) {
         JError::raiseError(404, $this->category->getError());
     }
     $this->topics = $this->get('Topics');
     $title = JText::_('COM_KUNENA_THREADS_IN_FORUM') . ': ' . $this->category->name;
     $this->setTitle($title);
     $metaDesc = $this->document->getDescription() . '. ' . $this->escape("{$this->category->name} - {$this->config->board_title}");
     $this->document->setDescription($metaDesc);
     // Create image for feed
     $image = new JFeedImage();
     $image->title = $this->document->getTitle();
     $image->url = $this->ktemplate->getImagePath('icons/rss.png');
     $image->description = $this->document->getDescription();
     $this->document->image = $image;
     foreach ($this->topics as $topic) {
         $description = $topic->last_post_message;
         $date = new JDate($topic->last_post_time);
         $userid = $topic->last_post_userid;
         $username = KunenaFactory::getUser($userid)->getName($topic->last_post_guest_name);
         $title = $topic->subject;
         $category = $topic->getCategory();
         $url = $topic->getUrl($category, true, 'last');
         $this->createItem($title, $url, $description, $category->name, $date, $userid, $username);
     }
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:32,代码来源:view.feed.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP KunenaForum类代码示例发布时间:2022-05-23
下一篇:
PHP KunenaError类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap