The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need help with $_GET['ting'] a parameter value to show in a template
I have tried searching the forum to no avail, words are too common.
In the register.php page, I am passing info to it via the GET parameter. I need to be able to look for the GET key in the URL, and then display its value in a field, to pre-populate it. Currently the template has {vb:raw username} and it looks for the GET key called name, however I want that field to prepop with the value of a different key: custom%20user. Can someone point me in the right direction please? Thanks. Dave EDIT: Here is an actual example with fake data Code:
/register.php?do=step2&email=someone%40gmail.com&from=someone%40gmail.com&custom%20user=Terminator2&meta_adtracking=reg&meta_message=1&name=John%20Connor&unit=forumreg&add_url=http%3A%2F%2Fforum.url%2Fstartregister.php&add_notes=192.168.0.1 |
#2
|
|||
|
|||
I'm a little confused because you say that it currently looks for the key 'name' and I don't see that in the register.php code anywhere (I also don't see any do='step2'). But anyway, maybe something like this (using a plugin on hook register start):
Code:
$vbulletin->input->clean_gpc('r', 'username', TYPE_NOHTML); if (empty($vbulletin->GPC['username'])) { $vbulletin->input->clean_gpc('r', 'custom user', TYPE_NOHTML); $vbulletin->GPC['username'] = $vbulletin->GPC['custom user']; } That way it'll use 'custom user' if it exists and there's no username already specified (if you want 'custom user' to always override the username, then remove the 'if' statement but leave both clean_cpc() calls). |
#3
|
|||
|
|||
kh99,
Thanks for the reply. EDIT: I think i found the problem. This is in the plugin code: PHP Code:
I was trying to fix it in the template itself, which doesn't parse php. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|