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


PHP Komento类代码示例

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


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

示例1: display

	function display($tmpl = null)
	{
		$mainframe = JFactory::getApplication();
		$commentsModel = Komento::getModel( 'comments' );

		$cid = JRequest::getVar( 'cid', 'all' );

		$filter['component']	= $mainframe->getUserStateFromRequest( 'com_komento.pending.filter_component', 'filter-component', 'all', 'string' );
		$filter['sort']			= $mainframe->getUserStateFromRequest( 'com_komento.pending.filter_sort', 'filter-sort', 'latest', 'string' );
		$filter['search']		= trim( JString::strtolower( $mainframe->getUserStateFromRequest( 'com_komento.pending.filter_search', 'filter-search', '', 'string' ) ) );

		$options = array(
			'limit'		=> 0,
			'sort'		=> $filter['sort'],
			'search'	=> $filter['search'],
			'published'	=> 2,
			'threaded'	=> 0
		);

		$comments = $commentsModel->getComments( $filter['component'], $cid, $options );
		$pagination = $commentsModel->getPagination();
		$components = $commentsModel->getUniqueComponents();

		$theme = Komento::getTheme();
		$theme->set( 'components', $components );
		$theme->set( 'pagination', $pagination );
		$theme->set( 'comments', $comments );
		$theme->set( 'filter', $filter );

		echo $theme->fetch('dashboard/pending.php');
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:view.html.php

示例2: getResource

 public function getResource()
 {
     $resources = JRequest::getVar('resource');
     $component = JRequest::getCmd('kmtcomponent');
     Komento::setCurrentComponent($component);
     if (!is_array($resources)) {
         header('Content-type: text/x-json; UTF-8');
         echo '[]';
         exit;
     }
     foreach ($resources as &$resource) {
         $resource = (object) $resource;
         switch ($resource->type) {
             case 'language':
                 $resource->content = JText::_(strtoupper($resource->name));
                 break;
             case 'view':
                 $template = Komento::getTheme();
                 $out = $template->fetch($resource->name . '.ejs');
                 if ($out !== false) {
                     $resource->content = $out;
                 }
                 break;
         }
     }
     Komento::getClass('json', 'KomentoJson');
     header('Content-type: text/x-json; UTF-8');
     $json = new KomentoJson();
     echo $json->encode($resources);
     exit;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:31,代码来源:foundry.php

示例3: purge

 public function purge()
 {
     $db = Komento::getDBO();
     $query = 'DELETE FROM ' . $db->nameQuote('#__komento_mailq');
     $db->setQuery($query);
     $db->Query();
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:mailq.php

示例4: getRule

	public function getRule()
	{
		$component	= Komento::getCurrentComponent();
		$ip			= KomentoIpHelper::getIP();

		$rules		= Komento::getModel( 'ipfilter' )->getRule( $component, $ip );
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:ip.php

示例5: getColumnsState

 function getColumnsState()
 {
     $columns = array('comment', 'published', 'link', 'edit', 'component', 'article', 'date', 'author', 'email', 'homepage', 'ip', 'latitude', 'longitude', 'address', 'id');
     $columnsConfig = Komento::getConfig('com_komento_pending_columns', false);
     $html = $this->renderColumnsConfiguration($columns, $columnsConfig);
     return $html;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:view.html.php

示例6: toFormat

	public function toFormat( $format='%Y-%m-%d %H:%M:%S' )
	{
		if( Komento::joomlaVersion() >= '3.0' )
		{
			if( JString::stristr( $format, '%' ) !== false )
			{
				Komento::import( 'helper', 'date' );
				$format = KomentoDateHelper::strftimeToDate( $format );
			}

			return $this->date->format( $format, true );
		}
		else
		{
			// There is no way to have cross version working, except for detecting % in the format
			if( JString::stristr( $format , '%' ) === false )
			{
				if( Komento::isJoomla15() )
				{
					// forced fallback for Joomla 15 if format doesn't have %
					$format = '%c';
				}
				else
				{
					return $this->date->format( $format , true );
				}

			}

			return $this->date->toFormat( $format, true );
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:date.php

示例7: getAjaxTemplate

 public function getAjaxTemplate()
 {
     $files = JRequest::getVar('names', '');
     if (empty($files)) {
         return false;
     }
     // Ensure the integrity of each items submitted to be an array.
     if (!is_array($files)) {
         $files = array($files);
     }
     $result = array();
     foreach ($files as $file) {
         $template = Komento::getTheme();
         $out = $template->fetch($file . '.ejs');
         $obj = new stdClass();
         $obj->name = $file;
         $obj->content = $out;
         $result[] = $obj;
     }
     Komento::getClass('json', 'KomentoJson');
     header('Content-type: text/x-json; UTF-8');
     $json = new KomentoJson();
     echo $json->encode($result);
     exit;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:25,代码来源:themes.php

示例8: bootstrap

	/**
	 * This renders the necessary bootstrap data into the html headers.
	 */
	public function bootstrap()
	{
		static $isRendered	= false;

		$doc 				= JFactory::getDocument();

		if( !$isRendered && $doc->getType() == 'html' )
		{
			// @task: Include dependencies from foundry.
			require_once( JPATH_ROOT . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'foundry' . DIRECTORY_SEPARATOR . '3.1' . DIRECTORY_SEPARATOR . 'joomla' . DIRECTORY_SEPARATOR . 'configuration.php' );

			$config = Komento::getConfig();

			$environment = JRequest::getVar( 'komento_environment' , $config->get( 'komento_environment' ) );

			$folder	= 'scripts';

			// @task: Let's see if we should load the dev scripts.
			if( $environment == 'development' )
			{
				$folder		= 'scripts_';
			}

			$doc->addScript( rtrim( JURI::root() , '/' ) . '/media/com_komento/' . $folder . '/abstract.js' );

			$isRendered		= true;
		}

		return $isRendered;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:33,代码来源:foundry.php

示例9: doSave

 private function doSave()
 {
     // Check for request forgeries
     JRequest::checkToken() or jexit('Invalid Token');
     $mainframe = JFactory::getApplication();
     if (!JRequest::getMethod() == 'POST') {
         $mainframe->enqueueMessage(JText::_('COM_KOMENTO_ACL_STORE_INVALID_REQUEST', 'error'));
         return false;
     }
     // Unset unecessary post data.
     $post = JRequest::get('POST');
     unset($post['task']);
     unset($post['option']);
     unset($post['c']);
     $token = Komento::_('getToken');
     unset($post[$token]);
     // check the target component
     if (!$post['target_component']) {
         $mainframe->enqueueMessage(JText::_('COM_KOMENTO_ACL_MISSING_TARGET_COMPONENT'));
         return false;
     }
     // rememeber user's choice
     // $mainframe->setUserState('com_komento.acl.component', $post['target_component']);
     // Save post data
     $model = Komento::getModel('Acl', true);
     if (!$model->save($post)) {
         $mainframe->enqueueMessage(JText::_('COM_KOMENTO_ACL_STORE_ERROR', 'error'));
         return false;
     }
     $mainframe->enqueueMessage(JText::_('COM_KOMENTO_ACL_STORE_SUCCESS', 'message'));
     // Clear the component's cache
     $cache = JFactory::getCache('com_komento');
     $cache->clean();
     return true;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:35,代码来源:acl.php

示例10: loadForm

	public static function loadForm( $id, $component, $options = array() )
	{
		$theme	= Komento::getTheme();
		$html	= $theme->fetch( 'comment/form.php' );

		echo $html;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:api.php

示例11: loadComposite

 public function loadComposite($component, $ip)
 {
     $sql = Komento::getSql();
     $sql->select('#__komento_ipfilter')->where('component', $component)->where('ip', $ip);
     $data = $sql->loadObject();
     return parent::bind($data);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:ipfilter.php

示例12: clear

 /**
  * Delete the outdated entries.
  */
 public function clear()
 {
     $db = Komento::getDBO();
     $date = Komento::getDate();
     $query = 'DELETE FROM ' . $db->nameQuote('#__komento_captcha') . ' WHERE ' . $db->nameQuote('created') . ' <= DATE_SUB( ' . $db->Quote($date->toMySQL()) . ', INTERVAL 12 HOUR )';
     $db->setQuery($query);
     $db->query();
     return true;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:12,代码来源:captcha.php

示例13: getCount

 /**
  * Renders the comment count for Komento
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return	
  */
 public function getCount(EasyBlogPost $post)
 {
     if (!$this->exists()) {
         return;
     }
     $model = Komento::getModel('Comments');
     $count = $model->getCount('com_easyblog', $post->id);
     return $count;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:17,代码来源:komento.php

示例14: preview

 function preview()
 {
     $id = JRequest::getInt('id');
     $table = Komento::getTable('mailq');
     $table->load($id);
     $ajax = Komento::getAjax();
     $ajax->success($table->body, $table->type);
     $ajax->send();
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:9,代码来源:view.ajax.php

示例15: getTotal

 function getTotal()
 {
     // Lets load the content if it doesn't already exist
     if (empty($this->_total)) {
         $sql = Komento::getSql();
         $sql->select('#__komento_comments', 'a')->column('a.id', 'id', 'count distinct')->rightjoin('#__komento_actions', 'b')->on('a.id', 'b.comment_id')->where('b.type', 'report');
         $this->_total = $sql->loadResult();
     }
     return $this->_total;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:10,代码来源:reports.php


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