Форуми / Cotonti / Core Labs / Archive / Redirect timer?

musiconly
#1 05.04.2009 00:37
I have a suggestion for errors which have redirects..

How about adding a simple countdown to that errors so the user would know that he will be redirected in a short amount of time.

For example:

An error occured, maybe a wrong URL ?

Redirecting in 5 seconds


What you think?
robofreak111
#2 05.04.2009 01:06
So it would be like:
An error occured, maybe a wrong URL ?

Redirecting in 5 seconds

and then 1 second later the 5 would turn into a 4? that really woulndt be too hard...
TwistedGA
#3 05.04.2009 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]

Відредаговано: TwistedGA (05.04.2009 03:56, 16 років тому)
gamer24.7
#4 16.04.2009 17:48
Where are the instances in message.inc.php?
[b][color=#000000]Click [/color][url=http://www.design-studio.netau.net][color=#EF2929][u]Here[/u][/color][/url] [color=#F57900]For All You Design [/color][color=#756745]Related Needs.[/color][/b]
pieter
#5 16.04.2009 18:02
\system\core\message\

1st instance: line 154
2nd instance: line 164

I tried it, first one works, but not the countdown.
Some error in the script. Some " are missing I guess.

For me he displays 2 seconds. Can I change it?
... can we help you ...

Відредаговано: pieter (16.04.2009 18:09, 16 років тому)
oc
#6 16.04.2009 21:11
Obsolete.
pieter
#7 16.04.2009 21:19
What do you mean OC?
Is this standard in new version?

I guess: http://trac.cotonti.com/ticket/266
... can we help you ...

Відредаговано: pieter (16.04.2009 21:21, 16 років тому)