A quick improvement to the shoutbox_postshout template:
This allows you to limit the characters posted by checking the form onsubmit. Javascript taken from
here because I'm lazy. Replace the shotubox_postshout template with:
Code:
<script Language="JavaScript">
<!--
function Length_TextField_Validator()
{
if ((vbform.message.value.length < 3) || (vbform.message.value.length > 500))
{
mesg = "You have entered " + vbform.message.value.length + " character"
if (vbform.message.value.length != 1) {
mesg = mesg + "s"
}
mesg = mesg + ".\nValid entries are between 3 and 500 characters.\n"
alert(mesg);
vbform.message.focus();
return (false);
}
return (true);
}
-->
</script>
<table cellpadding="5" cellspacing="0" border="0" width="100%">
<form action="/edge/shoutbox.php" method="post" name="vbform" onsubmit="return Length_TextField_Validator()">
<input type="hidden" name="type" value="shout">
<tr>
<td bgcolor="#006633" width="100%"><normalfont color="#FFCC00"><b>Send A Message</b></normalfont></td>
</tr>
</table>
<table cellpadding="8" cellspacing="0" border="0" width="100%">
<tr bgcolor="#DFDFDF">
<td width="100%"><normalfont><b>Message:</b></normalfont> <smallfont><b>[
<a href="$bburl/misc.php?s=$session[sessionhash]&action=showsmilies" class="small" target="_blank">Smilies</a> -
<a href="$bburl/misc.php?s=$session[sessionhash]&action=bbcode" class="small" target="_blank">vB Code</a> ]</b></smallfont>
<br/><textarea name="message" rows="10" cols="60" class="bginput" wrap></textarea>
<br/>$smiliebits</td>
</tr>
<tr bgcolor="#DFDFDF">
<td width="100%"><input type="submit" name="comment_submit" value="Shout Now!" class="bginput" accesskey="s"></td>
</tr>
</form>
</table>
Thanks to TWT for a great piece of work!