View Single Post
  #3  
Old 03-10-2013, 04:32 AM
Hedgen's Avatar
Hedgen Hedgen is offline
Member
 
Join Date: Oct 2012
Posts: 36
Gender: Male
Credits: 4,962
Hedgen is on a distinguished road
Default Redirect people after X seconds

Note: This is for Mysidia Version 1.3.2, It may or may not work for Version 1.3.3, I haven't tested it for 1.3.3 yet. Since it is just a little bit of HTML, you should be able to add it to any page, but again I haven't tested it yet.

Someone asked about redirecting people to the home page after logging in after 5 seconds, so I found this little bit of html code you place in your header of any page, and it will redirect people to wherever you specify.

Place this in whatever page you want:
HTML Code:
<head>
<meta http-equiv='refresh' content='timeinseconds; URL=yoursite.com'>
</head>
Replace "timeinseconds" with the amount of time in seconds you want to wait until the redirect. So if you wanted them to wait 5 seconds, set "content=" to 5.
Replace "yoursite.com" with the page you want them to be redirected to.

How to redirect someone from the login page after 5 seconds:
  Spoiler: login.php 
Go to login.php and find:
// Validation succeeded, now begins the actual login procedure

a couple lines below that, there should be "$mysidia->page->addcontent"
Place the html code right inside the quotes for that.
It should now be something like this:
PHP Code:
// Validation succeeded, now begins the actual login procedure
         
         
$mysidia->page->settitle($lang->success_title);
         
$mysidia->page->addcontent("<head>
                         <meta http-equiv='refresh' content='5;
                          URL=redirectedpage.com'>
                          </head>
                          Welcome back 
{$mysidia->input->post("username")}{$lang->success}"); 
content='5; being 5 second wait, and URL=redirectedpage.com' being the page you want people to be redirected to.


How to redirect someone from the logout page after 5 seconds:
  Spoiler: logout.php 

Go to logout.php, once there edit:
PHP Code:
  $mysidia->page->addcontent($lang->default); 
to
PHP Code:
  $mysidia->page->addcontent("<head>
            <meta http-equiv='refresh' content='5; URL=redirectedpage.com'>
            </head>"
$lang->default); 
Again, content='5; being 5 second wait, and URL=redirectedpage.com being the page you want people to be redirected to.

Last edited by Hedgen; 03-26-2013 at 01:53 PM.
Reply With Quote