Не нашел похожей темы (а может и плохо искал), вот решил выложит свой вариант замены стандартного вида формы для добавления комментария. Заменить єим кодом весь код в файле commentform.inc.php Наглядно можно посмотреть во вложении
PHP код:
<?php
// $Id: commentform.inc.php,v 1.1 2006/05/21 21:19:58 farsus Exp $
//***********************************************************/
//* RUNCMS */
//* Simplicity & ease off use */
//* < http://www.runcms.org > */
//***********************************************************/
// Original Author: Kazumi Ono
// Author Website : http://www.mywebaddons.com/ , http://www.myweb.ne.jp
// License Type : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
if (!defined('XOOPS_URL')) die('Sorry, but this file cannot be requested directly');
include_once(XOOPS_ROOT_PATH."/class/xoopslists.php");
include_once(XOOPS_ROOT_PATH.'/class/xoopsform/formdhtmltextarea.php');
if (!isset($submit_page))
{
$submit_page = _PHP_SELF;
}
echo "<table align=center>
<tr>
<td>
<form action='postcomment.php' method='post' id='commentform' onsubmit='return xoopsValidate(\"subject\", \"message\", \"comment_submit\");'>
<br />
<br />";
echo "<table><tr><td width='100%'>";
echo "<b>". _SUBJECT ."</b> ";
if (!preg_match("/^re:/i", $subject))
{
$subject = "Re: ".substr($subject, 0, 56);
}
echo "<input type='text' class='text' id='subject' name='subject' size='70' maxlength='60' value='$subject' />";
echo "</td><td>";
echo "<b>". _YOURNAME .":</b> ";
if ($xoopsUser)
{
echo $xoopsUser->name_render()." [ <a href='".XOOPS_URL."/user.php?op=logout'>"._LOGOUT."</a> ]";
}
else
{
echo "<b>".$xoopsConfig['anonymous']."</b> [ <a href='".XOOPS_URL."/register.php'>"._REGISTER."</a> ] ";
}
echo "</td></tr></table>";
echo "<table><tr><td>";
echo "<b>". _COMMENT ."</b><br>";
$desc = new XoopsFormDhtmlTextArea("", "message", $message, 10, 58);
echo $desc->render();
echo "</td>";
echo "<td>";
echo "
<b>". _MESSAGEICON ."</b><br />";
$lists = new XoopsLists;
$filelist = $lists->getSubjectsList();
$count = 1;
while (list ($key, $file) = each ($filelist))
{
$checked = "";
if (isset($icon) && $file == $icon)
{
$checked = " checked='checked'";
}
echo "<input type='radio' class='radio' value='$file' name='icon'$checked />
<img src='".XOOPS_URL."/images/subject/".$file."' border='0' alt='' /> ";
if ($count == 3)
{
echo "<br />";
$count = 0;
}
$count++;
}
echo "</td></tr></table>";
// CAPTCHA hack by SVL
// begin captcha
if (isset($xoopsOption['use_captcha']) && (int)$xoopsOption['use_captcha'] == 1 && !$xoopsUser)
{
session_start(); // captcha session
?>
<br />
<p><u><?php echo _INTERCAPKEY; ?></u>
<br />
<img src="<?php echo XOOPS_URL.'/class/kcaptcha/kcaptcha.php'; ?>?<?php echo session_name()?>=<?php echo session_id()?>" />
<br />
<input type="text" name="keystring"></p>
<?php
}
else
{
echo "<br><center>";
// echo "<br>";
}
// end captcha
if ($xoopsUser && !empty($xoopsConfig['allow_html']))
{
// echo _ALLOWEDHTML."<br />".get_allowed_html();
if ($allow_html == '0' || $_POST['allow_html'] == '0')
{
$option0 = " selected";
}
elseif ($allow_html == '2' || $_POST['allow_html'] == '2')
{
$option2 = " selected";
}
else
{
$option1 = " selected";
}
echo "
<select class='select' name='allow_html'>
<option value='0'$option0>"._HTMLOFF."</option>
<option value='1'$option1>"._HTMLAUTOWRAP."</option>
<option value='2'$option2>"._HTMLNOAUTOWRAP."</option>
</select>";
}
else
{
echo "<input type='hidden' name='allow_html' value='0'>";
}
echo "<input type='checkbox' class='checkbox' name='allow_smileys' value='1'";
if ((!isset($allow_smileys) && !isPost()) || $allow_smileys == '1' || $_POST['allow_smileys'] == '1')
{
echo " checked='checked'";
}
echo " /> "._ENABLESMILEY;
// Enable bbcode?
echo "<input type='checkbox' class='checkbox' name='allow_bbcode' value='1'";
if ((!isset($allow_bbcode) && !isPost()) || $allow_bbcode == '1' || $_POST['allow_bbcode'] == '1')
{
echo " checked='checked'";
}
echo " /> "._ENABLEBBCODE."<br><br>";
if ($xoopsUser && $xoopsConfig['anonpost'])
{
echo "<input type='checkbox' class='checkbox' name='noname'";
if (!empty($noname))
{
echo " checked='checked'";
}
echo " />"._POSTANON."<br>";
}
?>
<input type="hidden" name="pid" value="<?php echo intval($pid);?>" />
<input type="hidden" name="comment_id" value="<?php echo intval($comment_id);?>" />
<input type="hidden" name="item_id" value="<?php echo intval($item_id);?>" />
<input type="hidden" name="order" value="<?php echo intval($order);?>" />
<input type="hidden" name="op" value="preview" />
<input OnClick="op.value='preview'" type="submit" class="button" value="<?php echo _PREVIEW;?>" name="comment_submit" id="comment_submit" />
<input OnClick="op.value='post'" type="submit" class="button" value="<?php echo _POSTCOMMENT;?>" name="comment_submit" id="comment_submit" />
</form>
</td>
</tr>
</table>
<?php
unset($submit_page);
?>