function display($tpl = null)
 {
     $this->item = $this->get('Item');
     $this->reports = $this->get('Reports');
     $this->form = $this->get('Form');
     $this->state = $this->get('State');
     $this->ajax = JCommentsFactory::getLink('ajax-backend');
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     JHtml::_('behavior.tooltip');
     JHtml::_('behavior.formvalidation');
     if (version_compare(JVERSION, '3.0', 'ge')) {
         JHtml::_('formbehavior.chosen', 'select');
         $this->bootstrap = true;
     } else {
         JHtml::_('jcomments.bootstrap');
     }
     JHtml::_('jcomments.stylesheet');
     $this->addToolbar();
     parent::display($tpl);
 }
    public static function showImport($CommentSystems = array())
    {
        $app = JCommentsFactory::getApplication('administrator');
        $db = JCommentsFactory::getDBO();
        $db->setQuery("SHOW TABLES");
        $tables = $db->loadResultArray();
        foreach ($tables as $tableName) {
            for ($i = 0, $n = count($CommentSystems); $i < $n; $i++) {
                $tableMask = str_replace('#__', $app->getCfg('dbprefix'), $CommentSystems[$i]->table);
                if (preg_match('/' . $tableMask . '$/i', $tableName)) {
                    $CommentSystems[$i]->found = true;
                    $CommentSystems[$i]->UpdateCount();
                }
            }
        }
        $languages = JCommentsMultilingual::getLanguages();
        if (JCOMMENTS_JVERSION == '1.0') {
            $lang = JCommentsMultilingual::getLanguage();
        } else {
            $params = JComponentHelper::getParams('com_languages');
            $lang = $params->get("site", 'en-GB');
        }
        $ajaxUrl = JCommentsFactory::getLink('ajax-backend');
        ?>
<link rel="stylesheet" href="<?php 
        echo $app->getCfg('live_site');
        ?>
/administrator/components/com_jcomments/assets/style.css" type="text/css" />
<script type="text/javascript" src="<?php 
        echo $app->getCfg('live_site');
        ?>
/components/com_jcomments/libraries/joomlatune/ajax.js?v=2"></script>
<script type="text/javascript" src="<?php 
        echo $app->getCfg('live_site');
        ?>
/administrator/components/com_jcomments/assets/jcomments-backend-v2.1.js"></script>
<script type="text/javascript">
<!--
function JCommentsImportCommentsAJAX(source, language, start)
{
	try {
		jtajax.setup({url:'<?php 
        echo $ajaxUrl;
        ?>
'});
		return jtajax.call('JCommentsImportCommentsAjax', arguments, 'post');
	} catch (e) {
		return false;
	}
}

function startCommentsImport(source)
{
	var language = '';
	var e=document.getElementById(source.toLowerCase() + '_lang');
	if (e){for (var i=0;i<e.length;i++) {if (e.options[i].selected){language=e.options[i].value;break;}}}
	var b = document.getElementById('btnImport' + source);
	if (b) {b.disabled = true;}
	JCommentsImportCommentsAJAX(source, language, 0);
}

function finishCommentsImport(source) {
	var b=document.getElementById('btnImport'+source);if(b){b.disabled=false;}
}

<?php 
        if (JCOMMENTS_JVERSION == '1.7') {
            ?>
Joomla.submitbutton = function (task) {
	Joomla.submitform(task, document.getElementById('adminForm'));
};
<?php 
        } else {
            ?>
function submitbutton(task)
{
	submitform(task);
}
<?php 
        }
        ?>
//-->
</script>
<script type="text/javascript">
<!--
var jc_comments = new Array(
<?php 
        $jsArray = array();
        foreach ($CommentSystems as $CommentSystem) {
            if ($CommentSystem->found) {
                $jsArray[] = $CommentSystem->code;
            }
        }
        echo "'" . implode("', '", $jsArray) . "'";
        ?>
			);

function importMode( mode ) {
	if(document.getElementById) {
		for(var i=0;i<jc_comments.length;i++) {
			if (mode == jc_comments[i]) {
				document.getElementById('import' + jc_comments[i]).checked = true;
				document.getElementById('import' + jc_comments[i]+'Info').style.display = '';
			} else {
				document.getElementById('import' + jc_comments[i]).checked = false;
				document.getElementById('import' + jc_comments[i]+'Info').style.display = 'none';
			}
		}
	}
}
//-->
</script>

<style type="text/css">
#jcomments-message {padding: 0 0 0 25px;margin: 0; width: auto; float: right; font-size: 14px; font-weight: bold;}
.jcomments-message-error {background: transparent url(components/com_jcomments/assets/error.gif) no-repeat 4px 50%; color: red;}
.jcomments-message-info {background: transparent url(components/com_jcomments/assets/info.gif) no-repeat 4px 50%; color: green;}
.jcomments-message-wait {background: transparent url(components/com_jcomments/assets/wait.gif) no-repeat 4px 50%; color: green;}
.adminform fieldset { border: 1px #999 solid; }
.adminform fieldset input, fieldset select { float: none; }
.adminform span.note { color: #777; }
table.componentinfo td { color: #777; padding: 0; }
</style>

<div>
<form action="<?php 
        echo JCOMMENTS_INDEX;
        ?>
" method="post" name="adminForm" id="adminForm">
<input type="hidden" name="option" value="com_jcomments" />
<input type="hidden" name="task" value="" />
<?php 
        if (JCOMMENTS_JVERSION == '1.0') {
            ?>
<table class="adminheading">
<tr>
	<th style="background-image: none; padding: 0;"><img src="components/com_jcomments/assets/icon-48-import.png" width="48" height="48" align="middle" alt="<?php 
            echo JText::_('A_IMPORT');
            ?>
">&nbsp;<?php 
            echo JText::_('A_IMPORT');
            ?>
</th>
</tr>
</table>
<?php 
        }
        ?>

<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr valign="top">
		<td align="right">&nbsp;</td>
		<td width="50%" align="right"><div id="jcomments-message-holder"></div></td>
	</tr>
</table>

<table width="100%" border="0" cellpadding="4" cellspacing="2" class="adminform">
<tr>
	<td>
		<fieldset>
		<legend><?php 
        echo JText::_('A_IMPORT_SELECT_SOURCE');
        ?>
</legend>
		<table cellpadding="1" cellspacing="1" border="0">
<?php 
        $foundSources = 0;
        foreach ($CommentSystems as $CommentSystem) {
            if ($CommentSystem->found) {
                $foundSources++;
                ?>
		<tr valign="top" align="left">
			<td><input type="radio" id="import<?php 
                echo $CommentSystem->code;
                ?>
" name="vars[import]" value="<?php 
                echo $CommentSystem->code;
                ?>
" onclick="importMode('<?php 
                echo $CommentSystem->code;
                ?>
')" <?php 
                echo $CommentSystem->found ? '' : 'disabled';
                ?>
 /></td>
			<td><label for="import<?php 
                echo $CommentSystem->code;
                ?>
"><?php 
                echo $CommentSystem->name;
                ?>
</label></td>
			<td><div id="jcomments-message-<?php 
                echo strtolower($CommentSystem->code);
                ?>
"></div></td>
		</tr>
		<tr id="import<?php 
                echo $CommentSystem->code;
                ?>
Info" style="display: none;">
			<td>&nbsp;</td>
			<td>
				<table cellpadding="0" cellspacing="0" border="0" class="componentinfo">
				<tr>
					<td width="150px"><?php 
                echo JText::_('A_IMPORT_COMPONENT_AUTHOR');
                ?>
</td>
					<td><?php 
                echo $CommentSystem->author;
                ?>
</td>
				</tr>
				<tr>
					<td><?php 
                echo JText::_('A_IMPORT_COMPONENT_HOMEPAGE');
                ?>
</td>
					<td><a href="<?php 
                echo $CommentSystem->homepage;
                ?>
" target="_blank"><?php 
                echo str_replace('http://', '', $CommentSystem->homepage);
                ?>
</a></td>
				</tr>
				<tr>
					<td><?php 
                echo JText::_('A_IMPORT_COMPONENT_LICENSE');
                ?>
</td>
					<td>
<?php 
                if ($CommentSystem->license_url != '') {
                    ?>
						<a href="<?php 
                    echo $CommentSystem->license_url;
                    ?>
" target="_blank"><?php 
                    echo $CommentSystem->license;
                    ?>
</a>
<?php 
                } else {
                    ?>
					
						<?php 
                    echo $CommentSystem->license;
                }
                ?>
					</td>
				</tr>
				<tr>
					<td colspan="2">&nbsp;</td>
				</tr>
				<tr valign="top" align="left">
					<td>
						<?php 
                echo JText::_('A_IMPORT_COMPONENT_COMMENTS_COUNT');
                ?>
					</td>
					<td>
						<label for="import<?php 
                echo $CommentSystem->code;
                ?>
"><?php 
                echo $CommentSystem->count;
                ?>
</label>
					</td>
				</tr>

				<tr valign="top" align="left">
					<td>
					</td>
					<td>
<?php 
                if (count($languages)) {
                    echo JCommentsHTML::selectList($languages, strtolower($CommentSystem->code) . '_lang', 'class="inputbox" size="1"', 'value', 'name', $lang) . '&nbsp;';
                }
                ?>
						<input type="button" id="btnImport<?php 
                echo $CommentSystem->code;
                ?>
" name="btnImport<?php 
                echo $CommentSystem->code;
                ?>
" value="<?php 
                echo JText::_('A_IMPORT_BUTTON_IMPORT');
                ?>
" onclick="startCommentsImport('<?php 
                echo $CommentSystem->code;
                ?>
')" <?php 
                echo $CommentSystem->count ? '' : 'disabled';
                ?>
 />
					</td>
				</tr>

				<tr>
					<td colspan="2">&nbsp;</td>
				</tr>
				</table>
			</td>
		</tr>
<?php 
            }
        }
        if ($foundSources == 0) {
            ?>
		<tr>
			<td><?php 
            echo JText::_('A_IMPORT_NO_SOURCES');
            ?>
</td>
		</tr>
<?php 
        }
        ?>
		</table>
	</fieldset>
	</td>
</tr>
</table>
<?php 
        echo JCommentsSecurity::formToken();
        ?>
</form>
</div>
<?php 
    }
Exemple #3
0
 public static function prepareComment(&$comment)
 {
     if (isset($comment->_skip_prepare) && $comment->_skip_prepare == 1) {
         return;
     }
     JCommentsEventHelper::trigger('onJCommentsCommentBeforePrepare', array(&$comment));
     $config = JCommentsFactory::getConfig();
     $acl = JCommentsFactory::getACL();
     // run autocensor
     if ($acl->check('enable_autocensor')) {
         $comment->comment = JCommentsText::censor($comment->comment);
         if ($comment->title != '') {
             $comment->title = JCommentsText::censor($comment->title);
         }
     }
     // replace deleted comment text with predefined message
     if ($comment->deleted == 1) {
         $comment->comment = JText::_('COMMENT_TEXT_COMMENT_HAS_BEEN_DELETED');
         $comment->username = '';
         $comment->name = '';
         $comment->email = '';
         $comment->homepage = '';
         $comment->userid = 0;
         $comment->isgood = 0;
         $comment->ispoor = 0;
     }
     // replace BBCode tags
     $comment->comment = JCommentsFactory::getBBCode()->replace($comment->comment);
     if ($config->getInt('enable_custom_bbcode')) {
         $comment->comment = JCommentsFactory::getCustomBBCode()->replace($comment->comment);
     }
     // fix long words problem
     $word_maxlength = $config->getInt('word_maxlength');
     if ($word_maxlength > 0) {
         $comment->comment = JCommentsText::fixLongWords($comment->comment, $word_maxlength);
         if ($comment->title != '') {
             $comment->title = JCommentsText::fixLongWords($comment->title, $word_maxlength);
         }
     }
     if ($acl->check('emailprotection')) {
         $comment->comment = JComments::maskEmail($comment->id, $comment->comment);
     }
     // autolink urls
     if ($acl->check('autolinkurls')) {
         $comment->comment = preg_replace_callback(_JC_REGEXP_LINK, array('JComments', 'urlProcessor'), $comment->comment);
         if ($acl->check('emailprotection') != 1) {
             $comment->comment = preg_replace(_JC_REGEXP_EMAIL, '<a href="mailto:\\1@\\2">\\1@\\2</a>', $comment->comment);
         }
     }
     // replace smilies' codes with images
     if ($config->get('enable_smilies') == '1') {
         $comment->comment = JCommentsFactory::getSmilies()->replace($comment->comment);
     }
     $comment->author = JComments::getCommentAuthorName($comment);
     // Gravatar support
     $comment->gravatar = md5(strtolower($comment->email));
     if (empty($comment->avatar)) {
         $comment->avatar = '<img src="http://www.gravatar.com/avatar/' . $comment->gravatar . '?d=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="' . htmlspecialchars($comment->author) . '" />';
     }
     JCommentsEventHelper::trigger('onJCommentsCommentAfterPrepare', array(&$comment));
 }
 /**
  * Returns a reference to the global {@link JoomlaTuneTemplateRender} object,
  * only creating it if it doesn't already exist.
  *
  * @param int $object_id
  * @param string $object_group
  * @param bool $needThisUrl
  * @return JoomlaTuneTemplateRender
  */
 public static function getTemplate($object_id = 0, $object_group = 'com_content', $needThisUrl = true)
 {
     global $Itemid;
     ob_start();
     $app = JCommentsFactory::getApplication();
     $config = JCommentsFactory::getConfig();
     $templateName = $config->get('template');
     if (empty($templateName)) {
         $templateName = 'default';
         $config->set('template', $templateName);
     }
     include_once JCOMMENTS_LIBRARIES . '/joomlatune/template.php';
     $templateDefaultDirectory = JCOMMENTS_BASE . '/tpl/' . $templateName;
     $templateDirectory = $templateDefaultDirectory;
     $templateUrl = $app->getCfg('live_site') . '/components/com_jcomments/tpl/' . $templateName;
     if (JCOMMENTS_JVERSION != '1.0') {
         $templateOverride = JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_jcomments/' . $templateName;
         if (is_dir($templateOverride)) {
             $templateDirectory = $templateOverride;
             $templateUrl = JURI::root() . 'templates/' . $app->getTemplate() . '/html/com_jcomments/' . $templateName;
         }
     }
     $tmpl = JoomlaTuneTemplateRender::getInstance();
     $tmpl->setRoot($templateDirectory);
     $tmpl->setDefaultRoot($templateDefaultDirectory);
     $tmpl->setBaseURI($templateUrl);
     $tmpl->addGlobalVar('siteurl', $app->getCfg('live_site'));
     $tmpl->addGlobalVar('charset', strtolower(preg_replace('/charset=/', '', _ISO)));
     $tmpl->addGlobalVar('ajaxurl', JCommentsFactory::getLink('ajax', $object_id, $object_group));
     $tmpl->addGlobalVar('smilesurl', JCommentsFactory::getLink('smiles', $object_id, $object_group));
     if ($config->getInt('enable_rss') == 1) {
         $tmpl->addGlobalVar('rssurl', JCommentsFactory::getLink('rss', $object_id, $object_group));
     }
     $tmpl->addGlobalVar('template', $templateName);
     $tmpl->addGlobalVar('template_url', $templateUrl);
     $tmpl->addGlobalVar('itemid', $Itemid ? $Itemid : 1);
     if (JCOMMENTS_JVERSION == '1.0') {
         $tmpl->addGlobalVar('direction', 'ltr');
     } else {
         $language = JFactory::getLanguage();
         $tmpl->addGlobalVar('direction', $language->isRTL() ? 'rtl' : 'ltr');
     }
     $lang = $app->getCfg('lang');
     if ($lang == 'russian' || $lang == 'ukrainian' || $lang == 'belorussian' || $lang == 'ru-RU' || $lang == 'uk-UA' || $lang == 'be-BY') {
         $tmpl->addGlobalVar('support', base64_decode('PGEgaHJlZj0iaHR0cDovL3d3dy5qb29tbGF0dW5lLnJ1IiB0aXRsZT0iSkNvbW1lbnRzIiB0YXJnZXQ9Il9ibGFuayI+SkNvbW1lbnRzPC9hPg=='));
     } else {
         $tmpl->addGlobalVar('support', base64_decode('PGEgaHJlZj0iaHR0cDovL3d3dy5qb29tbGF0dW5lLmNvbSIgdGl0bGU9IkpDb21tZW50cyIgdGFyZ2V0PSJfYmxhbmsiPkpDb21tZW50czwvYT4='));
     }
     $tmpl->addGlobalVar('comment-object_id', $object_id);
     $tmpl->addGlobalVar('comment-object_group', $object_group);
     if ($needThisUrl == true) {
         $tmpl->addGlobalVar('thisurl', JCommentsObjectHelper::getLink($object_id, $object_group));
     }
     ob_end_clean();
     return $tmpl;
 }
 function show($object_id, $object_group = 'com_content', $object_title = '', $search_text = '')
 {
     $object_id = (int) $object_id;
     $object_group = trim($object_group);
     $object_title = trim($object_title);
     $acl =& JCommentsFactory::getACL();
     $config =& JCommentsFactory::getConfig();
     $JLMS_CONFIG =& JLMSFactory::getConfig();
     $app =& JFactory::getApplication();
     $tmpl =& JCommentsFactory::getTemplate($object_id, $object_group);
     $tmpl->load('tpl_index');
     if ($config->getInt('object_locked', 0) == 1) {
         $config->set('enable_rss', 0);
         $tmpl->addVar('tpl_index', 'comments-form-locked', 1);
     }
     if (JCOMMENTS_JVERSION == '1.5') {
         $document =& JFactory::getDocument();
     }
     if (!defined('JCOMMENTS_CSS')) {
         include_once JCOMMENTS_HELPERS . DS . 'system.php';
         if ($app->isAdmin()) {
             $tmpl->addVar('tpl_index', 'comments-css', 1);
         } else {
             $link = JCommentsSystemPluginHelper::getCSS();
             $document->addStyleSheet($link);
         }
     }
     if (!defined('JCOMMENTS_JS')) {
         include_once JCOMMENTS_HELPERS . DS . 'system.php';
         if ($config->getInt('gzip_js') == 1) {
             $document->addScript(JCommentsSystemPluginHelper::getCompressedJS());
         } else {
             $document->addScript(JCommentsSystemPluginHelper::getCoreJS());
             if (!defined('JOOMLATUNE_AJAX_JS')) {
                 $document->addScript(JCommentsSystemPluginHelper::getAjaxJS());
                 define('JOOMLATUNE_AJAX_JS', 1);
             }
         }
     }
     $tmpl->addVar('tpl_index', 'comments-form-captcha', $acl->check('enable_captcha'));
     $tmpl->addVar('tpl_index', 'comments-form-link', $config->getInt('form_show') ? 0 : 1);
     if ($config->getInt('enable_rss') == 1) {
         $link = JCommentsFactory::getLink('rss', $object_id, $object_group);
         $attribs = array('type' => 'application/rss+xml', 'title' => strip_tags($object_title));
         $document->addHeadLink($link, 'alternate', 'rel', $attribs);
     }
     $cacheEnabled = intval($JLMS_CONFIG->get('caching')) == 1;
     if ($cacheEnabled == 0) {
         $jrecache = $JLMS_CONFIG->get('absolute_path') . DS . 'components' . DS . 'com_jrecache' . DS . 'jrecache.config.php';
         if (is_file($jrecache)) {
             $cfg = new _JRECache_Config();
             $cacheEnabled = $cacheEnabled && $cfg->enable_cache;
         }
     }
     $load_cached_comments = $config->getInt('load_cached_comments', 0);
     if ($cacheEnabled) {
         $tmpl->addVar('tpl_index', 'comments-anticache', 1);
     }
     if (!$cacheEnabled || $load_cached_comments === 1) {
         if ($config->get('template_view') == 'tree' && !strlen($search_text)) {
             $tmpl->addVar('tpl_index', 'comments-list', JLMS_JComments::getCommentsTree($object_id, $object_group, $search_text));
         } else {
             $tmpl->addVar('tpl_index', 'comments-list', JLMS_JComments::getCommentsList($object_id, $object_group, $search_text));
         }
     }
     $needScrollToComment = $cacheEnabled || $config->getInt('comments_per_page') > 0;
     $tmpl->addVar('tpl_index', 'comments-gotocomment', (int) $needScrollToComment);
     $tmpl->addVar('tpl_index', 'comments-form', JComments::getCommentsForm($object_id, $object_group, $config->getInt('form_show') == 1));
     $result = $tmpl->renderTemplate('tpl_index');
     $tmpl->freeAllTemplates();
     return $result;
 }
Exemple #6
0
    function getCommentsFormFull()
    {
        $object_id = $this->getVar('comment-object_id');
        $object_group = $this->getVar('comment-object_group');
        $htmlBeforeForm = $this->getVar('comments-form-html-before');
        $htmlAfterForm = $this->getVar('comments-form-html-after');
        ?>
<h4><?php 
        echo JText::_('FORM_HEADER');
        ?>
</h4>
<?php 
        if ($this->getVar('comments-form-policy', 0) == 1) {
            ?>
<div class="comments-policy"><?php 
            echo $this->getVar('comments-policy');
            ?>
</div>
<?php 
        }
        echo $htmlBeforeForm;
        ?>
<a id="addcomments" href="#addcomments"></a>
<form id="comments-form" name="comments-form" action="javascript:void(null);">
<?php 
        if ($this->getVar('comments-form-user-name', 1) == 1) {
            ?>
<p>
	<input id="comments-form-name" type="text" name="name" value="" maxlength="<?php 
            echo $this->getVar('comment-name-maxlength');
            ?>
" size="22" tabindex="1" />
	<label for="comments-form-name"><?php 
            echo JText::_('FORM_NAME');
            ?>
</label>
</p>
<?php 
        }
        if ($this->getVar('comments-form-user-email', 1) == 1) {
            $text = $this->getVar('comments-form-email-required', 1) == 0 ? JText::_('FORM_EMAIL') : JText::_('FORM_EMAIL_REQUIRED');
            ?>
<p>
	<input id="comments-form-email" type="text" name="email" value="" size="22" tabindex="2" />
	<label for="comments-form-email"><?php 
            echo $text;
            ?>
</label>
</p>
<?php 
        }
        if ($this->getVar('comments-form-user-homepage', 0) == 1) {
            $text = $this->getVar('comments-form-homepage-required', 1) == 0 ? JText::_('FORM_HOMEPAGE') : JText::_('FORM_HOMEPAGE_REQUIRED');
            ?>
<p>
	<input id="comments-form-homepage" type="text" name="homepage" value="" size="22" tabindex="3" />
	<label for="comments-form-homepage"><?php 
            echo $text;
            ?>
</label>
</p>
<?php 
        }
        if ($this->getVar('comments-form-title', 0) == 1) {
            $text = $this->getVar('comments-form-title-required', 1) == 0 ? JText::_('FORM_TITLE') : JText::_('FORM_TITLE_REQUIRED');
            ?>
<p>
	<input id="comments-form-title" type="text" name="title" value="" size="22" tabindex="4" />
	<label for="comments-form-title"><?php 
            echo $text;
            ?>
</label>
</p>
<?php 
        }
        ?>
<p>
	<textarea id="comments-form-comment" name="comment" cols="65" rows="8" tabindex="5"></textarea>
</p>
<?php 
        if ($this->getVar('comments-form-subscribe', 0) == 1) {
            ?>
<p>
	<input class="checkbox" id="comments-form-subscribe" type="checkbox" name="subscribe" value="1" tabindex="5" />
	<label for="comments-form-subscribe"><?php 
            echo JText::_('FORM_SUBSCRIBE');
            ?>
</label><br />
</p>
<?php 
        }
        if ($this->getVar('comments-form-captcha', 0) == 1) {
            $html = $this->getVar('comments-form-captcha-html');
            if ($html != '') {
                echo $html;
            } else {
                $link = JCommentsFactory::getLink('captcha');
                ?>
<p>
	<img class="captcha" onclick="jcomments.clear('captcha');" id="comments-form-captcha-image" name="captcha-image" src="<?php 
                echo $link;
                ?>
" width="121" height="60" alt="<?php 
                echo JText::_('FORM_CAPTCHA');
                ?>
" /><br />
	<span class="captcha" onclick="jcomments.clear('captcha');"><?php 
                echo JText::_('FORM_CAPTCHA_REFRESH');
                ?>
</span><br />
	<input class="captcha" id="comments-form-captcha" type="text" name="captcha-refid" value="" size="5" tabindex="6" /><br />
</p>
<?php 
            }
        }
        ?>
<div id="comments-form-buttons">
	<div class="btn" id="comments-form-send"><div><a href="#" tabindex="7" onclick="jcomments.saveComment();return false;" title="<?php 
        echo JText::_('FORM_SEND_HINT');
        ?>
"><?php 
        echo JText::_('FORM_SEND');
        ?>
</a></div></div>
	<div class="btn" id="comments-form-cancel" style="display:none;"><div><a href="#" tabindex="8" onclick="return false;" title="<?php 
        echo JText::_('FORM_CANCEL');
        ?>
"><?php 
        echo JText::_('FORM_CANCEL');
        ?>
</a></div></div>
	<div style="clear:both;"></div>
</div>
	<input type="hidden" name="object_id" value="<?php 
        echo $object_id;
        ?>
" />
	<input type="hidden" name="object_group" value="<?php 
        echo $object_group;
        ?>
" />
</form>
<script type="text/javascript">
<!--
function JCommentsInitializeForm()
{
	var jcEditor = new JCommentsEditor('comments-form-comment', true);
<?php 
        if ($this->getVar('comments-form-bbcode', 0) == 1) {
            $bbcodes = array('b' => array(0 => JText::_('FORM_BBCODE_B'), 1 => JText::_('Enter text')), 'i' => array(0 => JText::_('FORM_BBCODE_I'), 1 => JText::_('Enter text')), 'u' => array(0 => JText::_('FORM_BBCODE_U'), 1 => JText::_('Enter text')), 's' => array(0 => JText::_('FORM_BBCODE_S'), 1 => JText::_('Enter text')), 'img' => array(0 => JText::_('FORM_BBCODE_IMG'), 1 => JText::_('Enter full URL to the image')), 'url' => array(0 => JText::_('FORM_BBCODE_URL'), 1 => JText::_('Enter full URL')), 'hide' => array(0 => JText::_('FORM_BBCODE_HIDE'), 1 => JText::_('Enter text to hide it from unregistered')), 'quote' => array(0 => JText::_('FORM_BBCODE_QUOTE'), 1 => JText::_('Enter text to quote')), 'list' => array(0 => JText::_('FORM_BBCODE_LIST'), 1 => JText::_('Enter list item text')));
            foreach ($bbcodes as $k => $v) {
                if ($this->getVar('comments-form-bbcode-' . $k, 0) == 1) {
                    $title = trim(JCommentsText::jsEscape($v[0]));
                    $text = trim(JCommentsText::jsEscape($v[1]));
                    ?>
	jcEditor.addButton('<?php 
                    echo $k;
                    ?>
','<?php 
                    echo $title;
                    ?>
','<?php 
                    echo $text;
                    ?>
');
<?php 
                }
            }
        }
        $customBBCodes = $this->getVar('comments-form-custombbcodes');
        if (count($customBBCodes)) {
            foreach ($customBBCodes as $code) {
                if ($code->button_enabled) {
                    $k = 'custombbcode' . $code->id;
                    $title = trim(JCommentsText::jsEscape($code->button_title));
                    $text = empty($code->button_prompt) ? JText::_('Enter text') : JText::_($code->button_prompt);
                    $open_tag = $code->button_open_tag;
                    $close_tag = $code->button_close_tag;
                    $icon = $code->button_image;
                    $css = $code->button_css;
                    ?>
	jcEditor.addButton('<?php 
                    echo $k;
                    ?>
','<?php 
                    echo $title;
                    ?>
','<?php 
                    echo $text;
                    ?>
','<?php 
                    echo $open_tag;
                    ?>
','<?php 
                    echo $close_tag;
                    ?>
','<?php 
                    echo $css;
                    ?>
','<?php 
                    echo $icon;
                    ?>
');
<?php 
                }
            }
        }
        $smiles = $this->getVar('comment-form-smiles');
        if (isset($smiles)) {
            if (is_array($smiles) && count($smiles) > 0) {
                ?>
	jcEditor.initSmiles('<?php 
                echo $this->getVar("smilesurl");
                ?>
');
<?php 
                foreach ($smiles as $code => $icon) {
                    $code = trim(JCommentsText::jsEscape($code));
                    $icon = trim(JCommentsText::jsEscape($icon));
                    ?>
	jcEditor.addSmile('<?php 
                    echo $code;
                    ?>
','<?php 
                    echo $icon;
                    ?>
');
<?php 
                }
            }
        }
        if ($this->getVar('comments-form-showlength-counter', 0) == 1) {
            ?>
	jcEditor.addCounter(<?php 
            echo $this->getVar('comment-maxlength');
            ?>
, '<?php 
            echo JText::_('FORM_CHARSLEFT_PREFIX');
            ?>
', '<?php 
            echo JText::_('FORM_CHARSLEFT_SUFFIX');
            ?>
', 'counter');
<?php 
        }
        ?>
	jcomments.setForm(new JCommentsForm('comments-form', jcEditor));
}

<?php 
        if ($this->getVar('comments-form-ajax', 0) == 1) {
            ?>
setTimeout(JCommentsInitializeForm, 100);
<?php 
        } else {
            ?>
if (window.addEventListener) {window.addEventListener('load',JCommentsInitializeForm,false);}
else if (document.addEventListener){document.addEventListener('load',JCommentsInitializeForm,false);}
else if (window.attachEvent){window.attachEvent('onload',JCommentsInitializeForm);}
else {if (typeof window.onload=='function'){var oldload=window.onload;window.onload=function(){oldload();JCommentsInitializeForm();}} else window.onload=JCommentsInitializeForm;} 
<?php 
        }
        ?>
//-->
</script>
<?php 
        echo $htmlAfterForm;
    }
Exemple #7
0
 /**
  * Returns a reference to the global {@link JoomlaTuneTemplateRender} object, only creating it if it does not already exist.
  *
  * @param int $object_id
  * @param string $object_group
  * @param bool $needThisUrl
  *
  * @return JoomlaTuneTemplateRender
  */
 public static function getTemplate($object_id = 0, $object_group = 'com_content', $needThisUrl = true)
 {
     global $Itemid;
     ob_start();
     $app = JFactory::getApplication();
     $language = JFactory::getLanguage();
     $config = JCommentsFactory::getConfig();
     $templateName = $config->get('template');
     if (empty($templateName)) {
         $templateName = 'default';
         $config->set('template', $templateName);
     }
     include_once JCOMMENTS_LIBRARIES . '/joomlatune/template.php';
     $templateDefaultDirectory = JCOMMENTS_SITE . '/tpl/' . $templateName;
     $templateDirectory = $templateDefaultDirectory;
     $templateUrl = JURI::root() . 'components/com_jcomments/tpl/' . $templateName;
     $templateOverride = JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_jcomments/' . $templateName;
     if (is_dir($templateOverride)) {
         $templateDirectory = $templateOverride;
         $templateUrl = JURI::root() . 'templates/' . $app->getTemplate() . '/html/com_jcomments/' . $templateName;
     }
     $tmpl = JoomlaTuneTemplateRender::getInstance();
     $tmpl->setRoot($templateDirectory);
     $tmpl->setDefaultRoot($templateDefaultDirectory);
     $tmpl->setBaseURI($templateUrl);
     $tmpl->addGlobalVar('siteurl', JURI::root());
     $tmpl->addGlobalVar('charset', 'utf-8');
     $tmpl->addGlobalVar('ajaxurl', JCommentsFactory::getLink('ajax', $object_id, $object_group));
     $tmpl->addGlobalVar('smilesurl', JCommentsFactory::getLink('smilies', $object_id, $object_group));
     if ($config->getInt('enable_rss') == 1) {
         $tmpl->addGlobalVar('rssurl', JCommentsFactory::getLink('rss', $object_id, $object_group));
     }
     $tmpl->addGlobalVar('template', $templateName);
     $tmpl->addGlobalVar('template_url', $templateUrl);
     $tmpl->addGlobalVar('itemid', $Itemid ? $Itemid : 1);
     $tmpl->addGlobalVar('direction', $language->isRTL() ? 'rtl' : 'ltr');
     $lang = $language->getTag();
     $domain = $lang == 'ru-RU' || $lang == 'uk-UA' || $lang == 'be-BY' ? 'ru' : 'com';
     $tmpl->addGlobalVar('comment-object_id', $object_id);
     $tmpl->addGlobalVar('comment-object_group', $object_group);
     if ($needThisUrl == true) {
         $tmpl->addGlobalVar('thisurl', JCommentsObjectHelper::getLink($object_id, $object_group, $lang));
     }
     ob_end_clean();
     return $tmpl;
 }
Exemple #8
0
 function prepareComment(&$comment)
 {
     if (isset($comment->_skip_prepare) && $comment->_skip_prepare == 1) {
         return;
     }
     $config =& JCommentsFactory::getConfig();
     $bbcode =& JCommentsFactory::getBBCode();
     $acl =& JCommentsFactory::getACL();
     // convert to datetime if variable contains string value
     if (is_string($comment->datetime)) {
         $comment->datetime = strtotime($comment->datetime);
     }
     // run autocensor
     if ($acl->check('enable_autocensor')) {
         $comment->comment = JCommentsText::censor($comment->comment);
     }
     // replace BBCode tags
     $comment->comment = $bbcode->replace($comment->comment);
     if ($config->getInt('enable_custom_bbcode')) {
         $customBBCode =& JCommentsFactory::getCustomBBCode();
         $comment->comment = $customBBCode->replace($comment->comment);
     }
     // fix long words problem
     $word_maxlength = $config->getInt('word_maxlength');
     if ($word_maxlength > 0) {
         $comment->comment = JCommentsText::fixLongWords($comment->comment, $word_maxlength);
         if ($comment->title != '') {
             $comment->title = JCommentsText::fixLongWords($comment->title, $word_maxlength);
         }
     }
     if ($acl->check('emailprotection')) {
         $comment->comment = JComments::maskEmail($comment->id, $comment->comment);
     }
     // autolink urls
     if ($acl->check('autolinkurls')) {
         $comment->comment = preg_replace_callback(_JC_REGEXP_LINK, array('JComments', 'urlProcessor'), $comment->comment);
         if ($acl->check('emailprotection') != 1) {
             $comment->comment = preg_replace(_JC_REGEXP_EMAIL, '<a href="mailto:\\1@\\2">\\1@\\2</a>', $comment->comment);
         }
     }
     // replace smile codes with images
     if ($config->get('enable_smiles') == '1') {
         $smiles =& JCommentsFactory::getSmiles();
         $comment->comment = $smiles->replace($comment->comment);
     }
     // Gravatar support
     $comment->gravatar = md5(strtolower($comment->email));
     if (empty($comment->avatar)) {
         $comment->avatar = '<img src="http://www.gravatar.com/avatar.php?gravatar_id=' . $comment->gravatar . '&amp;default=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="" />';
     }
     $comment->author = JComments::getCommentAuthorName($comment);
     if ($config->getInt('enable_mambots') == 1) {
         JCommentsPluginHelper::trigger('onAfterPrepareComment', array(&$comment));
     }
 }
Exemple #9
0
 public static function getList(&$params)
 {
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $source = $params->get('source', 'com_content');
     if (!is_array($source)) {
         $source = explode(',', $source);
     }
     $date = JFactory::getDate();
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $now = $date->toSql();
         $access = array_unique(JAccess::getAuthorisedViewLevels($user->get('id')));
         $access[] = 0;
         // for backward compability
     } else {
         $now = $date->toMySQL();
         $access = $user->get('aid', 0);
     }
     switch ($params->get('ordering', '')) {
         case 'vote':
             $orderBy = '(c.isgood-c.ispoor) DESC';
             break;
         case 'date':
         default:
             $orderBy = 'c.date DESC';
             break;
     }
     $where = array();
     $interval = $params->get('interval', '');
     if (!empty($interval)) {
         $timestamp = $date->toUnix();
         switch ($interval) {
             case '1-day':
                 $timestamp = strtotime('-1 day', $timestamp);
                 break;
             case '1-week':
                 $timestamp = strtotime('-1 week', $timestamp);
                 break;
             case '2-week':
                 $timestamp = strtotime('-2 week', $timestamp);
                 break;
             case '1-month':
                 $timestamp = strtotime('-1 month', $timestamp);
                 break;
             case '3-month':
                 $timestamp = strtotime('-3 month', $timestamp);
                 break;
             case '6-month':
                 $timestamp = strtotime('-6 month', $timestamp);
                 break;
             case '1-year':
                 $timestamp = strtotime('-1 year', $timestamp);
                 break;
             default:
                 $timestamp = NULL;
                 break;
         }
         if ($timestamp !== NULL) {
             $dateFrom = JFactory::getDate($timestamp);
             $dateTo = $date;
             if (version_compare(JVERSION, '1.6.0', 'ge')) {
                 $where[] = 'c.date BETWEEN ' . $db->Quote($dateFrom->toSQL()) . ' AND ' . $db->Quote($dateTo->toSQL());
             } else {
                 $where[] = 'c.date BETWEEN ' . $db->Quote($dateFrom->toMySQL()) . ' AND ' . $db->Quote($dateTo->toMySQL());
             }
         }
     }
     $where[] = 'c.published = 1';
     $where[] = 'c.deleted = 0';
     $where[] = "o.link <> ''";
     $where[] = is_array($access) ? "o.access IN (" . implode(',', $access) . ")" : " o.access <= " . (int) $access;
     if (JCommentsMultilingual::isEnabled()) {
         $where[] = 'c.lang = ' . $db->Quote(JCommentsMultilingual::getLanguage());
     }
     $joins = array();
     if (count($source) == 1 && $source[0] == 'com_content') {
         $joins[] = 'JOIN #__content AS cc ON cc.id = o.object_id';
         $joins[] = 'LEFT JOIN #__categories AS ct ON ct.id = cc.catid';
         $where[] = "c.object_group = " . $db->Quote($source[0]);
         $where[] = "(cc.publish_up = '0000-00-00 00:00:00' OR cc.publish_up <= '{$now}')";
         $where[] = "(cc.publish_down = '0000-00-00 00:00:00' OR cc.publish_down >= '{$now}')";
         $categories = $params->get('catid', array());
         if (!is_array($categories)) {
             $categories = explode(',', $categories);
         }
         JArrayHelper::toInteger($categories);
         $categories = implode(',', $categories);
         if (!empty($categories)) {
             $where[] = "cc.catid IN (" . $categories . ")";
         }
     } else {
         if (count($source)) {
             $where[] = "c.object_group in ('" . implode("','", $source) . "')";
         }
     }
     $query = "SELECT c.id, c.userid, c.comment, c.title, c.name, c.username, c.email, c.date, c.object_id, c.object_group, '' as avatar" . ", o.title AS object_title, o.link AS object_link, o.access AS object_access, o.userid AS object_owner" . " FROM #__jcomments AS c" . " JOIN #__jcomments_objects AS o ON c.object_id = o.object_id AND c.object_group = o.object_group AND c.lang = o.lang" . (count($joins) ? ' ' . implode(' ', $joins) : '') . (count($where) ? ' WHERE  ' . implode(' AND ', $where) : '') . " ORDER BY " . $orderBy;
     $db->setQuery($query, 0, $params->get('count'));
     $list = $db->loadObjectList();
     if (!is_array($list)) {
         $list = array();
     }
     if (count($list)) {
         $show_date = $params->get('show_comment_date', 0);
         $date_type = $params->get('date_type', '');
         $date_format = $params->get('date_format', 'd.m.Y H:i');
         $show_author = $params->get('show_comment_author', 0);
         $show_object_title = $params->get('show_object_title', 0);
         $show_comment_title = $params->get('show_comment_title', 0);
         $show_smiles = $params->get('show_smiles', 0);
         $show_avatar = $params->get('show_avatar', 0);
         $limit_comment_text = (int) $params->get('limit_comment_text', 0);
         $config = JCommentsFactory::getConfig();
         $bbcode = JCommentsFactory::getBBCode();
         $smiles = JCommentsFactory::getSmiles();
         $acl = JCommentsFactory::getACL();
         if ($show_avatar) {
             JPluginHelper::importPlugin('jcomments');
             if (version_compare(JVERSION, '3.0', 'ge')) {
                 $dispatcher = JEventDispatcher::getInstance();
             } else {
                 $dispatcher = JDispatcher::getInstance();
             }
             $dispatcher->trigger('onPrepareAvatars', array(&$list));
         }
         foreach ($list as &$item) {
             $item->displayDate = '';
             if ($show_date) {
                 if ($date_type == 'relative') {
                     $item->displayDate = modJCommentsLatestHelper::getRelativeDate($item->date);
                 } else {
                     $item->displayDate = JHTML::_('date', $item->date, $date_format);
                 }
             }
             $item->displayAuthorName = '';
             if ($show_author) {
                 $item->displayAuthorName = JComments::getCommentAuthorName($item);
             }
             $item->displayObjectTitle = '';
             if ($show_object_title) {
                 $item->displayObjectTitle = $item->object_title;
             }
             $item->displayCommentTitle = '';
             if ($show_comment_title) {
                 $item->displayCommentTitle = $item->title;
             }
             $item->displayCommentLink = $item->object_link . '#comment-' . $item->id;
             $text = JCommentsText::censor($item->comment);
             $text = preg_replace('#\\[quote[^\\]]*?\\](((?R)|.)*?)\\[\\/quote\\]#ismu', '', $text);
             $text = $bbcode->filter($text, true);
             $text = JCommentsText::fixLongWords($text, $config->getInt('word_maxlength'), ' ');
             if ($acl->check('autolinkurls')) {
                 $text = preg_replace_callback(_JC_REGEXP_LINK, array('JComments', 'urlProcessor'), $text);
             }
             $text = JCommentsText::cleanText($text);
             if ($limit_comment_text && JString::strlen($text) > $limit_comment_text) {
                 $text = self::truncateText($text, $limit_comment_text - 1);
             }
             switch ($show_smiles) {
                 case 1:
                     $text = $smiles->replace($text);
                     break;
                 case 2:
                     $text = $smiles->strip($text);
                     break;
             }
             $item->displayCommentText = $text;
             if ($show_avatar && empty($item->avatar)) {
                 $gravatar = md5(strtolower($item->email));
                 $item->avatar = '<img src="http://www.gravatar.com/avatar.php?gravatar_id=' . $gravatar . '&amp;default=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="' . htmlspecialchars(JComments::getCommentAuthorName($item)) . '" />';
             }
             $item->readmoreText = JText::_('MOD_JCOMMENTS_LATEST_READMORE');
         }
     }
     return $list;
 }
Exemple #10
0
 static function getList(&$params)
 {
     $db = JFactory::getDBO();
     $interval = $params->get('interval', '');
     $where = array();
     if (!empty($interval)) {
         $date = JFactory::getDate();
         $timestamp = $date->toUnix();
         switch ($interval) {
             case '1-day':
                 $timestamp = strtotime('-1 day', $timestamp);
                 break;
             case '1-week':
                 $timestamp = strtotime('-1 week', $timestamp);
                 break;
             case '2-week':
                 $timestamp = strtotime('-2 week', $timestamp);
                 break;
             case '1-month':
                 $timestamp = strtotime('-1 month', $timestamp);
                 break;
             case '3-month':
                 $timestamp = strtotime('-3 month', $timestamp);
                 break;
             case '6-month':
                 $timestamp = strtotime('-6 month', $timestamp);
                 break;
             case '1-year':
                 $timestamp = strtotime('-1 year', $timestamp);
                 break;
             default:
                 $timestamp = NULL;
                 break;
         }
         if ($timestamp !== NULL) {
             if (version_compare(JVERSION, '1.6.0', 'ge')) {
                 $dateFrom = JFactory::getDate($timestamp)->toSql();
                 $dateTo = $date->toSql();
             } else {
                 $dateFrom = JFactory::getDate($timestamp)->toMySql();
                 $dateTo = $date->toMySQL();
             }
             $where[] = 'c.date BETWEEN ' . $db->Quote($dateFrom) . ' AND ' . $db->Quote($dateTo);
         }
     }
     switch ($params->get('ordering', '')) {
         case 'votes':
             $orderBy = 'votes DESC';
             break;
         case 'comments':
         default:
             $orderBy = 'commentsCount DESC';
             break;
     }
     $where[] = 'c.published = 1';
     $where[] = 'c.deleted = 0';
     $query = "SELECT c.userid, '' as avatar, '' as profileLink" . " , CASE WHEN c.userid = 0 THEN c.email ELSE u.email END AS email" . " , CASE WHEN c.userid = 0 THEN c.name ELSE u.name END AS name" . " , CASE WHEN c.userid = 0 THEN c.username ELSE u.username END AS username" . " , COUNT(c.userid) AS commentsCount" . " , SUM(c.isgood) AS isgood, SUM(c.ispoor) AS ispoor, SUM(c.isgood - c.ispoor) AS votes" . " FROM #__jcomments AS c" . " LEFT JOIN #__users AS u ON u.id = c.userid" . (count($where) ? ' WHERE  ' . implode(' AND ', $where) : '') . " GROUP BY c.userid, email, name, username, avatar, profileLink" . " ORDER BY " . $orderBy;
     $db->setQuery($query, 0, $params->get('count'));
     $list = $db->loadObjectList();
     $show_avatar = $params->get('show_avatar', 0);
     if ($show_avatar) {
         JPluginHelper::importPlugin('jcomments');
         if (version_compare(JVERSION, '3.0', 'ge')) {
             $dispatcher = JEventDispatcher::getInstance();
         } else {
             $dispatcher = JDispatcher::getInstance();
         }
         $dispatcher->trigger('onPrepareAvatars', array(&$list));
     }
     foreach ($list as &$item) {
         $item->displayAuthorName = JComments::getCommentAuthorName($item);
         if ($show_avatar && empty($item->avatar)) {
             $gravatar = md5(strtolower($item->email));
             $item->avatar = '<img src="http://www.gravatar.com/avatar.php?gravatar_id=' . $gravatar . '&amp;default=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="' . htmlspecialchars(JComments::getCommentAuthorName($item)) . '" />';
         }
     }
     return $list;
 }
    function showImport()
    {
        global $mainframe;
        $CommentSystems = array();
        $CommentSystems[] = new JOtherCommentSystem('AkoComment', 'AkoComment', 'Arthur Konze', 'http://www.konze.de/content/view/8/26/', 'http://www.konze.de/content/view/8/26/', 'http://mamboportal.com', '#__akocomment');
        $CommentSystems[] = new JOtherCommentSystem('MosCom', 'MosCom', 'Chanh Ong', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://ongetc.com', '#__content_comments');
        $CommentSystems[] = new JOtherCommentSystem('ComboMax', 'ComboMax', 'Phil Taylor', 'Commercial (22.50 GPB)', '', 'http://www.phil-taylor.com/Joomla/Components/ComboMAX/', '#__combomax');
        $CommentSystems[] = new JOtherCommentSystem('JoomlaComment', 'JoomlaComment', 'Frantisek Hliva', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://cavo.co.nr', '#__comment');
        $CommentSystems[] = new JOtherCommentSystem('mXcomment', 'mXcomment', 'Bernard Gilly', 'Creative Commons', '', 'http://www.visualclinic.fr', '#__mxc_comments');
        $CommentSystems[] = new JOtherCommentSystem('JomComment', 'JomComment', 'Azrul Rahim', 'Commercial/Free', '', 'http://www.azrul.com', '#__jomcomment');
        $CommentSystems[] = new JOtherCommentSystem('jxtendedcomments', 'JXtended Comments', 'JXtended LLC', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://jxtended.com/products/comments.html', '#__jxcomments_comments');
        $CommentSystems[] = new JOtherCommentSystem('chronocomments', 'Chrono Comments', 'Chronoman', 'CC', '', 'http://www.chronoengine.com/', '#__chrono_comments');
        $CommentSystems[] = new JOtherCommentSystem('jacomment', 'JA Comment', 'JoomlArt', 'Copyrighted Commercial Software', '', 'www.joomlart.com', '#__jacomment_items');
        $CommentSystems[] = new JOtherCommentSystem('DatsoGallery', 'DatsoGallery comments', 'Andrey Datso', 'Free', '', 'http://www.datso.fr', '#__datsogallery_comments');
        $CommentSystems[] = new JOtherCommentSystem('JoomGallery', 'JoomGallery comments', 'M. Andreas Boettcher', 'Free', '', 'http://www.joomgallery.net', '#__joomgallery_comments');
        $CommentSystems[] = new JOtherCommentSystem('IceGallery', 'IceGallery comments', 'Markus Donhauser', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://joomlacode.org/gf/project/ice/', '#__ice_comments');
        $CommentSystems[] = new JOtherCommentSystem('Remository', 'Remository file reviews', 'Martin Brampton', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.remository.com', '#__downloads_reviews');
        $CommentSystems[] = new JOtherCommentSystem('PAXXGallery', 'PAXXGallery comments', 'Tobias Floery', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.paxxgallery.com', '#__paxxcomments');
        $CommentSystems[] = new JOtherCommentSystem('PhocaGallery', 'PhocaGallery comments', 'Jan Pavelka', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.phoca.cz', '#__phocagallery_comments');
        $CommentSystems[] = new JOtherCommentSystem('JMovies', 'JMovies comments', 'Luscarpa &amp; Vamba', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.jmovies.eu/', '#__jmovies_comments');
        $CommentSystems[] = new JOtherCommentSystem('Cinema', 'Cinema comments', 'Vamba', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.joomlaitalia.com', '#__cinema_comments');
        $CommentSystems[] = new JOtherCommentSystem('MosetsTree', 'Mosets Tree reviews', 'Mosets Consulting', 'Commercial', '', 'http://www.mosets.com', '#__mt_reviews');
        $CommentSystems[] = new JOtherCommentSystem('LinkDirectory', 'LinkDirectory link comments', 'Soner Ekici', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.sonerekici.com/', '#__ldcomment');
        $CommentSystems[] = new JOtherCommentSystem('zOOmMediaGallery', 'zOOm Media Gallery comments', 'Mike de Boer', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.zoomfactory.org/', '#__zoom_comments');
        $CommentSystems[] = new JOtherCommentSystem('rsgallery2', 'RSGallery2 comments', 'rsgallery2.net', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://rsgallery2.net/', '#__rsgallery2_comments');
        $CommentSystems[] = new JOtherCommentSystem('hotornot2', 'Hotornot2 comments', 'Aron Watson', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://joomlacode.org/gf/project/com_hotornot2/frs/', '#__hotornot_comments');
        $CommentSystems[] = new JOtherCommentSystem('easycomments', 'EasyComments (www.easy-joomla.org)', 'EasyJoomla', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.easy-joomla.org/', '#__easycomments');
        $CommentSystems[] = new JOtherCommentSystem('musicbox', 'MusicBox', 'Vamba', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.joomlaitalia.com', '#__musicboxrewiev');
        $CommentSystems[] = new JOtherCommentSystem('jreviews', 'JReviews', 'Alejandro Schmeichler', 'Commercial', '', 'http://www.reviewsforjoomla.com', '#__jreviews_comments');
        $CommentSystems[] = new JOtherCommentSystem('tutorials', 'Tutorials (comments for items)', 'NSOrg Project', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.nsorg.com', '#__tutorials_comments');
        $CommentSystems[] = new JOtherCommentSystem('idoblog', 'IDoBlog', 'Sunshine studio', 'GNU/GPL', '', 'http://idojoomla.com', '#__idoblog_comments');
        $CommentSystems[] = new JOtherCommentSystem('sobi2reviews', 'SOBI2 Reviews', 'SOBI2 Developer Team', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.sigsiu.net', '#__sobi2_plugin_reviews');
        $CommentSystems[] = new JOtherCommentSystem('jreactions', 'J! Reactions', 'SDeCNet Software', '', '', 'http://jreactions.sdecnet.com', '#__jreactions');
        $CommentSystems[] = new JOtherCommentSystem('virtuemart', 'VirtueMart product reviews', 'The VirtueMart Development Team', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.virtuemart.net', '#__vm_product_reviews');
        $CommentSystems[] = new JOtherCommentSystem('akobook', 'AkoBook', 'Arthur Konze', '', '', 'http://mamboportal.com', '#__akobook');
        $CommentSystems[] = new JOtherCommentSystem('jambook', 'JamBook', 'Olle Johansson', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.jxdevelopment.com/', '#__jx_jambook');
        $CommentSystems[] = new JOtherCommentSystem('k2', 'K2 Comments', 'JoomlaWorks', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://k2.joomlaworks.gr/', '#__k2_comments');
        $CommentSystems[] = new JOtherCommentSystem('smartblog', 'SmartBlog Comments', 'Aneesh S', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.aarthikaindia.com', '#__blog_comment');
        $CommentSystems[] = new JOtherCommentSystem('urcomment', 'UrComment', 'Comdev Software Sdn Bhd', 'GPL, Commercial Software', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://joomla.comdevweb.com', '#__urcomment');
        $CommentSystems[] = new yvCommentSystem('yvcomment', 'yvComment', 'Yuri Volkov', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://yurivolkov.com/Joomla/yvComment/index_en.html', '#__yvcomment');
        $CommentSystems[] = new JOtherCommentSystem('zimb', 'ZiMB Comment', 'ZiMB LLC', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.zimbllc.com/Software/zimbcomment', '#__zimbcomment_comment');
        $CommentSystems[] = new JOtherCommentSystem('rdbscomment', 'RDBS Commment', 'Robert Deutz', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.rdbs.de', '#__rdbs_comment_comments');
        $CommentSystems[] = new JOtherCommentSystem('lyftenbloggie', 'LyftenBloggie', 'Lyften Designs', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.lyften.com', '#__bloggies_comments');
        $CommentSystems[] = new JOtherCommentSystem('webee', 'Webee Comment', 'Onno Groen', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.onnogroen.nl/webee/', '#__webeecomment_comment');
        $CommentSystems[] = new JOtherCommentSystem('resource', 'MightyExtensions Resource comments', 'MightyExtensions', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://mightyextensions.com/', '#__js_res_comments');
        $CommentSystems[] = new JOtherCommentSystem('tpdugg', 'TPDugg', 'TemplatePlazza', '', '', 'http://templateplazza.com/', '#__tpdugg_comments');
        $CommentSystems[] = new JOtherCommentSystem('zoo', 'ZOO Comments', 'YOOtheme', 'GNU/GPLv2', 'http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only', 'http://zoo.yootheme.com', '#__zoo_comment');
        $CommentSystems[] = new JOtherCommentSystem('beeheard', 'BeeHeard Comments', 'Kaysten Mazerino', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.cmstactics.com', '#__beeheard_comments');
        $CommentSystems[] = new JOtherCommentSystem('jmylife', 'JMyLife Comments', 'Jeff Channell', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://jeffchannell.com', '#__jmylife_comments');
        $CommentSystems[] = new JOtherCommentSystem('muscol', 'Music Colllection Comments', 'Germinal Camps', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.joomlamusicsolutions.com', '#__muscol_comments');
        $CommentSystems[] = new JOtherCommentSystem('rscomments', 'RSComments', 'RSJoomla', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.rsjoomla.com/joomla-components/joomla-comments.html', '#__rscomments_comments');
        $db =& JCommentsFactory::getDBO();
        $db->setQuery("SHOW tables");
        $tables = $db->loadResultArray();
        foreach ($tables as $tblval) {
            for ($i = 0, $n = count($CommentSystems); $i < $n; $i++) {
                $table_mask = str_replace('#_', '', $CommentSystems[$i]->table);
                if (preg_match('/' . $table_mask . '$/i', $tblval)) {
                    $CommentSystems[$i]->found = true;
                    $CommentSystems[$i]->UpdateCount();
                }
            }
        }
        $languages = array();
        $joomfish = JOOMLATUNE_JPATH_SITE . DS . 'components' . DS . 'com_joomfish' . DS . 'joomfish.php';
        if (is_file($joomfish)) {
            $db =& JCommentsFactory::getDBO();
            $db->setQuery("SELECT name, `code` as value FROM #__languages WHERE active = 1");
            $languages = $db->loadObjectList();
        }
        if (JCOMMENTS_JVERSION == '1.5') {
            $params = JComponentHelper::getParams('com_languages');
            $lang = $params->get("site", 'en-GB');
        } else {
            $lang = JCommentsMultilingual::getLanguage();
        }
        $ajaxUrl = JCommentsFactory::getLink('ajax-backend');
        ?>
<script type="text/javascript" src="<?php 
        echo $mainframe->getCfg('live_site');
        ?>
/components/com_jcomments/libraries/joomlatune/ajax.js?v=2"></script>
<script type="text/javascript" src="<?php 
        echo $mainframe->getCfg('live_site');
        ?>
/administrator/components/com_jcomments/assets/jcomments-backend-v2.1.js"></script>
<script type="text/javascript">
<!--
function JCommentsImportCommentsAJAX() {
	try{
		jtajax.setup({url:'<?php 
        echo $ajaxUrl;
        ?>
'});
		return jtajax.call('JCommentsImportCommentsAjax',null,'post','adminForm');
	}catch(e){
		return false;
	}
}

function submitbutton(pressbutton) {
	var form = document.adminForm;
	if (pressbutton == 'cancel') {
		submitform( pressbutton );
		return;
	}

	JCommentsImportCommentsAJAX();
}
//-->
</script>
<script type="text/javascript">
<!--
var jc_comments = new Array(
<?php 
        $jsArray = array();
        foreach ($CommentSystems as $CommentSystem) {
            if ($CommentSystem->found) {
                $jsArray[] = $CommentSystem->code;
            }
        }
        echo "'" . implode("', '", $jsArray) . "'";
        ?>
			);

function importMode( mode ) {
	if(document.getElementById) {
		for(var i=0;i<jc_comments.length;i++) {
		        if (mode == jc_comments[i]) {
				document.getElementById('import' + jc_comments[i]).checked = true;
				document.getElementById('import' + jc_comments[i]+'Info').style.display = '';
			} else {
				document.getElementById('import' + jc_comments[i]).checked = false;
				document.getElementById('import' + jc_comments[i]+'Info').style.display = 'none';
			}
		}
	}
}
//-->
</script>

<style type="text/css">
#jcomments-message {padding: 0 0 0 25px;margin: 0; width: auto; float: right; font-size: 14px; font-weight: bold;}
.jcomments-message-error {background: transparent url(components/com_jcomments/assets/error.gif) no-repeat 4px 50%; color: red;}
.jcomments-message-info {background: transparent url(components/com_jcomments/assets/info.gif) no-repeat 4px 50%; color: green;}
fieldset { border: 1px #999 solid; }
span.note { color: #777; }
table.componentinfo td { color: #777; padding: 0; }
</style>

<div id="jc">
<form action="<?php 
        echo JCOMMENTS_INDEX;
        ?>
" method="post" name="adminForm" id="adminForm">
<input type="hidden" name="option" value="com_jcomments" />
<input type="hidden" name="task" value="" />
<?php 
        if (JCOMMENTS_JVERSION == '1.0') {
            ?>
<table class="adminheading">
<tr>
	<th style="background-image: none; padding: 0;"><img src="./components/com_jcomments/assets/import48x48.png" width="48" height="48" align="middle">&nbsp;<?php 
            echo JText::_('A_IMPORT');
            ?>
</th>
</tr>
</table>
<?php 
        }
        ?>

<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr valign="top">
		<td align="right">&nbsp;</td>
		<td width="50%" align="right"><div id="jcomments-message-holder"></div></td>
	</tr>
</table>

<table width="100%" border="0" cellpadding="4" cellspacing="2" class="adminform">
<tr>
	<td>
		<fieldset>
		<legend><?php 
        echo JText::_('A_IMPORT_SELECT_SOURCE');
        ?>
</legend>

		<table cellpadding="1" cellspacing="1" border="0">

<?php 
        $foundSources = 0;
        foreach ($CommentSystems as $CommentSystem) {
            if ($CommentSystem->found) {
                $foundSources++;
                ?>
		<tr valign="top" align="left">
			<td><input type="radio" id="import<?php 
                echo $CommentSystem->code;
                ?>
" name="vars[import]" value="<?php 
                echo $CommentSystem->code;
                ?>
" onclick="importMode('<?php 
                echo $CommentSystem->code;
                ?>
')" <?php 
                echo $CommentSystem->found ? '' : 'disabled';
                ?>
 /></td>
			<td><label for="import<?php 
                echo $CommentSystem->code;
                ?>
"><?php 
                echo $CommentSystem->name;
                ?>
 <?php 
                echo $CommentSystem->found ? '' : '<span class="note">[' . JText::_('A_IMPORT_COMPONENT_NOT_INSTALLED') . ']</span>';
                ?>
</label></td>
			<td><div id="jcomments-message-<?php 
                echo strtolower($CommentSystem->code);
                ?>
"></div></td>
		</tr>
		<tr id="import<?php 
                echo $CommentSystem->code;
                ?>
Info" style="display: none;">
			<td>&nbsp;</td>
			<td>
				<table cellpadding="0" cellspacing="0" border="0" class="componentinfo">
				<tr>
					<td width="150px"><?php 
                echo JText::_('A_IMPORT_COMPONENT_AUTHOR');
                ?>
</td>
					<td><?php 
                echo $CommentSystem->author;
                ?>
</td>
				</tr>
				<tr>
					<td><?php 
                echo JText::_('A_IMPORT_COMPONENT_HOMEPAGE');
                ?>
</td>
					<td><a href="<?php 
                echo $CommentSystem->homepage;
                ?>
" target="_blank"><?php 
                echo str_replace('http://', '', $CommentSystem->homepage);
                ?>
</a></td>
				</tr>
				<tr>
					<td><?php 
                echo JText::_('A_IMPORT_COMPONENT_LICENSE');
                ?>
</td>
					<td>
<?php 
                if ($CommentSystem->license_url != '') {
                    ?>
					
						<a href="<?php 
                    echo $CommentSystem->license_url;
                    ?>
" target="_blank"><?php 
                    echo $CommentSystem->license;
                    ?>
</a>
<?php 
                } else {
                    ?>
					
						<?php 
                    echo $CommentSystem->license;
                }
                ?>
					
					</td>
				</tr>
				<tr>
					<td colspan="2">&nbsp;</td>
				</tr>
				<tr valign="top" align="left">
					<td>
						<?php 
                echo JText::_('A_IMPORT_COMPONENT_COMMENTS_COUNT');
                ?>
					</td>
					<td>
					        <label for="import<?php 
                echo $CommentSystem->code;
                ?>
"><?php 
                echo $CommentSystem->count;
                ?>
</label>
					        <br />
<?php 
                if (count($languages)) {
                    echo JCommentsHTML::selectList($languages, strtolower($CommentSystem->code) . '_lang', 'class="inputbox" size="1"', 'value', 'name', $lang) . '&nbsp;';
                }
                ?>
					        
					        <input type="button" id="import<?php 
                echo $CommentSystem->code;
                ?>
" name="import<?php 
                echo $CommentSystem->code;
                ?>
" value="<?php 
                echo JText::_('A_IMPORT_DO_IMPORT');
                ?>
" onclick="submitbutton('doimport')" <?php 
                echo $CommentSystem->count ? '' : 'disabled';
                ?>
 />
					</td>
				</tr>
				<tr>
					<td colspan="2">&nbsp;</td>
				</tr>
				</table>
			</td>
		</tr>
<?php 
            }
        }
        if ($foundSources == 0) {
            ?>
		<tr>
			<td><?php 
            echo JText::_('A_IMPORT_NO_SOURCES');
            ?>
</td>
		</tr>
<?php 
        }
        ?>
		</table>
	</fieldset>
	</td>
</tr>
</table>
</form>
</div>
<?php 
    }
Exemple #12
0
    function getCommentsFormFull()
    {
        $object_id = $this->getVar('comment-object_id');
        $object_group = $this->getVar('comment-object_group');
        $htmlBeforeForm = $this->getVar('comments-form-html-before');
        $htmlAfterForm = $this->getVar('comments-form-html-after');
        ?>
<!-- <h4><?php 
        echo JText::_('FORM_HEADER');
        ?>
</h4>  -->
<div class="contenedor-blog-1-sep2"></div>
<div class="blogcomentarios-header">Deja un comentario</div>
<?php 
        if ($this->getVar('comments-form-policy', 0) == 1) {
            ?>
<div class="comments-policy"><?php 
            echo $this->getVar('comments-policy');
            ?>
</div>
<?php 
        }
        echo $htmlBeforeForm;
        ?>
<a id="addcomments" href="#addcomments"></a>
<form id="comments-form" name="comments-form" action="javascript:void(null);">
<?php 
        if ($this->getVar('comments-form-user-name', 1) == 1) {
            $text = $this->getVar('comments-form-user-name-required', 1) == 0 ? JText::_('FORM_NAME') : JText::_('FORM_NAME_REQUIRED');
            ?>
<p>
	<span>
		<input id="comments-form-name" type="text" name="name" value="" maxlength="<?php 
            echo $this->getVar('comment-name-maxlength');
            ?>
" size="22" tabindex="1" class="blog-comment-text" />
		<label for="comments-form-name" class="blogcomentarios-campo-form"><b>Nombre</b> requerido</label>
	</span>
</p>
<?php 
        }
        if ($this->getVar('comments-form-user-email', 1) == 1) {
            $text = $this->getVar('comments-form-email-required', 1) == 0 ? JText::_('FORM_EMAIL') : JText::_('FORM_EMAIL_REQUIRED');
            ?>
<p>
	<span>
		<input id="comments-form-email" type="text" name="email" value="" size="22" tabindex="2" class="blog-comment-text" />
		<label for="comments-form-email" class="blogcomentarios-campo-form"><b>E-MAIL</b> requerido (no se publicar&aacute)</label>
	</span>
</p>
<?php 
        }
        if ($this->getVar('comments-form-user-homepage', 0) == 1) {
            $text = $this->getVar('comments-form-homepage-required', 1) == 0 ? JText::_('FORM_HOMEPAGE') : JText::_('FORM_HOMEPAGE_REQUIRED');
            ?>
<p>
	<span>
		<input id="comments-form-homepage" type="text" name="homepage" value="" size="22" tabindex="3" />
		<label for="comments-form-homepage"><?php 
            echo $text;
            ?>
</label>
	</span>
</p>
<?php 
        }
        if ($this->getVar('comments-form-title', 0) == 1) {
            $text = $this->getVar('comments-form-title-required', 1) == 0 ? JText::_('FORM_TITLE') : JText::_('FORM_TITLE_REQUIRED');
            ?>
<p>
	<span>
		<input id="comments-form-title" type="text" name="title" value="" size="22" tabindex="4" />
		<label for="comments-form-title"><?php 
            echo $text;
            ?>
</label>
	</span>
</p>
<?php 
        }
        ?>
<p>
	<span>
		<textarea id="comments-form-comment" name="comment" cols="205" rows="5" tabindex="5" class="blog-comment-text"></textarea>
	</span>
</p>
<?php 
        if ($this->getVar('comments-form-subscribe', 0) == 1) {
            ?>
<p>
	<span>
		<input class="checkbox" id="comments-form-subscribe" type="checkbox" name="subscribe" value="1" tabindex="5" />
		<label for="comments-form-subscribe"><?php 
            echo JText::_('FORM_SUBSCRIBE');
            ?>
</label><br />
	</span>
</p>
<?php 
        }
        if ($this->getVar('comments-form-captcha', 0) == 1) {
            $html = $this->getVar('comments-form-captcha-html');
            if ($html != '') {
                echo $html;
            } else {
                $link = JCommentsFactory::getLink('captcha');
                ?>
<p>
	<span>
		<img class="captcha" onclick="jcomments.clear('captcha');" id="comments-form-captcha-image" src="<?php 
                echo $link;
                ?>
" width="121" height="60" alt="<?php 
                echo JText::_('FORM_CAPTCHA');
                ?>
" /><br />
		<span class="captcha" onclick="jcomments.clear('captcha');">Pulsa para mostrar otra imagen</span><br />
		<input class="captcha" id="comments-form-captcha" type="text" name="captcha_refid" value="" size="5" tabindex="6" /><br />
	</span>
</p>
<?php 
            }
        }
        ?>
<div id="comments-form-buttons">
	
	 <div id="comments-form-send" class="contenidonivel2-lateralderecho-boton-interno" style="background-image:url(http://www.cesae.es/images/btnpeq.png);cursor:hand;" onmouseover="JavaScript:this.style.backgroundImage='url(http://www.cesae.es/images/btnpeqon.png)'" onmouseout="JavaScript:this.style.backgroundImage='url(http://www.cesae.es/images/btnpeq.png)'" ontouchstart="JavaScript:this.style.backgroundImage='url(http://www.cesae.es/images/btnpeqon.png)'" ontouchend="JavaScript:this.style.backgroundImage='url(http://www.cesae.es/images/btnpeq.png)'">
			<a href="#" onclick="jcomments.saveComment();return false;"  title="CESAE ENVIAR COMENTARIO" id="contenidonivel2-lateralderecho-boton-interno-btn"  >ENVIAR COMENTARIO</a>
			</div>
	
	<div class="btn" id="comments-form-cancel" style="display:none;"><div><a href="#" tabindex="8" onclick="return false;" title="<?php 
        echo JText::_('FORM_CANCEL');
        ?>
"><?php 
        echo JText::_('FORM_CANCEL');
        ?>
</a></div></div>
	<div style="clear:both;"></div>
</div>
<div>
	<input type="hidden" name="object_id" value="<?php 
        echo $object_id;
        ?>
" />
	<input type="hidden" name="object_group" value="<?php 
        echo $object_group;
        ?>
" />
</div>
</form>
<script type="text/javascript">
<!--
function JCommentsInitializeForm()
{
	var jcEditor = new JCommentsEditor('comments-form-comment', true);
<?php 
        if ($this->getVar('comments-form-bbcode', 0) == 1) {
            $bbcodes = array('b' => array(0 => JText::_('FORM_BBCODE_B'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT')), 'i' => array(0 => JText::_('FORM_BBCODE_I'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT')), 'u' => array(0 => JText::_('FORM_BBCODE_U'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT')), 's' => array(0 => JText::_('FORM_BBCODE_S'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT')), 'img' => array(0 => JText::_('FORM_BBCODE_IMG'), 1 => JText::_('BBCODE_HINT_ENTER_FULL_URL_TO_THE_IMAGE')), 'url' => array(0 => JText::_('FORM_BBCODE_URL'), 1 => JText::_('BBCODE_HINT_ENTER_FULL_URL')), 'hide' => array(0 => JText::_('FORM_BBCODE_HIDE'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT_TO_HIDE_IT_FROM_UNREGISTERED')), 'quote' => array(0 => JText::_('FORM_BBCODE_QUOTE'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT_TO_QUOTE')), 'list' => array(0 => JText::_('FORM_BBCODE_LIST'), 1 => JText::_('BBCODE_HINT_ENTER_LIST_ITEM_TEXT')));
            foreach ($bbcodes as $k => $v) {
                if ($this->getVar('comments-form-bbcode-' . $k, 0) == 1) {
                    $title = trim(JCommentsText::jsEscape($v[0]));
                    $text = trim(JCommentsText::jsEscape($v[1]));
                    ?>
	jcEditor.addButton('<?php 
                    echo $k;
                    ?>
','<?php 
                    echo $title;
                    ?>
','<?php 
                    echo $text;
                    ?>
');
<?php 
                }
            }
        }
        $customBBCodes = $this->getVar('comments-form-custombbcodes');
        if (count($customBBCodes)) {
            foreach ($customBBCodes as $code) {
                if ($code->button_enabled) {
                    $k = 'custombbcode' . $code->id;
                    $title = trim(JCommentsText::jsEscape($code->button_title));
                    $text = empty($code->button_prompt) ? JText::_('BBCODE_HINT_ENTER_TEXT') : JText::_($code->button_prompt);
                    $open_tag = $code->button_open_tag;
                    $close_tag = $code->button_close_tag;
                    $icon = $code->button_image;
                    $css = $code->button_css;
                    ?>
	jcEditor.addButton('<?php 
                    echo $k;
                    ?>
','<?php 
                    echo $title;
                    ?>
','<?php 
                    echo $text;
                    ?>
','<?php 
                    echo $open_tag;
                    ?>
','<?php 
                    echo $close_tag;
                    ?>
','<?php 
                    echo $css;
                    ?>
','<?php 
                    echo $icon;
                    ?>
');
<?php 
                }
            }
        }
        $smiles = $this->getVar('comment-form-smiles');
        if (isset($smiles)) {
            if (is_array($smiles) && count($smiles) > 0) {
                ?>
	jcEditor.initSmiles('<?php 
                echo $this->getVar("smilesurl");
                ?>
');
<?php 
                foreach ($smiles as $code => $icon) {
                    $code = trim(JCommentsText::jsEscape($code));
                    $icon = trim(JCommentsText::jsEscape($icon));
                    ?>
	jcEditor.addSmile('<?php 
                    echo $code;
                    ?>
','<?php 
                    echo $icon;
                    ?>
');
<?php 
                }
            }
        }
        if ($this->getVar('comments-form-showlength-counter', 0) == 1) {
            ?>
	jcEditor.addCounter(<?php 
            echo $this->getVar('comment-maxlength');
            ?>
, 'Quedan', 'caracteres', 'counter');
<?php 
        }
        ?>
	jcomments.setForm(new JCommentsForm('comments-form', jcEditor));
}

<?php 
        if ($this->getVar('comments-form-ajax', 0) == 1) {
            ?>
setTimeout(JCommentsInitializeForm, 100);
<?php 
        } else {
            ?>
if (window.addEventListener) {window.addEventListener('load',JCommentsInitializeForm,false);}
else if (document.addEventListener){document.addEventListener('load',JCommentsInitializeForm,false);}
else if (window.attachEvent){window.attachEvent('onload',JCommentsInitializeForm);}
else {if (typeof window.onload=='function'){var oldload=window.onload;window.onload=function(){oldload();JCommentsInitializeForm();}} else window.onload=JCommentsInitializeForm;} 
<?php 
        }
        ?>
//-->
</script>
<?php 
        echo $htmlAfterForm;
    }