Esempio n. 1
0
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 '';
}
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 /**
  * 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);
 }
 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;
 }
Esempio n. 5
0
 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>';
     }
 }
Esempio n. 6
0
 /**
  * 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;
     }
 }
Esempio n. 7
0
	/**
	 * 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));
		}
	}
Esempio n. 8
0
 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;
 }
Esempio n. 9
0
 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);
             }
         }
     }
 }
Esempio n. 10
0
 /**
  * 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;
     }
 }
Esempio n. 11
0
 /**
  * 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;
 }
Esempio n. 12
0
 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;
 }
Esempio n. 13
0
 /**
  * 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;
 }
Esempio n. 14
0
 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;
 }
Esempio n. 15
0
 /**
  * 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 '';
 }
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;
}
Esempio n. 17
0

<?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>
Esempio n. 18
0
 public function getJcommentEditor($product = array(), $data_add = "")
 {
     $app = JFactory::getApplication();
     $product_reviews = "";
     $product_id = $product->product_id;
     if ($product_id && !strstr($data_add, "{jcomments off}") && strstr($data_add, "{jcomments on}")) {
         $comments = $app->getCfg('absolute_path') . '/components/com_jcomments/jcomments.php';
         if (file_exists($comments)) {
             require_once $comments;
             $product_reviews = JComments::showComments($product_id, 'com_redshop', $product->product_name);
         }
         $data_add = str_replace("{jcomments on}", $product_reviews, $data_add);
     }
     $data_add = str_replace("{jcomments on}", $product_reviews, $data_add);
     $data_add = str_replace("{jcomments off}", "", $data_add);
     return $data_add;
 }
Esempio n. 19
0
	
	
	<?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 
    }
    ?>
Esempio n. 20
0
 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;
 }
Esempio n. 21
0
    }
    ?>
	</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";
Esempio n. 22
0
					$o .= '<input class="btn btn-success" type="button" name="submit" onClick="location.href=\''.$v->link_external.'\';" id="pdlicensesubmit" value="'.JText::_('COM_PHOCADOWNLOAD_DOWNLOAD').'" />';
				} else {
					$o .= '<form action="'.htmlspecialchars($this->t['action']).'" method="post" name="phocaDownloadForm" id="phocadownloadform">';
					$o .= '<input class="btn btn-success" type="submit" name="submit" id="pdlicensesubmit" value="'.JText::_('COM_PHOCADOWNLOAD_DOWNLOAD').'" />';
					$o .= '<input type="hidden" name="license_agree" value="1" />';
					$o .= '<input type="hidden" name="download" value="'.$v->id.'" />';
					$o .= '<input type="hidden" name="'. JSession::getFormToken().'" value="1" />';
				}
				$o .= '</form>';
			}

			
			if ($this->t['display_file_comments'] == 1) {
				if (JComponentHelper::isEnabled('com_jcomments', true)) {
					include_once(JPATH_BASE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php');
					$o .= JComments::showComments($v->id, 'com_phocadownload_files', JText::_('COM_PHOCADOWNLOAD_FILE') .' '. $v->title);
				}
			}
			
			if ($this->t['display_file_comments'] == 2) {
				$o .= '<div class="pd-fbcomments">'.$this->loadTemplate('comments-fb').'</div>';
			}
			
			echo '<div class="row ">';
			echo '<div class="col-sm-12 col-md-12">';
			echo $o;
			echo '</div></div>'; // end col, end row
		
		} else {
			echo '<div class="row ">';
			echo '<div class="col-sm-12 col-md-12">';
Esempio n. 23
0
 public static function showComments($object_id, $object_group = 'com_content', $object_title = '')
 {
     return JComments::show($object_id, $object_group, $object_title);
 }
Esempio n. 24
0
                    ?>
                                    <?php 
                }
                ?>

                                    <?php 
                if ($params->get('tz_comment_type') == 'jcomment') {
                    ?>
                                        <?php 
                    $comments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
                    if (file_exists($comments)) {
                        require_once $comments;
                        if (class_exists('JComments')) {
                            ?>
                                                    <span itemprop="commentCount"><?php 
                            echo JComments::getCommentsCount((int) $row->id, 'com_tz_portfolio');
                            ?>
</span>
                                        <?php 
                        }
                    }
                    ?>
                                    <?php 
                }
                ?>
                                    <?php 
                if ($params->get('tz_comment_type') == 'disqus') {
                    ?>
                                        <?php 
                    if (isset($row->commentCount)) {
                        ?>
Esempio n. 25
0
            ?>
                <?php 
        }
        ?>

                <?php 
        if ($params->get('tz_comment_type') == 'jcomment') {
            ?>
                    <?php 
            $comments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
            if (file_exists($comments)) {
                require_once $comments;
                if (class_exists('JComments')) {
                    ?>
                        <span itemprop="commentCount"><?php 
                    echo JComments::getCommentsCount((int) $this->item->id, 'com_tz_portfolio');
                    ?>
</span>
                    <?php 
                }
            }
            ?>
                <?php 
        }
        ?>


            </span>
        <?php 
    }
    ?>
Esempio n. 26
0
			<?php 
        $this->escape(JText::printf($this->escape($this->article->created_by_alias) ? $this->escape($this->article->created_by_alias) : $this->escape($this->article->author)));
        ?>

		</span>
	<?php 
    }
    ?>


	<?php 
    $comments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
    if (file_exists($comments)) {
        require_once $comments;
        if (JCommentsContentPluginHelper::checkCategory($this->article->catid) && (JCommentsContentPluginHelper::isEnabled($this->article, false) || !JCommentsContentPluginHelper::isDisabled($this->article, false))) {
            $jcomment_count = JComments::getCommentsCount($this->article->id, 'com_content');
            ?>

	
		<a class="comments" href="<?php 
            echo $this->article->readmore_link;
            ?>
#comments"><?php 
            echo $jcomment_count;
            ?>
 <?php 
            echo JText::_('COMMENTS');
            ?>
</a>
			
	<?php 
Esempio n. 27
0
    function getJComments($content, $config)
    {
        //
        $db = JFactory::getDBO();
        $counters_tab = array();
        //
        if (count($content) > 0) {
            // initializing variables
            $sql_where = '';
            $ids = $content['ID'];
            //
            for ($i = 0; $i < count($ids); $i++) {
                // linking string with content IDs
                $sql_where .= $i != 0 ? ' OR content.id = ' . $ids[$i] : ' content.id = ' . $ids[$i];
            }
            // creating SQL query
            $query_news = '
		   SELECT
		   		content.id AS id
		   FROM
		        #__k2_items AS content
		   WHERE
		        ( ' . $sql_where . ' )
		   ;';
            // run SQL query
            $db->setQuery($query_news);
            // when exist some results
            if ($counters = $db->loadObjectList()) {
                $comments = JPATH_BASE . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
                // generating tables of news data
                if (file_exists($comments)) {
                    require_once $comments;
                    foreach ($counters as $item) {
                        $item->count = JComments::getCommentsCount($item->id, 'com_k2');
                        $counters_tab['art' . $item->id] = $item->count;
                    }
                } else {
                    foreach ($counters as $item) {
                        $counters_tab['art' . $item->id] = 0;
                    }
                }
            }
        }
        return $counters_tab;
    }
Esempio n. 28
0
</legend>
<table>
	<?php 
    foreach ($this->mail->attachments as $attachment) {
        echo '<tr><td><a href="' . $attachment->url . '" target="_blank">' . $attachment->name . '</a></td></tr>';
    }
    ?>
</table>
</fieldset>
<?php 
}
if ($this->config->get('comments_feature') == 'jcomments') {
    $comments = ACYMAILING_ROOT . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
    if (file_exists($comments)) {
        require_once $comments;
        echo JComments::showComments($this->mail->mailid, 'com_acymailing', $this->mail->subject);
    }
} elseif ($this->config->get('comments_feature') == 'jomcomment') {
    $comments = ACYMAILING_ROOT . 'plugins' . DS . 'content' . DS . 'jom_comment_bot.php';
    if (file_exists($comments)) {
        require_once $comments;
        echo jomcomment($this->mail->mailid, 'com_acymailing');
    }
} elseif ($this->config->get('comments_feature') == 'disqus') {
    $disqus_shortname = $this->config->get('disqus_shortname');
    if (!empty($disqus_shortname)) {
        $lang = JFactory::getLanguage();
        $lang_shortcode = explode('-', $lang->getTag());
        ?>
			<div style="clear:both;"></div><div id="disqus_thread"></div>
			<script type="text/javascript">
Esempio n. 29
0
 function getCommentsTree($object_id, $object_group = 'com_content', $search_text = '')
 {
     global $my;
     $object_id = (int) $object_id;
     $object_group = trim($object_group);
     $acl =& JCommentsFactory::getACL();
     $dbo =& JCommentsFactory::getDBO();
     $config =& JCommentsFactory::getConfig();
     $canPublish = $acl->canPublish();
     $canComment = $acl->canComment();
     $where = '';
     if ($search_text) {
         $words = explode(' ', $search_text);
         $wheres = array();
         foreach ($words as $word) {
             $wheres2 = array();
             $wheres2[] = "LOWER(name) LIKE '%{$word}%'";
             $wheres2[] = "LOWER(comment) LIKE '%{$word}%'";
         }
         if (isset($wheres2) && count($wheres2)) {
             $where .= ' AND (';
             $where .= implode(' OR ', $wheres2);
             $where .= ' )';
         }
     }
     if ($canComment == 0) {
         $total = JLMS_JComments::getCommentsCount($object_id, $object_group, $where);
         if ($total == 0) {
             return '';
         }
     }
     $query = "SELECT c.id, c.parent, c.object_id, c.object_group, c.userid, c.name, c.username, c.title, c.comment" . "\n , c.email, c.homepage, c.date as datetime, c.ip, c.published, c.checked_out, c.checked_out_time" . "\n , c.isgood, c.ispoor" . "\n , v.value as voted" . "\n FROM #__jcomments AS c" . "\n LEFT JOIN #__jcomments_votes AS v ON c.id = v.commentid " . ($my->id ? " AND  v.userid = " . $my->id : " AND  v.ip = '" . $acl->getUserIP() . "'") . "\n WHERE c.object_id = " . $object_id . "\n AND c.object_group = '" . $object_group . "'" . (JCommentsMultilingual::isEnabled() ? "\nAND c.lang = '" . JCommentsMultilingual::getLanguage() . "'" : "") . ($canPublish == 0 ? "\nAND c.published = 1" : "") . $where . "\n ORDER BY c.parent, c.date ASC";
     $dbo->setQuery($query);
     $rows = $dbo->loadObjectList();
     $tmpl =& JCommentsFactory::getTemplate($object_id, $object_group);
     $tmpl->load('tpl_tree');
     $tmpl->load('tpl_comment');
     if (count($rows)) {
         $isLocked = $config->getInt('object_locked', 0) == 1;
         $tmpl->addVar('tpl_tree', 'comments-refresh', intval(!$isLocked));
         $tmpl->addVar('tpl_tree', 'comments-rss', intval($config->getInt('enable_rss') && !$isLocked));
         $tmpl->addVar('tpl_tree', 'comments-can-subscribe', intval($my->id && $acl->check('enable_subscribe') && !$isLocked));
         if ($my->id && $acl->check('enable_subscribe')) {
             require_once JCOMMENTS_BASE . DS . 'jcomments.subscription.php';
             $manager =& JCommentsSubscriptionManager::getInstance();
             $isSubscribed = $manager->isSubscribed($object_id, $object_group, $my->id);
             $tmpl->addVar('tpl_tree', 'comments-user-subscribed', $isSubscribed);
         }
         $i = 1;
         if ($config->getInt('enable_mambots') == 1) {
             require_once JCOMMENTS_HELPERS . DS . 'plugin.php';
             JCommentsPluginHelper::importPlugin('jcomments');
             JCommentsPluginHelper::trigger('onBeforeDisplayCommentsList', array(&$rows));
             if ($acl->check('enable_gravatar')) {
                 JCommentsPluginHelper::trigger('onPrepareAvatars', array(&$rows));
             }
         }
         require_once JCOMMENTS_LIBRARIES . DS . 'joomlatune' . DS . 'tree.php';
         $tree = new JoomlaTuneTree($rows);
         $items = $tree->get();
         foreach ($rows as $row) {
             if ($config->getInt('enable_mambots') == 1) {
                 JCommentsPluginHelper::trigger('onBeforeDisplayComment', array(&$row));
             }
             // run autocensor, replace quotes, smiles and other pre-view processing
             JComments::prepareComment($row);
             // setup toolbar
             if (!$acl->canModerate($row)) {
                 $tmpl->addVar('tpl_comment', 'comments-panel-visible', 0);
             } else {
                 $tmpl->addVar('tpl_comment', 'comments-panel-visible', 1);
                 $tmpl->addVar('tpl_comment', 'button-edit', $acl->canEdit($row));
                 $tmpl->addVar('tpl_comment', 'button-delete', $acl->canDelete($row));
                 $tmpl->addVar('tpl_comment', 'button-publish', $acl->canPublish($row));
                 $tmpl->addVar('tpl_comment', 'button-ip', $acl->canViewIP($row));
             }
             $tmpl->addVar('tpl_comment', 'comment-show-vote', $config->getInt('enable_voting'));
             $tmpl->addVar('tpl_comment', 'comment-show-email', $acl->canViewEmail($row));
             $tmpl->addVar('tpl_comment', 'comment-show-homepage', $acl->canViewHomepage($row));
             $tmpl->addVar('tpl_comment', 'comment-show-title', $config->getInt('comment_title'));
             $tmpl->addVar('tpl_comment', 'button-vote', $acl->canVote($row));
             $tmpl->addVar('tpl_comment', 'button-quote', $acl->canQuote($row));
             $tmpl->addVar('tpl_comment', 'button-reply', $acl->canReply($row));
             $tmpl->addVar('tpl_comment', 'avatar', $acl->check('enable_gravatar'));
             if (isset($items[$row->id])) {
                 $tmpl->addVar('tpl_comment', 'comment-number', '');
                 $tmpl->addObject('tpl_comment', 'comment', $row);
                 $items[$row->id]->html = $tmpl->renderTemplate('tpl_comment');
                 $i++;
             }
         }
         $tmpl->addObject('tpl_tree', 'comments-items', $items);
         unset($rows);
     }
     return $tmpl->renderTemplate('tpl_tree');
 }
Esempio n. 30
0
	function onAfterDisplayContent(&$article, &$params, $limitstart = 0)
	{
		if ($this->params->get('show_comments_event', 'onAfterDisplayContent') == 'onAfterDisplayContent') {
			require_once (JCOMMENTS_HELPERS . '/content.php');
			$view = JRequest::getCmd('view');

			// check whether plugin has been unpublished
			if (!JPluginHelper::isEnabled('content', 'jcomments')
					|| ($view != 'article')
					|| $params->get('intro_only')
					|| $params->get('popup')
					|| JRequest::getBool('fullview')
					|| JRequest::getVar('print')) {
				JCommentsContentPluginHelper::clear($article, true);
				return '';
			}

			require_once (JCOMMENTS_BASE . '/jcomments.php');

			$config = JCommentsFactory::getConfig();
			$isEnabled = ($config->getInt('comments_on', 0) == 1) && ($config->getInt('comments_off', 0) == 0);

			if ($isEnabled && $view == 'article') {
				JCommentsContentPluginHelper::clear($article, true);
				return JComments::show($article->id, 'com_content', $article->title);
			}
		}
		return '';
	}