2007-06-30, 10:31 PM
I am trying to make a 'premium member' plug-in but for some reason I can not get the Usergroups to be populated into a 'setting'
Here is what I am trying in the plugin activate:
Then I dump the $group_options variable into the 'optionscode' key
The data in the SQL table looks fine, but its not parsing in the Change Setting page.
Any help? The string replace of the ' /' is to deal with the default Unregistered / Not Logged In group
Here is what I am trying in the plugin activate:
function premium_member_activate()
{
global $db;
$info = premium_member_info();
$result = $db->query("SELECT * FROM ".TABLE_PREFIX."usergroups ORDER BY gid");
$group_options = 'select';
while ($row = $db->fetch_array($result))
{
$group_options .= '\r'.$row['gid'].'='.str_replace(' /', '', $row['title']);
}
Then I dump the $group_options variable into the 'optionscode' key
$premium_member_setting_2 = array(
'sid' => NULL,
'name' => 'premium_member_moveinto',
'title' => 'Premium Group',
'description' => 'Group to move Premium Members into (if you edit groups, you must run the Update Groups option).',
'optionscode' => $group_options,
'value' => '2',
'disporder' => '2',
'gid' => intval($gid),
);
The data in the SQL table looks fine, but its not parsing in the Change Setting page.
select
1=Unregistered Not Logged In
2=Registered
3=Super Moderators
4=Administrators
5=Awaiting Activation
6=Moderators
7=Banned
8=Gold Member
9=Platinum Member
10=Vendor
Any help? The string replace of the ' /' is to deal with the default Unregistered / Not Logged In group