PDA

View Full Version : Force update of profile


grb123
03-14-2002, 07:24 PM
I have added some new required custom profile fields that I want our users to fill in so we have more accurate information about our members.

What I would like to do is force all members to update their profile before being able to view index.php. Or alternatively a pop-up window appears when they come to the boards requesting them to update their profile, and when it's updated, then the pop-up no longer appears.

I've tried a variety of options, including adding an additional no_permission in functions.php but I'm not really making any headway so would appreciate any help!

Admin
03-15-2002, 11:31 AM
By update you mean you want all fields to be fill with info, or just want your users to go and see the new fields?

grb123
03-15-2002, 11:39 AM
No, I actually want them to fill in the new fields.

So for example, there is a Gender field (M or F). When a member comes to the forum, I want Forum Home to query the database to check whether that Gender field has been completed, and if not, either to display a message (pop-up or on screen) asking them to update their profile or to redirect them to Edit Profile.

grb123
03-16-2002, 11:02 AM
OK, what I have so far is:


if ($userfield[required]=="") {
eval("standarderror(\"".gettemplate('error_updateprofile')."\");");
}


I've put that just below the show_nopermission(); in index.php and tried all sorts of combinations, like $userfield[field19]=="" but I get the error_updateprofile showing even if the required fields are filled in.

Admin
03-16-2002, 11:11 AM
Let's say field5 and field6 are required:
if (trim($bbuserinfo['field5']) == '' or trim($bbuserinfo['field6']) == '') {
eval("standarderror(\"".gettemplate('error_updateprofile')."\");");
}

grb123
03-16-2002, 12:07 PM
Brilliant! That's the one!

Thanks very much!