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


PHP Komento::commentify方法代码示例

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


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

示例1: html

 /**
  * Renders the comment form 
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return	
  */
 public function html(EasyBlogPost &$blog)
 {
     if (!$this->exists()) {
         return;
     }
     $output = Komento::commentify('com_easyblog', $blog, array('trigger' => 'onDisplayComments'));
     return $output;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:16,代码来源:komento.php

示例2: getCommentHTML


//.........这里部分代码省略.........
     if ($config->get('comment_jcomments')) {
         $file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_jcomments' . DIRECTORY_SEPARATOR . 'jcomments.php';
         if (JFile::exists($file)) {
             require_once $path . DIRECTORY_SEPARATOR . 'jcomments.php';
             $commentSystems['JCOMMENTS'] = EasyBlogCommentJComments::getHTML($blog);
             if (!$config->get('main_comment_multiple')) {
                 return $commentSystems['JCOMMENTS'];
             }
         }
     }
     if ($config->get('comment_rscomments')) {
         $file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_rscomments' . DIRECTORY_SEPARATOR . 'rscomments.php';
         if (JFile::exists($file)) {
             include_once $path . DIRECTORY_SEPARATOR . 'rscomments.php';
             $commentSystems['RSCOMMENTS'] = EasyBlogCommentRSComments::getHTML($blog);
             if (!$config->get('main_comment_multiple')) {
                 return $commentSystems['RSCOMMENTS'];
             }
         }
     }
     if ($config->get('comment_easydiscuss')) {
         $enabled = JPluginHelper::isEnabled('content', 'easydiscuss');
         if ($enabled) {
             JPluginHelper::importPlugin('content', 'easydiscuss');
             $articleParams = new stdClass();
             $result = JFactory::getApplication()->triggerEvent('onDisplayComments', array(&$blog, &$articleParams));
             if (isset($result[0]) || isset($result[1])) {
                 // There could be komento running on the site
                 if (isset($result[1]) && $result[1]) {
                     $commentSystems['EASYDISCUSS'] = $result[1];
                 } else {
                     $commentSystems['EASYDISCUSS'] = $result[0];
                 }
                 if (!$config->get('main_comment_multiple')) {
                     return $commentSystems['EASYDISCUSS'];
                 }
             }
         }
     }
     if ($config->get('comment_komento')) {
         $file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'bootstrap.php';
         if (JFile::exists($file)) {
             include_once $file;
             $commentSystems['KOMENTO'] = Komento::commentify('com_easyblog', $blog, array('trigger' => 'onDisplayComments'));
             if (!$config->get('main_comment_multiple')) {
                 return $commentSystems['KOMENTO'];
             }
         }
     }
     if (!$config->get('main_comment_multiple') || $config->get('comment_easyblog')) {
         //check if bbcode enabled or not.
         if ($config->get('comment_bbcode')) {
             EasyBlogCommentHelper::loadBBCode();
         }
         // If all else fail, try to use the default comment system
         $theme = new CodeThemes();
         // setup my own info to show in comment form area
         $my = JFactory::getUser();
         $profile = EasyBlogHelper::getTable('Profile', 'Table');
         $profile->load($my->id);
         $my->avatar = $profile->getAvatar();
         $my->displayName = $profile->getName();
         $my->url = $profile->url;
         $blogURL = base64_encode(EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $blog->id, false));
         $loginURL = EasyBlogHelper::getLoginLink($blogURL);
         $enableRecaptcha = $config->get('comment_recaptcha');
         $publicKey = $config->get('comment_recaptcha_public');
         // check if the user has subcribed to this thread
         $subscriptionId = false;
         if ($my->id > 0) {
             $blogModel = EasyblogHelper::getModel('Blog');
             $subscriptionId = $blogModel->isBlogSubscribedUser($blog->id, $my->id, $my->email);
             $subscriptionId = is_null($subscriptionId) ? false : $subscriptionId;
         }
         $theme->set('loginURL', $loginURL);
         $theme->set('blog', $blog);
         $theme->set('my', $my);
         $theme->set('config', $config);
         $theme->set('blogComments', $comments);
         $theme->set('pagination', $pagination);
         $theme->set('allowComment', true);
         $theme->set('canRegister', $registration);
         $theme->set('acl', EasyBlogACLHelper::getRuleSet());
         $theme->set('subscriptionId', $subscriptionId);
         $commentSystems['EASYBLOGCOMMENTS'] = $theme->fetch('blog.comment.box.php');
     }
     if (!$config->get('main_comment_multiple')) {
         return $commentSystems['EASYBLOGCOMMENTS'];
     }
     // If there's 1 system only, there's no point loading the tabs.
     if (count($commentSystems) == 1) {
         return $commentSystems[key($commentSystems)];
     }
     unset($theme);
     // Reverse the comment systems array so that easyblog comments are always the first item.
     $commentSystems = array_reverse($commentSystems);
     $theme = new CodeThemes();
     $theme->set('commentSystems', $commentSystems);
     return $theme->fetch('blog.comment.multiple.php');
 }
