The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Force Current Members To Fill Out Required Profile Field Details »» | |||||||||||||||||||||||||||
Force Current Members To Fill Out Required Profile Field
Developer Last Online: Nov 2023
So you add a new required profile field, and members who join afterwards are forced to fill out the field, but you want your current members to fill out that field too. Well unless your current members go edit their profile, the new field sits and waits for them to take action. This mini hack will force your current members to fill out the field by prompting them for action before allowing them to return to normal site use. Here are some further details:
Show Your Support
|
Comments |
#12
|
||||
|
||||
First, open the STANDARD_ERROR template, and copy it to a new template named zzzz_emptyreqfields. Then replace $errormessage with
Code:
There are new required profile field(s) since your last visit: click <a href="profile.php?$session[sessionurl]do=editprofile">$vbphrase[edit_profile]</a> to update. Code:
if ($bbuserinfo['userid'] AND $bbuserinfo['userid'] > 1) { if (!empty($_SERVER["REQUEST_URI"])) { ///// check your phpinfo $zzzz_noise = $_SERVER["REQUEST_URI"]; ///// check your phpinfo } else { $zzzz_noise = "zzzz"; } $zzzz_regex = "(profile\.php|usercp\.php)"; if (!eregi($zzzz_regex,$zzzz_noise)) { $zzzz_reqfields = $DB_site->query("SELECT * FROM ".TABLE_PREFIX."profilefield WHERE required=1"); if ($DB_site->num_rows($zzzz_reqfields)) { while ($zzzz_reqfield = $DB_site->fetch_array($zzzz_reqfields)) { $zzzz_ufields = $DB_site->query_first("SELECT * FROM ".TABLE_PREFIX."userfield WHERE userid='$bbuserinfo[userid]'"); $zzzz_fieldname = "field$zzzz_reqfield[profilefieldid]"; $zzzz_field = $zzzz_ufields[$zzzz_fieldname]; if (empty($zzzz_field)) { $zzzz_templatename = "zzzz_emptyreqfields"; eval('print_output("' . fetch_template($zzzz_templatename) . '");'); exit; } } } } } |
#13
|
|||
|
|||
Thanks integra99! Hopefully the required steps are now more clear for others. BTW, here is a mini script to check for other applicable $_SERVER elements.
PHP Code:
|
#14
|
|||
|
|||
Very useful. Is there a way to tell it to look only for some required field? I want birthdays, gender and country only. Unfortunately the weather hack has a required field (required when you select the weather) and that force people to choose it too. Perhaps a conditionals if condition required and different than weather field?
|
#15
|
|||
|
|||
Try changing...
PHP Code:
PHP Code:
|
#16
|
|||
|
|||
Calorie, your suggestion didn't work...it keeps sending me to the error page even after I have filled in the require field. Can you find another solution?
|
#17
|
||||
|
||||
*theArchitect clicks install*.
Nice hack, and very useful. Only one problem. When I add the necessary code to the global.php file I can't update anything. I first get sent to a page saying that there are new profile fields that I need to fill out and when I click on the link I get told that I need to fill out new profile fields before i can browse the forum. So I end up in a new profile field loop. I decided to add the code to the index.php page instead and this works fine. Though people can still use the rest of the forum if they choose to ignore the prompt. Do you know what I did wrong? |
#18
|
|||
|
|||
I am planning on implementing this hack into my boards. Yet, I am wondering if its possible to add onto it slightly.
I want a profile field such as "I Agree to post by the rules" that everyone has to fill out. However, if a user choses 'no' I want their account to be placed ina usergroup that will not let them post until they choose 'yes' in their profile field. Any guidance on how I can go about accomplishing this? Thanks. |
#19
|
||||
|
||||
Quote:
add a condition that checks the value from that field after submission, if the value is "NO" ... then change that users groupid to the groupid you want. if zzz_customfield = 'NO'{ bbusergroupid = 10}; |
#20
|
|||
|
|||
Quote:
|
#21
|
|||
|
|||
I get a heavy loop. Dont know what is up. Wish I could use this baby.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|