本文整理汇总了PHP中JComments::showComments方法的典型用法代码示例。如果您正苦于以下问题:PHP JComments::showComments方法的具体用法?PHP JComments::showComments怎么用?PHP JComments::showComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JComments
的用法示例。
在下文中一共展示了JComments::showComments方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Wordbridge entry view display method
* @return void
**/
function display($tpl = null)
{
$app = JFactory::getApplication();
$menu = $app->getMenu();
$item = $menu->getActive();
if (!$item) {
$item = $menu->getItem(JRequest::getInt('Itemid'));
}
$params = $item->params;
$this->assignRef('params', $params);
$postid = JRequest::getInt('p', 0);
$blogInfo = WordbridgeHelper::getBlogByName($params->get('wordbridge_blog_name'));
$this->assignRef('blogTitle', $blogInfo['description']);
$model = $this->getModel();
$entry = $model->getEntry($postid, $blogInfo['uuid']);
$baseUrl = $item->link . '&Itemid=' . $item->id;
$this->assignRef('blogLink', $baseUrl);
// Determine if we'll convert links
$convertLinks = $params->get('wordbridge_convert_links', 'no') == 'yes' ? true : false;
$this->assignRef('convertLinks', $convertLinks);
$this->assignRef('content', $entry['content']);
$this->assignRef('title', $entry['title']);
$this->assignRef('slug', $entry['slug']);
$this->assignRef('categories', $entry['categories']);
$this->assignRef('postid', $entry['postid']);
$this->assignRef('date', $entry['date']);
// Allow JComments to be added to blog entries
$jcomments = false;
$jcommentsPath = JPATH_SITE . DS . 'components' . DS . 'com_jcomments' . DS;
$jcommentFile = $jcommentsPath . 'jcomments.php';
if ($params->get('wordbridge_show_jcomments') == 'yes' && file_exists($jcommentFile)) {
$jbase = JPATH_SITE . DS . 'components' . DS;
$jPlgSrc = $jbase . 'com_wordbridge' . DS . 'assets' . DS . 'com_wordbridge.plugin.php';
$jPlgDst = $jbase . 'com_jcomments' . DS . 'plugins' . DS . 'com_wordbridge.plugin.php';
// Check to see if the integration is installed
$copyRes = true;
if (!file_exists($jPlgDst) || filemtime($jPlgSrc) > filemtime($jPlgDst)) {
// Copy the wordbridge plugin over to jcomments
$copyRes = JFile::copy($jPlgSrc, $jPlgDst);
}
// Only set up JComments if the wordbridge plugin is
// installed OK
if ($copyRes) {
require_once $jcommentFile;
$jid = $item->id * 10000000 + $entry['postid'];
$jcomments = JComments::showComments($jid, 'com_wordbridge', $entry['title']);
}
}
$this->assignRef('jcomments', $jcomments);
$document = JFactory::getDocument();
// Set the title to place above the blog
$blog_title = $params->get('page_heading');
if (!$blog_title) {
$blog_title = $document->getTitle();
}
$this->assignRef('blog_title', $blog_title);
// Set the page title
$document->setTitle($document->getTitle() . ' - ' . $entry['title']);
parent::display($tpl);
}
示例2: integrateVideoComments
function integrateVideoComments($row)
{
$c = jomtube_configs::get_instance();
$jomtubeCommentingSystemCode = '';
if ($c->commenting_system != 'No') {
//integrate commenting system with JomComment
if ($c->commenting_system == 'JomComment') {
if (file_exists(JPATH_ROOT . DS . 'plugins' . DS . 'content' . DS . 'jom_comment_bot.php')) {
require_once JPATH_ROOT . DS . 'plugins' . DS . 'content' . DS . 'jom_comment_bot.php';
$jomtubeCommentingSystemCode = jomcomment($row->id, 'com_jomtube');
} else {
$jomtubeCommentingSystemCode = '<b>You must install JomComment component to use comment function</b>';
}
}
//integrate commenting system with JComment
if ($c->commenting_system == 'JComment') {
if (file_exists(JPATH_SITE . DS . 'components/com_jcomments/jcomments.php')) {
require_once JPATH_SITE . DS . 'components/com_jcomments/jcomments.php';
$jomtubeCommentingSystemCode = JComments::showComments($row->id, 'com_jomtube', $row->video_title);
} else {
$jomtubeCommentingSystemCode = '<b>You must install JComment component to use comment function</b>';
}
}
}
return $jomtubeCommentingSystemCode;
}
示例3: onBeforeDisplayProductView
function onBeforeDisplayProductView(&$view)
{
$comments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once $comments;
$view->_tmp_product_html_before_review = '<div class="jcomments_comment">' . JComments::showComments($view->product->product_id, 'com_jshopping', $view->product->name) . '</div>';
}
}
示例4: ADSonContentAfterDisplay
/**
* JComments before display content method
*
* Method is called by the view and the results are imploded and displayed in a placeholder
*
* @param object The content params
*/
public function ADSonContentAfterDisplay($content)
{
// add JComments
$comments = JPATH_ROOT.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
if (is_file($comments)) {
require_once($comments);
return JComments::showComments($content->id, 'com_adsmanager', htmlspecialchars($content->ad_headline));
}
}
示例5: TZPortfolioJComment
function TZPortfolioJComment($context, &$article, &$params, $page = 0)
{
$html = null;
$comments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once $comments;
if (class_exists('JComments')) {
$html = '<div class="tz_portfolio_comment">';
$html .= JComments::showComments($article->id, 'com_tz_portfolio', $article->title);
$html .= '</div>';
}
} else {
$html = '<div class="tz_comment_notice">';
$html .= JText::_('COM_TZ_PORTFOLIO_COMMENT_NOTICE');
$html .= '</div>';
}
return $html;
}
示例6: onEventEnd
/**
* This method handles the supported comment systems
*
* @access public
* @param int $event_id Integer Event identifier
* @param int $event_title String Event title
* @return boolean
*
*/
public function onEventEnd($event_id, $event_title = '')
{
//simple, skip if processing not needed
if (!$this->params->get('commentsystem', '0')) {
return '';
}
$res = '';
//jcomments integration
if ($this->params->get('commentsystem') == 1) {
if (file_exists(JPATH_SITE . '/components/com_jcomments/jcomments.php')) {
require_once JPATH_SITE . '/components/com_jcomments/jcomments.php';
$res .= '<div class="jcomments">';
$res .= JComments::showComments($event_id, 'com_jem', $event_title);
$res .= '</div>';
}
}
return $res;
}
示例7: onEventDetailsEnd
/**
* This method handles the supported comment systems
*
* @access public
* @param int $event_id Integer Event identifier
* @param int $event_title String Event title
* @return boolean
* @since 1.0
*/
public function onEventDetailsEnd($event_id, $event_title = '')
{
//simple, skip if processing not needed
if (!$this->params->get('commentsystem', '0')) {
return '';
}
$res = '';
//jomcomment integration
if ($this->params->get('commentsystem') == 1) {
if (file_exists(JPATH_SITE . DS . 'plugins' . DS . 'content' . DS . 'jom_comment_bot.php')) {
require_once JPATH_SITE . DS . 'plugins' . DS . 'content' . DS . 'jom_comment_bot.php';
$res .= '<div class="elcomments">';
$res .= jomcomment($event_id, 'com_eventlist');
$res .= '</div>';
}
}
//jcomments integration
if ($this->params->get('commentsystem') == 2) {
if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php')) {
require_once JPATH_SITE . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
$res .= '<div class="elcomments">';
$res .= JComments::showComments($event_id, 'com_eventlist', $event_title);
$res .= '</div>';
}
}
//JXtended Comments integration
if ($this->params->get('commentsystem') == 3) {
if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_comments' . DS . 'helpers' . DS . 'html' . DS . 'comments.php')) {
require_once JPATH_SITE . DS . 'components' . DS . 'com_comments' . DS . 'helpers' . DS . 'html' . DS . 'comments.php';
$res .= '<div class="elcomments">';
// display sharing
$res .= JHtml::_('comments.share', substr($_SERVER['REQUEST_URI'], 1), $event_title);
// display ratings
$res .= JHtml::_('comments.rating', 'eventlist', $event_id, 'index.php?option=com_eventlist&view=details&id=' . $event_id, substr($_SERVER['REQUEST_URI'], 1), $event_title);
// display comments
$res .= JHtml::_('comments.comments', 'eventlist', $event_id, 'index.php?option=com_eventlist&view=details&id=' . $event_id, substr($_SERVER['REQUEST_URI'], 1), $event_title);
$res .= '<style type="text/css">';
$res .= 'div#respond-container dt { float: none;border-bottom: medium none;padding: 0;width: auto;}';
$res .= '</style>';
$res .= '</div>';
}
}
return $res;
}
示例8: getjomtubecomments
function getjomtubecomments($id)
{
global $mosConfig_absolute_path, $Itemid;
require $mosConfig_absolute_path . '/components/com_jomtube/includes/jomtube_permissions.php';
require $mosConfig_absolute_path . "/administrator/components/com_jomtube/jomtube_config.php";
$comments = "";
if ($showcomments == "yes") {
if ($commentingsystem == "jcomments") {
$comments = $mosConfig_absolute_path . '/components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once $comments;
$comments = JComments::showComments($id, 'com_jomtube', '');
}
} else {
if ($commentingsystem == "jomcomment") {
$jomcommentfile = $mosConfig_absolute_path . "/mambots/content/jom_comment_bot.php";
if (file_exists($jomcommentfile)) {
include_once $jomcommentfile;
$comments = jomcomment($id, "com_jomtube");
$comments .= "<div id=\"jomtubefbdiscussinput\"></div><div id=\"toggle\"></div>";
}
} else {
if ($commentingsystem == "fireboard") {
if ($showcomments == "yes") {
$comments = jomtubefbforum($id);
}
if ($comments == "") {
$comments = "<div id=\"jomtubefbdiscussinput\"></div><div id=\"toggle\"></div>";
}
} else {
if ($commentingsystem == "nocomment") {
$comments = "<div id=\"jomtubefbdiscussinput\"></div><div id=\"toggle\"></div>";
}
}
}
}
}
return $comments;
}
示例9: comments
public static function comments($torrent_id, $torrent_name)
{
$db = JFactory::getDBO();
$params = JComponentHelper::getParams('com_tracker');
if ($params->get('comment_system') == 'jcomments') {
$comments = JPATH_SITE . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once $comments;
echo JComments::showComments($torrent_id, 'com_tracker', $torrent_name);
}
}
}
示例10:
$this->parser->setVar('body', $announce['body']);
}
if (FSS_Settings::get('glossary_announce')) {
$this->parser->setVar('fulltext', FSS_Glossary::ReplaceGlossary($announce['fulltext']));
} else {
$this->parser->setVar('fulltext', $announce['fulltext']);
}
echo $this->parser->Parse();
if (FSS_Settings::get('announce_comments_allow') == 1) {
$this->comments->DisplayComments();
} else {
if (FSS_Settings::get('announce_comments_allow') == 2) {
$comments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once $comments;
echo JComments::showComments($announce['id'], 'com_fss_announce', $announce['title']);
}
}
}
?>
<?php
include JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . '_powered.php';
?>
<?php
if (FSS_Settings::get('glossary_announce')) {
echo FSS_Glossary::Footer();
}
?>
示例11: defined
<?php
defined('_JEXEC') or die('Restricted access');
?>
<div id="<?php
echo $this->mode;
?>
_jcomments_wrapper<?php
echo $this->uniqueid;
?>
" class="<?php
echo $this->mode;
?>
_jcomments_wrapper">
<?php
if ($this->mode == 'main' || $this->profile->allow_comments != 2) {
$jcommentsPath = JPATH_SITE . '/components/com_jcomments/jcomments.php';
if (file_exists($jcommentsPath)) {
include_once $jcommentsPath;
echo JComments::showComments($this->photoList[0]->id, 'com_igallery', $this->mode . '-' . $this->photoList[0]->filename);
}
}
?>
</div>
示例12: 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':
//.........这里部分代码省略.........
示例13:
if ($this->tmpl['mb_tags'] && $this->tmpl['displaying_tags_output'] != '') {
echo '<div class="pg-multibox-tags-box">';
echo '<div class="pg-multibox-tags" >' . JText::_('COM_PHOCAGALLERY_TAGS') . '</div>';
echo '<div class="pg-detail-tags-multibox">' . $this->tmpl['displaying_tags_output'] . '</div>';
echo '</div>';
}
// Comments
if ($this->tmpl['mb_comments']) {
echo '<div class="pg-multibox-comments">';
if ((int) $this->tmpl['externalcommentsystem'] == 2) {
echo $this->loadTemplate('comments-fb');
} else {
if ((int) $this->tmpl['externalcommentsystem'] == 1) {
if (JComponentHelper::isEnabled('com_jcomments', true)) {
include_once JPATH_BASE . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
echo JComments::showComments($this->item->id, 'com_phocagallery_images', JText::_('COM_PHOCAGALLERY_IMAGE') . ' ' . $this->item->title);
}
} else {
$src = JRoute::_('index.php?option=com_phocagallery&view=comment&catid=' . $this->item->catid . '&id=' . $this->item->id . '&tmpl=component&commentsi=1&Itemid=' . $this->itemId);
echo '<iframe src="' . $src . '" width="' . $this->tmpl['multibox_comments_width'] . '" height="' . $this->tmpl['multibox_comments_height'] . '" frameborder="0" class="pg-multibox-comments-iframe" name="pgcomment"></iframe>' . "\n";
}
}
echo '</div>';
}
echo '</div>' . "\n";
echo '</td>' . "\n";
echo '</tr>' . "\n";
echo '</table>' . "\n";
echo '</div>' . "\n";
if ($this->tmpl['detailwindow'] == 7) {
echo '<p> </p>';
示例14: Date
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<?php
} elseif ($sytem_comment == 'jacomment' && $this->jacomment) {
?>
{jacomment contentid=<?php
echo $item->id;
?>
option=com_javoice contenttitle=<?php
echo $item->title;
?>
}
<?php
} elseif ($sytem_comment == 'jcomments' && $this->jcomments) {
$comments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once $comments;
echo JComments::showComments($item->id, 'com_javoice', $item->title);
}
}
}
}
?>
示例15: jomcomment
}
?>
</tbody>
</table>
<?php
}
$comments = $this->params->get('show_comments', '0');
if ($comments != 0) {
$jcomments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
$jomcomment = JPATH_SITE . '/plugins/content/jom_comment_bot.php';
$jxcomments = JPATH_SITE . '/components/com_comments/comments.php';
$jacomments1 = JPATH_SITE . '/components/com_jacomment/jacomment.php';
$jacomments2 = JPATH_SITE . '/plugins/system/jacomment.php';
if ($comments == 1 && file_exists($jcomments)) {
require_once $jcomments;
echo JComments::showComments($this->poll->id, 'com_acepolls', $this->poll->title);
}
if ($comments == 2 && file_exists($jomcomment)) {
require_once $jomcomment;
echo jomcomment($this->poll->id, "com_acepolls");
}
if ($comments == 3 && file_exists($jxcomments)) {
$url = 'index.php?option=com_acepolls&view=poll&id=' . (int) $this->poll->id;
$route = $url . ':' . $this->poll->alias . '&Itemid=' . JRequest::getInt('Itemid');
JHTML::addIncludePath(JPATH_SITE . '/components/com_comments/helpers/html');
JHTML::_('comments.comments', 'acepolls', $this->poll->id, $url, $route, $this->poll->title);
}
if ($comments == 4 && file_exists($jacomments1) && file_exists($jacomments2) && !JRequest::getInt('print')) {
$_jacCode = "#{jacomment(.*?) contentid=(.*?) option=(.*?) contenttitle=(.*?)}#i";
$_jacCodeDisableid = "#{jacomment(\\s)off.*}#i";
$_jacCodeDisable = "#{jacomment(\\s)off}#i";