SimplePortal

Support => English Support => Topic started by: MissyNL on February 27, 2011, 11:05:43 AM

Title: Countdown script
Post by: MissyNL on February 27, 2011, 11:05:43 AM
Hello,

Does anybody had a nice countdown script? I have tried several.... but all give this error:

Code: [Select]
Parse error: syntax error, unexpected '<' in /home/xxx/domains/xxx/public_html/Sources/PortalBlocks.php(3333) : eval()'d code on line 1
thanks!
Title: Re: Countdown script
Post by: Old Fossil on February 27, 2011, 06:34:55 PM
Have a look at Underdogs forum at www.askusaquestion.net

There may be something there.
Title: Re: Countdown script
Post by: AngelinaBelle on February 28, 2011, 04:56:36 PM
It sounds like a simple parse error in one of your php blocks.
You could probably post code and get some help.
Title: Re: Countdown script
Post by: [SiNaN] on February 28, 2011, 04:58:00 PM
Try putting that code in a HTML block, rather than a PHP one.
Title: Re: Countdown script
Post by: Shitbit on February 28, 2011, 05:25:39 PM
Code: [Select]
<script language="JavaScript">
TargetDate = "12/31/2020 5:00 AM";
BackColor = "palegreen";
ForeColor = "navy";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="http://point_to_your/countdown.js"></script>


copy this into HTML Block , and change Script Source to your folder with countdown.js  (attached)

Regards

Shitbit
Title: Re: Countdown script
Post by: Chen Zhen on February 28, 2011, 07:18:33 PM
You can put the javascript in the html block without the file.

How do you want this to show and operate?

Here is a countdown of 20 seconds with a redirect to the root page: (example)
Code: [Select]
<table border="0" style="text-align:center;margin-left:auto;margin-right:auto;">
<tr>
<td style="text-align:center;font-face: arial;">This page will redirect in </td>
<td style="text-align:center;"><form name="d">
<p><input type="text" size="2" name="d2" style="text-align:center;"></p>
</form>
</td>
<td style="text-align:center;">seconds.</td>
</tr>
</table>

<script type="text/javascript">
<!--
var milisec=0
var seconds=20
var theUrl = location.protocol + "//" + location.hostname
document.d.d2.value='0'
function display(){
if (milisec>=0){
milisec=9
seconds-=1
if (seconds == 0){
      location.href = theUrl ;}
}
else
milisec-=1
document.d.d2.value=seconds
setTimeout("display()",1000)
}
display()
//-->
</script>

You need some additional logic for https protocol
Title: Re: Countdown script
Post by: AngelinaBelle on March 04, 2011, 07:53:44 AM
MissyNL,
Does putting HTML and/or javascript in an HTML block fix your problem?
SimplePortal 2.3.8 © 2008-2024, SimplePortal