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


PHP kimport函数代码示例

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


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

示例1: delete

	function delete() {
		$app =  JFactory::getApplication ();
		$db = JFactory::getDBO ();

		if (! JRequest::checkToken ()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$app->redirect ( KunenaRoute::_($this->baseurl, false) );
		}

		$cids = JRequest::getVar ( 'cid', array (), 'post', 'array' );

		if (! $cids) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_NO_ATTACHMENTS_SELECTED' ), 'error' );
			$app->redirect ( KunenaRoute::_($this->baseurl, false) );
		}

		foreach( $cids as $id ) {
			kimport ('kunena.forum.message.attachment.helper');
			$attachment = KunenaForumMessageAttachmentHelper::get($id);
			$attachment->delete();
		}

		$app->enqueueMessage ( JText::_('COM_KUNENA_ATTACHMENTS_DELETED_SUCCESSFULLY') );
		$app->redirect ( KunenaRoute::_($this->baseurl, false) );
	}
开发者ID:rich20,项目名称:Kunena,代码行数:25,代码来源:attachments.php

示例2: 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;
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:29,代码来源:com_kunena.php

示例3: recount

	function recount() {
		$app = JFactory::getApplication ();
		$state = $app->getUserState ( 'com_kunena.admin.recount', null );

		if ($state === null) {
			// First run
			$query = "SELECT MAX(id) FROM #__kunena_messages";
			$db = JFactory::getDBO();
			$db->setQuery ( $query );
			$state = new StdClass();
			$state->step = 0;
			$state->maxId = (int) $db->loadResult ();
			$state->start = 0;
		}

		$this->checkTimeout();
		while (1) {
			$count = mt_rand(95000, 105000);
			switch ($state->step) {
				case 0:
					// Update topic statistics
					kimport('kunena.forum.topic.helper');
					KunenaForumTopicHelper::recount(false, $state->start, $state->start+$count);
					$state->start += $count;
					//$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_TOPICS', min($state->start, $state->maxId), $state->maxId) );
					break;
				case 1:
					// Update usertopic statistics
					kimport('kunena.forum.topic.user.helper');
					KunenaForumTopicUserHelper::recount(false, $state->start, $state->start+$count);
					$state->start += $count;
					//$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_USERTOPICS', min($state->start, $state->maxId), $state->maxId) );
					break;
				case 2:
					// Update user statistics
					kimport('kunena.user.helper');
					KunenaUserHelper::recount();
					//$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_USER') );
					break;
				case 3:
					// Update category statistics
					kimport('kunena.forum.category.helper');
					KunenaForumCategoryHelper::recount();
					//$app->enqueueMessage ( JText::sprintf('COM_KUNENA_ADMIN_RECOUNT_CATEGORY') );
					break;
				default:
					$app->setUserState ( 'com_kunena.admin.recount', null );
					$app->enqueueMessage (JText::_('COM_KUNENA_RECOUNTFORUMS_DONE'));
					$this->setRedirect(KunenaRoute::_('index.php?option=com_kunena', false));
					return;
			}
			if (!$state->start || $state->start > $state->maxId) {
				$state->step++;
				$state->start = 0;
			}
			if ($this->checkTimeout()) break;
		}
		$app->setUserState ( 'com_kunena.admin.recount', $state );
		$this->setRedirect(KunenaRoute::_('index.php?option=com_kunena&view=recount&task=recount', false));
	}
开发者ID:rich20,项目名称:Kunena,代码行数:60,代码来源:recount.php

示例4: getSession

	/**
	 * Get Kunena session object
	 *
	 * Returns the global {@link KunenaSession} object, only creating it if it doesn't already exist.
	 *
	 * @param array An array containing session options
	 * @return object KunenaSession
	 */
	public static function getSession($update = false)
	{
		kimport('kunena.session');
		if (!is_object(KunenaFactory::$session)) {
			KunenaFactory::$session = KunenaSession::getInstance($update);
		}
		return KunenaFactory::$session;
	}
