Articles Hierarchy
Auto-redirect to the page visited after login...
- 26 Jun 2008
- Fusion Mods
- 22153 Reads
- 8 Comments
This is s nice way to make your users happy, redirecting them to the page they were viewing before logging in.
Coded, Tested and Provided by webadmin88
Open maincore.php and find
define("THEMES", BASEDIR."themes/");
Add this after it:
define("REDURL", $_SERVER['REQUEST_URI']);
Find this line:
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_name='$user_name' AND (user_password='".md5($user_pass)."' OR user_password='$user_pass')");
Add this after it:
$readurl = $_POST['redeurl'];
Find this line:
$cookie_value = $data['user_id'].".".$user_pass;
Replace with this line:
$cookie_value = $data['user_id'].".".$user_pass.".".$readurl;
Close and save the file.
********************
Replace infusions/user_info_panel/user_info_panel.php with the below version:
DOWNLOAD
********************
Replace setuser.php (in your root directory) with the below version:
DOWNLOAD
********************
Open your locale/YOURLANGUAGE/global.php and add this line at the end just before ?> :
$locale['199'] = "Please wait while we transfer you...<br><br>";
********************
END! ENJOY! ;)
If you wish you can change the last sentence into your language, as well as some english entries in the setuser.php.
Regards,
webadmin88
Coded, Tested and Provided by webadmin88
Open maincore.php and find
define("THEMES", BASEDIR."themes/");
Add this after it:
define("REDURL", $_SERVER['REQUEST_URI']);
Find this line:
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_name='$user_name' AND (user_password='".md5($user_pass)."' OR user_password='$user_pass')");
Add this after it:
$readurl = $_POST['redeurl'];
Find this line:
$cookie_value = $data['user_id'].".".$user_pass;
Replace with this line:
$cookie_value = $data['user_id'].".".$user_pass.".".$readurl;
Close and save the file.
********************
Replace infusions/user_info_panel/user_info_panel.php with the below version:
DOWNLOAD
********************
Replace setuser.php (in your root directory) with the below version:
DOWNLOAD
********************
Open your locale/YOURLANGUAGE/global.php and add this line at the end just before ?> :
$locale['199'] = "Please wait while we transfer you...<br><br>";
********************
END! ENJOY! ;)
If you wish you can change the last sentence into your language, as well as some english entries in the setuser.php.
Regards,
webadmin88
Post Comment
Please Login to Post a Comment.
Ratings


Information
Resources
Submit





I trust this article is not finished, and it should be marked "not finished". :(

After debugging it would be a very nice addition.
Believe me dothemath I finished it and am using it in my website. I started creating it but somehow it didn't show the whole thing I will try to continue it if Diemux give me the right
Here is the continuation, Diemux will upload it sometime when he sees it here:
in the infusions/user_info_panel/user_info_panel.php find this line:
<input type='checkbox' name='remember_me' value='y' title='".$locale['063']."' style='vertical-align:middle;'>
ADD THIS LINE AFTER IT:
<input type='hidden' name='redeurl' value='".REDURL."'>
Save and upload the file.
Now open again setuser.php and find all $locale['197'] entries. Replace 197 with 199.
Go to your locale/$$$$/global.php
Find this line:
$locale['198'] = "<b>Warning:</b> setup.php detected, please delete it immediately";
ADD THIS AFTER:
$locale['199'] = "Please wait while we transfer you...<br><br>
[ <a href='".$readurl."'>Or click here if you do not wish to wait</a> ]";
THAT IS IT. YOU HAVE IT WORKING! :) THE ONLY PROBLEM IS THAT THE LINK THAT IS SHOWN ALWAYS LEADS TO THE INDEX.PHP PAGE. HOWEVER IF YOU WAIT IT WILL LEAD TO THE CURRENTLY VISITED PAGE. I AM DOING SOME DEBUGGING AND I WILL SOON GET IT DISPLAYING CORRECTLY.
REGARDS,
webadmin88
NOW I'VE MADE THE DEBUGGING AND THIS IS THE FINAL PART:
If you have modified your locale/$$$/global.php open it and find the lines with locale['199']. Then make them look like:
$locale['199'] = "Please wait while we transfer you...<br><br>";
If you have not modified it, just copy the line above and paste it.
Open setuser.php
If you have modified it find all lines like
echo $locale['199']."<br><br>
Replace with:
echo $locale['199']."[ <a href='".$readurl."'>Or click here if you do not wish to wait</a> ]<br><br>
You can change the text in your own language if you want.
P.S. If you Diemux update the package you can miss the double and the mis-steps, so that it is sophisticated :) I will submit the article for the comment paging s00n.
Regards,
WebAdmin88
Ok, updated this tutorial with the one you submitted. Thank you very much!
does it work for v7
Well I am not familiar with V7's way of logging in, I heard it was using sessions as well? This particular tweak is ONLY limited for the V6, since the files and functions which I changed and tested were based on this version

Right now I don't have a lot of time to do it again for V7, but you can still use it to create yours and submit it here
srry no sessions for V7