Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Force Profile Update Hack Details »»
Force Profile Update Hack
Version: 1.00, by roxics roxics is offline
Developer Last Online: May 2009 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 07-02-2002 Last Update: Never Installs: 12
 
No support by the author.

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:
require('./global.php'); 
Under it put:
PHP Code:
 // +++++++ Start Erroring Missing User Profile Fields [ Start ] +++++++ 
function chkprofilefields($userid$n) {
  global 
$DB_site;
  
  
$fieldnumber="field$n";
  
$getu=$DB_site->query_first("SELECT $fieldnumber FROM userfield WHERE userid='$userid'");
  
$field=$getu[$fieldnumber];
    if(empty(
$field)) {
      eval(
"standarderror(\"".gettemplate("error_emptyrequiredfields")."\");");
      exit;
    }
}
// +++++++ Start Erroring Missing User Profile Fields [ End ] +++++++ 
Step 3. Log into your Admin CP and go to "User Profile Fields > Modify".
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:
chkprofilefields($bbuserinfo[userid],##); 
Now put that last code right under the larger code given above. Note: If there is more then one profile field you now require then add another line of that last code underneath the previous.
Example;
PHP Code:
chkprofilefields($bbuserinfo[userid],7);
chkprofilefields($bbuserinfo[userid],13);
chkprofilefields($bbuserinfo[userid],15); 
Repeat this process for whatever files you want to suspend from your users until they fill in the new profile fields (i.e. forumdisplay.php, newthread.php, calendar.php)

Step 5. Create a new template called: error_emptyrequiredfields

Place the folowing message in it (or whatever message you would like):

Quote:
Before you can go any further you need to update all profile fields that are now required on the forum. You can view your UserCP>Edit Profile and update it there. Thanks in advance!
Step 6. Smile That's it!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-03-2002, 07:09 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks good, defiantly useful
Reply With Quote
  #13  
Old 07-05-2002, 12:58 PM
djr's Avatar
djr djr is offline
 
Join Date: Nov 2001
Location: Amsterdam
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent hack! Thank you very much!!

/me clicks install
Reply With Quote
  #14  
Old 02-19-2003, 11:41 AM
Areku Areku is offline
 
Join Date: Feb 2002
Posts: 540
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #15  
Old 03-20-2003, 05:42 PM
AlexanderT's Avatar
AlexanderT AlexanderT is offline
 
Join Date: Mar 2003
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to add Avatar enforcement as well to this hack?
Reply With Quote
  #16  
Old 03-20-2003, 06:30 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #17  
Old 04-09-2003, 05:16 PM
kevinnguyen kevinnguyen is offline
 
Join Date: Feb 2003
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wat if i wanna force members to update their birthdate?
thanx
Reply With Quote
  #18  
Old 05-05-2003, 09:55 PM
ogden2k's Avatar
ogden2k ogden2k is offline
 
Join Date: Apr 2003
Posts: 192
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
04-09-03 at 02:16 PM kevinnguyen said this in Post #16
wat if i wanna force members to update their birthdate?
thanx
I want to know this too..
Reply With Quote
  #19  
Old 05-07-2003, 12:10 PM
ogden2k's Avatar
ogden2k ogden2k is offline
 
Join Date: Apr 2003
Posts: 192
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump
Reply With Quote
  #20  
Old 05-11-2003, 07:47 AM
OmaniMan OmaniMan is offline
 
Join Date: Nov 2002
Location: Oman
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great :banana:
Reply With Quote
  #21  
Old 06-04-2003, 04:11 PM
bandersen's Avatar
bandersen bandersen is offline
 
Join Date: Feb 2002
Location: Oslo
Posts: 211
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what if you want to force an update from people in a specific usergroup only?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:20 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04863 seconds
  • Memory Usage 2,305KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete