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

PHP JComments类代码示例

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

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



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

示例1: plgContentJCommentsViewJ10

function plgContentJCommentsViewJ10(&$row, &$params, $page = 0)
{
    global $task, $option;
    if (!isset($params)) {
        $params = new mosParameters('');
    }
    $pvars = array_keys(get_object_vars($params->_params));
    if ($params->get('popup') || in_array('moduleclass_sfx', $pvars)) {
        return '';
    }
    if (isset($GLOBALS['jcomments_params_readmore']) && isset($GLOBALS['jcomments_row_readmore'])) {
        $params->set('readmore', $GLOBALS['jcomments_params_readmore']);
        $row->readmore = $GLOBALS['jcomments_row_readmore'];
    }
    require_once JCOMMENTS_BASE . '/jcomments.php';
    require_once JCOMMENTS_HELPERS . '/content.php';
    JCommentsContentPluginHelper::processForeignTags($row, false, false);
    if (JCommentsContentPluginHelper::isDisabled($row)) {
        return '';
    }
    if ($task == 'view' && (JCommentsContentPluginHelper::checkCategory($row->catid) || JCommentsContentPluginHelper::isEnabled($row))) {
        if (JCommentsContentPluginHelper::isLocked($row)) {
            $config = JCommentsFactory::getConfig();
            $config->set('comments_locked', 1);
        }
        return JComments::show($row->id, 'com_content', $row->title);
    } else {
        if ($option == 'com_events' && $task == 'view_detail') {
            return JComments::show($row->id, 'com_events', $row->title);
        }
    }
    return '';
}
开发者ID:sergy444,项目名称:joomla,代码行数:33,代码来源:jcomments.j10.php


示例2: getList

 public static function getList($params)
 {
     $db = JFactory::getDBO();
     $db->setQuery("SELECT * FROM #__jcomments ORDER BY date DESC", 0, $params->get('count'));
     $items = $db->loadObjectList();
     if (!is_array($items)) {
         $items = array();
     }
     if (count($items)) {
         $config = JCommentsFactory::getConfig();
         $bbcode = JCommentsFactory::getBBCode();
         $limit_comment_text = (int) $params->get('limit_comment_text', 0);
         foreach ($items as &$item) {
             $item->link = 'index.php?option=com_jcomments&&view=comment&layout=edit&id=' . $item->id;
             $item->author = JComments::getCommentAuthorName($item);
             $text = JCommentsText::censor($item->comment);
             $text = $bbcode->filter($text, true);
             $text = JCommentsText::cleanText($text);
             if ($limit_comment_text && JString::strlen($text) > $limit_comment_text) {
                 $text = self::truncateText($text, $limit_comment_text - 1);
             }
             $item->comment = $text;
         }
     }
     return $items;
 }
开发者ID:enjoy2000,项目名称:smcd,代码行数:26,代码来源:helper.php


示例3: 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);
 }
开发者ID:tamlen,项目名称:WordBridge,代码行数:64,代码来源:view.html.php


示例4: 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;
 }
开发者ID:plexicloud,项目名称:Plexicloud-Pleximedia,代码行数:26,代码来源:toolsHelpers.php


示例5: 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>';
     }
 }
开发者ID:aldegtyarev,项目名称:vip-kvartira,代码行数:8,代码来源:jcomments.php


示例6: onMatchComments

 /**
  * adds comments to a match (independent if they were made before or after the match)
  * @param object match
  * @param string title
  * @return boolean true on success
  */
 public function onMatchComments(&$match, $title, &$html)
 {
     $separate_comments = $this->params->get('separate_comments', 0);
     if ($separate_comments == 0) {
         $html = '<div class="jlgcomments">' . JComments::show($match->id, 'com_joomleague', $title) . '</div>';
         return true;
     }
 }
开发者ID:hfmprs,项目名称:JoomLeague,代码行数:14,代码来源:joomleague_comments.php


示例7: 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));
		}
	}
开发者ID:networksoft,项目名称:seekerplus2.com,代码行数:16,代码来源:jcomments.php


示例8: getCommentPage

 public function getCommentPage($object_id, $object_group, $comment_id)
 {
     $result = 0;
     if ($this->commentsPerPage > 0) {
         $compare = $this->commentsOrder == 'DESC' ? '>=' : '<=';
         $prev = JComments::getCommentsCount($object_id, $object_group, "\n id " . $compare . " " . $comment_id);
         $result = max(ceil($prev / $this->commentsPerPage), 1);
     }
     return $result;
 }
开发者ID:carmerin,项目名称:cesae-web,代码行数:10,代码来源:pagination.php


示例9: onAfterRoute

 function onAfterRoute()
 {
     include_once JPATH_ROOT . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.legacy.php';
     $mainframe =& JFactory::getApplication('site');
     $mainframe->getRouter();
     $document =& JFactory::getDocument();
     if ($document->getType() == 'pdf') {
         return;
     }
     if ($mainframe->isAdmin()) {
         $document->addStyleSheet(JURI::base() . 'components/com_jcomments/assets/icon.css?v=2');
         $option = JAdministratorHelper::findOption();
         $task = JRequest::getCmd('task');
         $type = JRequest::getCmd('type', '', 'post');
         // remove comments if content item deleted from trash
         if ($option == 'com_trash' && $task == 'delete' && $type == 'content') {
             $cid = JRequest::getVar('cid', array(0), 'post', 'array');
             JArrayHelper::toInteger($cid, array(0));
             include_once JPATH_ROOT . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
             JComments::deleteComments($cid, 'com_content');
         }
     } else {
         $option = JRequest::getCmd('option');
         if ($option == 'com_content' || $option == 'com_alphacontent') {
             include_once JCOMMENTS_BASE . DS . 'jcomments.class.php';
             include_once JCOMMENTS_BASE . DS . 'jcomments.config.php';
             include_once JCOMMENTS_HELPERS . DS . 'system.php';
             // include JComments CSS
             if ($this->params->get('disable_template_css', 0) == 0) {
                 $document->addStyleSheet(JCommentsSystemPluginHelper::getCSS());
                 $language =& JFactory::getLanguage();
                 if ($language->isRTL()) {
                     $rtlCSS = JCommentsSystemPluginHelper::getCSS(true);
                     if ($rtlCSS != '') {
                         $document->addStyleSheet($rtlCSS);
                     }
                 }
             }
             if (!defined('JCOMMENTS_CSS')) {
                 define('JCOMMENTS_CSS', 1);
             }
             $config =& JCommentsCfg::getInstance();
             // include JComments JavaScript library
             $document->addScript(JCommentsSystemPluginHelper::getCoreJS());
             if (!defined('JOOMLATUNE_AJAX_JS')) {
                 $document->addScript(JCommentsSystemPluginHelper::getAjaxJS());
                 define('JOOMLATUNE_AJAX_JS', 1);
             }
             if (!defined('JCOMMENTS_JS')) {
                 define('JCOMMENTS_JS', 1);
             }
         }
     }
 }
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:54,代码来源:jcomments.php


示例10: onMatchComments

 /**
  * adds comments to a match (independent if they were made before or after the match)
  * @param object match
  * @param string title
  * @return boolean true on success
  */
 public function onMatchComments(&$match, $title, &$html)
 {
     // load plugin params info
     $plugin =& JPluginHelper::getPlugin('content', 'joomleague_comments');
     $pluginParams = new JParameter($plugin->params);
     $separate_comments = $pluginParams->get('separate_comments', 0);
     if ($separate_comments == 0) {
         $comments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
         if (file_exists($comments)) {
             require_once $comments;
             $html = '<div class="jlgcomments">' . JComments::show($match->id, 'com_joomleague', $title) . '</div>';
             return true;
         }
         return false;
     }
 }
开发者ID:Heart1010,项目名称:JoomLeague,代码行数:22,代码来源:joomleague_comments.php


示例11: 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;
 }
开发者ID:JKoelman,项目名称:JEM-3,代码行数:27,代码来源:comments.php


示例12: 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;
 }
开发者ID:Glonum,项目名称:tz_portfolio,代码行数:18,代码来源:tz_portfolio_comment.php


示例13: 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;
 }
开发者ID:julienV,项目名称:testrepo,代码行数:53,代码来源:comments.php


示例14: onK2CommentsCounter

 public function onK2CommentsCounter(&$item, &$params, $limitstart)
 {
     $result = '';
     $commentsAPI = JPATH_SITE . '/components/com_jcomments/jcomments.php';
     if (is_file($commentsAPI)) {
         require_once $commentsAPI;
         $count = JComments::getCommentsCount($item->id, 'com_k2');
         if ($count == 0) {
             $link = $item->link . '#addcomments';
             $text = JText::_('PLG_K2_JCOMMENTS_LINK_ADD_COMMENT');
         } else {
             $link = $item->link . '#comments';
             $text = JText::sprintf('PLG_K2_JCOMMENTS_LINK_READ_COMMENTS', $count);
         }
         $anchor_css = $this->params->get('anchor_css');
         $class = empty($anchor_css) ? '' : ' class="' . $anchor_css . '"';
         $result = '<a href="' . $link . '"' . $class . ' title="' . $text . '">' . $text . '</a>';
     }
     return $result;
 }
开发者ID:enjoy2000,项目名称:smcd,代码行数:20,代码来源:jcomments.php


示例15: onContentAfterDisplay

 /**
  * We display Jcomments tpl, regarding the plugin config and the display config set previously
  * 
  * @author Florian Voutzinos
  * @param string $context
  * @param object reference $product virtuemart product object
  * @param object reference $params 
  * @param int $limitstart
  * @return string JComments display
  */
 function onContentAfterDisplay($context, &$product, &$params, $limitstart = 0)
 {
     // If the trigger comes from virtuemart productdetails and the plugin is activated in the config
     if ($context == 'com_virtuemart.productdetails' && $this->params->get('plugin_activated')) {
         // Do not display comments in modules
         $data = $params->toArray();
         if (isset($data['moduleclass_sfx'])) {
             return '';
         }
         // Display the comments if enabled
         if (VmJcommentsHelperPlugin::areCommentsEnabled()) {
             if (!class_exists('JComments')) {
                 require JCOMMENTS_BASE . '/jcomments.php';
             }
             return JComments::show($product->virtuemart_product_id, 'com_virtuemart', $product->product_name);
         }
         return '';
     }
     return '';
 }
开发者ID:romuland,项目名称:khparts,代码行数:30,代码来源:vmjcomments.php


示例16: 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;
}
开发者ID:plexicloud,项目名称:Plexicloud-Pleximedia,代码行数:39,代码来源:jomtube_remotevideo.php


示例17: require_once



<?php 
$user = JFactory::getUser();
$userid = $user->get('id');
$groups = JAccess::getGroupsByUser($userid);
if(in_array(23, $groups) || in_array(8, $groups))
{

    ?>
    <div class="box_info_contenuto row">
        <?php
            // global $mosConfig_absolute_path;
        $comments = JPATH_BASE   . '/components/com_jcomments/jcomments.php';
        require_once($comments);
        echo JComments::showComments($id, 'com_gglms', $imgtitle);
        ?>

    </div>


    <?php
}
?>






</div>
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:29,代码来源:default_testuale.php


示例18: jomcomment

	
	
	<?php 
    echo $mainAreaTag == 'section' ? '</article>' : '';
    ?>
	
	<?php 
    if ($this->params->get('comments') && !JRequest::getVar('print')) {
        ?>
		<!-- BOF comments -->
		<div class="comments group">
		<?php 
        if ($this->params->get('comments') == 1) {
            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';
                echo JComments::showComments($item->id, 'com_flexicontent', $this->escape($item->title));
            }
        }
        if ($this->params->get('comments') == 2) {
            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';
                echo jomcomment($item->id, 'com_flexicontent');
            }
        }
        ?>
		</div>
		<!-- BOF comments -->
	<?php 
    }
    ?>
