PDA

View Full Version : [RELEASE-addon] Homepage Login on Non-VB Page -- Addon


badmeetsevil-
Wed 17th Oct '01, 11:16pm
Here's a little mini-addon to a very popular hack by RobAC. You can view the original hack here. (http://vbulletin.com/forum/showthread.php?threadid=23524)

When Rob released this hack, it would log you in, and bring you to the Forums home. This was very fustrating to some, who put the logon on their mainpage, and it'd bring them to the Forums Home, and not back to where they logged in.

I decided to do it myself, and found it pretty simple.

What this little addon will do, is when you login, it'll bring you back to the page you were previously on when you logged on. So, lets say you had Rob's login code on your mainpage, and you logged in, it'd bring you back to your mainpage saying "Welcome Back, Username". This will work with any page since it uses "$HTTP_REFERER". "$HTTP_REFERER" is just a little code that tracks the last page you've been on.

To install this, you'll need to change one line in your member.php.

Find
eval("standardredirect(\"".gettemplate("redirect_login")."\",\"index.php?s=$session[dbsessionhash]\");");

and replace it with
eval("standardredirect(\"".gettemplate("redirect_login")."\",\"$HTTP_REFERER\");");

Once you do this, this should bring you back to the page you were on while logging in.:)

Thanks Rob for the great hack!:D

Does this work for you?

drumsy
Thu 18th Oct '01, 1:36am
Thanks, I'll try it! :)

Btw, both these hacks would work on say, a block on PHPnuke?

RobAC
Thu 18th Oct '01, 12:08pm
No problem. I'm glad it's helped out. I apologize for not updating it with more features, but I just haven't had the time. I've got a few major projects I'm trying to roll out on my own site and haven't been here in the support forums much.

Looks like a cool feature! :)

certify
Thu 18th Oct '01, 1:07pm
Thanks!

I'm looking for this for quite sometime now. :)

badmeetsevil-
Thu 18th Oct '01, 4:25pm
Hehe. No problem. Rob did all the work, I just edited a very little part of it.

certify
Wed 24th Oct '01, 9:57am
badmeetsevil-

Now that we have the login return to the referrer page can you do one for logout too? :)

It would be a complete package then won't you think instead of going to the forum cookies clear page which is irritating.

badmeetsevil-
Wed 24th Oct '01, 5:48pm
Here you go certify.

The following code will return you to your previous page when you log out of your Forums.

Open the template "error_cookieclear" and change this
All cookies cleared! Click <a href="index.php?s=$session[sessionhash]">here</a> to return to the forums index.
to this

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="1;URL=$HTTP_REFERER">
All cookies cleared! You are being returned to your previous page.

This should work. Tell me if it doesn't. :)

certify
Thu 25th Oct '01, 11:05am
Thanks, I'll try it now! :)

badmeetsevil-
Thu 25th Oct '01, 4:58pm
Is it working correctly? I only tested it a bit on my forums, but it seems to be working fine.

certify
Fri 26th Oct '01, 4:46am
It works!!! :D

badmeetsevil-
Fri 26th Oct '01, 10:52am
Great. Glad I could help out.