开发者ID:Tommar,项目名称:vino2,代码行数:101,代码来源:comment.php

示例3: array

                require_once $jcomments;
                echo JComments::show($this->item->id, 'com_djcatalog2', $this->item->name);
            }
            ?>
	<?php 
        } else {
            if ($this->params->get('comments', 0) == '4') {
                ?>
   	<?php 
                $komento = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'bootstrap.php';
                if (file_exists($komento)) {
                    require_once $komento;
                    $options = array();
                    $options['trigger'] = 'onDJCatalog2Item';
                    $options['context'] = 'com_djcatalog2.item';
                    $options['params'] = $this->params;
                    $comments = Komento::commentify('com_djcatalog2', $this->item, $options);
                    if ($comments) {
                        echo $comments;
                    }
                }
                ?>
	<?php 
            }
        }
    }
}
?>
					
</div>
开发者ID:jputz12,项目名称:OneNow-Vshop,代码行数:30,代码来源:default_comments.php

示例4: function

        echo $this->mail->mailid;
        ?>
";
				var disqus_shortname = "<?php 
        echo $disqus_shortname;
        ?>
";
				var disqus_config = function () {
					this.language = "<?php 
        echo $lang_shortcode[0];
        ?>
";
				};
				(function() {
					var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true;
					dsq.src = "http://" + disqus_shortname + ".disqus.com/embed.js";
					(document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq);
				})();
			</script>
			<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<?php 
    }
} elseif ($this->config->get('comments_feature') == 'rscomments') {
    echo '{rscomments option="com_acymailing" id="' . $this->mail->mailid . '"}';
} elseif ($this->config->get('comments_feature') == 'komento') {
    require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'bootstrap.php';
    echo Komento::commentify('com_acymailing', $this->mail, array());
}
?>
</div>
开发者ID:madcsaba,项目名称:li-de,代码行数:30,代码来源:view.php

示例5:

        if ($params->get('show_hits')) {
            ?>
					<dd>
						<div class="item_hits">
							<?php 
            echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $item->hits);
            ?>
						</div>
					</dd>
					<?php 
        }
        if (Komento::loadApplication('com_content')) {
            ?>
					<dd class="komento">
						<?php 
            echo Komento::commentify('com_content', $item);
            ?>
					</dd>
					<?php 
        }
        ?>
				</dl>
			</footer>
			<?php 
    }
    ?>
		</article>
	</div>
	<?php 
}
?>
开发者ID:jdrzaic,项目名称:joomla-dummy,代码行数:31,代码来源:default_items.php

