vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Location field required (https://vborg.vbsupport.ru/showthread.php?t=285922)

sandboa 07-25-2012 12:36 AM

Location field required
 
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...

PHP Code:

$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:
PHP Code:

$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 [DATE]1343234333[/DATE] at [TIME]1343234333[/TIME] ---------------

Didn't work. The field is missing from the registration form

--------------- Added [DATE]1343235632[/DATE] at [TIME]1343235632[/TIME] ---------------

Got it. Thanks


All times are GMT. The time now is 04:10 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01033 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete