The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Custom user.php with specific custom profile fields...
Hello,
I am creating multiple custom user.php files to make creation of specific user types easier. I have entirely too many custom profile fields that are specific to user types to keep them all in one single user.php. I need some assistance figuring out the proper code for just a few things. Rather than use the existing lines that generate ALL of the custom profile field options, I want to display only specific custom profile field options. For example, in user.php there are lines like this: PHP Code:
I was trying to guess at it and came up with this, but it doesn't work right. I need it to load the array of options specific to that field... NOT a vbphrase: PHP Code:
Any suggestions? Thanks! --------------- Added 24 Nov 2011 at 10:50 --------------- Anyone have any ideas? I just need to know the bit of code to load a specific profile field and its selectable options in user.php. Thanks! |
#2
|
||||
|
||||
Help?
|
#3
|
|||
|
|||
Sorry, but I'm not sure what you want to do. Are you asking how to use the print_select_row() function?
|
#4
|
||||
|
||||
Sorry if my explanation wasn't clear. In admincp, you use user.php to create new users and enter the details for that user's custom profile fields. By default, user.php lists ALL custom profile field options that have been created in the database. I have created a secondary modified user-venue.php file, and want to display only certain custom profile fields, not all of them like the default does.
So, I need to remove the default code that generates ALL of the custom profile field options in my modified user-venue.php. I located it and removed it. Now, I need to replace that with the code that will generate specific profile fields. I don't know what code to use to make that happen. My goal is to have a secondary user.php file that will make my life easier by only showing me the custom profile fields I want, relative to the type of usergroup I am putting someone in. Does that make more sense? Thanks for replying, by the way. |
#5
|
|||
|
|||
OK, I think I get that. Assuming I do understand, it seems like the easiest thing to do would be to leave the existing code but modify the SQL to get the fields you want, or else leave the SQL to get all the fields but modify the loop to "continue;" if the field is not one that you want to display.
|
#6
|
||||
|
||||
Well, I wouldn't know how to go about doing that. I still want the original user.php file to function as normal. Would what you are suggesting affect the original as well as the new modified version, user-venue.php?
|
#7
|
|||
|
|||
It would only affect your new file if you don't modify the code in user.php. I assume you removed this code?:
Code:
$profilefields = $db->query_read(" SELECT * FROM " . TABLE_PREFIX . "profilefield AS profilefield LEFT JOIN " . TABLE_PREFIX . "profilefieldcategory AS profilefieldcategory ON (profilefield.profilefieldcategoryid = profilefieldcategory.profilefieldcategoryid) ORDER BY profilefield.form, profilefieldcategory.displayorder, profilefield.displayorder "); while ($profilefield = $db->fetch_array($profilefields)) { if ($profilefield['form'] != $currentform) { print_description_row(construct_phrase($vbphrase['fields_from_form_x'], $forms["$profilefield[form]"]), false, 2, 'optiontitle'); $currentform = $profilefield['form']; } print_profilefield_row('userfield', $profilefield, $userfield, false); construct_hidden_code('userfield[field' . $profilefield['profilefieldid'] . '_set]', 1); } so if you have a list of profilefieldids you want to display in your modified file, you could probably change the query part to be something like (line in red added): Code:
$profilefields = $db->query_read(" SELECT * FROM " . TABLE_PREFIX . "profilefield AS profilefield LEFT JOIN " . TABLE_PREFIX . "profilefieldcategory AS profilefieldcategory ON (profilefield.profilefieldcategoryid = profilefieldcategory.profilefieldcategoryid) WHERE profilefieldid IN(1, 2, 3, 4) ORDER BY profilefield.form, profilefieldcategory.displayorder, profilefield.displayorder "); |
#8
|
||||
|
||||
I tried what you suggested and it worked! Hurray!!! Thanks so much! I was trying to do it a harder way, of course! Lol!
So for anyone trying to do this... forget everything I was trying and do what kh99 said in the last post. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|