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


PHP Komento::getProfile方法代码示例

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


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

示例1: upload

	public function upload( $fileItem, $fileName = '', $storagePath = '', $published = 1 )
	{
		// $fileItem['name'] = filename
		// $fileItem['type'] = mime
		// $fileItem['tmp_name'] = temporary source
		// $fileItem['size'] = size

		if( empty( $fileItem ) )
		{
			return false;
		}

		// store record first
		$uploadtable = Komento::getTable( 'uploads' );

		$now = Komento::getDate()->toMySQL();
		$uploadtable->created = $now;

		$profile = Komento::getProfile();
		$uploadtable->created_by = $profile->id;

		$uploadtable->published = $published;

		$uploadtable->mime = $fileItem['type'];

		$uploadtable->size = $fileItem['size'];

		if( $fileName == '' )
		{
			$fileName = $fileItem['name'];
		}
		$uploadtable->filename = $fileName;

		if( $storagePath == '' )
		{
			$config = Komento::getConfig();
			$storagePath = $config->get( 'upload_path' );
		}
		$uploadtable->path = $storagePath;

		if( !$uploadtable->upload() )
		{
			return false;
		}

		$source = $fileItem['tmp_name'];
		$destination = $uploadtable->getFilePath();

		jimport( 'joomla.filesystem.file' );
		if( !JFile::copy( $source , $destination ) )
		{
			$uploadtable->rollback();
			return false;
		}

		return $uploadtable->id;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:57,代码来源:file.php

示例2: init

 public function init()
 {
     $obj = new stdClass();
     $obj->config = Komento::getConfig();
     $obj->konfig = Komento::getKonfig();
     $obj->my = Komento::getProfile();
     $obj->acl = Komento::getHelper('acl');
     $obj->session = JFactory::getSession();
     $this->_system = $obj;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:10,代码来源:themes.php

示例3: display

 public function display($tpl = null)
 {
     $konfig = Komento::getKonfig();
     $id = JRequest::getInt('id', 0);
     // @task: If profiles are disabled, do not show the profile here.
     if (!$konfig->get('profile_enable')) {
         $app = JFactory::getApplication();
         $app->redirect('index.php', JText::_('COM_KOMENTO_PROFILE_SYSTEM_DISABLED'));
         $app->close();
     }
     $profileModel = Komento::getModel('Profile');
     $activityModel = Komento::getModel('Activity');
     $commentsModel = Komento::getModel('Comments');
     $actionsModel = Komento::getModel('Actions');
     $count = new stdClass();
     $user = JFactory::getUser();
     if ($id === 0 && $user->id > 0) {
         $id = $user->id;
     }
     // Block non-exists profile
     if (!$profileModel->exists($id)) {
         echo JText::_('COM_KOMENTO_PROFILE_NOT_FOUND');
         return;
     }
     // TODO: Block custom profile id
     // ..
     $profile = Komento::getProfile($id);
     // $activities		= $activityModel->getUserActivities( $profile->id );
     $count->totalComments = $commentsModel->getTotalComment($profile->id);
     $count->likesReceived = $actionsModel->getLikesReceived($profile->id);
     $count->likesGiven = $actionsModel->getLikesGiven($profile->id);
     // Set Pathway
     // Check if Komento profile menu item exist before setting profile pathway
     $app = JFactory::getApplication();
     $menu = $app->getMenu();
     $item = $menu->getActive();
     if (empty($item) || $item->query['view'] != 'profile') {
         $this->setPathway(JText::_('COM_KOMENTO_PROFILE'), '');
     }
     $this->setPathway($profile->getName(), '');
     // Set browser title
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_KOMENTO_USER_PROFILE') . ' - ' . $profile->getName());
     // set component to com_komento
     Komento::setCurrentComponent('com_komento');
     $theme = Komento::getTheme();
     $theme->set('profile', $profile);
     $theme->set('count', $count);
     // $theme->set( 'activities', $activities );
     echo $theme->fetch('profile/profile.php');
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:51,代码来源:view.html.php

示例4: __construct

	public function __construct()
	{
		$konfig = Komento::getKonfig();
		$config = Komento::getConfig();

		// @legacy: If environment is set to production, change to static.
		$environment = $konfig->get('komento_environment');
		if ($environment=='production') {
			$environment='static';
		}

		$this->fullName		= 'Komento';
		$this->shortName	= 'kmt';
		$this->environment	= $environment;
		$this->mode			= $konfig->get('komento_mode');
		$this->version		= (string) Komento::getHelper( 'Version' )->getLocalVersion();
		$this->baseUrl		= Komento::getHelper( 'Document' )->getBaseUrl();
		$this->token		= Komento::_( 'getToken' );

		$newConfig = clone $config->toObject();
		$newKonfig = clone $konfig->toObject();

		unset( $newConfig->antispam_recaptcha_private_key );
		unset( $newConfig->antispam_recaptcha_public_key );
		unset( $newConfig->antispam_akismet_key );
		unset( $newConfig->layout_phpbb_path );
		unset( $newConfig->layout_phpbb_url );
		unset( $newKonfig->layout_phpbb_path );
		unset( $newKonfig->layout_phpbb_url );

		$this->options     = array(
			"responsive"	=> (bool) $config->get('enable_responsive'),
			"jversion"		=> Komento::joomlaVersion(),
			"spinner"		=> JURI::root() . 'media/com_komento/images/loader.gif',
			"view"			=> JRequest::getString( 'view', '' ),
			"guest"			=> Komento::getProfile()->guest ? 1 : 0,
			"config"		=> $newConfig,
			"konfig"		=> $newKonfig,
			"acl"			=> Komento::getACL(),
			"element"		=> new stdClass()
		);

		parent::__construct();
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:44,代码来源:configuration.php

示例5: loadHeaders

 public static function loadHeaders()
 {
     if (!self::$loaded) {
         $url = KomentoDocumentHelper::getBaseUrl();
         $resourcePath = $url . '&tmpl=component&no_html=1&controller=foundry&task=getResource&kmtcomponent=' . JRequest::getCmd('option', '');
         $document = JFactory::getDocument();
         $config = Komento::getConfig();
         $konfig = Komento::getKonfig();
         $acl = Komento::getAcl();
         $guest = Komento::getProfile()->guest ? 1 : 0;
         if ($document->getType() != 'html') {
             return true;
         }
         // only temporary to load development css
         // waiting chang to finalise reset.css and comments.css
         self::addTemplateCss('common.css');
         // self::addTemplateCss( 'comments.css' );
         // Load KomentoConfiguration class
         require_once KOMENTO_CLASSES . DIRECTORY_SEPARATOR . 'configuration.php';
         // Get configuration instance
         $configuration = KomentoConfiguration::getInstance();
         // Attach configuration to headers
         $configuration->attach();
         if ($config->get('layout_inherit_kuro_css', 1) && $config->get('layout_theme') != 'wireframe') {
             $document->addStylesheet(JURI::root() . 'components/com_komento/themes/kuro/css/style.css');
         }
         // support for RTL sites
         // forcertl = 1 for dev purposes
         if (($document->direction == 'rtl' || JRequest::getInt('forcertl') == 1) && $config->get('layout_theme') != 'wireframe') {
             $document->addStylesheet(JURI::root() . 'components/com_komento/themes/kuro/css/style-rtl.css');
         }
         $document->addStylesheet(JURI::root() . 'media/foundry/3.1/styles/dialog/default.css');
         $document->addStylesheet(JURI::root() . 'media/foundry/3.1/styles/fancybox/default.css');
         self::load('style', 'css', 'themes');
         // load SH css if config is on
         if ($config->get('enable_syntax_highlighting')) {
             $shtheme = $config->get('syntaxhighlighter_theme', 'default');
             self::load('syntaxhighlighter/' . $shtheme, 'css', 'assets');
         }
         self::$loaded = true;
     }
     return self::$loaded;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:43,代码来源:document.php

示例6: download

	public function download()
	{
		$id	= JRequest::getInt( 'id' );

		// need to get component to check acl because controller link component is com_komento

		$filetable = Komento::getTable( 'uploads' );
		if( !$filetable->load( $id ) )
		{
			echo JText::_( 'COM_KOMENTO_ATTACHMENT_INVALID_ID' );
			exit;
		}

		$comment = Komento::getComment( $filetable->uid );

		$profile = Komento::getProfile();
		if( !$profile->allow( 'download_attachment', $comment->component ) )
		{
			echo JText::_( 'COM_KOMENTO_ATTACHMENT_NO_PERMISSION' );
			exit;
		}

		return $filetable->download();
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:24,代码来源:file.php

示例7: display

 function display($tmpl = null)
 {
     $config = Komento::getConfig();
     if (!$config->get('enable_rss')) {
         return;
     }
     require_once KOMENTO_HELPERS . DIRECTORY_SEPARATOR . 'helper.php';
     $component = JRequest::getString('component', 'all');
     $cid = JRequest::getInt('cid');
     $cid = !$cid ? 'all' : $cid;
     $userid = JRequest::getInt('userid', null);
     if ($component != 'all' && $cid != 'all') {
         $application = Komento::loadApplication($component)->load($cid);
         if ($application === false) {
             $application = Komento::getErrorApplication($component, $cid);
         }
         $contentTitle = $component != 'all' && $cid != 'all' ? $application->getContentTitle() : '';
     }
     $username = $userid !== null ? Komento::getProfile($userid)->getName() : '';
     $document = JFactory::getDocument();
     // to do: get permalink or view name from api/componentlist
     if ($component != 'all' && $cid != 'all') {
         $document->link = $application->getContentPermalink();
     } else {
         $document->link = JURI::root();
     }
     // to do : get article name from api/componentlist
     // document title based on request parameter
     // integrate settings for rss
     // allow all component rss
     // allow all article rss
     // allow all user rss
     // allow all guest rss
     $document->setTitle(JText::_('COM_KOMENTO_FEEDS_LATEST_TITLE'));
     $document->setDescription(JText::_('COM_KOMENTO_FEEDS_LATEST_TITLE_DESCRIPTION'));
     if ($component == 'all') {
         if ($cid != 'all') {
             // impossible all component and specific article
             echo 'Error! Component = all, cid != all.';
             exit;
         }
         // all component all article
         if (is_null($userid)) {
             // all users/guests
             $document->setTitle(JText::_('COM_KOMENTO_FEEDS_ALL_COMMENTS_TITLE'));
             $document->setDescription(JText::_('COM_KOMENTO_FEEDS_ALL_COMMENTS_TITLE_DESCRIPTION'));
         } else {
             if ($userid === 0) {
                 // for all guest $userid = 0
                 $document->setTitle(JText::_('COM_KOMENTO_FEEDS_GUEST_COMMENTS_TITLE'));
                 $document->setDescription(JText::_('COM_KOMENTO_FEEDS_GUEST_COMMENTS_TITLE_DESCRIPTION'));
             } else {
                 // specific user
                 $document->setTitle(JText::_('COM_KOMENTO_FEEDS_COMMENTS_FROM_USER_TITLE') . ' : ' . $username);
                 $document->setDescription(JText::_('COM_KOMENTO_FEEDS_COMMENTS_FROM_USER_TITLE_DESCRIPTION') . ' : ' . $username);
             }
         }
     } else {
         // specific component
         if ($cid == 'all') {
             // all article
             if (is_null($userid)) {
                 // all users/guests
                 $document->setTitle(JText::_('COM_KOMENTO_FEEDS_COMMENTS_FOR_COMPONENT_TITLE') . ' : ' . Komento::loadApplication($component)->getComponentName());
                 $document->setDescription(JText::_('COM_KOMENTO_FEEDS_COMMENTS_FOR_COMPONENT_TITLE_DESCRIPTION'));
             } else {
                 if ($userid === 0) {
                     // for all guest $userid = 0
                     $document->setTitle(JText::_('COM_KOMENTO_FEEDS_GUEST_COMMENTS_FOR_COMPONENT_TITLE') . ' : ' . Komento::loadApplication($component)->getComponentName());
                     $document->setDescription(JText::_('COM_KOMENTO_FEEDS_GUEST_COMMENTS_FOR_COMPONENT_TITLE_DESCRIPTION'));
                 } else {
                     // specific user
                     $document->setTitle(JText::_('COM_KOMENTO_FEEDS_COMMENTS_FROM_USER_FOR_COMPONENT_TITLE') . ' : ' . $username . ' : ' . Komento::loadApplication($component)->getComponentName());
                     $document->setDescription(JText::_('COM_KOMENTO_FEEDS_COMMENTS_FROM_USER_FOR_COMPONENT_TITLE_DESCRIPTION') . ' : ' . $username);
                 }
             }
         } else {
             // specific article
             if (is_null($userid)) {
                 // all users/guests
                 $document->setTitle(JText::_('COM_KOMENTO_FEEDS_COMMENTS_FOR_COMPONENT_OF_ARTICLE_TITLE') . ' : ' . Komento::loadApplication($component)->getComponentName() . ' : ' . $contentTitle);
                 $document->setDescription(JText::_('COM_KOMENTO_FEEDS_COMMENTS_FOR_COMPONENT_OF_ARTICLE_TITLE_DESCRIPTION'));
             } else {
                 if ($userid === 0) {
                     // for all guest $userid = 0
                     $document->setTitle(JText::_('COM_KOMENTO_FEEDS_GUEST_COMMENTS_FOR_COMPONENT_OF_ARTICLE_TITLE') . ' : ' . Komento::loadApplication($component)->getComponentName() . ' : ' . $contentTitle);
                     $document->setDescription(JText::_('COM_KOMENTO_FEEDS_GUEST_COMMENTS_FOR_COMPONENT_OF_ARTICLE_TITLE_DESCRIPTION'));
                 } else {
                     // specific user
                     $document->setTitle(JText::_('COM_KOMENTO_FEEDS_COMMENTS_FROM_USER_FOR_COMPONENT_TITLE_OF_ARTICLE') . ' : ' . $username . ' : ' . Komento::loadApplication($component)->getComponentName() . ' : ' . $contentTitle);
                     $document->setDescription(JText::_('COM_KOMENTO_FEEDS_COMMENTS_FROM_USER_FOR_COMPONENT_TITLE_OF_ARTICLE_DESCRIPTION') . ' : ' . $username);
                 }
             }
         }
     }
     $options = array('sort' => 'latest', 'limit' => $config->get('rss_max_items'), 'userid' => $userid === null ? 'all' : $userid, 'threaded' => 0);
     $commentsModel = Komento::getModel('comments');
     $comments = $commentsModel->getComments($component, $cid, $options);
     if (!empty($comments)) {
         foreach ($comments as $row) {
//.........这里部分代码省略.........
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:101,代码来源:view.feed.php

示例8: getRules

	public static function getRules( $userId, $component = 'com_content' )
	{
		$signature	= serialize( array( $userId, $component ) );

		if( empty( self::$rules[$signature] ) )
		{
			$profile = Komento::getProfile( $userId );

			$model	= Komento::getModel( 'acl' );
			$data	= array();

			// check user group specific rules
			$gids = $profile->getUsergroups();

			foreach( $gids as $gid )
			{
				$data[]	= $model->getAclObject( $gid, 'usergroup', $component );
			}

			// check user specific rules
			$data[] = $model->getAclObject( $userId, 'user', $component );

			// remove empty set
			foreach( $data as $key => $value )
			{
				if( empty( $value ) )
				{
					unset( $data[$key] );
				}
			}

			if( count( $data ) < 1 )
			{
				$data[] = KomentoACLHelper::getEmptySet( true );
			}

			self::$rules[$signature] = self::merge( $data );
		}

		return self::$rules[$signature];
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:41,代码来源:acl.php

示例9:

            if (!Komento::getProfile($row->created_by)->guest) {
                ?>
						<a href="<?php 
                echo Komento::getProfile($row->created_by)->getProfileLink();
                ?>
">
							<img src="<?php 
                echo Komento::getProfile($row->created_by)->getAvatar($row->email);
                ?>
" class="avatar" width="30" />
						</a>
					<?php 
            } else {
                ?>
						<img src="<?php 
                echo Komento::getProfile($row->created_by)->getAvatar($row->email);
                ?>
" class="avatar" width="30" />
					<?php 
            }
            ?>
				</div>
				<?php 
        }
        ?>

				<!-- Author -->
				<?php 
        if ($params->get('showauthor')) {
            ?>
					<?php 
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:31,代码来源:default.php

示例10:

					<ul class="kmt-form-author reset-ul float-li clearfix">
						<?php 
            // Name field li.kmt-form-name
            echo $this->fetch('comment/form/namefield.php');
            // Email field li.kmt-form-email
            echo $this->fetch('comment/form/emailfield.php');
            // Website field li.kmt-form-website
            echo $this->fetch('comment/form/websitefield.php');
            ?>
					</ul>
				<?php 
        }
        ?>

				<?php 
        if (!Komento::getProfile()->guest) {
            ?>
				<div class="kmt-form-author clearfix">
					<?php 
            // Avatar div.kmt-avatar
            echo $this->fetch('comment/form/avatar.php');
            // Author div.kmt-comment-detail
            echo $this->fetch('comment/form/author.php');
            ?>
				</div>
				<?php 
        }
        ?>

				<div class="kmt-form-content">
					<?php 
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:31,代码来源:-form.php

示例11: getLikedUsers

	function getLikedUsers( $id )
	{
		$query  = 'SELECT * FROM ' . $this->db->nameQuote( '#__komento_actions' );
		$query .= ' WHERE ' . $this->db->nameQuote( 'comment_id' ) . ' = ' . $this->db->quote( $id );
		$query .= ' AND ' . $this->db->nameQuote( 'type' ) . ' = ' . $this->db->quote( 'likes' );

		$this->db->setQuery( $query );
		$result = $this->db->loadObjectList();

		foreach( $result as &$row )
		{
			$row->author = Komento::getProfile( $row->action_by );
		}

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

示例12: prepareData

	private function prepareData( $type = 'new', $options )
	{
		Komento::import( 'helper', 'date' );

		$data							= array();

		if( $type === 'confirm' )
		{
			$subscribeTable = Komento::getTable( 'subscription' );
			$subscribeTable->load( $options['subscribeId'] );

			$profile = Komento::getProfile( $subscribeTable->userid );
		}
		else
		{
			$profile	= Komento::getProfile( $options['comment']->created_by );

			$data['contentTitle']			= $options['comment']->contenttitle;
			$data['contentPermalink']		= $options['comment']->pagelink;
			$data['commentAuthorName']		= $options['comment']->name;
			$data['commentAuthorAvatar']	= $profile->getAvatar();
		}

		$config 					= Komento::getConfig();

		switch( $type )
		{
			case 'confirm':
				$data['confirmLink']	= rtrim( JURI::root() , '/' ) . '/index.php?option=com_komento&task=confirmSubscription&id=' . $options['subscribeId'];
				break;
			case 'pending':
			case 'moderate':
				$hashkeys = Komento::getTable( 'hashkeys' );
				$hashkeys->uid = $options['comment']->id;
				$hashkeys->type = 'comment';
				$hashkeys->store();
				$key = $hashkeys->key;

				$data['approveLink']	= rtrim( JURI::root() , '/' ) . '/index.php?option=com_komento&task=approveComment&token=' . $key;
				$data['commentContent']	= JFilterOutput::cleanText($options['comment']->comment);
				$date					= KomentoDateHelper::dateWithOffSet( $options['comment']->unformattedDate );
				$date					= KomentoDateHelper::toFormat( $date , $config->get( 'date_format' , '%A, %B %e, %Y' ) );
				$data['commentDate']	= $date;
				break;
			case 'report':
				$action = Komento::getTable( 'actions' );
				$action->load( $options['actionId'] );
				$actionUser = $action->action_by;

				$data['actionUser']			= Komento::getProfile( $actionUser );
				$data['commentPermalink']	= $data['contentPermalink'] . '#kmt-' . $options['comment']->id;
				$data['commentContent']		= JFilterOutput::cleanText($options['comment']->comment);
				$date						= KomentoDateHelper::dateWithOffSet( $options['comment']->unformattedDate );
				$date						= KomentoDateHelper::toFormat( $date , $config->get( 'date_format' , '%A, %B %e, %Y' ) );
				$data['commentDate']		= $date;
				break;
			case 'reply':
			case 'comment':
			case 'new':
			default:
				$data['commentPermalink']	= $data['contentPermalink'] . '#kmt-' . $options['comment']->id;
				$data['commentContent']		= JFilterOutput::cleanText($options['comment']->comment);
				$date						= KomentoDateHelper::dateWithOffSet( $options['comment']->unformattedDate );
				$date						= KomentoDateHelper::toFormat( $date , $config->get( 'date_format' , '%A, %B %e, %Y' ) );
				$data['commentDate']		= $date;
				$data['unsubscribe'] 		= rtrim( JURI::root(), '/' ) . '/index.php?option=com_komento&task=unsubscribe&id=';
				break;
		}

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

示例13: defined

/**
* @package		Komento
* @copyright	Copyright (C) 2012 Stack Ideas Private Limited. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Komento is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
if( $system->config->get( 'enable_info' ) && $row->modified_by ) { ?>
<span class="commentInfo kmt-info">
	<?php $modified = $row->modified;
	if( $system->config->get( 'enable_lapsed_time' ) ) {
		$modified = Komento::getHelper( 'date' )->getLapsedTime( $row->modified );
	} ?>
	<?php echo JText::sprintf( 'COM_KOMENTO_COMMENT_EDITTED_BY', $modified, Komento::getProfile( $row->modified_by )->getName() ); ?>

	<!-- Extended data for schema purposes -->
	<?php if( $system->konfig->get( 'enable_schema' ) ) { ?>
	<span class="hidden" itemprop="editor" itemscope itemtype="http://schema.org/Person">
		<span itemprop="name"><?php echo Komento::getProfile( $row->modified_by )->getName(); ?></span>
	</span>
	<time class="hidden" itemprop="dateModified" datetime="<?php echo $this->formatDate( 'c', $row->modified ); ?>"></time>
	<?php } ?>
</span>
<?php } else { ?>
<span class="commentInfo kmt-info hidden"></span>
<?php }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:30,代码来源:info.php

示例14: nl2br

		<!-- Permalink -->
		<li class="kmt-permalink"><a href="<?php echo Komento::loadApplication( $row->component )->load( $row->cid )->getContentPermalink() . '#kmt-' . $row->id; ?>"><?php echo JText::_( 'COM_KOMENTO_COMMENT_PERMALINK' ) ; ?></a></li>
	</ul>

	<div class="kmt-body">
		<?php // parseBBcode to HTML
			$row->comment = KomentoCommentHelper::parseBBCode($row->comment);
			$row->comment = nl2br($row->comment);
		?>
		<span class="kmt-text"><?php echo $row->comment; ?></span>
	</div>

	<ul class="kmt-info">
		<?php if($row->modified_by != 0) { ?>
		<li>
			Comment last edited on <?php echo $row->modified; ?> by <?php echo Komento::getProfile($row->modified_by)->getName(); ?>
		</li>
		<?php } ?>

	</ul>

	<div class="kmt-control">
		<ul class="kmt-control-admin">
			<li>
				<?php if( $system->my->allow( 'publish_all_comment', $row->component ) || ( $row->created_by == $system->my->id && $system->my->allow( 'publish_own_comment', $row->component ) ) ) { ?>
				<a href="javascript:void(0);" class="kmt-status">
				<?php } ?>
				<?php switch ($row->published)
				{
					case 0:
						echo JText::_( 'COM_KOMENTO_UNPUBLISHED' );
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:comments.item.php

示例15: commentify


//.........这里部分代码省略.........
     if ($config->get('notification_sendmailonpageload')) {
         self::getMailQueue()->sendOnPageLoad();
     }
     // @task: clear captcha database
     if ($konfig->get('database_clearcaptchaonpageload')) {
         self::clearCaptcha();
     }
     // @task: load necessary css and javascript files.
     self::getHelper('Document')->loadHeaders();
     /**********************************************/
     // Run Komento!
     $commentsModel = Komento::getModel('comments');
     $comments = '';
     $return = false;
     $commentCount = $commentsModel->getCount($component, $cid);
     // Get total ratings
     $ratings = $commentsModel->getOverallRatings($component, $cid);
     $totalRating = 0;
     $totalRatingCount = 0;
     if ($ratings) {
         $totalRating = $ratings->value;
         $totalRatingCount = $ratings->total;
     }
     if ($application->isListingView()) {
         $html = '';
         if (!array_key_exists('skipBar', $options)) {
             $commentOptions = array();
             $commentOptions['threaded'] = 0;
             $commentOptions['limit'] = $config->get('preview_count', '3');
             $commentOptions['sort'] = $config->get('preview_sort', 'latest');
             $commentOptions['parentid'] = $config->get('preview_parent_only', false) ? 0 : 'all';
             $commentOptions['sticked'] = $config->get('preview_sticked_only', false) ? true : 'all';
             if ($commentOptions['sort'] == 'popular') {
                 $comments = $commentsModel->getPopularComments($component, $cid, $commentOptions);
             } else {
                 $comments = $commentsModel->getComments($component, $cid, $commentOptions);
             }
             $theme = Komento::getTheme();
             $theme->set('commentCount', $commentCount);
             $theme->set('componentHelper', $application);
             $theme->set('component', $component);
             $theme->set('cid', $cid);
             $theme->set('comments', $comments);
             $theme->set('article', $article);
             $html = $theme->fetch('comment/bar.php');
         }
         $return = $application->onExecute($article, $html, 'listing', $options);
     }
     if ($application->isEntryView()) {
         // check for escaped_fragment (google ajax crawler)
         $fragment = JRequest::getVar('_escaped_fragment_', '');
         if ($fragment != '') {
             $tmp = explode('=', $fragment);
             $fragment = array($tmp[0] => $tmp[1]);
             if (isset($fragment['kmt-start'])) {
                 $options['limitstart'] = $fragment['kmt-start'];
             }
         } else {
             // Sort comments oldest first by default.
             if (!isset($options['sort'])) {
                 $options['sort'] = JRequest::getVar('kmt-sort', $config->get('default_sort'));
             }
             if ($config->get('load_previous')) {
                 $options['limitstart'] = $commentCount - $config->get('max_comments_per_page');
                 if ($options['limitstart'] < 0) {
                     $options['limitstart'] = 0;
                 }
             }
         }
         $options['threaded'] = $config->get('enable_threaded');
         $profile = Komento::getProfile();
         $my = JFactory::getUser();
         if (!$profile->allow('read_others_comment')) {
             $options['userid'] = $my->id;
         }
         if ($profile->allow('read_comment')) {
             $comments = $commentsModel->getComments($component, $cid, $options);
         }
         $contentLink = $application->getContentPermalink();
         $theme = Komento::getTheme();
         $theme->set('totalRating', $totalRating);
         $theme->set('totalRatingCount', $totalRatingCount);
         $theme->set('component', $component);
         $theme->set('cid', $cid);
         $theme->set('comments', $comments);
         $theme->set('options', $options);
         $theme->set('componentHelper', $application);
         $theme->set('application', $application);
         $theme->set('commentCount', $commentCount);
         $theme->set('contentLink', $contentLink);
         $html = $theme->fetch('comment/box.php');
         /* [KOMENTO_POWERED_BY_LINK] */
         // free version powered by link append (for reference only)
         // $html	.= '<div style="text-align: center; padding: 20px 0;"><a href="http://stackideas.com">' . JText::_( 'COM_KOMENTO_POWERED_BY_KOMENTO' ) . '</a></div>';
         $return = $application->onExecute($article, $html, 'entry', $options);
         // @task: Append hidden token into the page.
         $return .= '<span id="komento-token" style="display:none;"><input type="hidden" name="' . Komento::_('getToken') . '" value="1" /></span>';
     }
     return $return;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:101,代码来源:helper.php


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