![]() |
Force Current Members To Fill Out Required Profile Field
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:
|
Great idea, I will give a careful look at this one.
... hmm the idea is good, but the code looks like a mess and the instruction is not clear. is this a complete clean one? |
hmm, nice one. this might come handy for me
|
>> ...is this a complete clean one?
Hmm, got it running on my vB, no probs. If you find a prob with the code, just post. >> ...might come handy for me Maybe handy for verification purposes, community interaction, who knows what else. |
nice... this will definitly come in use
|
/me clicks install
|
Those instructs are horrible. Can anyone clean that up?
|
Nice IDea, though Id personally use a little Javascript to alert users torequired profile fields on registration, maybe via alerts. I may actaully do that and add this hack as abckup for already reged users or someone maybe on a aolder browser whos bypassed the Js
|
THANK YOU for the hack!!!!!!!! Exactly what I need.
Hope I can figure out how to install it............... |
>> Those instructs are horrible. Can anyone clean that up?
Horrible? Are you offering? :D |
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) { |
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:
|
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?
|
Try changing...
PHP Code:
PHP Code:
|
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?
|
*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? |
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. |
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}; |
Quote:
|
I get a heavy loop. Dont know what is up. Wish I could use this baby.
|
:::bump:::
|
uninstall to the extream
|
does this work in 3.07?
i tried installing, wanting to make 'birthday' a required field.. but when i go to the user profile field manager, there's nothing there.. ?? |
wow see this is how you know this site isnt moderated properly. hacks listed with no support, coder disapears.... and its here like the sunshine for a next poor sap to use.
that was my negitive post. now my question... anyone bothered with this? Would love to hear how people got this baby to work. |
Quote:
|
Ok, if no support is given, I will post my clean, optimised code when I get home.
The main issue that made my stomach turn about this hack is that it is loop querying the profilefield table to check if it is set, when everybody knows that all this info is contained in the $bbuserinfo variable :p I got it down to adding 1 query (the one to check whether or not a field is required, if Im not too much mistaken) :) |
This is my revised code, and it seems to work OK. It goes in place of the original global.php edit:
PHP Code:
|
Quote:
|
Quote:
if you can do magic with zero tols mass PM that would be a god send as well. dam thing just stopped working. Yeah I know its not in this thread but who IS in this thread? checkin your stuff now bro. |
works. may sound crazy but how can you have this exclude the year of birth or birday entirely? thanks. but it works I personallly just need a slight mod
|
To do this, change the query in the hack to:
[sql]$DB_site->query("SELECT * FROM `" . TABLE_PREFIX . "profilefield` WHERE `required` = '1' AND `title` NOT LIKE 'Age'");[/sql] Just replace "Age" with the title of whatever profilefield you want to exclude. Find these titles in the AdminCP Profile Field Manager. |
Quote:
I dont even know where to look for the name of the birthday location. Just so you know I am talking about the birthday users have to answer when they register. |
It seems like the Birthday is not listed in the profilefield table, at which point what you are asking is impossible without adding further queries.
Not to mention me having no idea how it would be done. And I also have to wonder, why would you want to exclude birthdays? If you have it mandatory on register, then it will already be filled out, and wont trigger this mod. |
Quote:
(I dont know why people on vb always doubt a question... but ok) so your looking at around 5000 users with this field blank. and around 7000 or so that do have it. But the profile page does not have it available. (next hack installed) But hey this hack is doing what it says.... awsome. so you have to do a db query to STOP the year result in this hack? maybe we are not hitting each other. Jan 3rd 1980 <--- The year on the site I wanted to use your awsome hack with has the year un editable. so the field is there. |
Quote:
Thanks bro. |
Well the thing is, if the Birthday is not listed as a Required profilefield in that table, it will be ignored automatically :)
|
Its not that is why I responded as I did remember?
how could I make your code work with the position of the field in the database? Thanks in advance. |
Finally found this thing... I knew I saw it somewhere! Now I suppose I should install per the "cleaned up" code, huh...
|
/me clicks install with Revan's revised code.
|
excellent hack!!!! exactly what i have been looking for since i changed to vb.
this should be standard.............. |
All times are GMT. The time now is 06:35 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|