The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Check profile custom field for unique when registeration
Hi All
I add a custom field called "field5" for user profile and show on registeration form. I want to force vbb to check if this value is unique on database when click "Complete Registration" just like username , email field checking. Can anybody help me in this Thanks alot |
#2
|
|||
|
|||
Try creating a plugin using hook location register_addmember_process, and do whatever checking you want on $vbulletin->GPC['userfield']['field5']. If it's bad, set an error like this;
Code:
$userdata->error("field5 must be unique"); |
Благодарность от: | ||
tbworld |
#3
|
|||
|
|||
Quote:
im newbie on this regards |
#4
|
|||
|
|||
Well, what is field5, is it a number, a string, an email address? If it's a number then checking for '=' might be enough, but if it's some other string then you'd probably want to trim white space and make it all the same case or something like that.
Or did you mean details on creating a plugin? You can look in the manual here: http://www.vbulletin.com/en/manual/ . Select your vb version from the dropdown first, then search for plugin and go to "Adding or Editing a plugin". |
#5
|
|||
|
|||
Quote:
i will try with your guide regards |
#6
|
||||
|
||||
I recommend against feeding any error or "gotcha" message to the spammer. Let 'em think they got registered okay. Give them the "thanks for registering" message but create no account.
|
#7
|
|||
|
|||
I was assuming that you know how to query the database to see if the field is unique, but if not we could help you with that as well.
|
#8
|
|||
|
|||
Quote:
function checkdisplayname(displayname) { if(displayname.value == '') { alert('Blank Display Name'); return false; } else { return true; } return false; } and inside the function verify_passwords i add the function above to force it check for valid display name when i click the button to finish registering function verify_passwords(password1, password2) { // do various checks, this will save people noticing mistakes on next page if (!checkdisplayname(cfield_5)) { return false; } ................... ....... I work ok now i want the function "checkdisplayname" will check for the unique value in mysql database. Can you help me to call the result from an external php or how to query mysql from a template by editting the function above THanks and regards |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|