PDA

View Full Version : priv_sendprivmsg (enhancement)


sabret00the
02-28-2003, 09:21 PM
basically i've tried to make sending pm's a bit more fun by adding random title thing and psycho text thing to it (things = jscripts) but they won't work so i'm assuming i've messed up the coding somehow, but how 0_o

i get messages saying that 'title' or 'message' cannot be found, tell me where i'm going wrong please


{htmldoctype}
<html>
<head><title>$bbtitle - Private Messaging - Send Message</title>
$headinclude
<!--<script type="text/javascript" language="javascript" src="$bburl/spellcheck/spch.js"></script>-->
<script language="javascript">
<!--
var pmmaxchars = $pmmaxchars;
function validate(theform) {
if (theform.touser.value=="" || theform.message.value=="" || theform.title.value=="") {
alert("Please complete the recipient, subject and message fields.");
return false; }
if (pmmaxchars != 0) {
if (theform.message.value.length > $pmmaxchars) {
alert("Your message is too long.\n\nReduce your message to $pmmaxchars characters.\nIt is currently "+theform.message.value.length+" characters long.");
return false; }
else { return true; }
} else { return true; }
}
function checklength(theform) {
if (pmmaxchars != 0) { message = "\nThe maximum permitted length is $pmmaxchars characters."; }
else { message = ""; }
alert("Your message is "+theform.message.value.length+" characters long."+message);
}
//-->
</script>

<script language="JavaScript">
<!--
function rS(){
var p = ["dirty","exotic","flaming","breakfast","saucy","ugly","fruity","humungous","lucky","evil","faulty","trippy","ebs","terrible","musical","magnetic","electronic","stimulation","ownage","delightful","curious","pimping","bored","pink","rolling","horny","football"];
var q = ["tadpole","dinner lady","tramp","monster","cabbage","bubble","camel","stopwatch","submarine","bees","lemon","iceberg","time","swordfish","teeth","kittens","gangsta","brain","girl","eyelashes","belly","heart","freak","star","bottle","food","drink","foot","orgasm"];
fo('msg').title.value = p[Math.round(Math.random()*15)]+" "+q[Math.round(Math.random()*16)];}
function cZa(x){var y='';for (var r=0; r < x.length; r++){
if (r%2==0){y=y.concat((x.substring(r,r+1)).toUpperCa se())}else{y=y.concat((x.substring(r,r+1)).toLower Case())}}
return y;}
function cZ(){var e=fo('msg').message.value;var f = "";var g=fo('msg').title.value;var h = "";
if (e==''){e='Enter your text here before using psycho text.';};if (cr==1){cr=0;f=e.toLowerCase();h=g.toLowerCase();} else {cr=1;f=cZa(e);h=cZa(g);};fo('msg').message.value = f;fo('msg').title.value = h;}
//-->
</script>
</head>
<body>
$header

<!-- breadcrumb -->
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<td width="75%">$navbar</td>
</tr>
</table>
<!-- /breadcrumb -->

<br>
$cpnav
<br>

<form action="private.php" method="post" name="vbform" onSubmit="return validate(this)">
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="prevmessageid" value="$privatemessageid">
<input type="hidden" name="forward" value="$forward">

<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
<td bgcolor="{tableheadbgcolor}" colspan="2"><normalfont color="{tableheadtextcolor}" class="thtcolor"><b>New Private Message</b></normalfont></td>
</tr>
$logincode
<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>Recipient:</b></normalfont></td>
<td bgcolor="{firstaltcolor}"><normalfont><input type="text" class="bginput" name="touser" value="$touserinfo[username]" size="25" maxlength="25" tabindex="1">&nbsp;&nbsp;</normalfont>
<smallfont><a href="memberlist.php?s=$session[sessionhash]" target="_blank">Find user names</a></smallfont></td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Subject:</b></normalfont></td>
<td bgcolor="{secondaltcolor}"><normalfont><input type="text" class="bginput" name="title" value="$subject" size="40" maxlength="85" tabindex="2"></normalfont>
<smallfont><a href="javascript:void(0);" ONMOUSEOVER="self.status='Random Subject Title';return true" ONMOUSEOUT="self.status='';return true" onClick="rS();">Random
Subject Title</a></smallfont> </td>
</tr>
$posticons
$vbcode_buttons
<tr>
<td bgcolor="{secondaltcolor}" valign="top" nowrap><p><normalfont><b>Your Message:</b></normalfont></p>
$vbcode_smilies</td>
<td bgcolor="{secondaltcolor}">

<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td><textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="3">$message[message]</textarea><br>
<smallfont>
<a href="javascript:void(0);" ONMOUSEOVER="self.status='PsYcHoTeXt';return true" ONMOUSEOUT="self.status='';return true" onClick="cZ();">PsYcHoTeXt</a><br>
<a href="javascript:checklength(document.vbform);">[check message length]</a><br>
</smallfont></td>
</tr>
</table>

</td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}" valign="top"><normalfont><b>Options</b></normalfont></td>
<td bgcolor="{firstaltcolor}" valign="top"><smallfont>
<input type="checkbox" name="parseurl" value="yes" checked> <b>Automatically parse URLs:</b> automatically adds and around internet addresses.
<br><input type="checkbox" name="signature" value="yes" $signaturechecked> <b>Show Signature:</b> include your profile signature. Only registered users may have signatures.
<br><input type="checkbox" name="savecopy" value="yes" checked> <b>Save a copy:</b> Also save a copy in the 'Sent Items' folder.
$requestreceipt
</smallfont></td>
</tr>
</table>
</td></tr></table>

<br>

<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<td align="center"><normalfont>
<input type="hidden" name="action" value="dosend">
<input type="submit" class="bginput" name="submit" value="Send Message" accesskey="s" tabindex="4">
<!--<input type="button" class="bginput" value="Spell Check" onclick="var f=document.forms['vbform']; doSpell( '$spellchecklang', f.message, '$bburl/spellcheck/sproxy.php', true);" tabindex="5">-->
<input type="reset" class="bginput" name="RESET" value="Clear Fields" tabindex="6">
</normalfont></td>
</tr>
</table>

</form>

$footer

</body>
</html>

sabret00the
03-01-2003, 07:06 AM
someone, anyone, it's only javascript :nervous: