Log in

View Full Version : [help] How to Create unique user field ???


muhannadhy
03-05-2006, 01:38 PM
hi all ;
pleaze help me in making one or more of user fields to be unique; i mean if i added a user field called univ-ID ; and it should be unique for every member; like user name and email are unique by default.

pleaze i need this help as soon as possible :disappointed:

tehste
03-05-2006, 02:45 PM
hi all ;
pleaze help me in making one or more of user fields to be unique; i mean if i added a user field called univ-ID ; and it should be unique for every member; like user name and email are unique by default.

pleaze i need this help as soon as possible :disappointed:

wow i realised that there is nothing like that in the stock install.
I'm sure a quick and dirty plugin like:

$check=$vbulletin->db->query_first("SELECT value FROM " . TABLE_PREFIX . "userfield WHERE name='" . $field['name'] . "' AND value='". $field['value'] ."' AND userid!='" . $vbulletin->userinfo['userid'] . "'");
if (isset($check['value'])) {
# error redirect
exit;
}
//continue...


I haven't tested that and I am not sure the table fields are right and it doesn't display an error or anything, so it needs prettying up. Maybe some coder with more than 5 mins spare time could help more :)

muhannadhy
03-05-2006, 09:39 PM
thanks alot man;

but pleaze, could anyone or any coder complete this code or tell me how to test it ?

thanks again.

muhannadhy
03-07-2006, 03:28 PM
pleeeeeeeeeeeeeeeeeeeeeeez
could any coder help me here ?
i need this pleeez