示例6: load_comments

    /**
     * Loads the comments from the installed/selected comment system. The comment system <code>type</code> should tell which comment system need to be used to load the comments from. The possible values are:<br><br>
     * jcomment - JComments (id and title are required) <br>
     * fbcomment - Facebook comment system (url is required)<br>
     * disqus - Disqus comment system (id, title, identifier and url are required)<br>
     * intensedebate - Intense Debate comment system (id, title, identifier and url are required)<br>
     * jacomment - JAComment system (id and title are required)<br>
     * jomcomment - JomComment (id is required)<br><br>
     * Passing any other value will silently skips the code. In all the above cases, <code>type</code> and <code>app_name</code> are required parameters. 
     * While <code>type</code> specifies the comment system to be used, <code>app_name</code> is the Joomla extension name (ex: com_appname) which is loading the comments for its content.
     *  
     * @param string $type comment system type
     * @param string $app_name extension name
     * @param int $id id of the content for which the comments are being loaded
     * @param string $title title of the content
     * @param string $url page url in case of facebook/disqus/intensedebate comment system.
     * @param string $identifier disqus username in case of disqus/intensedebate comment system.
     * @param object $item the item object for kommento
     * 
     * @return string the code to render the comments.
     */
    public static function load_comments($type, $app_name, $id = 0, $title = '', $url = '', $identifier = '', $item = null)
    {
        switch ($type) {
            case 'jcomment':
                $app = JFactory::getApplication();
                $path = JPATH_ROOT . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
                if (file_exists($path)) {
                    require_once $path;
                    return JComments::showComments($id, $app_name, $title);
                }
                break;
            case 'fbcomment':
                return '
					<div id="fb-root"></div>
					<script type="text/javascript">
						(function(d, s, id) {
							var js, fjs = d.getElementsByTagName(s)[0]; 
							if (d.getElementById(id)) return; 
							js = d.createElement(s); 
							js.id = id;
							js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3";
							fjs.parentNode.insertBefore(js, fjs); 
						}(document, "script", "facebook-jssdk"));
					</script>
					<div class="fb-comments" data-href="' . $url . '" data-num-posts="5" data-width="640"></div>';
            case 'disqus':
                return '
					<div id="disqus_thread"></div>
					<script type="text/javascript">
						var disqus_shortname = "' . $identifier . '";
// 						var disqus_developer = 1;
						var disqus_identifier = "' . $id . '";
						var disqus_url = "' . $url . '";
						var disqus_title = "' . $title . '";
						(function() {
							var dsq = document.createElement("script"); 
							dsq.type = "text/javascript"; 
							dsq.async = true;
							dsq.src = "http://" + disqus_shortname + ".disqus.com/embed.js";
							(document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq);
						})();
					</script>
					<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>';
            case 'intensedebate':
                return '
					<script>
						var idcomments_acct = "' . $identifier . '";
						var idcomments_post_id = "' . $id . '";
						var idcomments_post_url = "' . $url . '";
					</script>
					<span id="IDCommentsPostTitle" style="display:none"></span>
					<script type="text/javascript" src="http://www.intensedebate.com/js/genericCommentWrapperV2.js"></script>';
                break;
            case 'jacomment':
                if (!JRequest::getInt('print') && file_exists(JPATH_SITE . DS . 'components' . DS . 'com_jacomment' . DS . 'jacomment.php') && file_exists(JPATH_SITE . DS . 'plugins' . DS . 'system' . DS . 'jacomment.php')) {
                    $_jacCode = "#{jacomment(.*?) contentid=(.*?) option=(.*?) contenttitle=(.*?)}#i";
                    $_jacCodeDisableid = "#{jacomment(\\s)off.*}#i";
                    $_jacCodeDisable = "#{jacomment(\\s)off}#i";
                    if (!preg_match($_jacCode, $title) && !preg_match($_jacCodeDisable, $title) && !preg_match($_jacCodeDisableid, $title)) {
                        return '{jacomment contentid=' . $id . ' option=' . $app_name . ' contenttitle=' . $title . '}';
                    }
                }
                break;
            case 'jomcomment':
                $path = JPATH_PLUGINS . DS . 'content' . DS . 'jom_comment_bot.php';
                if (file_exists($path)) {
                    include_once $path;
                    return jomcomment($id, $app_name);
                }
                break;
            case 'kommento':
                $api = JPATH_ROOT . DS . 'components' . DS . 'com_komento' . DS . 'bootstrap.php';
                if (file_exists($api)) {
                    require_once $api;
                    $item->text = $item->introtext = !empty($item->description) ? $item->description : '';
                    return Komento::commentify($app_name, $item);
                }
                break;
            case 'ccomment':
//.........这里部分代码省略.........
开发者ID:pguilford,项目名称:vcomcc,代码行数:101,代码来源:functions.php

示例7: execute

	private function execute( $eventTrigger, $context = '', &$article, &$params, $page = 0 )
	{
		static $bootstrap;

		// @task: load bootstrap
		if( !$bootstrap )
		{
			$file	= JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'bootstrap.php';

			jimport('joomla.filesystem.file');

			if( !JFile::exists( $file ) )
			{
				// missing bootstrap
				return false;
			}

			require_once( $file );
			$bootstrap = true;
		}

		if( !$this->extension )
		{
			$this->extension = JRequest::getCmd( 'option' );
		}

		// @task: trigger onAfterEventTriggered
		if( !$result = Komento::onAfterEventTriggered( __CLASS__, $eventTrigger, $this->extension, $context, $article, $params ) )
		{
			return false;
		}

		// @task: trigger onBeforeCommentify
		// if( !$result = Komento::loadApplication( $this->extension )->onBeforeCommentify( $eventTrigger, $context, $article, $params, $page ) )
		// {
		// 	return false;
		// }

		// Passing in the data
		$options			= array();
		$options['trigger']	= $eventTrigger;
		$options['context']	= $context;
		$options['params']	= $params;
		$options['page']	= $page;

		// Ready to Commentify!
		return Komento::commentify( $this->extension, $article, $options );
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:48,代码来源:komento.php

示例8: array

                    ?>
					<div class="djcf_comments jcomments_comments_box">
						<h2><?php 
                    echo JText::_('COM_DJCLASSIFIEDS_COMMENTS');
                    ?>
</h2>
						<?php 
                    echo JComments::show($this->item->id, 'com_djclassifieds', $this->item->name);
                    ?>
					</div>
					<?php 
                }
            } else {
                if ($par->get('comments', '0') == 4) {
                    $komento = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'bootstrap.php';
                    if (file_exists($komento)) {
                        require_once $komento;
                        $options = array();
                        $options['trigger'] = 'onDJClassifiedsItem';
                        $options['context'] = 'com_djclassifieds.item';
                        $options['params'] = $par;
                        $comments = Komento::commentify('com_djclassifieds', $this->item, $options);
                        if ($comments) {
                            echo $comments;
                        }
                    }
                }
            }
        }
    }
}
开发者ID:kidaa30,项目名称:lojinha,代码行数:31,代码来源:default_comments.php

