Forums / Cotonti / Core Labs / Archive / Redirect timer?

TwistedGA
#11058 2009-04-05 03:29
The way error message redirection works is through the use of META tags. In it's current state, you can do this very easily. The countdown will need to be implemented, but showing the user the seconds, only takes editing two lines in the message.inc.php.

Replace the 2(Two) instances of:
	$body .= "<br />&nbsp;<br />".$L['msgredir'];

First instance:
	$body .= "<br />&nbsp;<br />".$L['msgredir']." 2 ".$L['Seconds']." ";

Second instance:
	$body .= "<br />&nbsp;<br />".$L['msgredir']." ".$rd." ".$L['Seconds']." ";

I can work on the countdown if you think it would be worth it. :-)

Well, I'm bored and wanted something new to do. I'm sure theres a better method for this, but a working countdown can be added using these two instead of the ones above.

First Instance:
	$body .= "
        <br />&nbsp;<br />".$L['msgredir']." 2 ".$L['Seconds']." 
        <script>
                var milisec=0
                var seconds=3
                document.getElementById(\"d2\").innerHTML=\"3\";

                function display(){
                         if (milisec<=0){
                         milisec=9
                         seconds-=1
                }
                if (seconds<=-1){
                milisec=0
                seconds+=1
                }
                else
                milisec-=1
                document.getElementById(\"d2\").innerHTML=seconds;
                setTimeout(\"display()\",100)
                }
                display()
        </script>"

Second Instance:
	$body .= "
        <br />&nbsp;<br />".$L['msgredir']." <label id=\"d2\">".$rd."</label> ".$L['Seconds']."
        <script>
                var milisec=0
                var seconds=$rd+1
                document.getElementById(\"d2\").innerHTML=\"$rd+1\";

                function display(){
                         if (milisec<=0){
                         milisec=9
                         seconds-=1
                }
                if (seconds<=-1){
                milisec=0
                seconds+=1
                }
                else
                milisec-=1
                document.getElementById(\"d2\").innerHTML=seconds;
                setTimeout(\"display()\",100)
                }
                display()
        </script>";
[color=#CC0000]Lazymod[/color] [color=#000000]Studios[/color]
This post was edited by TwistedGA (2009-04-05 03:56, 15 years ago)