vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Force users to complete new required fields (https://vborg.vbsupport.ru/showthread.php?t=53397)

Locutus2999 05-25-2003 10:00 PM

Force users to complete new required fields
 
Hey guys, first post here, as I have only been using/running vb for a little over a week now.

Basically I added some new required fields for users, so I wanted a way to make users fill out the new fields before they could use the site.

It is real simple, and only requires adding a block of code to the global.php file and adding an error template.

First, in global.php, find "$logincode=makelogincode();" (should be the last before ?>)
And underneath it add:

PHP Code:

if ($bbuserinfo[userid]!=&& !strchr($REQUEST_URI"usercp.php") && !strchr($REQUEST_URI"member.php")) {
  
$reqfields=$DB_site->query("SELECT * FROM profilefield WHERE required=1");

  if (
$DB_site->num_rows($reqfields)) {
    while (
$reqfield=$DB_site->fetch_array($reqfields)) {
      
$ufields=$DB_site->query_first("SELECT * FROM userfield WHERE userid='$bbuserinfo[userid]'");
      
$fieldname="field$reqfield[profilefieldid]";
      
$field=$ufields[$fieldname];
        if(empty(
$field)) {
              eval(
"standarderror(\"".gettemplate('error_emptyreqfields')."\");");
              exit;
          }
    }
  }


Then create a new template called "error_emptyreqfields" containing:
PHP Code:

We have added new required profile field(ssince your last visitPlease click  <a href="member.php?s=$session[sessionhash]&action=editprofile">here</ato update your profile

Basically, once they log in, they wont be able to do anything but go to their profile until the fields are completed.

If I posted this in the wrong forum or in the wrong format, I am sorry.

MindTrix 05-26-2003 11:16 AM

do u mean it forces people who are registerin to fill them in? or already registered users to go and fill the new fields in?

Locutus2999 05-26-2003 12:37 PM

For users that had registered prior to you adding the required fields.

Alan Ang 02-09-2004 09:39 AM

how do we force the users to enter their birthdates?

i am also using the country flags hack as well as the gender hack. how do i force them to update those?

any advice is appreciated. thanks in advance.


All times are GMT. The time now is 01:50 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.01114 seconds
  • Memory Usage 1,724KB
  • 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
  • (4)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