示例9:

    if ($params->get('show_hits')) {
        ?>
		<dd>
			<div class="item_hits">
				<?php 
        echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits);
        ?>
			</div>
		</dd>
		<?php 
    }
    if (Komento::loadApplication('com_content')) {
        ?>
		<dd class="komento">
			<?php 
        echo Komento::commentify('com_content', $this->item);
        ?>
		</dd>
	<?php 
    }
    ?>
	</dl>
</footer>
<?php 
}
if ($params->get('show_readmore') && $this->item->readmore) {
    if ($params->get('access-view')) {
        $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
    } else {
        $menu = JFactory::getApplication()->getMenu();
        $active = $menu->getActive();
开发者ID:jdrzaic,项目名称:joomla-dummy,代码行数:31,代码来源:blog_item.php

示例10: execute

 private function execute($eventTrigger, $context = 'none', &$article, &$params, $page = 0)
 {
     static $bootstrap;
     // @task: load bootstrap
     if (!$bootstrap) {
         $file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'bootstrap.php';
         jimport('joomla.filesystem.file');
         if (!JFile::exists($file)) {
             // missing bootstrap
             return false;
         }
         require_once $file;
         $bootstrap = true;
     }
     if (!$this->extension) {
         $this->extension = JRequest::getCmd('option');
     }
     // Fix flexicontent's mess as they are trying to reset the option=com_flexicontent to com_content.
     if (JRequest::getVar('isflexicontent')) {
         $this->extension = 'com_flexicontent';
     }
     // @task: trigger onAfterEventTriggered
     if (!($result = Komento::onAfterEventTriggered(__CLASS__, $eventTrigger, $this->extension, $context, $article, $params))) {
         return false;
     }
     // Passing in the data
     $options = array();
     $options['trigger'] = $eventTrigger;
     $options['context'] = $context;
     $options['params'] = $params;
     $options['page'] = $page;
     // Ready to Commentify!
     return Komento::commentify($this->extension, $article, $options);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:34,代码来源:komento.php


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