SimplePortal
Support => English Support => Topic started 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:
Parse error: syntax error, unexpected '<' in /home/xxx/domains/xxx/public_html/Sources/PortalBlocks.php(3333) : eval()'d code on line 1
thanks!
-
Have a look at Underdogs forum at www.askusaquestion.net
There may be something there.
-
It sounds like a simple parse error in one of your php blocks.
You could probably post code and get some help.
-
Try putting that code in a HTML block, rather than a PHP one.
-
<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
-
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)
<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
-
MissyNL,
Does putting HTML and/or javascript in an HTML block fix your problem?