Exemplo n.º 1
0
 public static function yesnoSelectList($tag_name, $tag_attribs, $selected, $yes = 'yes', $no = 'no')
 {
     if (JCOMMENTS_JVERSION == '1.0') {
         $arr = array(JCommentsHTML::makeOption(0, $no), JCommentsHTML::makeOption(1, $yes));
     } else {
         $arr = array(JCommentsHTML::makeOption(0, $no), JCommentsHTML::makeOption(1, $yes));
     }
     return JCommentsHTML::selectList($arr, $tag_name, $tag_attribs, 'value', 'text', (int) $selected);
 }
    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 
    }
    public static function edit($row)
    {
        ?>
<style type="text/css">
.editbox {border: 1px solid #ccc;padding: 2px;}
.short {width: 40px;}
.long {width: 450px;}
</style>
<script type="text/javascript">
<!--
<?php 
        if (JCOMMENTS_JVERSION == '1.7') {
            ?>
Joomla.submitbutton = function (task) {
	if (task == 'subscription.cancel') {
		Joomla.submitform(task, document.getElementById('adminForm'));
		return;
	}
	if (document.adminForm.object_group.value == "") {
		alert("<?php 
            echo addslashes(JText::sprintf('A_FORM_VALIDATE_FIELD_REQUIRED', JText::_('A_COMPONENT')));
            ?>
");
	} else if (document.adminForm.object_id.value == "") {
		alert("<?php 
            echo addslashes(JText::sprintf('A_FORM_VALIDATE_FIELD_REQUIRED', JText::_('A_SUBSCRIPTION_OBJECT_ID')));
            ?>
");
	} else if (document.adminForm.name.value == "") {
		alert("<?php 
            echo addslashes(JText::sprintf('A_FORM_VALIDATE_FIELD_REQUIRED', JText::_('A_SUBSCRIPTION_NAME')));
            ?>
");
	} else if (document.adminForm.email.value == "") {
		alert("<?php 
            echo addslashes(JText::sprintf('A_FORM_VALIDATE_FIELD_REQUIRED', JText::_('A_SUBSCRIPTION_EMAIL')));
            ?>
");
	} else {
		Joomla.submitform(task, document.getElementById('adminForm'));
	}
};
<?php 
        } else {
            ?>
function submitbutton(task)
{
	if (task == 'subscription.cancel') {
		submitform(task);
		return;
	}
	if (document.adminForm.object_group.value == "") {
		alert("<?php 
            echo addslashes(JText::sprintf('A_FORM_VALIDATE_FIELD_REQUIRED', JText::_('A_COMPONENT')));
            ?>
");
	} else if (document.adminForm.object_id.value == "") {
		alert("<?php 
            echo addslashes(JText::sprintf('A_FORM_VALIDATE_FIELD_REQUIRED', JText::_('A_SUBSCRIPTION_OBJECT_ID')));
            ?>
");
	} else if (document.adminForm.name.value == "") {
		alert("<?php 
            echo addslashes(JText::sprintf('A_FORM_VALIDATE_FIELD_REQUIRED', JText::_('A_SUBSCRIPTION_NAME')));
            ?>
");
	} else if (document.adminForm.email.value == "") {
		alert("<?php 
            echo addslashes(JText::sprintf('A_FORM_VALIDATE_FIELD_REQUIRED', JText::_('A_SUBSCRIPTION_EMAIL')));
            ?>
");
	} else {
		submitform(task);
	}
}
<?php 
        }
        ?>
//-->
</script>
<form action="<?php 
        echo JCOMMENTS_INDEX;
        ?>
" method="post" name="adminForm" id="adminForm">
<?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-subscriptions.png" width="48" height="48" align="middle" alt="<?php 
            echo JText::_('A_SUBSCRIPTION_EDIT');
            ?>
">&nbsp;<?php 
            echo JText::_('A_SUBSCRIPTION_EDIT');
            ?>
</th>
	</tr>
</table>
<?php 
        }
        ?>
<table class="adminform" width="100%" cellpadding="4" cellspacing="1" border="0">
<tr valign="top" align="left">
	<td><label for="object_group"><?php 
        echo JText::_('A_COMPONENT');
        ?>
</label></td>
	<td><input type="text" class="editbox long" size="35" id="object_group" name="object_group" value="<?php 
        echo $row->object_group;
        ?>
"></td>
</tr>
<tr valign="top" align="left">
	<td><label for="object_id"><?php 
        echo JText::_('A_SUBSCRIPTION_OBJECT_ID');
        ?>
</label></td>
	<td><input type="text" class="editbox short" size="35" id="object_id" name="object_id" value="<?php 
        echo $row->object_id;
        ?>
"></td>
</tr>
<tr valign="top" align="left">
	<td><label for="name"><?php 
        echo JText::_('A_SUBSCRIPTION_NAME');
        ?>
</label></td>
	<td><input type="text" class="editbox long" size="35" id="name" name="name" value="<?php 
        echo $row->name;
        ?>
"></td>
</tr>
<tr valign="top" align="left">
	<td><label for="email"><?php 
        echo JText::_('A_SUBSCRIPTION_EMAIL');
        ?>
</label></td>
	<td><input type="text" class="editbox long" size="35" id="email" name="email" value="<?php 
        echo $row->email;
        ?>
"></td>
</tr>
<tr valign="top" align="left">
	<td><?php 
        echo JText::_('A_PUBLISHING');
        ?>
</td>
	<td><?php 
        echo JCommentsHTML::yesnoRadioList('published', 'class="inputbox"', $row->published, JText::_('A_YES'), JText::_('A_NO'));
        ?>
</td>
</tr>
</table>
<input type="hidden" name="option" value="com_jcomments" />
<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
<input type="hidden" name="task" value="" />
<?php 
        echo JCommentsSecurity::formToken();
        ?>
</form>
<?php 
    }
Exemplo n.º 4
0
    public static function show($lists)
    {
        if (JCOMMENTS_JVERSION != '1.0') {
            ?>
<script type="text/javascript">
<!--
function tableOrdering(order, dir, task)
{
	var form = document.adminForm;
	form.filter_order.value = order;
	form.filter_order_Dir.value = dir;
	document.adminForm.submit(task);
}
//-->
</script>
<?php 
        }
        ?>
<form action="<?php 
        echo JCOMMENTS_INDEX;
        ?>
" method="post" name="adminForm" id="adminForm">
<table class="adminheading" width="100%">
	<tr>
<?php 
        if (JCOMMENTS_JVERSION == '1.0') {
            ?>
		<th style="background-image: none; padding: 0;"><img src="components/com_jcomments/assets/icon-48-blacklist.png" width="48" height="48" align="middle" alt="<?php 
            echo JText::_('A_BLACKLIST');
            ?>
" />&nbsp;<?php 
            echo JText::_('A_BLACKLIST');
            ?>
</th>
<?php 
        }
        ?>
		<td nowrap="nowrap" align="left" width="50%">
			<label for="search"><?php 
        echo JText::_('A_FILTER');
        ?>
:</label>
			<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
			<button onclick="this.form.submit();"><?php 
        echo JText::_('A_FILTER_APPLY');
        ?>
</button>
			<button onclick="document.getElementById('search').value='';this.form.submit();"><?php 
        echo JText::_('A_FILTER_RESET');
        ?>
</button>
		</td>
		<td nowrap="nowrap" align="right" width="50%"></td>
	</tr>
</table>
<table class="adminlist" cellspacing="1">
	<thead>
		<tr>
			<th width="1%"><input type="checkbox" id="toggle" name="toggle" value="" onclick="checkAll(<?php 
        echo count($lists['rows']);
        ?>
);" /></th>
<?php 
        if (JCOMMENTS_JVERSION == '1.0') {
            ?>
			<th width="10%" align="left" nowrap="nowrap"><?php 
            echo JText::_('A_BLACKLIST_IP');
            ?>
</th>
			<th width="20%" align="left"><?php 
            echo JText::_('A_BLACKLIST_REASON');
            ?>
</th>
			<th width="60%" align="left"><?php 
            echo JText::_('A_BLACKLIST_NOTES');
            ?>
</th>
			<th width="10%" align="left"><?php 
            echo JText::_('A_BLACKLIST_CREATED');
            ?>
</th>
<?php 
        } else {
            ?>
			<th width="10%" align="left" nowrap="nowrap"><?php 
            echo JHTML::_('grid.sort', 'A_BLACKLIST_IP', 'bl.ip', $lists['order_Dir'], $lists['order']);
            ?>
</th>
			<th width="20%" align="left"><?php 
            echo JHTML::_('grid.sort', 'A_BLACKLIST_REASON', 'bl.reason', $lists['order_Dir'], $lists['order']);
            ?>
</th>
			<th width="60%" align="left"><?php 
            echo JHTML::_('grid.sort', 'A_BLACKLIST_NOTES', 'bl.notes', $lists['order_Dir'], $lists['order']);
            ?>
</th>
			<th width="10%" align="left"><?php 
            echo JHTML::_('grid.sort', 'A_BLACKLIST_CREATED', 'bl.created', $lists['order_Dir'], $lists['order']);
            ?>
</th>
<?php 
        }
        ?>
		</tr>
	</thead>
	<tbody>
<?php 
        for ($i = 0, $k = 0, $n = count($lists['rows']); $i < $n; $i++) {
            $row =& $lists['rows'][$i];
            $link = JCOMMENTS_INDEX . '?option=com_jcomments&task=blacklist.edit&hidemainmenu=1&cid=' . $row->id;
            ?>
<tr class="<?php 
            echo "row{$k}";
            ?>
">
	<td align="center"><?php 
            echo JCommentsHTML::_('grid.checkedout', $row, $i);
            ?>
</td>
	<td align="left"><a href="<?php 
            echo $link;
            ?>
" title="<?php 
            echo JText::_('A_EDIT');
            ?>
"><?php 
            echo $row->ip;
            ?>
</a></td>
	<td align="left"><?php 
            echo $row->reason;
            ?>
</td>
	<td align="left"><?php 
            echo $row->notes;
            ?>
</td>
	<td align="center"><?php 
            echo $row->created;
            ?>
</td>
</tr>
<?php 
            $k = 1 - $k;
        }
        ?>
</tbody>
	<tfoot>
		<tr>
			<td colspan="15"><?php 
        echo $lists['pageNav']->getListFooter();
        ?>
</td>
		</tr>
	</tfoot>
</table>
<input type="hidden" name="option" value="com_jcomments" />
<input type="hidden" name="task" value="blacklist" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="hidemainmenu" value="0" />
<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
<input type="hidden" name="filter_order_Dir" value="" />
<?php 
        echo JCommentsSecurity::formToken();
        ?>
</form>
<?php 
    }
Exemplo n.º 5
0
 public static function showSettings()
 {
     $db = JCommentsFactory::getDBO();
     $config = JCommentsFactory::getConfig();
     // check current site template for afterDisplayContent event
     if (JCOMMENTS_JVERSION == '1.5') {
         $db->setQuery('SELECT template FROM #__templates_menu WHERE client_id = 0 AND menuid = 0', 0, 1);
         $template = $db->loadResult();
         $articleTemplate = JPATH_SITE . '/templates/' . $template . '/html/com_content/article/default.php';
         if (is_file($articleTemplate)) {
             $tmpl = implode('', file($articleTemplate));
             if (strpos($tmpl, 'afterDisplayContent') === false && !(strpos($tmpl, 'include') !== false || strpos($tmpl, 'require') !== false)) {
                 JError::raiseWarning(500, JText::_('A_WARNINGS_TEMPLATE_EVENT'));
             }
         }
     }
     $joomfish = JOOMLATUNE_JPATH_SITE . '/components/com_joomfish/joomfish.php';
     if (is_file($joomfish) || JCommentsMultilingual::isEnabled()) {
         $languages = JCommentsMultilingual::getLanguages();
         if (count($languages)) {
             $lang = trim(JCommentsInput::getVar('lang', ''));
             if ($lang == '') {
                 if (JCOMMENTS_JVERSION != '1.0') {
                     $params = JComponentHelper::getParams('com_languages');
                     $lang = $params->get("site", 'en-GB');
                 }
                 if ($lang == '') {
                     $lang = JCommentsMultilingual::getLanguage();
                 }
             }
             // reload configuration
             $config = JCommentsFactory::getConfig($lang);
             $lists['languages'] = JCommentsHTML::selectList($languages, 'lang', 'class="inputbox" size="1" onchange="submitform(\'settings\');"', 'value', 'name', $lang);
         }
     }
     $forbiddenNames = $config->get('forbidden_names');
     $forbiddenNames = preg_replace('#,+#', "\n", $forbiddenNames);
     $config->set('forbidden_names', $forbiddenNames);
     $badWords = $config->get('badwords');
     if ($badWords != '') {
         $config->set('badwords', implode("\n", $badWords));
     }
     require_once JCOMMENTS_LIBRARIES . '/joomlatune/filesystem.php';
     // path to images directory
     $path = JCOMMENTS_BASE . DS . 'tpl' . DS;
     $items = JoomlaTuneFS::readDirectory($path);
     $templates = array();
     foreach ($items as $item) {
         if (is_dir($path . $item)) {
             $tpl = new StdClass();
             $tpl->text = $item;
             $tpl->value = $item;
             $templates[] = $tpl;
         }
     }
     $currentTemplate = $config->get('template');
     $lists['templates'] = JCommentsHTML::selectList($templates, 'cfg_template', 'class="inputbox"', 'value', 'text', $currentTemplate);
     require_once JCOMMENTS_HELPERS . '/user.php';
     $groups = JCommentsUserHelper::getUserGroups();
     $captchaError = '';
     $captchaExclude = array();
     if (!extension_loaded('gd') || !function_exists('imagecreatefrompng')) {
         if ($config->get('captcha_engine', 'kcaptcha') != 'recaptcha') {
             foreach ($groups as $group) {
                 $captchaExclude[] = $group->id;
             }
             $captchaError = JText::_('A_WARNINGS_PHP_GD');
         }
     }
     $reportError = '';
     $reportExclude = array();
     if ($config->getInt('enable_notification') == 0 || $config->check('notification_type', 2) == false) {
         foreach ($groups as $group) {
             $reportExclude[] = $group->id;
         }
         $reportError = JText::_('A_REPORTS_WARNING_NOTIFICATIONS_DISABLED');
     }
     $lists['group_names'] = $groups;
     $permissions = array();
     // Post
     JCommentsAdmin::loadParam($permissions, 'can_comment', $groups, JText::_('A_RIGHTS_POST'), JText::_('AP_CAN_COMMENT'), JText::_('AP_CAN_COMMENT_DESC'));
     JCommentsAdmin::loadParam($permissions, 'can_reply', $groups, JText::_('A_RIGHTS_POST'), JText::_('AP_CAN_REPLY'), JText::_('AP_CAN_REPLY_DESC'));
     JCommentsAdmin::loadParam($permissions, 'autopublish', $groups, JText::_('A_RIGHTS_POST'), JText::_('AP_AUTOPUBLISH'), JText::_('AP_AUTOPUBLISH_DESC'));
     JCommentsAdmin::loadParam($permissions, 'show_policy', $groups, JText::_('A_RIGHTS_POST'), JText::_('AP_SHOW_POLICY'), JText::_('AP_SHOW_POLICY_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_captcha', $groups, JText::_('A_RIGHTS_POST'), JText::_('AP_ENABLE_CAPTCHA'), JText::_('AP_ENABLE_CAPTCHA_DESC'), $captchaExclude, $captchaError);
     JCommentsAdmin::loadParam($permissions, 'floodprotection', $groups, JText::_('A_RIGHTS_POST'), JText::_('AP_ENABLE_FLOODPROTECTION'), JText::_('AP_ENABLE_FLOODPROTECTION_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_comment_length_check', $groups, JText::_('A_RIGHTS_POST'), JText::_('AP_ENABLE_COMMENT_LENGTH_CHECK'), JText::_('AP_ENABLE_COMMENT_LENGTH_CHECK_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_autocensor', $groups, JText::_('A_RIGHTS_POST'), JText::_('AP_ENABLE_AUTOCENSOR'), JText::_('AP_ENABLE_AUTOCENSOR_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_subscribe', $groups, JText::_('A_RIGHTS_POST'), JText::_('AP_ENABLE_SUBSCRIBE'), JText::_('AP_ENABLE_SUBSCRIBE_DESC'));
     // BBCodes
     JCommentsAdmin::loadParam($permissions, 'enable_bbcode_b', $groups, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_B'), JText::_('AP_ENABLE_BBCODE_B_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_bbcode_i', $groups, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_I'), JText::_('AP_ENABLE_BBCODE_I_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_bbcode_u', $groups, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_U'), JText::_('AP_ENABLE_BBCODE_U_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_bbcode_s', $groups, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_S'), JText::_('AP_ENABLE_BBCODE_S_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_bbcode_url', $groups, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_URL'), JText::_('AP_ENABLE_BBCODE_URL_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_bbcode_img', $groups, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_IMG'), JText::_('AP_ENABLE_BBCODE_IMG_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_bbcode_list', $groups, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_LIST'), JText::_('AP_ENABLE_BBCODE_LIST_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_bbcode_hide', $groups, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_HIDE'), JText::_('AP_ENABLE_BBCODE_HIDE_DESC'), array('Public'));
     JCommentsAdmin::loadParam($permissions, 'enable_bbcode_quote', $groups, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_QUOTE'), JText::_('AP_ENABLE_BBCODE_QUOTE_DESC'));
     // View
     JCommentsAdmin::loadParam($permissions, 'autolinkurls', $groups, JText::_('A_RIGHTS_VIEW'), JText::_('AP_ENABLE_AUTOLINKURLS'), JText::_('AP_ENABLE_AUTOLINKURLS_DESC'));
     JCommentsAdmin::loadParam($permissions, 'emailprotection', $groups, JText::_('A_RIGHTS_VIEW'), JText::_('AP_ENABLE_EMAILPROTECTION'), JText::_('AP_ENABLE_EMAILPROTECTION_DESC'));
     JCommentsAdmin::loadParam($permissions, 'enable_gravatar', $groups, JText::_('A_RIGHTS_VIEW'), JText::_('AP_ENABLE_GRAVATAR'), JText::_('AP_ENABLE_GRAVATAR_DESC'));
     JCommentsAdmin::loadParam($permissions, 'can_view_email', $groups, JText::_('A_RIGHTS_VIEW'), JText::_('AP_CAN_VIEW_AUTHOR_EMAIL'), JText::_('AP_CAN_VIEW_AUTHOR_EMAIL_DESC'));
     JCommentsAdmin::loadParam($permissions, 'can_view_homepage', $groups, JText::_('A_RIGHTS_VIEW'), JText::_('AP_CAN_VIEW_AUTHOR_HOMEPAGE'), JText::_('AP_CAN_VIEW_AUTHOR_HOMEPAGE_DESC'));
     JCommentsAdmin::loadParam($permissions, 'can_view_ip', $groups, JText::_('A_RIGHTS_VIEW'), JText::_('AP_CAN_VIEW_AUTHOR_IP'), JText::_('AP_CAN_VIEW_AUTHOR_IP_DESC'), array('Public', 'Registered'));
     // Edit
     JCommentsAdmin::loadParam($permissions, 'can_edit_own', $groups, JText::_('A_RIGHTS_EDIT'), JText::_('AP_CAN_EDIT_OWN'), JText::_('AP_CAN_EDIT_OWN_DESC'), array('Public'));
     JCommentsAdmin::loadParam($permissions, 'can_delete_own', $groups, JText::_('A_RIGHTS_EDIT'), JText::_('AP_CAN_DELETE_OWN'), JText::_('AP_CAN_DELETE_OWN_DESC'), array('Public'));
     // Administration
     JCommentsAdmin::loadParam($permissions, 'can_edit', $groups, JText::_('A_RIGHTS_ADMINISTRATION'), JText::_('AP_CAN_EDIT'), JText::_('AP_CAN_EDIT_DESC'), array('Public', 'Registered'));
     JCommentsAdmin::loadParam($permissions, 'can_edit_for_my_object', $groups, JText::_('A_RIGHTS_ADMINISTRATION'), JText::_('AP_CAN_EDIT_FOR_MY_OBJECT'), JText::_('AP_CAN_EDIT_FOR_MY_OBJECT_DESC'), array('Public'));
     JCommentsAdmin::loadParam($permissions, 'can_publish', $groups, JText::_('A_RIGHTS_ADMINISTRATION'), JText::_('AP_CAN_PUBLISH'), JText::_('AP_CAN_PUBLISH_DESC'), array('Public', 'Registered'));
     JCommentsAdmin::loadParam($permissions, 'can_publish_for_my_object', $groups, JText::_('A_RIGHTS_ADMINISTRATION'), JText::_('AP_CAN_PUBLISH_FOR_MY_OBJECT'), JText::_('AP_CAN_PUBLISH_FOR_MY_OBJECT_DESC'), array('Public'));
     JCommentsAdmin::loadParam($permissions, 'can_delete', $groups, JText::_('A_RIGHTS_ADMINISTRATION'), JText::_('AP_CAN_DELETE'), JText::_('AP_CAN_DELETE_DESC'), array('Public', 'Registered'));
     JCommentsAdmin::loadParam($permissions, 'can_delete_for_my_object', $groups, JText::_('A_RIGHTS_ADMINISTRATION'), JText::_('AP_CAN_DELETE_FOR_MY_OBJECT'), JText::_('AP_CAN_DELETE_FOR_MY_OBJECT_DESC'), array('Public'));
     // Votes
     JCommentsAdmin::loadParam($permissions, 'can_vote', $groups, JText::_('A_RIGHTS_MISC'), JText::_('AP_CAN_VOTE'), JText::_('AP_CAN_VOTE_DESC'));
     JCommentsAdmin::loadParam($permissions, 'can_report', $groups, JText::_('A_RIGHTS_MISC'), JText::_('AP_CAN_REPORT'), JText::_('AP_CAN_REPORT_DESC'), $reportExclude, $reportError);
     JCommentsAdmin::loadParam($permissions, 'can_ban', $groups, JText::_('A_RIGHTS_MISC'), JText::_('AP_CAN_BAN'), JText::_('AP_CAN_BAN_DESC'), array('Public', 'Registered'));
     $lists['groups'] =& $permissions;
     if (JCOMMENTS_JVERSION == '1.0') {
         $lookupQuery = "SELECT c.id AS `value`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n WHERE c.id IN ( " . $config->get('enable_categories') . " )" . "\n ORDER BY s.title,c.title";
         $categoriesQuery = "SELECT c.id AS `value`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n ORDER BY s.title,c.title";
     } elseif (JCOMMENTS_JVERSION == '1.5') {
         $lookupQuery = "SELECT c.id AS `value`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n WHERE c.id IN ( " . $config->get('enable_categories') . " )" . "\n ORDER BY s.title,c.title";
         $categoriesQuery = "SELECT c.id AS `value`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n ORDER BY s.title,c.title";
     } else {
         $lookupQuery = "SELECT c.id AS `value`, c.title AS `text`" . "\n FROM #__categories AS c" . "\n WHERE c.extension = 'com_content'" . "\n AND c.id IN ( " . $config->get('enable_categories') . " )" . "\n ORDER BY c.title";
         $categoriesQuery = "SELECT c.id AS `value`, c.title AS `text`, c.level" . "\n FROM #__categories AS c" . "\n WHERE c.extension = 'com_content'" . "\n ORDER BY c.lft, c.title";
     }
     $db->setQuery($categoriesQuery);
     $categories = $db->loadObjectList();
     if (!is_array($categories)) {
         $categories = array();
     } else {
         if (JCOMMENTS_JVERSION == '1.7') {
             for ($i = 0, $n = count($categories); $i < $n; $i++) {
                 $repeat = $categories[$i]->level - 1 >= 0 ? $categories[$i]->level - 1 : 0;
                 $categories[$i]->text = str_repeat('- ', $repeat) . $categories[$i]->text;
             }
         }
     }
     if ($config->get('enable_categories') != '') {
         $db->setQuery($lookupQuery);
         $lookup = $db->loadObjectList();
     } else {
         $lookup = '';
     }
     $lists['categories'] = JCommentsHTML::selectList($categories, 'cfg_enable_categories[]', 'class="inputbox categories" size="10" multiple="multiple"', 'value', 'text', $lookup);
     $captcha = array();
     $captcha[] = JCommentsHTML::makeOption('kcaptcha', 'KCAPTCHA');
     $config->set('enable_mambots', 1);
     $enginesList = JCommentsEvent::trigger('onJCommentsCaptchaEngines');
     foreach ($enginesList as $engines) {
         foreach ($engines as $code => $text) {
             $captcha[] = JCommentsHTML::makeOption($code, $text);
         }
     }
     $disabledCAPTCHA = count($captcha) == 1 ? ' disabled="disabled"' : '';
     $lists["captcha"] = JCommentsHTML::selectList($captcha, 'cfg_captcha_engine', 'class="inputbox"' . $disabledCAPTCHA, 'value', 'text', $config->get('captcha_engine', 'kcaptcha'));
     HTML_JComments::showSettings($lists);
 }
    function edit($row, $lists)
    {
        ?>
<style type="text/css">
.editbox {border: 1px solid #ccc;padding: 2px;}
.short {width: 60px;}
.long {width: 450px;}
</style>
<script language="javascript" type="text/javascript">
<!--
function jc_insertText(id,text) {
	var ta=document.getElementById(id);
	if(typeof(ta.caretPos)!="undefined"&&ta.createTextRange){ta.focus();var sel=document.selection.createRange();sel.text=sel.text+text;ta.focus();}
	else if(typeof(ta.selectionStart)!="undefined"){
		var ss=ta.value.substr(0, ta.selectionStart);
		var se=ta.value.substr(ta.selectionEnd),sp=ta.scrollTop;
		ta.value=ss+text+se;
		if(ta.setSelectionRange){ta.focus();ta.setSelectionRange(ss.length+text.length,ss.length+text.length);}
		ta.scrollTop=sp;
	} else {ta.value+=text;ta.focus(ta.value.length-1);}
}

function submitbutton(pressbutton) {
	var form = document.adminForm;
	if (pressbutton == 'cancel') {
		submitform( pressbutton );
		return;
	}
	submitform( pressbutton );
}
//-->
</script>
<form action="<?php 
        echo JCOMMENTS_INDEX;
        ?>
" method="post" name="adminForm">
<?php 
        if (JCOMMENTS_JVERSION == '1.0') {
            ?>
<table class="adminheading">
	<tr>
		<th style="background-image: none; padding: 0;"><img src="./components/com_jcomments/assets/custombbcode48x48.png" width="48" height="48" align="middle">&nbsp;<?php 
            echo JText::_('EDIT');
            ?>
</th>
	</tr>
</table>
<?php 
        }
        ?>
<table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('A_COMMON');
        ?>
</legend>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="10%"><?php 
        echo JText::_('name');
        ?>
</td>
					<td><input type="text" class="editbox long" size="35" name="name" onChange="return generate_tag();" value="<?php 
        echo $row->name;
        ?>
"></td>
				</tr>
				<tr valign="top" align="left">
					<td><?php 
        echo JText::_('A_PUBLISHING');
        ?>
</td>
					<td><?php 
        echo JCommentsHTML::yesnoRadioList('published', 'class="inputbox"', $row->published, JText::_('A_YES'), JText::_('A_NO'));
        ?>
</td>
					<td></td>
				</tr>
				</table>
			</fieldset>
		</td>
	</tr>
	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('Pattern');
        ?>
</legend>
<?php 
        $tabs = new JCommentsTabs(1);
        $tabs->startPane('com_jcomments_custom_bbcode_pattern');
        $tabs->startTab(JText::_('Simple'), "simple_pattern_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="4" id="simple_pattern" name="simple_pattern"><?php 
        echo $row->simple_pattern;
        ?>
</textarea>
						<br />
						<?php 
        echo JText::_('Available tokens');
        ?>
						<abbr onclick="jc_insertText('simple_pattern', '{SIMPLETEXT}');" title="<?php 
        echo JText::_('TOKEN SIMPLETEXT');
        ?>
">{SIMPLETEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_pattern', '{TEXT}');" title="<?php 
        echo JText::_('TOKEN TEXT');
        ?>
">{TEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_pattern', '{IDENTIFIER}');" title="<?php 
        echo JText::_('TOKEN IDENTIFIER');
        ?>
">{IDENTIFIER}</abbr>
						<abbr onclick="jc_insertText('simple_pattern', '{NUMBER}');" title="<?php 
        echo JText::_('TOKEN NUMBER');
        ?>
">{NUMBER}</abbr>
					</td>
					<td align="left"><?php 
        echo JText::_('Simple pattern description');
        ?>
<br />
						<br /><?php 
        echo JText::_('Example');
        ?>
 [highlight={SIMPLETEXT1}]{SIMPLETEXT2}[/highlight]
					</td>
				</tr>
				</table>
<?php 
        $tabs->endTab();
        $tabs->startTab(JText::_('Advanced (Regular Expression)'), "regexp_pattern_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="4" name="pattern"><?php 
        echo $row->pattern;
        ?>
</textarea>
					</td>
					<td align="left">
						<?php 
        echo JText::_('PATTERN_DESC');
        ?>
<br />
						<br /><?php 
        echo JText::_('Example');
        ?>
 \[highlight\=([a-zA-Z0-9].?)\](*.?)\[\/highlight\]
					</td>
				</tr>
				</table>
<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>
			</fieldset>
		</td>
	</tr>
	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('Replacement');
        ?>
 (<?php 
        echo JText::_('HTML');
        ?>
)</legend>
<?php 
        $tabs2 = new JCommentsTabs(1);
        $tabs2->startPane('com_jcomments_custom_bbcode_replacement_html');
        $tabs2->startTab(JText::_('Simple'), "simple_replacement_html_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="4" id="simple_replacement_html" name="simple_replacement_html"><?php 
        echo $row->simple_replacement_html;
        ?>
</textarea>
						<br />
						<?php 
        echo JText::_('Available tokens');
        ?>
						<abbr onclick="jc_insertText('simple_replacement_html', '{SIMPLETEXT}');" title="<?php 
        echo JText::_('TOKEN SIMPLETEXT');
        ?>
">{SIMPLETEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_replacement_html', '{TEXT}');" title="<?php 
        echo JText::_('TOKEN TEXT');
        ?>
">{TEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_replacement_html', '{IDENTIFIER}');" title="<?php 
        echo JText::_('TOKEN IDENTIFIER');
        ?>
">{IDENTIFIER}</abbr>
						<abbr onclick="jc_insertText('simple_replacement_html', '{NUMBER}');" title="<?php 
        echo JText::_('TOKEN NUMBER');
        ?>
">{NUMBER}</abbr>
					</td>
					<td align="left">
						<?php 
        echo JText::_('Simple html replacement description');
        ?>
<br />
						<br /><?php 
        echo JText::_('Example');
        ?>
 &lt;span style="background-color: {SIMPLETEXT1};"&gt;{SIMPLETEXT2}&lt;/span&gt;
					</td>
				</tr>
				</table>
<?php 
        $tabs2->endTab();
        $tabs2->startTab(JText::_('Advanced (Regular Expression)'), "regexp_replacement_html_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="4" name="replacement_html"><?php 
        echo $row->replacement_html;
        ?>
</textarea>
					</td>
					<td align="left">
						<?php 
        echo JText::_('PATTERN_DESC');
        ?>
<br />
						<br /><?php 
        echo JText::_('Example');
        ?>
 &lt;span style="background-color: ${1};"&gt;${2}&lt;/span&gt;
					</td>
				</tr>
				</table>
<?php 
        $tabs2->endTab();
        $tabs2->endPane();
        ?>
			</fieldset>
		</td>
	</tr>

	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('Replacement');
        ?>
 (<?php 
        echo JText::_('Plain text');
        ?>
)</legend>
<?php 
        $tabs2 = new JCommentsTabs(1);
        $tabs2->startPane('com_jcomments_custom_bbcode_replacement_text');
        $tabs2->startTab(JText::_('Simple'), "simple_replacement_text_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="3" id="simple_replacement_text" name="simple_replacement_text"><?php 
        echo $row->simple_replacement_text;
        ?>
</textarea>
						<br />
						<?php 
        echo JText::_('Available tokens');
        ?>
						<abbr onclick="jc_insertText('simple_replacement_text', '{SIMPLETEXT}');" title="<?php 
        echo JText::_('TOKEN SIMPLETEXT');
        ?>
">{SIMPLETEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_replacement_text', '{TEXT}');" title="<?php 
        echo JText::_('TOKEN TEXT');
        ?>
">{TEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_replacement_text', '{IDENTIFIER}');" title="<?php 
        echo JText::_('TOKEN IDENTIFIER');
        ?>
">{IDENTIFIER}</abbr>
						<abbr onclick="jc_insertText('simple_replacement_text', '{NUMBER}');" title="<?php 
        echo JText::_('TOKEN NUMBER');
        ?>
">{NUMBER}</abbr>
					</td>
					<td align="left">
						<?php 
        echo JText::_('Simple text replacement description');
        ?>
<br />
						<br /><?php 
        echo JText::_('Example');
        ?>
 {SIMPLETEXT2}
					</td>
				</tr>
				</table>
<?php 
        $tabs2->endTab();
        $tabs2->startTab(JText::_('Advanced (Regular Expression)'), "regexp_replacement_text_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="3" name="replacement_text"><?php 
        echo $row->replacement_text;
        ?>
</textarea>
					</td>
					<td align="left">
						<?php 
        echo JText::_('PATTERN_DESC');
        ?>
<br />
						<br /><?php 
        echo JText::_('Example');
        ?>
 ${2}
					</td>
				</tr>
				</table>
<?php 
        $tabs2->endTab();
        $tabs2->endPane();
        ?>
			</fieldset>
		</td>
	</tr>

	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('Button');
        ?>
</legend>

				<table width="100%">
				<tr valign="top" align="left">
					<td width="10%"><label for="button_title"><?php 
        echo JText::_('Title');
        ?>
</label></td>
					<td><input type="text" class="editbox long" size="35" id="button_title" name="button_title" value="<?php 
        echo $row->button_title;
        ?>
"></td>
					<td><?php 
        echo JText::_('Title for this button');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><label for="button_prompt"><?php 
        echo JText::_('Help line');
        ?>
</label></td>
					<td><input type="text" class="editbox long" size="35" id="button_prompt" name="button_prompt" value="<?php 
        echo $row->button_prompt;
        ?>
"></td>
					<td><?php 
        echo JText::_('Help line for this button');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><label for="button_image"><?php 
        echo JText::_('Icon');
        ?>
</label></td>
					<td><input type="text" class="editbox long" size="35" id="button_image" name="button_image" value="<?php 
        echo $row->button_image;
        ?>
"></td>
					<td><?php 
        echo JText::_('Path to button icon');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><label for="button_css"><?php 
        echo JText::_('CSS class');
        ?>
</label></td>
					<td><input type="text" class="editbox short" size="35" id="button_css" name="button_css" value="<?php 
        echo $row->button_css;
        ?>
"></td>
					<td><?php 
        echo JText::_('CSS class name for this button');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><label for="button_open_tag"><?php 
        echo JText::_('Open tag');
        ?>
</label></td>
					<td><input type="text" class="editbox short" size="35" id="button_open_tag" name="button_open_tag" value="<?php 
        echo $row->button_open_tag;
        ?>
"></td>
					<td><?php 
        echo JText::_('The opening tag for this BBCode');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><label for="button_close_tag"><?php 
        echo JText::_('Close tag');
        ?>
</label></td>
					<td><input type="text" class="editbox short" size="35" id="button_close_tag" name="button_close_tag" value="<?php 
        echo $row->button_close_tag;
        ?>
"></td>
					<td><?php 
        echo JText::_('The closing tag of the BBCode');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><?php 
        echo JText::_('Enable button');
        ?>
</td>
					<td><?php 
        echo JCommentsHTML::yesnoRadioList('button_enabled', 'class="inputbox"', $row->button_enabled, JText::_('A_YES'), JText::_('A_NO'));
        ?>
</td>
					<td></td>
				</tr>
				</table>
			</fieldset>
		</td>
	</tr>

	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('Permissions');
        ?>
</legend>

				<table width="100%">
				<tr valign="top" align="left">
					<td>
<?php 
        foreach ($lists['groups'] as $k => $v) {
            ?>
						<input type="checkbox" name="button_acl[]" value="<?php 
            echo $k;
            ?>
" <?php 
            echo $v == '1' ? 'checked' : '';
            ?>
 />
						<label for="<?php 
            echo $k;
            ?>
"><?php 
            echo $k;
            ?>
</label>
						<br />
<?php 
        }
        ?>
					
					</td>
				</tr>
				</table>
			</fieldset>
		</td>
	</tr>
</table>
<input type="hidden" name="option" value="com_jcomments" />
<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
<input type="hidden" name="task" value="" />
</form>
<?php 
    }
    function edit($row)
    {
        ?>
<style type="text/css">
.editbox {border: 1px solid #ccc;padding: 2px;}
.short {width: 40px;}
.long {width: 450px;}
</style>
<script type="text/javascript">
<!--
function submitbutton(pressbutton) {
	var form = document.adminForm;
	if (pressbutton == 'subscription.cancel') {
		submitform( pressbutton );
		return;
	}
	if ( form.email.value == "" ) {
		alert( "<?php 
        echo JText::_('ERROR_EMPTY_EMAIL');
        ?>
" );
	} else {
		submitform( pressbutton );
	}
}
//-->
</script>
<form action="<?php 
        echo JCOMMENTS_INDEX;
        ?>
" method="post" name="adminForm">
<?php 
        if (JCOMMENTS_JVERSION == '1.0') {
            ?>
<table class="adminheading">
	<tr>
		<th style="background-image: none; padding: 0;"><img src="./components/com_jcomments/assets/subscriptions48x48" width="48" height="48" align="middle">&nbsp;<?php 
            echo JText::_('EDIT');
            ?>
</th>
	</tr>
</table>
<?php 
        }
        ?>
<table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
<tr valign="top" align="left">
	<td><label for="object_group"><?php 
        echo JText::_('Component');
        ?>
</label></td>
	<td><input type="text" class="editbox long" size="35" id="object_group" name="object_group" value="<?php 
        echo $row->object_group;
        ?>
"></td>
</tr>
<tr valign="top" align="left">
	<td><label for="object_id"><?php 
        echo JText::_('Object ID');
        ?>
</label></td>
	<td><input type="text" class="editbox short" size="35" id="object_id" name="object_id" value="<?php 
        echo $row->object_id;
        ?>
"></td>
</tr>
<tr valign="top" align="left">
	<td><label for="name"><?php 
        echo JText::_('Name');
        ?>
</label></td>
	<td><input type="text" class="editbox long" size="35" id="name" name="name" value="<?php 
        echo $row->name;
        ?>
"></td>
</tr>
<tr valign="top" align="left">
	<td><label for="email"><?php 
        echo JText::_('E-mail');
        ?>
</label></td>
	<td><input type="text" class="editbox long" size="35" id="email" name="email" value="<?php 
        echo $row->email;
        ?>
"></td>
</tr>
<tr valign="top" align="left">
	<td><?php 
        echo JText::_('State');
        ?>
</td>
	<td><?php 
        echo JCommentsHTML::yesnoRadioList('published', 'class="inputbox"', $row->published, JText::_('A_YES'), JText::_('A_NO'));
        ?>
</td>
</tr>
</table>
<input type="hidden" name="option" value="com_jcomments" />
<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
<input type="hidden" name="task" value="" />
</form>
<?php 
    }
    public static function edit($row, $lists)
    {
        $pcreText = JText::_('A_CUSTOM_BBCODE_ADVANCED_PATTERN_PCRE');
        $pcreLink = JText::_('A_CUSTOM_BBCODE_ADVANCED_PATTERN_PCRE_LINK');
        $patternLink = '<a href="' . $pcreLink . '">' . $pcreText . '</a>';
        $patternDescription = JText::sprintf('A_CUSTOM_BBCODE_ADVANCED_PATTERN_DESC', $patternLink);
        ?>
<style type="text/css">
.editbox {border: 1px solid #ccc;padding: 2px;}
.short {width: 100px;}
.middle {width: 250px;}
.long {width: 450px;}
.adminform fieldset label {display: inline; clear: none; float: none; font-size: 1em;}
.adminform fieldset input {float: none}
.adminform fieldset p {margin: 5px 0; }
</style>
<script language="javascript" type="text/javascript">
<!--
function jc_insertText(id,text) {
	var ta=document.getElementById(id);
	if(typeof(ta.caretPos)!="undefined"&&ta.createTextRange){ta.focus();var sel=document.selection.createRange();sel.text=sel.text+text;ta.focus();}
	else if(typeof(ta.selectionStart)!="undefined"){
		var ss=ta.value.substr(0, ta.selectionStart);
		var se=ta.value.substr(ta.selectionEnd),sp=ta.scrollTop;
		ta.value=ss+text+se;
		if(ta.setSelectionRange){ta.focus();ta.setSelectionRange(ss.length+text.length,ss.length+text.length);}
		ta.scrollTop=sp;
	} else {ta.value+=text;ta.focus(ta.value.length-1);}
}

<?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>
<form action="<?php 
        echo JCOMMENTS_INDEX;
        ?>
" method="post" name="adminForm" id="adminForm">
<?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-custombbcodes.png" width="48" height="48" align="middle" alt="<?php 
            echo JText::_('A_CUSTOM_BBCODE_EDIT');
            ?>
">&nbsp;<?php 
            echo JText::_('A_CUSTOM_BBCODE_EDIT');
            ?>
</th>
	</tr>
</table>
<?php 
        }
        ?>
<table class="adminform" width="100%" cellpadding="4" cellspacing="1" border="0">
	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('A_COMMON');
        ?>
</legend>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="10%"><label for="name"><?php 
        echo JText::_('A_CUSTOM_BBCODE_NAME');
        ?>
</label></td>
					<td><input type="text" class="editbox middle" size="35" id="name" name="name" onChange="return generate_tag();" value="<?php 
        echo $row->name;
        ?>
"></td>
				</tr>
				<tr valign="top" align="left">
					<td><?php 
        echo JText::_('A_PUBLISHING');
        ?>
</td>
					<td><?php 
        echo JCommentsHTML::yesnoRadioList('published', 'class="inputbox"', $row->published, JText::_('A_YES'), JText::_('A_NO'));
        ?>
</td>
					<td></td>
				</tr>
				</table>
			</fieldset>
		</td>
	</tr>
	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('A_CUSTOM_BBCODE_PATTERN');
        ?>
</legend>
<?php 
        $tabs = new JCommentsTabs(1);
        $tabs->startPane('com_jcomments_custom_bbcode_pattern');
        $tabs->startTab(JText::_('A_CUSTOM_BBCODE_SIMPLE'), "simple_pattern_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="4" cols="50" id="simple_pattern" name="simple_pattern"><?php 
        echo $row->simple_pattern;
        ?>
</textarea>
						<p><?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKENS');
        ?>
</p>
						<p>
						<abbr onclick="jc_insertText('simple_pattern', '{SIMPLETEXT}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_SIMPLETEXT');
        ?>
">{SIMPLETEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_pattern', '{TEXT}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_TEXT');
        ?>
">{TEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_pattern', '{IDENTIFIER}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_IDENTIFIER');
        ?>
">{IDENTIFIER}</abbr>
						<abbr onclick="jc_insertText('simple_pattern', '{ALPHA}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_ALPHA');
        ?>
">{ALPHA}</abbr>
						<abbr onclick="jc_insertText('simple_pattern', '{NUMBER}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_NUMBER');
        ?>
">{NUMBER}</abbr>
						</p>
					</td>
					<td align="left">
						<label for="simple_pattern"><?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_PATTERN_DESC');
        ?>
</label><br />
						<br /><?php 
        echo JText::_('A_CUSTOM_BBCODE_EXAMPLE');
        ?>
 [highlight={SIMPLETEXT1}]{SIMPLETEXT2}[/highlight]
					</td>
				</tr>
				</table>
<?php 
        $tabs->endTab();
        $tabs->startTab(JText::_('A_CUSTOM_BBCODE_ADVANCED'), "regexp_pattern_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="4" cols="50" id="pattern" name="pattern"><?php 
        echo $row->pattern;
        ?>
</textarea>
					</td>
					<td align="left">
						<label for="pattern"><?php 
        echo $patternDescription;
        ?>
</label><br />
						<br /><?php 
        echo JText::_('A_CUSTOM_BBCODE_EXAMPLE');
        ?>
 \[highlight\=([a-zA-Z0-9].?)\](*.?)\[\/highlight\]
					</td>
				</tr>
				</table>
<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>
			</fieldset>
		</td>
	</tr>
	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('A_CUSTOM_BBCODE_REPLACEMENT');
        ?>
 (<?php 
        echo JText::_('A_CUSTOM_BBCODE_HTML');
        ?>
)</legend>
<?php 
        $tabs2 = new JCommentsTabs(1);
        $tabs2->startPane('com_jcomments_custom_bbcode_replacement_html');
        $tabs2->startTab(JText::_('A_CUSTOM_BBCODE_SIMPLE'), "simple_replacement_html_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="4" cols="50" id="simple_replacement_html" name="simple_replacement_html"><?php 
        echo $row->simple_replacement_html;
        ?>
</textarea>
						<p><?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKENS');
        ?>
</p>
						<p>
						<abbr onclick="jc_insertText('simple_replacement_html', '{SIMPLETEXT}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_SIMPLETEXT');
        ?>
">{SIMPLETEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_replacement_html', '{TEXT}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_TEXT');
        ?>
">{TEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_replacement_html', '{IDENTIFIER}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_IDENTIFIER');
        ?>
">{IDENTIFIER}</abbr>
						<abbr onclick="jc_insertText('simple_replacement_html', '{ALPHA}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_ALPHA');
        ?>
">{ALPHA}</abbr>
						<abbr onclick="jc_insertText('simple_replacement_html', '{NUMBER}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_NUMBER');
        ?>
">{NUMBER}</abbr>
						</p>
					</td>
					<td align="left">
						<label for="simple_replacement_html"><?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_REPLACEMENT_HTML_DESC');
        ?>
</label><br />
						<br /><?php 
        echo JText::_('A_CUSTOM_BBCODE_EXAMPLE');
        ?>
 &lt;span style="background-color: {SIMPLETEXT1};"&gt;{SIMPLETEXT2}&lt;/span&gt;
					</td>
				</tr>
				</table>
<?php 
        $tabs2->endTab();
        $tabs2->startTab(JText::_('A_CUSTOM_BBCODE_ADVANCED'), "regexp_replacement_html_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="4" cols="50" id="replacement_html" name="replacement_html"><?php 
        echo $row->replacement_html;
        ?>
</textarea>
					</td>
					<td align="left">
						<label for="replacement_html"><?php 
        echo $patternDescription;
        ?>
</label><br />
						<br /><?php 
        echo JText::_('A_CUSTOM_BBCODE_EXAMPLE');
        ?>
 &lt;span style="background-color: ${1};"&gt;${2}&lt;/span&gt;
					</td>
				</tr>
				</table>
<?php 
        $tabs2->endTab();
        $tabs2->endPane();
        ?>
			</fieldset>
		</td>
	</tr>

	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('A_CUSTOM_BBCODE_REPLACEMENT');
        ?>
 (<?php 
        echo JText::_('A_CUSTOM_BBCODE_PLAIN_TEXT');
        ?>
)</legend>
<?php 
        $tabs2 = new JCommentsTabs(1);
        $tabs2->startPane('com_jcomments_custom_bbcode_replacement_text');
        $tabs2->startTab(JText::_('A_CUSTOM_BBCODE_SIMPLE'), "simple_replacement_text_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="3" cols="50" id="simple_replacement_text" name="simple_replacement_text"><?php 
        echo $row->simple_replacement_text;
        ?>
</textarea>
						<p><?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKENS');
        ?>
</p>
						<p>
						<abbr onclick="jc_insertText('simple_replacement_text', '{SIMPLETEXT}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_SIMPLETEXT');
        ?>
">{SIMPLETEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_replacement_text', '{TEXT}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_TEXT');
        ?>
">{TEXT}</abbr>,
						<abbr onclick="jc_insertText('simple_replacement_text', '{IDENTIFIER}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_IDENTIFIER');
        ?>
">{IDENTIFIER}</abbr>
						<abbr onclick="jc_insertText('simple_replacement_text', '{ALPHA}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_ALPHA');
        ?>
">{ALPHA}</abbr>
						<abbr onclick="jc_insertText('simple_replacement_text', '{NUMBER}');" title="<?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_TOKEN_NUMBER');
        ?>
">{NUMBER}</abbr>
						</p>
					</td>
					<td align="left">
						<label for="simple_replacement_text"><?php 
        echo JText::_('A_CUSTOM_BBCODE_SIMPLE_REPLACEMENT_TEXT_DESC');
        ?>
</label><br />
						<br /><?php 
        echo JText::_('A_CUSTOM_BBCODE_EXAMPLE');
        ?>
 {SIMPLETEXT2}
					</td>
				</tr>
				</table>
<?php 
        $tabs2->endTab();
        $tabs2->startTab(JText::_('A_CUSTOM_BBCODE_ADVANCED'), "regexp_replacement_text_tab");
        ?>
				<table width="100%">
				<tr valign="top" align="left">
					<td width="30%">
						<textarea class="editbox long" rows="3" cols="50" id="replacement_text" name="replacement_text"><?php 
        echo $row->replacement_text;
        ?>
</textarea>
					</td>
					<td align="left">
						<label for="replacement_text"><?php 
        echo $patternDescription;
        ?>
</label><br />
						<br /><?php 
        echo JText::_('A_CUSTOM_BBCODE_EXAMPLE');
        ?>
 ${2}
					</td>
				</tr>
				</table>
<?php 
        $tabs2->endTab();
        $tabs2->endPane();
        ?>
			</fieldset>
		</td>
	</tr>

	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON');
        ?>
</legend>

				<table class="adminform" width="100%">
				<tr valign="top" align="left">
					<td width="20%"><label for="button_title"><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_TITLE');
        ?>
</label></td>
					<td width="30%"><input type="text" class="editbox middle" size="35" id="button_title" name="button_title" value="<?php 
        echo $row->button_title;
        ?>
"></td>
					<td><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_TITLE_DESC');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><label for="button_prompt"><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_HELP_LINE');
        ?>
</label></td>
					<td><input type="text" class="editbox middle" size="35" id="button_prompt" name="button_prompt" value="<?php 
        echo $row->button_prompt;
        ?>
"></td>
					<td><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_HELP_LINE_DESC');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><label for="button_image"><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_ICON');
        ?>
</label></td>
					<td><input type="text" class="editbox middle" size="35" id="button_image" name="button_image" value="<?php 
        echo $row->button_image;
        ?>
"></td>
					<td><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_ICON_DESC');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><label for="button_css"><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_CSS_CLASS');
        ?>
</label></td>
					<td><input type="text" class="editbox short" size="35" id="button_css" name="button_css" value="<?php 
        echo $row->button_css;
        ?>
"></td>
					<td><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_CSS_CLASS_DESC');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><label for="button_open_tag"><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_OPEN_TAG');
        ?>
</label></td>
					<td><input type="text" class="editbox short" size="35" id="button_open_tag" name="button_open_tag" value="<?php 
        echo $row->button_open_tag;
        ?>
"></td>
					<td><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_OPEN_TAG_DESC');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><label for="button_close_tag"><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_CLOSE_TAG');
        ?>
</label></td>
					<td><input type="text" class="editbox short" size="35" id="button_close_tag" name="button_close_tag" value="<?php 
        echo $row->button_close_tag;
        ?>
"></td>
					<td><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_CLOSE_TAG_DESC');
        ?>
</td>
				</tr>
				<tr valign="top" align="left">
					<td><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_ENABLE');
        ?>
</td>
					<td><?php 
        echo JCommentsHTML::yesnoRadioList('button_enabled', 'class="inputbox"', $row->button_enabled, JText::_('A_YES'), JText::_('A_NO'));
        ?>
</td>
					<td></td>
				</tr>
				</table>
			</fieldset>
		</td>
	</tr>

	<tr valign="top" align="left">
		<td>
			<fieldset>
				<legend><?php 
        echo JText::_('A_CUSTOM_BBCODE_PERMISSIONS');
        ?>
</legend>

				<table class="adminform" width="100%">
				<tr valign="top" align="left">
					<td>
<?php 
        foreach ($lists['groups'] as $group) {
            $inputId = 'button_' . $row->id . '_acl_' . $group->id;
            $inputValue = $group->id;
            $prefix = trim(str_repeat('|&mdash; ', $group->level) . ' ');
            $text = ($prefix != '' ? '<span style="color: #ccc;">' . $prefix . '</span>&nbsp;' : '') . $group->text;
            ?>
						<input type="checkbox" id="<?php 
            echo $inputId;
            ?>
" name="button_acl[]" value="<?php 
            echo $inputValue;
            ?>
" <?php 
            echo $group->enabled == '1' ? 'checked="checked"' : '';
            ?>
 />
						<label for="<?php 
            echo $inputId;
            ?>
"><?php 
            echo $text;
            ?>
</label>
						<br />
<?php 
        }
        ?>
					</td>
				</tr>
				</table>
			</fieldset>
		</td>
	</tr>
</table>
<input type="hidden" name="option" value="com_jcomments" />
<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
<input type="hidden" name="task" value="" />
<?php 
        echo JCommentsSecurity::formToken();
        ?>
</form>
<?php 
    }
    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 
    }
Exemplo n.º 10
0
 function showSettings()
 {
     $db =& JCommentsFactory::getDBO();
     $config =& JCommentsFactory::getConfig();
     // check current site template for afterDisplayContent event
     if (JCOMMENTS_JVERSION == '1.5') {
         $db->setQuery('SELECT template FROM #__templates_menu WHERE client_id = 0 AND menuid = 0', 0, 1);
         $template = $db->loadResult();
         $articleTemplate = JPATH_SITE . DS . 'templates' . DS . $template . DS . 'html' . DS . 'com_content' . DS . 'article' . DS . 'default.php';
         if (is_file($articleTemplate)) {
             $tmpl = implode('', file($articleTemplate));
             if (strpos($tmpl, 'afterDisplayContent') === false) {
                 JError::raiseWarning(500, JText::_('Your current site template doesn\'t have afterDisplayContent event!'));
             }
         }
     }
     $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 (is_array($languages)) {
             $lang = trim(JCommentsInput::getVar('lang', ''));
             if ($lang == '') {
                 if (JCOMMENTS_JVERSION == '1.5') {
                     $params = JComponentHelper::getParams('com_languages');
                     $lang = $params->get("site", 'en-GB');
                 }
                 if ($lang == '') {
                     $lang = JCommentsMultilingual::getLanguage();
                 }
             }
             // reload configuration
             $config =& JCommentsFactory::getConfig($lang);
             $lists['languages'] = JCommentsHTML::selectList($languages, 'lang', 'class="inputbox" size="1" onchange="submitform(\'settings\');"', 'value', 'name', $lang);
         }
     }
     $forbiddenNames = $config->get('forbidden_names');
     $forbiddenNames = preg_replace('#,+#', "\n", $forbiddenNames);
     $config->set('forbidden_names', $forbiddenNames);
     $badWords = $config->get('badwords');
     if ($badWords != '') {
         $config->set('badwords', implode("\n", $badWords));
     }
     require_once JCOMMENTS_LIBRARIES . DS . 'joomlatune' . DS . 'filesystem.php';
     // path to images directory
     $path = JCOMMENTS_BASE . DS . 'tpl' . DS;
     $items = JoomlaTuneFS::readDirectory($path);
     $templates = array();
     foreach ($items as $item) {
         if (is_dir($path . $item)) {
             $tpl = new StdClass();
             $tpl->text = $item;
             $tpl->value = $item;
             $templates[] = $tpl;
         }
     }
     $currentTemplate = $config->get('template');
     $lists['templates'] = JCommentsHTML::selectList($templates, 'cfg_template', 'class="inputbox"', 'value', 'text', $currentTemplate);
     $rows = JCommentsAdmin::getAllGroups();
     $exclude = JCommentsAdmin::getHigherGroups();
     if (count($exclude)) {
         // remove users 'above' me
         $i = 0;
         while ($i < count($rows)) {
             if (in_array($rows[$i]->group_id, $exclude)) {
                 array_splice($rows, $i, 1);
             } else {
                 $i++;
             }
         }
     }
     $captchaError = '';
     $captchaExclude = array();
     if (!extension_loaded('gd') || !function_exists('imagecreatefrompng')) {
         if ($config->get('captcha_engine', 'kcaptcha') != 'recaptcha') {
             foreach ($rows as $row) {
                 $captchaExclude[] = $row->value;
             }
             $captchaError = JText::_('GD library is not installed!');
         }
     }
     $lists['group_names'] = $rows;
     $groups = array();
     // Post
     JCommentsAdmin::loadParam($groups, 'can_comment', $rows, JText::_('A_RIGHTS_POST'), JText::_('AP_CAN_COMMENT'), JText::_('AP_CAN_COMMENT_DESC'));
     JCommentsAdmin::loadParam($groups, 'can_reply', $rows, JText::_('A_RIGHTS_POST'), JText::_('AP_CAN_REPLY'), JText::_('AP_CAN_REPLY_DESC'));
     JCommentsAdmin::loadParam($groups, 'autopublish', $rows, JText::_('A_RIGHTS_POST'), JText::_('AP_AUTOPUBLISH'), JText::_('AP_AUTOPUBLISH_DESC'));
     JCommentsAdmin::loadParam($groups, 'show_policy', $rows, JText::_('A_RIGHTS_POST'), JText::_('AP_SHOW_POLICY'), JText::_('AP_SHOW_POLICY_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_captcha', $rows, JText::_('A_RIGHTS_POST'), JText::_('AP_ENABLE_CAPTCHA'), JText::_('AP_ENABLE_CAPTCHA_DESC'), $captchaExclude, $captchaError);
     JCommentsAdmin::loadParam($groups, 'floodprotection', $rows, JText::_('A_RIGHTS_POST'), JText::_('AP_ENABLE_FLOODPROTECTION'), JText::_('AP_ENABLE_FLOODPROTECTION_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_comment_length_check', $rows, JText::_('A_RIGHTS_POST'), JText::_('AP_ENABLE_COMMENT_LENGTH_CHECK'), JText::_('AP_ENABLE_COMMENT_LENGTH_CHECK_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_autocensor', $rows, JText::_('A_RIGHTS_POST'), JText::_('AP_ENABLE_AUTOCENSOR'), JText::_('AP_ENABLE_AUTOCENSOR_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_subscribe', $rows, JText::_('A_RIGHTS_POST'), JText::_('AP_ENABLE_SUBSCRIBE'), JText::_('AP_ENABLE_SUBSCRIBE_DESC'));
     // BBCodes
     JCommentsAdmin::loadParam($groups, 'enable_bbcode_b', $rows, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_B'), JText::_('AP_ENABLE_BBCODE_B_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_bbcode_i', $rows, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_I'), JText::_('AP_ENABLE_BBCODE_I_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_bbcode_u', $rows, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_U'), JText::_('AP_ENABLE_BBCODE_U_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_bbcode_s', $rows, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_S'), JText::_('AP_ENABLE_BBCODE_S_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_bbcode_url', $rows, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_URL'), JText::_('AP_ENABLE_BBCODE_URL_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_bbcode_img', $rows, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_IMG'), JText::_('AP_ENABLE_BBCODE_IMG_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_bbcode_list', $rows, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_LIST'), JText::_('AP_ENABLE_BBCODE_LIST_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_bbcode_hide', $rows, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_HIDE'), JText::_('AP_ENABLE_BBCODE_HIDE_DESC'), array('Unregistered'));
     JCommentsAdmin::loadParam($groups, 'enable_bbcode_quote', $rows, JText::_('A_RIGHTS_BBCODE'), JText::_('AP_ENABLE_BBCODE_QUOTE'), JText::_('AP_ENABLE_BBCODE_QUOTE_DESC'));
     // View
     JCommentsAdmin::loadParam($groups, 'autolinkurls', $rows, JText::_('A_RIGHTS_VIEW'), JText::_('AP_ENABLE_AUTOLINKURLS'), JText::_('AP_ENABLE_AUTOLINKURLS_DESC'));
     JCommentsAdmin::loadParam($groups, 'emailprotection', $rows, JText::_('A_RIGHTS_VIEW'), JText::_('AP_ENABLE_EMAILPROTECTION'), JText::_('AP_ENABLE_EMAILPROTECTION_DESC'));
     JCommentsAdmin::loadParam($groups, 'enable_gravatar', $rows, JText::_('A_RIGHTS_VIEW'), JText::_('AP_ENABLE_GRAVATAR'), JText::_('AP_ENABLE_GRAVATAR_DESC'));
     JCommentsAdmin::loadParam($groups, 'can_view_email', $rows, JText::_('A_RIGHTS_VIEW'), JText::_('AP_CAN_VIEW_AUTHOR_EMAIL'), JText::_('AP_CAN_VIEW_AUTHOR_EMAIL_DESC'));
     JCommentsAdmin::loadParam($groups, 'can_view_homepage', $rows, JText::_('A_RIGHTS_VIEW'), JText::_('AP_CAN_VIEW_AUTHOR_HOMEPAGE'), JText::_('AP_CAN_VIEW_AUTHOR_HOMEPAGE_DESC'));
     JCommentsAdmin::loadParam($groups, 'can_view_ip', $rows, JText::_('A_RIGHTS_VIEW'), JText::_('AP_CAN_VIEW_AUTHOR_IP'), JText::_('AP_CAN_VIEW_AUTHOR_IP_DESC'), array('Unregistered', 'Registered'));
     // Edit
     JCommentsAdmin::loadParam($groups, 'can_edit_own', $rows, JText::_('A_RIGHTS_EDIT'), JText::_('AP_CAN_EDIT_OWN'), JText::_('AP_CAN_EDIT_OWN_DESC'), array('Unregistered'));
     JCommentsAdmin::loadParam($groups, 'can_delete_own', $rows, JText::_('A_RIGHTS_EDIT'), JText::_('AP_CAN_DELETE_OWN'), JText::_('AP_CAN_DELETE_OWN_DESC'), array('Unregistered'));
     // Administration
     JCommentsAdmin::loadParam($groups, 'can_edit', $rows, JText::_('A_RIGHTS_ADMINISTRATION'), JText::_('AP_CAN_EDIT'), JText::_('AP_CAN_EDIT_DESC'), array('Unregistered', 'Registered'));
     JCommentsAdmin::loadParam($groups, 'can_publish', $rows, JText::_('A_RIGHTS_ADMINISTRATION'), JText::_('AP_CAN_PUBLISH'), JText::_('AP_CAN_PUBLISH_DESC'), array('Unregistered', 'Registered'));
     JCommentsAdmin::loadParam($groups, 'can_delete', $rows, JText::_('A_RIGHTS_ADMINISTRATION'), JText::_('AP_CAN_DELETE'), JText::_('AP_CAN_DELETE_DESC'), array('Unregistered', 'Registered'));
     // Votes
     JCommentsAdmin::loadParam($groups, 'can_vote', $rows, JText::_('A_RIGHTS_MISC'), JText::_('AP_CAN_VOTE'), JText::_('AP_CAN_VOTE_DESC'));
     $reportError = '';
     $reportExclude = array();
     if ($config->getInt('enable_notification') == 0 || $config->check('notification_type', 2) == false) {
         foreach ($rows as $row) {
             $reportExclude[] = $row->value;
         }
         $reportError = JText::_('Notifications are disabled! Please, enable notifications first.');
     }
     JCommentsAdmin::loadParam($groups, 'can_report', $rows, JText::_('A_RIGHTS_MISC'), JText::_('AP_CAN_REPORT'), JText::_('AP_CAN_REPORT_DESC'), $reportExclude, $reportError);
     $lists['groups'] =& $groups;
     if ($config->get('enable_categories') != '') {
         $query = "SELECT c.id AS `value`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n WHERE c.id IN ( " . $config->get('enable_categories') . " )" . "\n ORDER BY s.name,c.name";
         $db->setQuery($query);
         $lookup = $db->loadObjectList();
     } else {
         $lookup = '';
     }
     $query = "SELECT c.id AS `value`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n ORDER BY s.name,c.name";
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     if (!is_array($categories)) {
         $categories = array();
     }
     $lists['categories'] = JCommentsHTML::selectList($categories, 'cfg_enable_categories[]', 'class="inputbox" size="10" multiple="multiple"', 'value', 'text', $lookup);
     $captcha = array();
     $captcha[] = JCommentsHTML::makeOption('kcaptcha', 'KCAPTCHA');
     require_once JCOMMENTS_HELPERS . DS . 'plugin.php';
     JCommentsPluginHelper::importPlugin('jcomments');
     $enginesList = JCommentsPluginHelper::trigger('onJCommentsCaptchaEngines');
     foreach ($enginesList as $engines) {
         foreach ($engines as $code => $text) {
             $captcha[] = JCommentsHTML::makeOption($code, $text);
         }
     }
     $disabledCAPTCHA = count($captcha) == 1 ? ' disabled="disabled"' : '';
     $lists["captcha"] = JCommentsHTML::selectList($captcha, 'cfg_captcha_engine', 'class="inputbox"' . $disabledCAPTCHA, 'value', 'text', $config->get('captcha_engine'));
     HTML_JComments::showSettings($lists);
 }