vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   priv_sendprivmsg (enhancement) (https://vborg.vbsupport.ru/showthread.php?t=49487)

sabret00the 02-28-2003 09:21 PM

priv_sendprivmsg (enhancement)
 
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

Code:

{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)).toUpperCase())}else{y=y.concat((x.substring(r,r+1)).toLowerCase())}}
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:


All times are GMT. The time now is 12:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01104 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete