The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I'm wondering if there is an option in vbulletin to have register.php redirect the user to their previous page on completion. I don't require email verification on my forum so it would be great if once they were registered it would take them to the original page the clicked the register link on rather than dumping them on the forum index.
I've seen a post about how to modify register.php to redirect somewhere else but I before I start changing register.php I thought I better make sure this isn't an option in the control panel or something. |
#2
|
|||
|
|||
![]()
I helped Ludnix out with his question.
Instead of doing this the smart way, which involves putting a hidden value on the registration page and then carrying that value throughout the registration process, I decided to take the easy (and fast) route and use a temporary cookie to store my data. In register.php, right under this line: PHP Code:
PHP Code:
Then, after the user completes registration. The task is to redirect them to whatever that cookie value is. So I found this line: PHP Code:
PHP Code:
If you want, you can then delete your cookie: PHP Code:
|
#3
|
||||
|
||||
![]()
Bit of advice?
Next time, if you can avoid it, don't change the hard-code. :3 Instead, use the Plugin/Hook system that vBulletin created for us. This is because any changes you make directly to the file can and will be over-written upon a forum update. The hook in question you should use is register_signup. For those wishing to do this to their forums, go to your AdminCP, "Add a New Plugin", choose 'register_signup' as the hook location (title it whatever you want). You can use the same code Saurdo created above in that location: PHP Code:
For the actual redirect, create another Plugin, and use the Hook Location register_addmember_complete. In this hook, use the following code: PHP Code:
|
#4
|
|||
|
|||
![]()
I don't have any experience modifying vbulletin, hence why I didn't want to learn what register.php was doing, but you certainly make a good point. It would be annoying to have to fix this whenever the register.php file is updated. I was kind of using this old thread to help me find where I needed to edit. (apparently I failed to read the last post though)
Thanks for the tip. I am definitely going to move my code to the plugin system and use it for any modifications I do in the future. |
#5
|
||||
|
||||
![]()
Great. :3
Just look for them hook locations in the code whenever you want to modify something or add functionality. Sometimes you just can't avoid making a direct hack to the file, but most of the time you can get something done with plugins that you need to. ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|