SemperFidelis
01-20-2003, 12:57 PM
Ok, straight up I have a reasonably well hacked test board which once its finished 100%, I will be rolling out as my production board.
Right now Im having issues with viewing PM's.
Im getting this error when trying to view a PM :
Line : 295
Char: 87
Error: Unterminated string constant
Here is the code from around that line when viewing source thru IE (with line 295 being "currently "+theform.message.value.length+" characters long.)
<script language="javascript">
<!--
var pmmaxchars = 1000;
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 > 1000) {
alert("Your message is too long.\n\nReduce your message to 1000 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 1000 characters."; }
else { message = ""; }
alert("Your message is "+theform.message.value.length+" characters long."+message);
}
//-->
</script>
And here is a copy of my privmsg template :
{htmldoctype}
<html>
<head><title>$bbtitle - Private Messages - $message[title]</title>
$headinclude
<script language="javascript" type="text/javascript">
<!--
function aimwindow(aimid) {
window.open("member.php?s=$session[sessionhash]&action=aimmessage&aim="+aimid,"_blank","toolbar=no,location=no,menubar=no,scrollbars=no,wi dth=175,height=275,resizeable=yes,status=no")
}
// -->
</script>
</head>
<BODY onLoad="document.forms.vbform.message.focus()">
$header
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<td width="75%">$navbar</td>
<td width="25%" align="right">
</b></smallfont></td>
</tr>
</table>
<br>
$cpnav
<br>
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<form action="private.php" method="post">
<td><smallfont><input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="action" value="dodelete">
<input type="hidden" name="privatemessageid" value="$privatemessageid">
<input type="hidden" name="folderid" value="$folderid">
<b>Delete?</b> <input type="checkbox" name="delete" value="yes" $checked>
<input type="submit" class="bginput" value="Delete"></td>
</form>
<form action="private.php" method="post">
<td align="right"><smallfont><input type="hidden" name="s" value="$session[sessionhash]"><b>Jump to folder:</b>
<select name="folderid" onchange="window.location=('private.php?s=$session[sessionhash]&folderid='+this.options[this.selectedIndex].value)">
<option value="0" $folderselect[0]>$inboxname</option>
<option value="-1" $folderselect[$sent]>$sentitemsname</option>
$folderjump
$readreceiptsoption
</select>$gobutton</smallfont></td>
</form>
</tr>
</table>
<br>
<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}" width="20%" nowrap><smallfont color="{tableheadtextcolor}" class="thtcolor"><b>Author</b></smallfont></td>
<td bgcolor="{tableheadbgcolor}" width="80%"><smallfont color="{tableheadtextcolor}" class="thtcolor"><b>Message</b></smallfont></td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}" width="20%" valign="top" nowrap>
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>
<td width="100%"><normalfont><b>$fromuserinfo[username]</b></normalfont><br>
<smallfont>$fromuserinfo[usertitle]</smallfont><br><br>
$post[avatar]<br><br>
<smallfont>Registered: $fromuserinfo[joindate]<br>
Posts: $fromuserinfo[posts]</smallfont></td>
</tr>
</table>
</td>
<td bgcolor="{secondaltcolor}" valign="top" width="80%">
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>
<td width="100%">$message[icon] <smallfont><b>$message[title]</b></smallfont>
<p><normalfont>$message[message]</normalfont></p></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}" width="20%" height="16" nowrap><smallfont>$message[foldericon] $message[postdate] $message[posttime]</smallfont></td>
<td bgcolor="{secondaltcolor}" width="80%" valign="middle" height="16">
<table width="100%" border=0 cellpadding=0 cellspacing=0>
<tr>
<td><smallfont>$onlinestatus
$fromuserinfo[profile] $fromuserinfo[useremail] $fromuserinfo[homepage]
<a href="search.php?s=$session[sessionhash]&action=finduser&userid=$fromuserinfo[userid]"><img src="{imagesfolder}/find.gif" border="0" alt="Find more posts by $fromuserinfo[username]"></a>
<!-- $ post[icqicon] $ post[aimicon] $ post[yahooicon] --> </smallfont></td>
</tr>
</table>
</td>
</tr>
<tr id="cat">
<td bgcolor="{tableheadbgcolor}" colspan="2" align="center"><smallfont color="{tableheadtextcolor}" class="thtcolor">
<b>$nextoldest $nextnewest</b>
</smallfont></td>
</tr>
</table>
</td></tr></table>
<br>
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<td>$forumjump</td>
<td align="right"><smallfont><b>$timezone</b></smallfont></td>
</tr>
<tr>
<td colspan="2" align="center">
<a href="private.php?s=$session[sessionhash]&action=newmessage&privatemessageid=$privatemessageid"><img src="{imagesfolder}/pm_sendreply.gif" alt="Reply to this message" border="0"></a>
<a href="private.php?s=$session[sessionhash]&action=newmessage&forward=true&privatemessageid=$privatemessageid"><img src="{imagesfolder}/pm_forward.gif" alt="Forward this message to another member" border="0"></a>
$buddyforwardlink
<a href="private.php?s=$session[sessionhash]&action=newmessage"><img src="{imagesfolder}/pm_sendnew.gif" alt="Send a new private message" border="0"></a>
</td>
</tr>
</table>
<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>
<form action="private.php" method="post" enctype="multipart/form-data" name="vbform" onSubmit="return
validate(this)">
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="privatemessageid" value="$privatemessageid">
<input type="hidden" name="prevmessageid" value="$privatemessageid">
<input type="hidden" name="action" value="dosend">
<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>
<tr id="cat">
<td bgcolor="{categorybackcolor}" colspan="6"><normalfont color="{categoryfontcolor}"><b>Quick PM
Reply</normalfont></b></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}" colspan="6">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Recipient:</b></normalfont></td><td bgcolor="{secondaltcolor}">
<normalfont><input type="text" class="bginput" name="touser" value="$fromuserinfo[username]" size="25"
maxlength="25" tabindex="1"> </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="RE:
$message[title]" size="40" maxlength="85" tabindex="2"></normalfont> </td>
</tr><tr>
<td bgcolor="{secondaltcolor}" valign="top" nowrap><p><normalfont><b>Your Message:</b></normalfont>
</td>
<td bgcolor="{secondaltcolor}">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td><textarea name="message" rows="7" cols="$textareacols" wrap="virtual" tabindex="3">
$pmquote
</textarea><br>
<smallfont><a href="javascript:checklength(document.vbform);">[check message
length]</a></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="deleteorig" value="yes"><b>Delete original:</b> Delete original PM from PM box.
<br><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" checked><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.
<br><input type="checkbox" name="pmreceipt" value="yes" checked><b>Request Read Receipt:</b> Allows you to
check whether your message has been read by the recipient.
</smallfont></td>
</tr>
</table>
</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="submit" class="bginput" name="submit" value="Send Message"
accesskey="s" tabindex="4"><input type="reset" class="bginput" name="RESET" value="Clear Fields" tabindex="6">
</normalfont></td>
</tr>
</table>
</form>
$footer
</body>
</html>
Can someone please give me some assistance with getting this one sorted ?
If you need to view private.php Im more than happy to email / PM it to you as I cant post it here in its entirity.
Thanks in advance for any assistance given
It is greatly appreciated.
Right now Im having issues with viewing PM's.
Im getting this error when trying to view a PM :
Line : 295
Char: 87
Error: Unterminated string constant
Here is the code from around that line when viewing source thru IE (with line 295 being "currently "+theform.message.value.length+" characters long.)
<script language="javascript">
<!--
var pmmaxchars = 1000;
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 > 1000) {
alert("Your message is too long.\n\nReduce your message to 1000 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 1000 characters."; }
else { message = ""; }
alert("Your message is "+theform.message.value.length+" characters long."+message);
}
//-->
</script>
And here is a copy of my privmsg template :
{htmldoctype}
<html>
<head><title>$bbtitle - Private Messages - $message[title]</title>
$headinclude
<script language="javascript" type="text/javascript">
<!--
function aimwindow(aimid) {
window.open("member.php?s=$session[sessionhash]&action=aimmessage&aim="+aimid,"_blank","toolbar=no,location=no,menubar=no,scrollbars=no,wi dth=175,height=275,resizeable=yes,status=no")
}
// -->
</script>
</head>
<BODY onLoad="document.forms.vbform.message.focus()">
$header
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<td width="75%">$navbar</td>
<td width="25%" align="right">
</b></smallfont></td>
</tr>
</table>
<br>
$cpnav
<br>
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<form action="private.php" method="post">
<td><smallfont><input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="action" value="dodelete">
<input type="hidden" name="privatemessageid" value="$privatemessageid">
<input type="hidden" name="folderid" value="$folderid">
<b>Delete?</b> <input type="checkbox" name="delete" value="yes" $checked>
<input type="submit" class="bginput" value="Delete"></td>
</form>
<form action="private.php" method="post">
<td align="right"><smallfont><input type="hidden" name="s" value="$session[sessionhash]"><b>Jump to folder:</b>
<select name="folderid" onchange="window.location=('private.php?s=$session[sessionhash]&folderid='+this.options[this.selectedIndex].value)">
<option value="0" $folderselect[0]>$inboxname</option>
<option value="-1" $folderselect[$sent]>$sentitemsname</option>
$folderjump
$readreceiptsoption
</select>$gobutton</smallfont></td>
</form>
</tr>
</table>
<br>
<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}" width="20%" nowrap><smallfont color="{tableheadtextcolor}" class="thtcolor"><b>Author</b></smallfont></td>
<td bgcolor="{tableheadbgcolor}" width="80%"><smallfont color="{tableheadtextcolor}" class="thtcolor"><b>Message</b></smallfont></td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}" width="20%" valign="top" nowrap>
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>
<td width="100%"><normalfont><b>$fromuserinfo[username]</b></normalfont><br>
<smallfont>$fromuserinfo[usertitle]</smallfont><br><br>
$post[avatar]<br><br>
<smallfont>Registered: $fromuserinfo[joindate]<br>
Posts: $fromuserinfo[posts]</smallfont></td>
</tr>
</table>
</td>
<td bgcolor="{secondaltcolor}" valign="top" width="80%">
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>
<td width="100%">$message[icon] <smallfont><b>$message[title]</b></smallfont>
<p><normalfont>$message[message]</normalfont></p></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}" width="20%" height="16" nowrap><smallfont>$message[foldericon] $message[postdate] $message[posttime]</smallfont></td>
<td bgcolor="{secondaltcolor}" width="80%" valign="middle" height="16">
<table width="100%" border=0 cellpadding=0 cellspacing=0>
<tr>
<td><smallfont>$onlinestatus
$fromuserinfo[profile] $fromuserinfo[useremail] $fromuserinfo[homepage]
<a href="search.php?s=$session[sessionhash]&action=finduser&userid=$fromuserinfo[userid]"><img src="{imagesfolder}/find.gif" border="0" alt="Find more posts by $fromuserinfo[username]"></a>
<!-- $ post[icqicon] $ post[aimicon] $ post[yahooicon] --> </smallfont></td>
</tr>
</table>
</td>
</tr>
<tr id="cat">
<td bgcolor="{tableheadbgcolor}" colspan="2" align="center"><smallfont color="{tableheadtextcolor}" class="thtcolor">
<b>$nextoldest $nextnewest</b>
</smallfont></td>
</tr>
</table>
</td></tr></table>
<br>
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<td>$forumjump</td>
<td align="right"><smallfont><b>$timezone</b></smallfont></td>
</tr>
<tr>
<td colspan="2" align="center">
<a href="private.php?s=$session[sessionhash]&action=newmessage&privatemessageid=$privatemessageid"><img src="{imagesfolder}/pm_sendreply.gif" alt="Reply to this message" border="0"></a>
<a href="private.php?s=$session[sessionhash]&action=newmessage&forward=true&privatemessageid=$privatemessageid"><img src="{imagesfolder}/pm_forward.gif" alt="Forward this message to another member" border="0"></a>
$buddyforwardlink
<a href="private.php?s=$session[sessionhash]&action=newmessage"><img src="{imagesfolder}/pm_sendnew.gif" alt="Send a new private message" border="0"></a>
</td>
</tr>
</table>
<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>
<form action="private.php" method="post" enctype="multipart/form-data" name="vbform" onSubmit="return
validate(this)">
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="privatemessageid" value="$privatemessageid">
<input type="hidden" name="prevmessageid" value="$privatemessageid">
<input type="hidden" name="action" value="dosend">
<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>
<tr id="cat">
<td bgcolor="{categorybackcolor}" colspan="6"><normalfont color="{categoryfontcolor}"><b>Quick PM
Reply</normalfont></b></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}" colspan="6">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Recipient:</b></normalfont></td><td bgcolor="{secondaltcolor}">
<normalfont><input type="text" class="bginput" name="touser" value="$fromuserinfo[username]" size="25"
maxlength="25" tabindex="1"> </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="RE:
$message[title]" size="40" maxlength="85" tabindex="2"></normalfont> </td>
</tr><tr>
<td bgcolor="{secondaltcolor}" valign="top" nowrap><p><normalfont><b>Your Message:</b></normalfont>
</td>
<td bgcolor="{secondaltcolor}">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td><textarea name="message" rows="7" cols="$textareacols" wrap="virtual" tabindex="3">
$pmquote
</textarea><br>
<smallfont><a href="javascript:checklength(document.vbform);">[check message
length]</a></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="deleteorig" value="yes"><b>Delete original:</b> Delete original PM from PM box.
<br><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" checked><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.
<br><input type="checkbox" name="pmreceipt" value="yes" checked><b>Request Read Receipt:</b> Allows you to
check whether your message has been read by the recipient.
</smallfont></td>
</tr>
</table>
</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="submit" class="bginput" name="submit" value="Send Message"
accesskey="s" tabindex="4"><input type="reset" class="bginput" name="RESET" value="Clear Fields" tabindex="6">
</normalfont></td>
</tr>
</table>
</form>
$footer
</body>
</html>
Can someone please give me some assistance with getting this one sorted ?
If you need to view private.php Im more than happy to email / PM it to you as I cant post it here in its entirity.
Thanks in advance for any assistance given
It is greatly appreciated.