Log in

View Full Version : Registration: Passing Source Page Thru Registration Form


I.M.O.G.
11-06-2012, 08:06 AM
When a user completes registration, they are typically greeted with a message that includes a link "Click HERE to return to where you were previously". If vBulletin doesn't actually know where the user came from, that link sends them back to the forum homepage.

If I have an overlay which allows registration on my site without leaving the thread currently being viewed, how do I pass the source page variable through the registration process, so that on the register.php?do=addmember landing page they are given a link back to where they started?

kh99
11-06-2012, 12:35 PM
You can set $vbulletin->url to the page you want to go to. You could use a plugin on hook register_addmember_complete, for example.

I think you'd also want a plugin on register_start that looks for a specific parameter and sets a variable to be used in the registration template, and then add a hidden field in the form using that variable as the value. That way when the registration form is submitted (or resubmitted after an error), you will have the source page url available to use in the plug mentioned above.

I no that's probably not a very clear explanation, but I hope it makes some sense.

I.M.O.G.
11-06-2012, 02:32 PM
Thank you kh99. I think I get what you are after. :)

Do you know what the variable is that I need to get the current page URL on vb3? On vb4, it looks like its "{vb:raw relpath}"

--------------- Added 1352216251 at 1352216251 ---------------

Maybe "$threadinfo[threadid]" would do it when they access the registration overlay from a showthread.php page.

--------------- Added 1352218072 at 1352218072 ---------------

Sorry, nevermind. On my custom overlay, I had defined the following url variable statically, once I removed that line, the redirect back to the source URL worked normally.