![]() |
Select user profile field inside a user profile field possible?
Hello everyone,
I am trying to add a new user profile field. This user profile field is a 'Single selection menu' I'd like the menu to contain fields 6 to 15 as a selection Is that possible? To make things more realistic, field6 to 15 are player names my members has in their game-server accounts (it auto fills not editable using some php script) I'd like for them to be able to choose a main player from the list |
Quote:
then add all the fields to that Category from "6" to "11" as you wish |
I already have that,
How do i make those fields appear in a Single selection menu userfield so that userfield16 can have one of their selection --------------- Added [DATE]1351249095[/DATE] at [TIME]1351249095[/TIME] --------------- Would be glad to get assistance |
So I take it by the no replies that this isnt possible?
|
Can you post what you have done and tell us what is wrong with your current set up? And, images of what you want always help as I can't picture what you've done and what you want.
|
1 Attachment(s)
That's going to be abit long but why not.
I have coded my registration page to require a custom field. This field is my users username in a game server I am running In order to make sure they use their username I also added a script that checks if their password match the game password. This part is working great. Then, I added a php schedule task that connects to my sql game server and takes all the players info based on the field they used in registration and adding this info into Players user field category (let's say fields 6-15 10 player limit) You can see this here: https://vborg.vbsupport.ru/attachmen...1&d=1351365398 Now, After this is working as it should, I am trying to pull more information but I want the members to be able to set a main player (one of the fields) so I can display other stuff like guild, profession etc So to do this, I need to add another custom field called Main Player the members would have to choose from the list of players contained in fields6-15 which one is their main player and this field will be used to pull more information |
If the field is already created and you have php code that's setting the other fields, you can set the menu options of your Main Player field like this:
Code:
$players = array(); Note that members won't have any value for this field until they set it themselves, unless you also update the userfield table. |
Quote:
|
Quote:
If I can use plugins, which hook do you think is best for this? Quote:
Reminder, this is a private server not a global server (still not relevant to the case :) ) |
Quote:
Well, in a post above you said: Quote:
|
fields6 to 15 are not editable and are synced daily with my sql db
i want field 16 to be editable and to have it contain one of the fields from 6~15* (selectable by the member) |
OK, so can you add the code I posted above (or something like it) to the code that does your daily syncing?
|
Yeah, but what would be the point there if I want the member itself to choose which one of the players is his main player?
|
Because that would be the place to have any updates to fields 6-15 be reflected in the menu choices. The user would still need to go to their profile to choose main player.
Maybe I don't understand. |
Those fields are OK, I am trying to set up field16 to be choosable by the player
I want that field to be a SELECT field, the SELECT options would be the data inside field6(Rogue),field7(Mage),field8(etc),field9,fiel d10,field11,field12,field13,fi eld14,field15 which are not editable by the members.. |
I do understand that. But now I see that my idea wouldn't work because there is only one set of options in the database for a menu field, and you need each user to have their own, so it probably needs to be built when they go to edit their proifle.
OK, let me look in to that... |
OK, I kind of figured it out, but it's not perfect. First create a menu with choices that are just the numbers 1 to 10 (or however many player slots you have). Then create a plugin using hook profile_fetch_profilefields and this code:
Code:
$menufield = 16; // id of menu field |
1 Attachment(s)
Thank you for the kind help,
I have added your code to profile_fetch_profilefields and it works great! Just need to continue working on this :) sorry about the attach it was my misstake by reduplicating the plugin |
All times are GMT. The time now is 06:13 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:
|