开发者ID:rich20,项目名称:Kunena,代码行数:16,代码来源:factory.php

示例5: __construct

 /**
  * Contructor
  *
  * @since 1.6
  */
 function __construct()
 {
     $this->pid = JRequest::getInt('pid', '');
     $this->catid = JRequest::getInt('catid', '');
     $this->my =& JFactory::getUser();
     $this->config = KunenaFactory::getConfig();
     $this->_db =& JFactory::getDBO();
     $this->_app =& JFactory::getApplication();
     kimport('thankyou');
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:15,代码来源:kunena.thankyou.php

示例6: kunenaOnline

 protected static function kunenaOnline()
 {
     // Kunena detection and version check
     $minKunenaVersion = '1.6.3';
     if (!class_exists('Kunena') || Kunena::versionBuild() < 4344) {
         JFactory::getApplication()->enqueueMessage(JText::sprintf('PLG_COMMUNITY_KUNENAGROUPS_KUNENA_NOT_INSTALLED', $minKunenaVersion), 'notice');
         return false;
     }
     // Kunena online check
     if (!Kunena::enabled()) {
         JFactory::getApplication()->enqueueMessage(JText::_('PLG_COMMUNITY_KUNENAGROUPS_KUNENA_OFFLINE'), 'notice');
         return false;
     }
     // Initialize session
     $session = KunenaFactory::getSession();
     $session->updateAllowedForums();
     kimport('category');
     return true;
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:19,代码来源:kunenagroups.php

示例7: onAfterReply

	public function onAfterReply($message) {
		CFactory::load ( 'libraries', 'userpoints' );
		CUserPoints::assignPoint ( 'com_kunena.thread.reply' );

		// Check for permisions of the current category - activity only if public or registered
		if ($message->getCategory()->pub_access <= 0) {
			//activity stream - reply post
			require_once KPATH_SITE.'/lib/kunena.link.class.php';
			$JSPostLink = CKunenaLink::GetThreadPageURL ( 'view', $message->catid, $message->thread, 0 );

			kimport('kunena.html.parser');
			$content = KunenaHtmlParser::plainBBCode($message->message, $this->_config->activity_limit);

			// Add readmore link
			$content .= '<br /><a href="'.
					CKunenaLink::GetMessageURL($message->id, $message->catid).
					'" class="small profile-newsfeed-item-action">'.JText::sprintf('Read more...').'</a>';

			$act = new stdClass ();
			$act->cmd = 'wall.write';
			$act->actor = $message->userid;
			$act->target = 0; // no target
			$act->title = JText::_ ( '{single}{actor}{/single}{multiple}{actors}{/multiple} ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG1' ) . ' <a href="' . $JSPostLink . '">' . $message->subject . '</a> ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG2' ) );
			$act->content = $content;
			$act->app = 'kunena.post';
			$act->cid = $message->thread;

			// jomsocial 0 = public, 20 = registered members
			if ($message->getCategory()->pub_access == 0) {
				$act->access = 0;
			} else {
				$act->access = 20;
			}

			CFactory::load ( 'libraries', 'activities' );
			CActivityStream::add ( $act );
		}
	}
开发者ID:rich20,项目名称:Kunena,代码行数:38,代码来源:activity.php

