![]() |
Hey there,
I have a "graduation year" and an extra "birthyear" (admin view only) user profile fields in my board, so I wrote this hack to make sure members are entering valid and acceptable numeric data for these fields. ;) This hack will require your members to enter a numeric data (numbers) for a user profile field. If the user did not enter a number or if the number is not between the limits you set, he will get an error message and should go back and enter a valid number. INSTALLATION 1- Login to your CP and create a new template named: "error_numericfieldonly" In your template specify your error message. eg: -- cut -- You should enter number between X and B for the field A. Please go back and correct it. -- cut -- 2- In "User Profiles", create your profile field (should be a "required" field). After you create it, click "Modify User Profile Field". Find your field in the list, left mouse click on "EDIT" link and choose "Open in New Window". In the new window check your browser's address bar: at the end you'll see smt. like that "profilefieldid=5". This is your field's ID. Note that number. 3- Edit "register.php" and "member.php". Find this: PHP Code:
PHP Code:
Enjoy! \\=^)) Logician |
Sweet great hack, I like it
|
great hack, i requested such hack long time ago specifically for a graduation year, plus it would be nice to have a count down for each member to the graduation year ;)
|
Excuse me.
Great idea and nice small hack. Actually, with che code you suggested, such a check for one field would be performed each custom field for the same X number (it's within the while clause). I think should be better to replace the above code with something like : PHP Code:
Thanks again and sorry the intrusion. But I did this way and would share such a small work-around. Bye |
@javelin: Honestly it's not a big deal for me which error user gets first : required field error or numeric entry error. But your code is a good enhancement for Admins who care, so thanks for sharing.. :)
Regards, Logician \\=^)) |
Of course. Nothing to say: your hack works and it's a nice idea (this reason I installed it too) :D....
And when installed I found such a small problem; tried to fix it and though someone else could have the same... Thanks again. Bye |
Great idea for a great hack. Our of curiosity, would it be possible to modify this to work for a *post* field. eg. Have an extra field in the newthread and newreply that requires numeric entry for the post to be accepted?
|
Quote:
|
All times are GMT. The time now is 09:57 PM. |
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:
|