The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hi guys,
I wanted to use print_membergroup_row in the options forum I created one plugin Product: My addon Hook location: forumadmin_edit_form Title: my plugin forum Execution order: 5 Plugin php code: print_membergroup_row($vbphrase[mylabelphrase], 'forum[cts_reportgr]', 2, $forum['cts_reportgr']); with this plugin I get the list of groups with checkbox, but I can not save selections and when I get back in the option forums are all unchecked If I used this plugin Product: My addon Hook location: forumadmin_edit_form Title: my plugin forum Execution order: 5 Plugin php code: print_input_row ($vbphrase[mylabelphrase], 'forum[cts_reportgr]', $forum['cts_reportgr']); the entered values are saved. I know it should be a trivial thing, but until now I never used print_membergroup_row and then of course I miss the code. Thank you for your help |
#2
|
|||
|
|||
![]()
One problem is that the 4th parameter to print_membergroup_row() is expected to be userdata, so you'd have to do something like this:
Code:
$userarray = array('usergroupid' => 0, 'membergroupids' => $forum['cts_reportgr']); print_membergroup_row($vbphrase[‘mylabelphrase’], 'forum[cts_reportgr]', 2, $userarray); Also, you must have had to add a 'cts_reportgr' column to the forum table, and also make that a valid field in the forum data manager? In the data manager it should be something like this: Code:
'cts_reportgr' => array(TYPE_ARRAY_INT, REQ_NO, VF_METHOD, 'verify_list'), |
#3
|
||||
|
||||
![]()
Thank's
I changed this code PHP Code:
PHP Code:
Regards Asterix |
#4
|
|||
|
|||
![]() Oh right, thanks. Truth is I tested it by editing the class_dm_forum.php file and inserting that code into the array initialization. I forgot that that code wouldn't work directly in a plugin. |
#5
|
||||
|
||||
![]()
I noticed one thing, if I select one or more groups and save, then I can reduce or increase the selected groups but I cant clear all, minimum one remains selected
Why ? Regards. |
#6
|
|||
|
|||
![]()
I guess you need one more plugin, using hook forumadmin_update_save and code like this:
Code:
if (empty($vbulletin->GPC['forum']['cts_reportgr'])) { $forumdata->set('cts_reportgr', ''); } |
#7
|
||||
|
||||
![]()
Thanks
now it works very fine Regards Edit I would not exaggerate, but I can 'eliminate some groups from the list eg. administrator |
#8
|
|||
|
|||
![]() Quote:
Are you asking if there's a way to remove some of the options? There is no way using that function. Of course instead of calling that function you could copy the code to your plugin and modify it (it's in includes/adminfunctions.php). |
#9
|
||||
|
||||
![]()
thanks very nice
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|