示例8: __construct

 function __construct($parent, $message)
 {
     kimport('html.parser');
     $this->limitstart = $parent->limitstart;
     $this->limit = $parent->limit;
     $this->mesid = $parent->mesid;
     $this->replynum = $parent->replynum;
     $this->replycnt = $parent->total_messages;
     $this->mmm = $parent->mmm;
     $this->topicLocked = $parent->topicLocked;
     $this->allow_anonymous = $parent->allow_anonymous;
     $this->anonymous = $parent->anonymous;
     $this->myname = $parent->myname;
     $this->templatepath = $parent->templatepath;
     $this->msg = $message;
     $this->my = JFactory::getUser();
     $this->me = KunenaFactory::getUser();
     $this->config = KunenaFactory::getConfig();
     $this->db = JFactory::getDBO();
     $template = KunenaFactory::getTemplate();
     $this->params = $template->params;
     $this->cansubscribe = $parent->cansubscribe;
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:23,代码来源:view.php

示例9: displayFooter

	function displayFooter($tpl = null) {
		require_once KPATH_SITE . '/lib/kunena.link.class.php';
		$catid = 0;
		if (KunenaFactory::getConfig ()->enablerss) {
			if ($catid > 0) {
				kimport ( 'kunena.forum.category.helper' );
				$category = KunenaForumCategoryHelper::get ( $catid );
				if ($category->pub_access == 0 && $category->parent)
					$rss_params = '&catid=' . ( int ) $catid;
			} else {
				$rss_params = '';
			}
			if (isset ( $rss_params )) {
				$document = JFactory::getDocument ();
				$document->addCustomTag ( '<link rel="alternate" type="application/rss+xml" title="' . JText::_ ( 'COM_KUNENA_LISTCAT_RSS' ) . '" href="' . CKunenaLink::GetRSSURL ( $rss_params ) . '" />' );
				$this->assign ( 'rss', CKunenaLink::GetRSSLink ( $this->getIcon ( 'krss', JText::_('COM_KUNENA_LISTCAT_RSS') ), 'follow', $rss_params ));
			}
		}
		$template = KunenaFactory::getTemplate ();
		$credits = CKunenaLink::GetTeamCreditsLink ( $catid, JText::_('COM_KUNENA_POWEREDBY') ) . ' ' . CKunenaLink::GetCreditsLink ();
		if ($template->params->get('templatebyText') !='') {
			$credits .= ' :: <a href ="'. $template->params->get('templatebyLink').'" rel="follow">' . $template->params->get('templatebyText') .' '. $template->params->get('templatebyName') .'</a>';
		}
		$this->assign ( 'credits', $credits );
		$result = $this->loadTemplate($tpl);
		if (JError::isError($result)) {
			return $result;
		}
		echo $result;
	}
开发者ID:rich20,项目名称:Kunena,代码行数:30,代码来源:view.html.php

示例10: delfile

	function delfile() {
		$app = JFactory::getApplication ();
		if (! JRequest::checkToken ()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$this->redirectBack ();
		}
		$cids = JRequest::getVar ( 'cid', array (), 'post', 'array' );

		$number = count($cids);

		foreach( $cids as $id ) {
			kimport ('kunena.forum.message.attachment.helper');
			$attachment = KunenaForumMessageAttachmentHelper::get($id);
			$attachment->delete();
		}

		$app->enqueueMessage ( JText::sprintf( 'COM_KUNENA_ATTACHMENTS_DELETE_SUCCESSFULLY', $number) );
		$this->redirectBack ();
	}
开发者ID:rich20,项目名称:Kunena,代码行数:19,代码来源:user.php

示例11: newTopic

	public function newTopic($fields=array(), $user=null) {
		kimport ('kunena.forum.topic');
		kimport ('kunena.forum.message');

		$catid = $this->getNewTopicCategory()->id;
		$user = KunenaUserHelper::get($user);
		$message = new KunenaForumMessage();
		$message->catid = $catid;
		$message->name = $user->getName('');
		$message->userid = $user->userid;
		$message->ip = $_SERVER ["REMOTE_ADDR"];
		$message->hold = $this->review ? (int)!$this->authorise ('moderate', $user, true) : 0;
		$message->bind($fields, array ('name', 'email', 'subject', 'message'));

		$topic = new KunenaForumTopic();
		$topic->category_id = $catid;
		$topic->hold = $message->hold;
		$topic->bind($fields, array ('subject','icon_id'));

		$message->setTopic($topic);
		return array($topic, $message);
	}
开发者ID:rich20,项目名称:Kunena,代码行数:22,代码来源:category.php

示例12: defined

/**
 * @version $Id$
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

kimport ( 'kunena.model' );
kimport('kunena.forum.category.helper');
kimport('kunena.forum.topic.helper');
kimport('kunena.forum.message.helper');
kimport('kunena.user.helper');

/**
 * Topics Model for Kunena
 *
 * @package		Kunena
 * @subpackage	com_kunena
 * @since		2.0
 */
class KunenaModelTopics extends KunenaModel {
	protected $topics = false;
	protected $messages = false;
	protected $total = 0;
	protected $topicActions = false;
	protected $actionMove = false;
开发者ID:rich20,项目名称:Kunena,代码行数:30,代码来源:topics.php

示例13: unblock

	function unblock() {
		$app = JFactory::getApplication ();
		kimport('kunena.user.ban');
		if (! JRequest::checkToken ()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$app->redirect ( KunenaRoute::_($this->baseurl, false) );
		}

		$cid = JRequest::getVar ( 'cid', array (), 'post', 'array' );
		$userid = (int)array_shift($cid);

		if ($userid < 0 ) {
			$app->enqueueMessage ( JText::_('COM_KUNENA_PROFILE_NO_USER'), 'error' );
			$app->redirect ( KunenaRoute::_($this->baseurl, false) );
		}

		$ban = KunenaUserBan::getInstanceByUserid ( $userid, true );
		if (! $ban->id) {
			$ban->ban ( $userid, null, 1 );
			$success = $ban->save ();
		} else {
			jimport ('joomla.utilities.date');
			$now = new JDate();
			$ban->setExpiration ( $now );
			$success = $ban->save ();
		}

		$message = JText::_ ( 'COM_KUNENA_USER_UNBLOCK_DONE' );

		if (! $success) {
			$app->enqueueMessage ( $ban->getError (), 'error' );
		} else {
			$app->enqueueMessage ( $message );
		}

		$app->redirect ( KunenaRoute::_($this->baseurl, false) );
	}
开发者ID:rich20,项目名称:Kunena,代码行数:37,代码来源:users.php

示例14: defined

/**
 * @version $Id: kunenacategories.php 4220 2011-01-18 09:13:04Z mahagr $
 * Kunena Component
 * @package Kunena
 *
 * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

require_once KPATH_ADMIN . '/libraries/integration/integration.php';
kimport ( 'kunena.error' );
kimport ( 'kunena.forum.category.helper' );
kimport ( 'kunena.forum.topic.helper' );
kimport ( 'kunena.databasequery' );

abstract class KunenaAccess {
	public $priority = 0;

	protected static $instance = false;
	protected static $adminsByCatid = array();
	protected static $adminsByUserid = array();
	protected static $moderatorsByCatid = array();
	protected static $moderatorsByUserid = array();

	protected static $cacheKey = 'com_kunena.access.global';

	abstract public function __construct();

	static public function getInstance($integration = null) {
开发者ID:rich20,项目名称:Kunena,代码行数:31,代码来源:access.php

示例15: permdel_posts

	function permdel_posts() {
		kimport('kunena.forum.message.helper');

		$app = JFactory::getApplication ();
		if (! JRequest::checkToken ()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$this->redirectBack ();
		}

		$success = 0;
		$messages = KunenaForumMessageHelper::getMessages(array_keys(JRequest::getVar('posts', array ( 0 ), 'post', 'array')));
		if (!$messages) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_NO_MESSAGES_SELECTED' ) );
		} else {
			foreach ( $messages as $message ) {
				if ($message->authorise('permdelete') && $message->delete()) {
					$success++;
				} else {
					$app->enqueueMessage ( $message->getError (), 'notice' );
				}
			}
		}
		if ($success) $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_BULKMSG_DELETED' ) );
		$this->redirectBack ();
	}
开发者ID:rich20,项目名称:Kunena,代码行数:25,代码来源:topics.php


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