![]() |
Force Profile Update Hack
This hack was made by gforce2001 on request by myself here:
https://vborg.vbsupport.ru/showthrea...threadid=40584 He deserves a big thank you for it :) It is being release with his permission. What does this hack do? Here?s a Scenario: You have a board with 1000 members. You decide you want to add a new required field to your members profiles. Well everyone who registers after you add the new required field will be required to fill it in to complete registration (makes perfect sense :) ). But your 1000 existing members can skate by without updating and continue to go about posting and such. This hack forces your existing members to update the new fields you?ve added to the profiles. You can set it so that once members log in and try to view the board, reply to a post, post new topics, search forums, and so on, they will instead get a message that tells them they need to first update the new fields in their profile before they can go any further. Why use this hack? Even if you tell your members to go and update the new profile fields they won?t always do it. But if they are forced to do it before they can post or view the board then they will do it. What am I using it for? I have 300 existing members and I now want all my members to be searchable by their location and key interests. But my members need to have this information in their profiles before anyone can get any results. So I'm forcing them to put this new information in. Doesn't sound nice but it's needed to make the system work. This hack gives me the power to force members to update that profile before they can do anything they want to do on the board. What can you restrict? ForumDisplay, Calendar, Newreply, Newthread, Poll, etc. Warning: Do not use this hack on usercp.php. Your members need access to edit their profiles. Step by Step; Step 1. Open up the file you want to restrict (i.e. newreply.php) Step 2. Find: PHP Code:
PHP Code:
Hover your mouse over the edit link of the forum you want to make your exisiting members require to fill out. Note the last number in the url ( the profilefieldid= number). Write it down. Step 4. Replace the ## in the code below with the number you just wrote down. PHP Code:
Example; PHP Code:
Step 5. Create a new template called: error_emptyrequiredfields Place the folowing message in it (or whatever message you would like): Quote:
|
Quote:
PHP Code:
|
How many queries does this add?
|
Yes you are correct.
Number of queries I don't know. |
You don't need any queries, roxics. You can use this instead:
PHP Code:
|
Excellent!
|
I have installed this on newreply and newthread, and it's working like a charm. Thank you.
|
Quote:
g-force2k2 |
getuserinfo() does, but we only call it if we need to.
|
ah ic... thanks again for the explanation FireFly :D
g-force2k2 |
Looks good, defiantly useful :D
|
Excellent hack! Thank you very much!!
/me clicks install |
I added roxics code to my 2.2.0 and it seemed to work like a charm until some users began complaining about not being able to post due to "field is required" message.
Field was already filled in, so why the message appears? Would firefly's solve the probem? I can't see a relation between the field contents and the quey not being able to retrieve them. Ideas? Thanks! |
Is it possible to add Avatar enforcement as well to this hack?
|
Couldn't you just put this function in the functions.php and use the "chkprofilefields($bbuserinfo[userid],##);" line in the files you need to instead of having to have the whole function code in each file?
|
wat if i wanna force members to update their birthdate?
thanx |
Quote:
|
Bump
|
Great :banana:
|
what if you want to force an update from people in a specific usergroup only?
|
which file should i change if i want to restrict viewing of threads? because there are a lot of people on my board who do not post.
|
Would it be possible to modify this hack so I can get it so that I can click button and it forces everybody to change some fields in their profile? Not that I may or may not have added, but I have fields that would change every 6 or so months and would like to send soemthing to my users so they would go in there and change them.
Is something like this possible with the already given code? It should work with my version of VB, so you wouldn't have to worry about that part. Anybody? |
what's profile field ID for birthdate?
|
Any similar hack for 3.0?
|
yes is there anything similar for 3.5 ? :)
|
All times are GMT. The time now is 02:08 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:
|