View Full Version : Location field required
sandboa
07-25-2012, 12:36 AM
Hi, I am wondering if there is a way to require the location field in the profile to be filled?
Sarteck
07-25-2012, 05:56 AM
YOu mean filled at registration?
First you'd have to add the location field to the registration form (not there by default). For that, you could add in a plugin at register_form_start with something like...
$human_verify .= '<input name="location" type="text" />';(You'd definitely want to tweak the HTML to look better.)
Next you'd want to make a plugin on register_addmember_process to check and add that info. Something like:$location = $vbulletin->input->clean_gpc('r', 'location', TYPE_STR);
if (!$location) {standard_error('HERPADERP, YOU FORGOT THE DARN LOCATION!',false);
$location_array = array('field2' => $location);
$userdata->set_userfields($location_array);
That -should- do you... but tbh, someone's probably already created a plugin for something like that. If not, just twaek that code, test it out, see if it works for you.
sandboa
07-25-2012, 02:57 PM
Thanks. I'll give it a try. I search for some time for a plugin to do just that. Could not find one for 4.2.
--------------- Added 1343234333 at 1343234333 ---------------
Didn't work. The field is missing from the registration form
--------------- Added 1343235632 at 1343235632 ---------------
Got it. Thanks
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.