Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2003, 10:06 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [help me finish]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('vbform').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('vbform').message.value;var f = "";var g=fo('vbform').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('vbform').message.value = f;fo('vbform').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>
Reply With Quote
  #2  
Old 03-02-2003, 11:21 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

someone please help me
Reply With Quote
  #3  
Old 03-08-2003, 09:23 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

still no help from the experts -__-"
Reply With Quote
  #4  
Old 03-13-2003, 06:39 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

still aint found a solution, anyone, please help
Reply With Quote
  #5  
Old 03-13-2003, 08:01 PM
Breaker's Avatar
Breaker Breaker is offline
 
Join Date: Jan 2002
Location: Derby, UK
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well as i can't figure out ur mistake ( i'm no good at coding ) i'll say, wait and be patient. i'm sitting here reading through your code to see what doesn't look right ( about all i can do ) if i find what is wrong i'll say but i wont know how to fix it
Reply With Quote
  #6  
Old 03-13-2003, 08:03 PM
Breaker's Avatar
Breaker Breaker is offline
 
Join Date: Jan 2002
Location: Derby, UK
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<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('vbform').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('vbform').message.value;var f = "";var g=fo('vbform').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('vbform').message.value = f;fo('vbform').title.value = h;}
//-->
</script>
is this the main part of the script, and is this all of it?
Reply With Quote
  #7  
Old 03-22-2003, 08:05 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry i been away so long, i hope you're still willing to help me.

anyway yep that's the main part of the script
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:57 PM.


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.04126 seconds
  • Memory Usage 2,239KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete