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

PHP KunenaTemplate类代码示例

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

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



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

示例1: displayEdit

	function displayEdit()
	{
		$this->setToolBarEdit();

		// FIXME: enable template parameters
		$this->form         = $this->get('Form');
		$this->params       = $this->get('editparams');
		$this->details      = $this->get('templatedetails');
		$this->templatename = $this->app->getUserState('kunena.edit.template');
		$template           = KunenaTemplate::getInstance($this->templatename);
		$template->initializeBackend();

		$this->templatefile = KPATH_SITE . '/template/' . $this->templatename . '/params.ini';

		if (!JFile::exists($this->templatefile))
		{
			$ourFileHandle = @fopen($this->templatefile, 'w');

			if ($ourFileHandle)
			{
				fclose($ourFileHandle);
			}
		}

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


示例2: loadFormData

 /**
  * @see JModelForm::loadFormData()
  */
 protected function loadFormData()
 {
     // Check the session for previously entered form data.
     $data = JFactory::getApplication()->getUserState('com_kunena.edit.template.data', array());
     if (empty($data)) {
         $template = $this->getState('template');
         $data = KunenaTemplate::getInstance($template)->params->toArray();
     }
     return $data;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:13,代码来源:templates.php


示例3: displayEdit

 function displayEdit()
 {
     $this->setToolBarEdit();
     $this->params = $this->get('editparams');
     $this->details = $this->get('templatedetails');
     $this->templatename = $this->app->getUserState('kunena.edit.template');
     $template = KunenaTemplate::getInstance($this->templatename);
     $template->initializeBackend();
     $this->display();
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:10,代码来源:view.html.php


示例4: before

 /**
  * Prepare topic moderate display.
  *
  * @return void
  *
  * @throws KunenaExceptionAuthorise
  */
 protected function before()
 {
     parent::before();
     $catid = $this->input->getInt('catid');
     $id = $this->input->getInt('id');
     $mesid = $this->input->getInt('mesid');
     if (!$mesid) {
         $this->topic = KunenaForumTopicHelper::get($id);
         $this->topic->tryAuthorise('move');
     } else {
         $this->message = KunenaForumMessageHelper::get($mesid);
         $this->message->tryAuthorise('move');
         $this->topic = $this->message->getTopic();
     }
     $this->category = $this->topic->getCategory();
     $this->uri = "index.php?option=com_kunena&view=topic&layout=moderate" . "&catid={$this->category->id}&id={$this->topic->id}" . ($this->message ? "&mesid={$this->message->id}" : '');
     $this->title = !$this->message ? JText::_('COM_KUNENA_TITLE_MODERATE_TOPIC') : JText::_('COM_KUNENA_TITLE_MODERATE_MESSAGE');
     // Load topic icons if available.
     if ($this->config->topicicons) {
         $this->template = KunenaTemplate::getInstance();
         $this->template->setCategoryIconset();
         $this->topicIcons = $this->template->getTopicIcons(false);
     }
     // Have a link to moderate user as well.
     if (isset($this->message)) {
         $user = $this->message->getAuthor();
         if ($user->exists()) {
             $username = $user->getName();
             $this->userLink = $this->message->userid ? JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=user&layout=moderate&userid=' . $this->message->userid, $username . ' (' . $this->message->userid . ')', $username . ' (' . $this->message->userid . ')') : null;
         }
     }
     if ($this->message) {
         $this->banHistory = KunenaUserBan::getUserHistory($this->message->userid);
         $this->me = KunenaFactory::getUser();
         // Get thread and reply count from current message:
         $db = JFactory::getDbo();
         $query = "SELECT COUNT(mm.id) AS replies FROM #__kunena_messages AS m\r\n\t\t\t\tINNER JOIN #__kunena_messages AS t ON m.thread=t.id\r\n\t\t\t\tLEFT JOIN #__kunena_messages AS mm ON mm.thread=m.thread AND mm.time > m.time\r\n\t\t\t\tWHERE m.id={$db->Quote($this->message->id)}";
         $db->setQuery($query, 0, 1);
         $this->replies = $db->loadResult();
         if (KunenaError::checkDatabaseError()) {
             return;
         }
     }
     $this->banInfo = KunenaUserBan::getInstanceByUserid(JFactory::getUser()->id, true);
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:52,代码来源:display.php


示例5: initialize

	public function initialize($identifier ='class') {
		$js = "window.addEvent('domready', function() {
	kbbcode = new kbbcode('kbbcode-message', 'kbbcode-toolbar', {
		dispatchChangeEvent: true,
		changeEventDelay: 1000,
		interceptTab: true
});\n";
		$editor = simplexml_load_file(dirname(__FILE__).'/editor.xml');
		foreach ($editor as $item) {
			if ($item['disabled'] == 'disabled') continue;
			switch ($item->getName()) {
				case 'button':
					// <button tag="i" name="italic" title="COM_KUNENA_EDITOR_ITALIC" alt="COM_KUNENA_EDITOR_HELPLINE_ITALIC">
					if ($item['config']) {
						$cfgVariable = (string) $item['config'];
						$cfgValue = intval($cfgVariable[0] != '!');
						if (!$cfgValue) $cfgVariable = substr($cfgVariable, 1);
						if (KunenaFactory::getConfig()->$cfgVariable != $cfgValue) continue;
					}
					$name = $item['name'] ? $item['name'] : ($item['tag'] ? $item['tag'] : '#');
					$class = $item['class'] ? $item['class'] : "kbbcode-{$name}-button";
					$js .= "\nkbbcode.addFunction('{$name}', function() {";
					$js .= $this->editorAction($name, $item);
					$js .= "\n}, {";
					foreach (array('title', 'alt') as $type) {
						if (isset($item[$type])) {
							$value = JText::_($item[$type], true);
							$js .= "\n	'{$type}': '{$value}',";
						}
					}
					if ($item['class']) {
						$js .= "\n	'class': '{$class}'";
					} else {
							$js .= "\n	'{$identifier}': '{$class}'";
					}
					$js .= "\n});\n";
					break;
			}
		}
		$js .= "});\n";
		$template = KunenaTemplate::getInstance();
		$template->addScript('js/editor.js');
		JFactory::getDocument()->addScriptDeclaration( "// <![CDATA[\n{$js}\n// ]]>");
	}
开发者ID:rich20,项目名称:Kunena,代码行数:44,代码来源:editor.php


示例6: displayDefault

	function displayDefault($tpl = null) {
		$this->config = KunenaFactory::getConfig();
		if (!$this->config->enablerss) {
			JError::raiseError ( 404, JText::_ ( 'COM_KUNENA_RSS_DISABLED' ) );
		}

		$this->assignRef ( 'category', $this->get ( 'Category' ) );
		if (! $this->category->authorise('read')) {
			JError::raiseError ( 404, $this->category->getError() );
		}

		$this->template = KunenaTemplate::getInstance();
		$this->assignRef ( 'topics', $this->get ( 'Topics' ) );

		$title = JText::_('COM_KUNENA_THREADS_IN_FORUM').': '. $this->category->name;
		$this->setTitle ( $title );

		$metaDesc = $this->document->get ( 'description' ) . '. ' . $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->template->getImagePath('icons/rss.png');
		$image->description = $this->document->getDescription();
		$this->document->image = $image;

		foreach ( $this->topics as $topic ) {
			$id = $topic->last_post_id;
			$page = ceil ( $topic->posts / $this->config->messages_per_page );
			$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;
			$url = CKunenaLink::GetThreadPageURL('view', $topic->category_id, $topic->id, $page, $this->config->messages_per_page, $id, true );
			$category = $topic->getCategory()->name;

			$this->createItem($title, $url, $description, $category, $date, $userid, $username);
		}
	}
开发者ID:rich20,项目名称:Kunena,代码行数:42,代码来源:view.feed.php


示例7: getRank


//.........这里部分代码省略.........
         self::$_ranks = $this->_db->loadObjectList('rank_id');
         KunenaError::checkDatabaseError();
     }
     $userType = $special !== false ? $this->getType($catid, true) : 'count';
     if (isset(self::$_ranks[$this->rank]) && !in_array($userType, array('guest', 'blocked', 'banned', 'count'))) {
         // Use rank specified to the user.
         $rank = self::$_ranks[$this->rank];
     } else {
         // Generate user rank.
         $rank = new stdClass();
         $rank->rank_id = 0;
         $rank->rank_title = JText::_('COM_KUNENA_RANK_USER');
         $rank->rank_min = 0;
         $rank->rank_special = 0;
         $rank->rank_image = 'rank0.gif';
         switch ($userType) {
             case 'guest':
                 $rank->rank_title = JText::_('COM_KUNENA_RANK_VISITOR');
                 $rank->rank_special = 1;
                 foreach (self::$_ranks as $cur) {
                     if ($cur->rank_special == 1 && strstr($cur->rank_image, 'guest')) {
                         $rank = $cur;
                         break;
                     }
                 }
                 break;
             case 'blocked':
                 $rank->rank_title = JText::_('COM_KUNENA_RANK_BLOCKED');
                 $rank->rank_special = 1;
                 $rank->rank_image = 'rankdisabled.gif';
                 foreach (self::$_ranks as $cur) {
                     if ($cur->rank_special == 1 && strstr($cur->rank_image, 'disabled')) {
                         $rank = $cur;
                         break;
                     }
                 }
                 break;
             case 'banned':
                 $rank->rank_title = JText::_('COM_KUNENA_RANK_BANNED');
                 $rank->rank_special = 1;
                 $rank->rank_image = 'rankbanned.gif';
                 foreach (self::$_ranks as $cur) {
                     if ($cur->rank_special == 1 && strstr($cur->rank_image, 'banned')) {
                         $rank = $cur;
                         break;
                     }
                 }
                 break;
             case 'admin':
             case 'localadmin':
                 $rank->rank_title = JText::_('COM_KUNENA_RANK_ADMINISTRATOR');
                 $rank->rank_special = 1;
                 $rank->rank_image = 'rankadmin.gif';
                 foreach (self::$_ranks as $cur) {
                     if ($cur->rank_special == 1 && strstr($cur->rank_image, 'admin')) {
                         $rank = $cur;
                         break;
                     }
                 }
                 break;
             case 'globalmod':
             case 'moderator':
                 $rank->rank_title = JText::_('COM_KUNENA_RANK_MODERATOR');
                 $rank->rank_special = 1;
                 $rank->rank_image = 'rankmod.gif';
                 foreach (self::$_ranks as $cur) {
                     if ($cur->rank_special == 1 && (strstr($cur->rank_image, 'rankmod') || strstr($cur->rank_image, 'moderator'))) {
                         $rank = $cur;
                         break;
                     }
                 }
                 break;
             case 'user':
             case 'count':
                 foreach (self::$_ranks as $cur) {
                     if ($cur->rank_special == 0 && $cur->rank_min <= $this->posts && $cur->rank_min >= $rank->rank_min) {
                         $rank = $cur;
                     }
                 }
                 break;
         }
     }
     if ($special === true && !$rank->rank_special) {
         return null;
     }
     if ($type == 'title') {
         return $rank->rank_title;
     }
     if (!$config->rankimages) {
         $rank->rank_image = null;
     }
     if ($type == 'image') {
         if (!$rank->rank_image) {
             return null;
         }
         $url = KunenaTemplate::getInstance()->getRankPath($rank->rank_image, true);
         return '<img src="' . $url . '" alt="" />';
     }
     return $rank;
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:101,代码来源:user.php


示例8: getTemplate

	/**
	 * Get a Kunena template object
	 *
	 * Returns the global {@link KunenaTemplate} object, only creating it if it doesn't already exist.
	 *
	 * @param	string	$name
	 * @return KunenaTemplate
	 */
	public static function getTemplate($name = null) {
		return KunenaTemplate::getInstance($name);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:11,代码来源:factory.php


示例9: getUserRank

 /**
  * @param  UserTable  $user
  * @param  bool       $showTitle
  * @param  bool       $showImage
  * @return string|null
  */
 public static function getUserRank($user, $showTitle = true, $showImage = true)
 {
     global $_CB_framework;
     if (!class_exists('KunenaUser')) {
         return null;
     }
     $value = null;
     if ($user->get('id')) {
         $forumUser = KunenaUser::getInstance((int) $user->get('id'));
         if ($forumUser) {
             $userRank = $forumUser->getRank();
             if (!$userRank) {
                 return null;
             }
             $title = $userRank->rank_title;
             if ($showTitle) {
                 $value .= '<div>' . $title . '</div>';
             }
             if ($showImage && class_exists('KunenaTemplate')) {
                 $template = KunenaTemplate::getInstance();
                 $value .= '<div><img src="' . $_CB_framework->getCfg('live_site') . '/' . $template->getRankPath($userRank->rank_image) . '" alt="' . htmlspecialchars($title) . '" border="0" /></div>';
             }
             if (!$value) {
                 $value = $forumUser->rank;
             }
         }
     }
     return $value;
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:35,代码来源:kunena20.php


示例10: displayPosts

	function displayPosts($tpl = null) {
		$this->config = KunenaFactory::getConfig();
		if (!$this->config->enablerss) {
			JError::raiseError ( 404, JText::_ ( 'COM_KUNENA_RSS_DISABLED' ) );
		}
		$this->layout = 'posts';
		$this->assignRef ( 'messages', $this->get ( 'Messages' ) );
		$this->assignRef ( 'topics', $this->get ( 'Topics' ) );
		$this->assignRef ( 'total', $this->get ( 'Total' ) );
		$this->me = KunenaUserHelper::getMyself();
		$this->template = KunenaTemplate::getInstance();

		// TODO: if start != 0, add information from it into description
		$title = JText::_('COM_KUNENA_ALL_DISCUSSIONS');
		$this->document->setGenerator('Kunena Forum (Joomla)');

		switch ($this->state->get ( 'list.mode' )) {
			case 'unapproved':
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_POSTS_MODE_UNAPPROVED');
				break;
			case 'deleted':
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_POSTS_MODE_DELETED');
				break;
			case 'mythanks':
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_POSTS_MODE_MYTHANKS');
				break;
			case 'thankyou':
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_POSTS_MODE_THANKYOU');
				break;
			case 'recent':
			default:
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_POSTS_MODE_DEFAULT');
		}
		$this->setTitle ( $title );

		// Create image for feed
		$image = new JFeedImage();
		$image->title = $this->document->getTitle();
		$image->url = $this->template->getImagePath('icons/rss.png');
		$image->description = $this->document->getDescription();
		$this->document->image = $image;

		$this->displayPostRows();
	}
开发者ID:GoremanX,项目名称:Kunena-2.0,代码行数:44,代码来源:view.feed.php


示例11: initialize

 /**
  * @param string $identifier
  */
 public function initialize($identifier = 'class')
 {
     $js = "window.addEvent('domready', function() {\n\tkbbcode = new kbbcode('kbbcode-message', 'kbbcode-toolbar', {\n\t\tdispatchChangeEvent: true,\n\t\tchangeEventDelay: 1000,\n\t\tinterceptTab: true\n});\n";
     $xml_file = simplexml_load_file(dirname(__FILE__) . '/editor.xml');
     $this->editor_elements = self::parseXML($xml_file);
     //Hook to manipulate the Editor XML like adding buttons
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('kunena');
     $dispatcher->trigger('onKunenaBbcodeEditorInit', array($this));
     foreach ($this->editor_elements as $item) {
         $js .= $item->generateJs($identifier);
     }
     $js .= "});\n";
     $template = KunenaTemplate::getInstance();
     $template->addScript('js/editor.js');
     JFactory::getDocument()->addScriptDeclaration("// <![CDATA[\n{$js}\n// ]]>");
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:20,代码来源:editor.php


示例12: getTemplate

	/**
	 * Get a Kunena template object
	 *
	 * Returns the global {@link KunenaTemplate} object, only creating it if it doesn't already exist.
	 *
	 * @return object KunenaTemplate
	 */
	public static function getTemplate($name = null)
	{
		kimport('kunena.template');
		return KunenaTemplate::getInstance($name);
	}
开发者ID:rich20,项目名称:Kunena,代码行数:12,代码来源:factory.php


示例13: behavior

	static function behavior() {
		static $loaded = false;

		if (!$loaded)
		{
			JHTML::_('behavior.tooltip');
			KunenaTemplate::getInstance()->addScript ( 'js/grid.js' );

			// Build the behavior script.
			$js = '
		window.addEvent(\'domready\', function(){
			actions = $$(\'a.move_up\');
			actions.combine($$(\'a.move_down\'));
			actions.combine($$(\'a.grid_true\'));
			actions.combine($$(\'a.grid_false\'));
			actions.combine($$(\'a.grid_trash\'));
			actions.combine($$(\'a.grid_action\'));
			actions.each(function(a){
				a.addEvent(\'click\', function(){
					args = JSON.decode(this.rel);
					listItemTask(args.id, args.task);
				});
			});
			$$(\'input.check-all-toggle\').each(function(el){
				el.addEvent(\'click\', function(){
					if (el.checked) {
						document.id(this.form).getElements(\'input[type=checkbox]\').each(function(i){
							i.checked = true;
						})
					}
					else {
						document.id(this.form).getElements(\'input[type=checkbox]\').each(function(i){
							i.checked = false;
						})
					}
				});
			});
		});';

			// Add the behavior to the document head.
			$document = JFactory::getDocument();
			$document->addScriptDeclaration($js);

			$loaded = true;
		}
	}
开发者ID:GoremanX,项目名称:Kunena-2.0,代码行数:46,代码来源:kunenagrid.php


示例14: getRank

 /**
  * @param int  $catid
  * @param bool $type
  *
  * @return stdClass|string
  */
 public function getRank($catid = 0, $type = false)
 {
     // Default rank
     $rank = new stdClass();
     $rank->rank_id = false;
     $rank->rank_title = null;
     $rank->rank_min = 0;
     $rank->rank_special = 0;
     $rank->rank_image = null;
     $config = KunenaFactory::getConfig();
     $category = KunenaForumCategoryHelper::get($catid);
     if (!$config->showranking) {
         return;
     }
     if (self::$_ranks === null) {
         $this->_db->setQuery("SELECT * FROM #__kunena_ranks");
         self::$_ranks = $this->_db->loadObjectList('rank_id');
         KunenaError::checkDatabaseError();
     }
     $rank->rank_title = JText::_('COM_KUNENA_RANK_USER');
     $rank->rank_image = 'rank0.gif';
     if ($this->userid == 0) {
         $rank->rank_id = 0;
         $rank->rank_title = JText::_('COM_KUNENA_RANK_VISITOR');
         $rank->rank_special = 1;
     } else {
         if ($this->isBanned()) {
             $rank->rank_id = 0;
             $rank->rank_title = JText::_('COM_KUNENA_RANK_BANNED');
             $rank->rank_special = 1;
             $rank->rank_image = 'rankbanned.gif';
             foreach (self::$_ranks as $cur) {
                 if ($cur->rank_special == 1 && JFile::stripExt($cur->rank_image) == 'rankbanned') {
                     $rank = $cur;
                     break;
                 }
             }
         } else {
             if ($this->rank != 0 && isset(self::$_ranks[$this->rank])) {
                 $rank = self::$_ranks[$this->rank];
             } else {
                 if ($this->rank == 0 && $this->isAdmin($category)) {
                     $rank->rank_id = 0;
                     $rank->rank_title = JText::_('COM_KUNENA_RANK_ADMINISTRATOR');
                     $rank->rank_special = 1;
                     $rank->rank_image = 'rankadmin.gif';
                     foreach (self::$_ranks as $cur) {
                         if ($cur->rank_special == 1 && JFile::stripExt($cur->rank_image) == 'rankadmin') {
                             $rank = $cur;
                             break;
                         }
                     }
                 } else {
                     if ($this->rank == 0 && $this->isModerator($category)) {
                         $rank->rank_id = 0;
                         $rank->rank_title = JText::_('COM_KUNENA_RANK_MODERATOR');
                         $rank->rank_special = 1;
                         $rank->rank_image = 'rankmod.gif';
                         foreach (self::$_ranks as $cur) {
                             if ($cur->rank_special == 1 && JFile::stripExt($cur->rank_image) == 'rankmod') {
                                 $rank = $cur;
                                 break;
                             }
                         }
                     }
                 }
             }
         }
     }
     if ($rank->rank_id === false) {
         //post count rank
         $rank->rank_id = 0;
         foreach (self::$_ranks as $cur) {
             if ($cur->rank_special == 0 && $cur->rank_min <= $this->posts && $cur->rank_min >= $rank->rank_min) {
                 $rank = $cur;
             }
         }
     }
     if ($type == 'title') {
         return $rank->rank_title;
     }
     if ($type == 'image') {
         $template = KunenaTemplate::getInstance();
         if (!$config->rankimages) {
             return;
         }
         $iconurl = $template->getRankPath($rank->rank_image, true);
         return '<img src="' . $iconurl . '" alt="" />';
     }
     if (!$config->rankimages) {
         $rank->rank_image = null;
     }
     return $rank;
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:100,代码来源:user.php


示例15: report

 function report()
 {
     if (!JSession::checkToken('post')) {
         $this->app->enqueueMessage(JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
         $this->setRedirectBack();
         return;
     }
     if (!$this->me->exists() || $this->config->reportmsg == 0) {
         // Deny access if report feature has been disabled or user is guest
         $this->app->enqueueMessage(JText::_('COM_KUNENA_NO_ACCESS'), 'notice');
         $this->setRedirectBack();
         return;
     }
     if (!$this->config->get('send_emails')) {
         // Emails have been disabled
         $this->app->enqueueMessage(JText::_('COM_KUNENA_EMAIL_DISABLED'), 'notice');
         $this->setRedirectBack();
         return;
     }
     if (!$this->config->getEmail() || !JMailHelper::isEmailAddress($this->config->getEmail())) {
         // Error: email address is invalid
         $this->app->enqueueMessage(JText::_('COM_KUNENA_EMAIL_INVALID'), 'error');
         $this->setRedirectBack();
         return;
     }
     // Get target object for the report
     if ($this->mesid) {
         $message = $target = KunenaForumMessageHelper::get($this->mesid);
         $topic = $target->getTopic();
     } else {
         $topic = $target = KunenaForumTopicHelper::get($this->id);
         $message = KunenaForumMessageHelper::get($topic->first_post_id);
     }
     $messagetext = $message->message;
     $baduser = KunenaFactory::getUser($message->userid);
     if (!$target->authorise('read')) {
         // Deny access if user cannot read target
         $this->app->enqueueMessage($target->getError(), 'notice');
         $this->setRedirectBack();
         return;
     }
     $reason = JRequest::getString('reason');
     $text = JRequest::getString('text');
     $template = KunenaTemplate::getInstance();
     if (method_exists($template, 'reportMessage')) {
         $template->reportMessage($message, $reason, $text);
     }
     // Load language file from the template.
     KunenaFactory::getTemplate()->loadLanguage();
     if (empty($reason) && empty($text)) {
         // Do nothing: empty subject or reason is empty
         $this->app->enqueueMessage(JText::_('COM_KUNENA_REPORT_FORG0T_SUB_MES'));
         $this->setRedirectBack();
         return;
     } else {
         $acl = KunenaAccess::getInstance();
         $emailToList = $acl->getSubscribers($topic->category_id, $topic->id, false, true, false);
         if (!empty($emailToList)) {
             $mailsender = JMailHelper::cleanAddress($this->config->board_title . ' ' . JText::_('COM_KUNENA_FORUM') . ': ' . $this->me->getName());
             $mailsubject = "[" . $this->config->board_title . " " . JText::_('COM_KUNENA_FORUM') . "] " . JText::_('COM_KUNENA_REPORT_MSG') . ": ";
             if ($reason) {
                 $mailsubject .= $reason;
             } else {
                 $mailsubject .= $topic->subject;
             }
             jimport('joomla.environment.uri');
             $msglink = JUri::getInstance()->toString(array('scheme', 'host', 'port')) . $target->getPermaUrl(null, false);
             $mail = JFactory::getMailer();
             $mail->setSender(array($this->me->username, $this->me->email));
             $mail->setSubject($mailsubject);
             // Render the email.
             $layout = KunenaLayout::factory('Email/Report')->debug(false)->set('mail', $mail)->set('message', $message)->set('me', $this->me)->set('title', $reason)->set('content', $text)->set('messageLink', $msglink);
             try {
                 $body = trim($layout->render());
                 $mail->setBody($body);
             } catch (Exception $e) {
                 // TODO: Deprecated in K4.0, remove in K5.0
                 $mailmessage = "" . JText::_('COM_KUNENA_REPORT_RSENDER') . " {$this->me->username} ({$this->me->name})";
                 $mailmessage .= "\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_RREASON') . " " . $reason;
                 $mailmessage .= "\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_RMESSAGE') . " " . $text;
                 $mailmessage .= "\n\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_POST_POSTER') . " {$baduser->username} ({$baduser->name})";
                 $mailmessage .= "\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_POST_SUBJECT') . ": " . $topic->subject;
                 $mailmessage .= "\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_POST_MESSAGE') . "\n-----\n" . KunenaHtmlParser::stripBBCode($messagetext, 0, false);
                 $mailmessage .= "\n-----\n\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_POST_LINK') . " " . $msglink;
                 $mailmessage = JMailHelper::cleanBody(strtr($mailmessage, array('&#32;' => '')));
                 $mail->setBody($mailmessage);
             }
             $receivers = array();
             foreach ($emailToList as $emailTo) {
                 if (!$emailTo->email || !JMailHelper::isEmailAddress($emailTo->email)) {
                     continue;
                 }
                 $receivers[] = $emailTo->email;
             }
//.........这里部分代码省略.........
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:101,代码来源:topic.php


示例16: defined

<?php

/**
 * Kunena Component
 * @package Kunena.Template.Blue_Eagle
 * @subpackage Statistics
 *
 * @copyright (C) 2008 - 2013 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined('_JEXEC') or die;
$template = KunenaTemplate::getInstance();
?>
<!-- BEGIN: GENERAL STATS -->
<?php 
if ($this->config->showgenstats) {
    ?>
<div class="kblock kgenstats">
	<div class="kheader clearfix">
		<span class="ktoggler"><a class="ktoggler close" title="<?php 
    echo JText::_('COM_KUNENA_TOGGLER_COLLAPSE');
    ?>
" rel="kgenstats_tbody"></a></span>
		<h2><span><?php 
    echo $this->escape($this->config->board_title);
    ?>
 <?php 
    echo JText::_('COM_KUNENA_STAT_FORUMSTATS');
    ?>
</span></h2>
开发者ID:juanferden,项目名称:adoperp,代码行数:31,代码来源:default.php


示例17: getUserDetails

 /**
  * Generate users details
  *
  * @param moscomprofilerUser $user
  * @param object             $forum
  * @return object
  */
 function getUserDetails($user, $forum)
 {
     global $_CB_database, $_CB_framework;
     static $usersdetailsCache = array();
     if (!isset($usersdetailsCache[$user->id])) {
         if ((isset($forum->config['showuserstats']) ? $forum->config['showuserstats'] : $forum->config['showstats']) || !$forum->config['showranking'] && !$forum->config['showkarma'] && !(isset($forum->config['poststats']) ? $forum->config['poststats'] : (isset($forum->config['postStats']) ? $forum->config['postStats'] : (isset($forum->config['userlist_posts']) ? $forum->config['userlist_posts'] : $forum->config['showstats'])))) {
             if ($forum->component == 'com_fireboard' && $forum->version >= '1.0.3' || $forum->component == 'com_kunena') {
                 $supportsDbRanks = ', ' . $_CB_database->NameQuote('rank');
             } else {
                 $supportsDbRanks = null;
             }
             $userDetails = $this->getUserSettings($user, $forum, $supportsDbRanks);
             if (isset($userDetails->posts) && $userDetails->posts != 0) {
                 if (class_exists('KunenaTemplate') && class_exists('KunenaForum')) {
                     $kunenaTemplate = KunenaTemplate::getInstance();
                 } else {
                     $kunenaTemplate = null;
                 }
                 if ($forum->config['showranking']) {
                     $uIsAdm = isModerator($user->id);
                     $uIsMod = $userDetails->moderator;
                     $pathImage = $_CB_framework->getCfg('live_site') . '/components/' . $forum->component;
                     if ($forum->prefix != 'kunena' || $forum->prefix == 'kunena' && !class_exists('KunenaForum')) {
                         if ($supportsDbRanks) {
                             if ($userDetails->rank != 0) {
                                 $where = $_CB_database->NameQuote('rank_id') . ' = ' . (int) $userDetails->rank;
                             } else {
                                 $where = $_CB_database->NameQuote('rank_min') . ' <= ' . (int) $userDetails->posts . "\n ORDER BY " . $_CB_database->NameQuote('rank_min') . ' DESC';
                             }
                             $query = 'SELECT ' . $_CB_database->NameQuote('rank_title') . ', ' . $_CB_database->NameQuote('rank_image') . "\n FROM " . $_CB_database->NameQuote('#__' . $forum->prefix . '_ranks') . "\n WHERE " . $where;
                             $_CB_database->setQuery($query, 0, 1);
                             $userRank = null;
                             $_CB_database->loadObject($userRank);
                             $pathImage = $pathImage . $this->params->get('TemplateRank', '/template/default/images');
                             $rText = $userRank->rank_title;
                             $rImg = $pathImage . '/ranks/' . $userRank->rank_image;
                         } else {
                             $userDetails->rank = 1;
                             for ($i = 1; $i <= 5; $i++) {
                                 $rankPrev = $forum->config['rank' . ($i > 1 ? $i - 1 : $i)];
                                 $rank = $forum->config['rank' . $i];
                                 if ($userDetails->posts <= $rank && $userDetails->posts > $rankPrev) {
                                     $userDetails->rank = $i;
                                 } elseif ($i == 5 && $userDetails->posts > $rank) {
                                     $userDetails->rank = 6;
                                 }
                             }
                             $rText = $forum->config['rank' . $userDetails->rank . 'txt'];
                             $rImg = $pathImage . '/ranks/rank' . $userDetails->rank . '.gif';
                         }
                     } elseif ($userDetails instanceof KunenaUser) {
                         $pathImage = $pathImage . $this->params->get('TemplateRank', '/template/default/images');
                         $userRank = $userDetails->getRank();
                         $rText = $userRank->rank_title;
                         if ($kunenaTemplate) {
                             $rImg = $_CB_framework->getCfg('live_site') . '/' . $kunenaTemplate->getRankPath($userRank->rank_image);
                         } else {
                             $rImg = null;
                         }
                     } else {
                         $rText = null;
                         $rImg = null;
                     }
                     if ($userDetails->rank == 0 && $uIsMod) {
                         $rText = CBTxt::T('Moderator');
                         if ($kunenaTemplate) {
                             $rImg = $_CB_framework->getCfg('live_site') . '/' . $kunenaTemplate->getRankPath('rankmod.gif');
                         } else {
                             $rImg = $pathImage . '/ranks/rankmod.gif';
                         }
                     }
                     if ($userDetails->rank == 0 && $uIsAdm) {
                         $rText = CBTxt::T('Administrator');
                         if ($kunenaTemplate) {
                             $rImg = $_CB_framework->getCfg('live_site') . '/' . $kunenaTemplate->getRankPath('rankadmin.gif');
                         } else {
                             $rImg = $pathImage . '/ranks/rankadmin.gif';
                         }
                     }
                     if ($forum->config['rankimages'] && $rImg) {
                         $userDetails->msg_userrankimg = '<img src="' . htmlspecialchars($rImg) . '" alt="' . htmlspecialchars($rText) . '" border="0" />';
                     }
                     $userDetails->msg_userrank = $rText;
                 }
             } else {
                 $userDetails = false;
             }
         } else {
             $userDetails = false;
         }
         $usersdetailsCache[$user->id] = $userDetails;
     }
     return $usersdetailsCache[$user->id];
//.........这里部分代码省略.........
开发者ID:rogatnev-nikita,项目名称:cloudinterpreter,代码行数:101,代码来源:cb.simpleboardtab.model.php


示例18: initialize

    /**
     * Template initialization.
     *
     * @return void
     */
    public function initialize()
    {
        // Template requires Bootstrap javascript
        // Template also requires jQuery framework.
        // Load JavaScript.
        // Compile CSS from LESS files.
        if (jimport('jproofless.jproofless')) {
            $jproofLess = JProofLess::getInstance();
            $cssFile = KPATH_MEDIA . "/cache/{$this->name}/css/" . $this->name . '.css';
            $lessFile = KPATH_COMPONENT_RELATIVE . "/template/{$this->name}/less/{$this->name}.less";
            $extraStyle = JPATH_SITE . '/components/com_kunena/template/crypsis/css/custom.css';
            $jproofLess->setCssFile($cssFile)->setLessFile($lessFile)->setVariables($this->style_variables)->useStrategy('missingcss')->setExtraContent($extraStyle);
            $class = $this;
            $jproofLess->getLess()->registerFunction('url', function ($arg) use($class) {
                list($type, $q, $values) = $arg;
                $value = reset($values);
                return "url({$q}{$class->getFile($value, true, 'media', 'media/kunena')}{$q})";
            });
            // Load template colors settings
            $this->ktemplate = KunenaFactory::getTemplate();
            $styles = <<<EOF
\t\t/* Kunena Custom CSS */
EOF;
            $iconcolor = $this->ktemplate->params->get('IconColor');
            if ($iconcolor) {
                $styles .= <<<EOF
\t\t.layout#kunena [class*="category"] i,
\t\t.layout#kunena #kwho i.icon-users,
\t\t.layout#kunena#kstats i.icon-bars { color: {$iconcolor}; }
EOF;
            }
            $iconcolornew = $this->ktemplate->params->get('IconColorNew');
            if ($iconcolornew) {
                $styles .= <<<EOF
\t\t.layout#kunena [class*="category"] .icon-knewchar { color: {$iconcolornew} !important; }
\t\t.layout#kunena sup.knewchar { color: {$iconcolornew} !important; }
\t\t.layout#kunena .topic-item-unread { border-left-color: {$iconcolornew} !important; }
EOF;
            }
            $jproofLess->setExtraContent($styles);
            $jproofLess->autoCompile();
        } else {
            // adding an Log message if it is an good choice to install the JProofLess
            JLog::add('JProofLess is missing: ' . __FILE__ . ' @see <a target="_blank" href="http://wiki.jproof.de/projects/joomla-library-jproof-less/wiki"><b>Wiki</b></a>', JLog::NOTICE);
            // Adding each time the regular already rendered css into the template if the LessCompiler not found
            //JFactory::getDocument()->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template.css');
        }
        parent::initialize();
    }
开发者ID:JProof,项目名称:JProofLessExamples,代码行数:54,代码来源:kunenatemplate.php


示例19: before

 protected function before()
 {
     KUNENA_PROFILER ? KunenaProf 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP KunenaUser类代码示例发布时间:2022-05-23
下一篇:
PHP KunenaTable类代码示例发布时间: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