* Komento is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ defined( '_JEXEC' ) or die( 'Restricted access' ); ?> <?php // KURO THEME Komento::trigger( 'onBeforeProcessComment', array( 'component' => $row->component, 'cid' => $row->cid, 'comment' => &$row ) ); // Process data Komento::import( 'helper', 'comment' ); $row = KomentoCommentHelper::process( $row ); Komento::trigger( 'onAfterProcessComment', array( 'component' => $row->component, 'cid' => $row->cid, 'comment' => &$row ) ); // Construct classes for this row $classes = array(); $classes[] = 'kmt-item'; // Usergroup CSS classes if( $row->author->guest ) { $classes[] = $system->config->get( 'layout_css_public' ); } else {
public static function getComment($id = 0, $process = 0, $admin = 0) { static $commentsObj = array(); if (empty($commentsObj[$id])) { $comment = new KomentoComment($id); if ($comment->getError()) { return false; } $commentsObj[$id] = $comment; } if ($process) { self::import('helper', 'comment'); $commentsObj[$id] = KomentoCommentHelper::process($commentsObj[$id], $admin); } return $commentsObj[$id]; }
function getComment() { $profile = Komento::getProfile(); if( !$profile->allow( 'read_comment' ) ) { $ajax->fail(); $ajax->send(); } $id = JRequest::getVar( 'id' ); $comment = Komento::getComment( $id ); $comment = KomentoCommentHelper::process( $comment ); $parentTheme = Komento::getTheme(); $parentTheme->set( 'row', $comment ); // todo: configurable $html = $parentTheme->fetch( 'comment/item/avatar.php' ); $html .= $parentTheme->fetch( 'comment/item/author.php' ); $html .= $parentTheme->fetch( 'comment/item/time.php' ); $html .= $parentTheme->fetch( 'comment/item/text.php' ); $ajax = Komento::getAjax(); $ajax->success( $html ); $ajax->send(); }