The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
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) |
#12
|
|||
|
|||
OK, so can you add the code I posted above (or something like it) to the code that does your daily syncing?
|
#13
|
|||
|
|||
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?
|
#14
|
|||
|
|||
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. |
#15
|
|||
|
|||
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.. |
#16
|
|||
|
|||
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... |
#17
|
|||
|
|||
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 $firstplayerfield = 6; // id of first player field $numplayers = 10; if ($profilefield['profilefieldid'] == $menufield) { global $vbulletin; $players = array(); for ($i = 0; $i < $numplayers; $i++) { $fld = 'field' . ($i + $firstplayerfield); if (!empty($vbulletin->userinfo[$fld])) { $players[$i] = $vbulletin->userinfo[$fld]; if (intval($vbulletin->userinfo['field' . $menufield]) == ($i + 1)) { $vbulletin->userinfo['field' . $menufield] = $players[$i]; } } } if (count($players)) { $profilefield['data'] = serialize($players); } } |
#18
|
|||
|
|||
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|