t

Cricket2

<font color=blue>Administrator<br><font color=red>
Joined
Jan 29, 2001
Messages
7,985
AmyA

<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'September 10, 2002 12:00:00 PM CST';");document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");document.writeln('<font size=2 color=darkblue>Lance\\'s and Amy\\'s first trip to the World (together):earseek::bounce:</font><br>');document.writeln("<input type=text value='' size=40 name='WrittenByJamesMVenglarikII'>");document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();";else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";theFunction += "var out = 'Hanging out at the Castle';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.WrittenByJamesMVenglarikII.value = out;";setInterval(theFunction, 1000);</Script>
 
Here is the above code from the page source using the vB codes for her font color and size:
PHP:
<font color="blue"><font size="4">AmyA</font></font>
<br />

<br />
<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'September 10, 2002 12:00:00 PM CST';");document.writeln("<form name='CDTform" + rndNum + "' action='java script:void(0);'>");document.writeln('<font size=2 color=darkblue>Lance's and Amy's first trip to the World (together)<img src="images/smilies/eareek.gif" border="0" alt=""><img src="images/smilies/bounce.gif" border="0" alt=""></font><br>');document.writeln("<input type=text value='' size=40 name='WrittenByJamesMVenglarikII'>");document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();";else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";theFunction += "var out = 'Hanging out at the Castle';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.WrittenByJamesMVenglarikII.value = out;";setInterval(theFunction, 1000);</Script></font></p>
 
Sorry about the width. I used the PHP vB tag so it would show up easier.

JC
 
Yep, that's what's wrong with the code you posted - if you take each of the single quotes in the text to be displayed above the Countdown Timer and put backslashes in front of them, it should fix the error.

- Jim
 

Here's the wierd thing, they ARE there. Something with the vB parse must remove them. It has to be done server side because when viewing the page source, they are gone but when viewing the post code they are there.

Do you think adding a second set of them (backslashes) would fix it?

What about only removing one of them (the quotes not the slashes)?

You can see in the PHP coloring that it is "quoting" just the code between them:

's and Amy'

Would taking out one of them possibly make it worse?

JC
 
I don't think removing one of them would help, but as I have no idea why this is happening sporadically I say go for it. You can also try putting two backslashes in front of the single quote. If the vB code is parsing and rendering the escaped code this would have the effect of escaping the backslash, so a single one should be posted to the client.

I'm wondering if the board stores signatures (or parses them) differently than normal posts?

Just some thoughts...

- Jim
 
I added a second "\" to each existing "\" so the escape code was:

\\'

That did the trick.

This makes it much easier to fix but I'm going to mess around with it more later and see if I can figure it out better.

JC
 
Just removing one of them doesn't help (which you already sort of figured).

Obvoiusly removing both of them also is a fix.

I guess there is 3 choices:

1) Don't use the " ' "

2) Have a Supermod add an extra " \ " wherever needed

3) Code in HTML whenever the problem happens rather than with vB

I vote for #3 :D

JC
 












Receive up to $1,000 in Onboard Credit and a Gift Basket!
That’s right — when you book your Disney Cruise with Dreams Unlimited Travel, you’ll receive incredible shipboard credits to spend during your vacation!
CLICK HERE







New Posts







DIS Facebook DIS youtube DIS Instagram DIS Pinterest DIS Tiktok DIS Twitter DIS Bluesky

Back
Top