sv1cec
12-26-2012, 07:53 PM
OK guys, please forgive me, but I am trying to port some antispam mods I had in my vB 3.0.xx site to the newest vB I plan to use in it and I have a problem. I am trying to alter register.php from vB 4.2.0 Patch Level 2.
Specifically, I need to grab the value of a userfield and compare it with the value I'll get from a table. It is a Single-selection menu field, I have it defined in the Profile fields, exactly as I had it in the old vB. It contains a list of countries and the registering member has to select one of them. I check $vbulletin->GPC['userfield']['field5'] (field5 is the name of the field) right before the register_addmember_process hook and I get a numeric value, which corresponds to the country the user has selected. What I want however, is the name of the country associated with that country value. In vB 3.0.xx I used $bbuserinfo['field5'] after I checked for errors and I got the country name. What am I supposed to check in vB 4.2??
Here is the part of the code I am looking at in register.php pf vB 4.2
else
{
$show['errors'] = false;
// save the data
$vbulletin->userinfo['userid']
= $userid
= $userdata->save();
echo "HERE: ";
echo ($vbulletin->userinfo['field5']);
break;
From the two echos shown above, which I've added, I see the "HERE: " and then nothing.
What is the variable I should use in :
$country_name = some_variable_here???
To get the name of the selected country?
I could use some help here guys, many thanks.
Specifically, I need to grab the value of a userfield and compare it with the value I'll get from a table. It is a Single-selection menu field, I have it defined in the Profile fields, exactly as I had it in the old vB. It contains a list of countries and the registering member has to select one of them. I check $vbulletin->GPC['userfield']['field5'] (field5 is the name of the field) right before the register_addmember_process hook and I get a numeric value, which corresponds to the country the user has selected. What I want however, is the name of the country associated with that country value. In vB 3.0.xx I used $bbuserinfo['field5'] after I checked for errors and I got the country name. What am I supposed to check in vB 4.2??
Here is the part of the code I am looking at in register.php pf vB 4.2
else
{
$show['errors'] = false;
// save the data
$vbulletin->userinfo['userid']
= $userid
= $userdata->save();
echo "HERE: ";
echo ($vbulletin->userinfo['field5']);
break;
From the two echos shown above, which I've added, I see the "HERE: " and then nothing.
What is the variable I should use in :
$country_name = some_variable_here???
To get the name of the selected country?
I could use some help here guys, many thanks.