开发者ID:jakesyl,项目名称:flexicontent,代码行数:28,代码来源:modular.php


示例19: reportComment

 function reportComment()
 {
     if (JCommentsSecurity::badRequest() == 1) {
         JCommentsSecurity::notAuth();
     }
     $acl =& JCommentsFactory::getACL();
     $db =& JCommentsFactory::getDBO();
     $config =& JCommentsFactory::getConfig();
     $response =& JCommentsFactory::getAjaxResponse();
     $values = JCommentsAJAX::prepareValues($_POST);
     $id = (int) $values['commentid'];
     $reason = trim(strip_tags($values['reason']));
     $name = trim(strip_tags($values['name']));
     $ip = $acl->getUserIP();
     if ($reason == '') {
         JCommentsAJAX::showErrorMessage(JText::_('Please enter the reason for your report!'), '', 'comments-report-form');
         return $response;
     }
     $query = 'SELECT COUNT(*) FROM `#__jcomments_reports` WHERE commentid = ' . $id;
     if ($acl->getUserId()) {
         $query .= ' AND userid = ' . $acl->getUserId();
     } else {
         $query .= ' AND ip = "' . $ip . '"';
     }
     $db->setQuery($query);
     $reported = $db->loadResult();
     if (!$reported) {
         $query = 'SELECT COUNT(*) FROM `#__jcomments_reports` WHERE commentid = ' . $id;
         $db->setQuery($query);
         $reported = $db->loadResult();
         if (!$reported) {
             $comment = new JCommentsDB($db);
             if ($comment->load($id)) {
                 if ($acl->canReport($comment)) {
                     $allowed = true;
                     if ($config->getInt('enable_mambots') == 1) {
                         require_once JCOMMENTS_HELPERS . DS . 'plugin.php';
                         JCommentsPluginHelper::importPlugin('jcomments');
                         JCommentsPluginHelper::trigger('onReportComment', array(&$comment, &$response, &$allowed, &$value));
                     }
                     if ($allowed !== false) {
                         if ($acl->getUserId()) {
                             $user = JCommentsFactory::getUser();
                             $name = $user->name;
                         } else {
                             if ($name == '') {
                                 $name = JText::_('Guest');
                             }
                         }
                         $query = "INSERT INTO `#__jcomments_reports`(`commentid`,`userid`, `name`,`ip`,`date`,`reason`)" . "VALUES('" . $comment->id . "', '" . $acl->getUserId() . "', '" . $db->getEscaped($name) . "', '" . $db->getEscaped($ip) . "', now(), '" . $db->getEscaped($reason) . "')";
                         $db->setQuery($query);
                         $db->query();
                         if ($config->getInt('enable_notification') == 1) {
                             if ($config->check('notification_type', 2)) {
                                 $comment->datetime = $comment->date;
                                 if (is_string($comment->datetime)) {
                                     $comment->datetime = strtotime($comment->datetime);
                                 }
                                 JComments::sendReport($comment, $name, $reason);
                             }
                         }
                         $html = JText::_('Report successfully sent!');
                         $html = str_replace("\n", '\\n', $html);
                         $html = str_replace('\\n', '<br />', $html);
                         $html = JCommentsText::jsEscape($html);
                         $response->addScript("jcomments.closeReport('{$html}');");
                     }
                 } else {
                     JCommentsAJAX::showErrorMessage(JText::_('You have no rights to report comment!'), '', 'comments-report-form');
                 }
             } else {
                 $response->addAlert(JText::_('ERROR_NOT_FOUND'));
             }
             unset($comment);
         } else {
             JCommentsAJAX::showErrorMessage(JText::_('Comment already reported to the site administrator'), '', 'comments-report-form');
         }
     } else {
         JCommentsAJAX::showErrorMessage(JText::_('You can\'t report the same comment more than once!'), '', 'comments-report-form');
     }
     return $response;
 }
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:82,代码来源:jcomments.ajax.php


示例20: 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";
开发者ID:vuchannguyen,项目名称:dayhoc,代码行数:31,代码来源:default.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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