Log in

View Full Version : add new usergroup on product install


Nullifi3d
02-18-2008, 01:59 AM
I would like to add a new usergroup (additional, not primary) based off registered members usergroup permissions when my product is installed. I have browsed over the update function in usergroup.php, but can't view what query's are used. Can anyone shed some light on the subject for me?

Opserty
02-18-2008, 08:11 AM
Line 435 in my admincp/usergroup.php has this:
// insert
/*insert query*/
$db->query_write(fetch_query_sql($vbulletin->GPC['usergroup'], 'usergroup'));
$newugid = $db->insert_id();
You can find out what fetch_query_sql() does in the vBulletin API Docs, the best thing would be to run a var_dump() on $vbulletin->GPC['usergroup'] to see what it contains, you can then duplicate this how you see fit.

Good luck, doesn't seem like an easy task!


http://members.vbulletin.com/api/ - vBulletin 3.6 Code Documentation

Nullifi3d
02-19-2008, 01:46 AM
I have found the same. I sometimes get lost when trying to duplicate a function that vbulletin does through a nest of functions, but if nobody else can provide some input I'll just have to man up and find out myself.