![]() |
After an Action Redirecting
Hi Everyone,
After subscribing to a thread or a Forum, it redirects you back. Within the program, what contols that? How would I write it to redirect and log out? I think it has something to do with this code in the member2.php file: eval("standardredirect(\"".gettemplate("redirect_s ubsadd")."\",\"\$url\");"); Thanks, Alex |
You want to be automatically logged out after subscribing to a thread?
|
Hi Tubedogg,
Thanks for replying!! :) :) Yes, that's right. How to rewrite it so that it subscribes you, but then you come back logged out. All the best, Alex |
The $url variable is dynamic -- it varies based on where you last came from.
If you replace the: \$url in that line (yes, include the \), with: member.php?action=logout&s=\$session[sessionhash] it should work. eval("standardredirect(\"".gettemplate("redirect_s ubsadd")."\",\"member.php?acti on=logout&s=\$session[sessionhash]\");"); |
Hi Ed,
That's what I wanted :) But, I think we both overlooked one detail. Because the subscription process includes the .gettemplate("redirect_subsadd") as the second to last step, the logout works great, and the return too, but that .gettemplate("redirect_subsadd") is the returned to location, which then goes to the logout, which then goes to the... and it gets in a loop. How would I write it so it redirects back ?2? places, instead of just to the immediately previous location Many, many thanks, :) :) :) Alex |
Logging out shouldn't be a redirect, and the template that is used to say you're now logged out -- error_cookieclear -- doesn't have any references to $url, so that shouldn't be happening. Have you hacked logging out so it redirects as well?
|
Dr. E,
Of course you were right. :classic: I had. Took that out. Now, it subscribes them, and they finish at the "All cookies cleared. Click here to return to the forums index." What would I need to add to have it redirect them back as the last step? Thanks, :):) :) Alex |
Presumably, if you change the subscription redirection to include $url:
eval("standardredirect(\"".gettemplate("redirect_s ubsadd")."\",\"member.php?action=logout&url=\$url& s=\$session[sessionhash]\");"); Then put your $url-dependent logout code back in, it should work. No guarantees though. :) |
Hey Dr. E,
I had used this one for the logout https://vborg.vbsupport.ru/showthrea...hreadid=24889. That's the only hack I have right now. Everything else is native. Added that back with your new code, but still got subscribe, logout then stop there, no redirect. Tried to rewrite it a few other ways, but came up empty :P Any other way to write it? I can remove that hack if it will help. Thanks, :) :) :) Alex |
You can also stick the code from member.php's logout action in member2.php, and change the redirect to a standarderror. If you need more info let me know. :)
(and stop with all the smilies, makes the page load slower ;) j/k) |
Hi FireFly,
Wow, thanks for replying! smile, smile, smile, ;) The closest I got was, subscribe, log out and then the redirect code broke into the top of the screen. Darn... close! Any suggestions? Thanks, Alex |
Try this, not tested but should work.
In member2.php replace this: Code:
if (!$checkid=$DB_site->query_first("SELECT $tableid FROM $table WHERE userid=$bbuserinfo[userid] AND $typeid=".intval($id))) { Code:
if (!$checkid=$DB_site->query_first("SELECT $tableid FROM $table WHERE userid=$bbuserinfo[userid] AND $typeid=".intval($id))) { |
All times are GMT. The time now is 04:44 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|