Place this at the top of the accounts page.
<script type="text/javascript">
/*<![CDATA[*/
function check_av(){
var height_constraint = 100;
var width_constraint = 100;
if((document.getElementById('av_height').value > height_constraint) || (document.getElementById('av_width').value > width_constraint))
{
document.getElementById('av_height').value=80;
document.getElementById('av_width').value=80;
document.getElementById('av_height').focus();
document.getElementById('av_height').focus();
alert('Avatar size too big. Size set to 80x80.');
}
if((document.getElementById('av_height').value=="") || (document.getElementById('av_width').value==""))
{
document.getElementById('av_height').value=0;
document.getElementById('av_width').value=0;
document.getElementById('av_height').focus();
document.getElementById('av_height').focus();
alert('Avatar size not entered. Size set to 0x0.');
}
}
/*]]>*/
</script>
<script type="text/javascript">
/*<![CDATA[*/
function limitText(limitCount) {
var limit = 300;
if(limitCount >= limit){
document.getElementById('sig').value = document.getElementById('sig').value.substring(0, limit);
document.getElementById('countdown').value = (limit-limitCount);
}
else{
document.getElementById('countdown').value = (limit-limitCount);
}
}
/*]]>*/
</script>
Place this lower on the accounts page between a </tr> and <tr>.
<tr>
<td class="tableHeader"> Avatar:</td>
<td> <input type="text" name="av" value="[av]" /><br />
Width: <input type="text" id="av_width" name="av_width" value="[av_width]" size="5" />
Height: <input type="text" id="av_height" name="av_height" value="[av_height]" size="5" /></td>
</tr>
<tr>
<td class="tableHeader"> Signature:</td>
<td> <textarea name="sig" id="sig" rows="5" cols="20" onKeyDown="limitText(this.value.length);" onKeyUp="limitText(this.value.length);">[sig]</textarea><br />
<input readonly="readonly" type="text" id="countdown" size="3" value="300"> characters left.</td>
</tr>
Change:
<input type="submit" name="submit" value="Submit" />
To:
<input type="submit" name="submit" value="Submit" onclick="check_av();" />
Place this where you wish avatars to display
[if:av]<img src="[av]" style="width: [av_width]px; height: [av_height]px; border: 0;" alt="[username]'s Avatar" />[endif:av]
Place this where you wish signatures to display.
[if:sig][sig][endif:sig]
The code was adapted by myself from one used on AG. This version will validate.