PDA

View Full Version : Changing Usergroup ID


Boofo
03-30-2003, 10:33 PM
Can someone please tell me how I would go about changing the Usergroupid for the "Banned by Moderators" usergroupid from 9 to 8? Mine is set at nine and it is supposed to be set at 8 for default vbulletin, isn't it?

filburt1
03-30-2003, 11:28 PM
UPDATE usergroup SET usergroupid = 8 WHERE usergroupid = 9;
UPDATE user SET usergroupid = 8 WHERE usergroupid = 9;

Might cause unpredictable results though, for all I know.

Boofo
03-31-2003, 08:58 AM
What is the default Banned by Moderators group? I had a usergroup I set up called Banned at usergroup 8 because I never saw the Banned by Moderators group until I test banned someone from the mod cp. It never showed up until then. That was the only reason I made a special banned group. If this is the default one, then I don't need the other one. But since it was usergroup 8, this one seemed to move up to usergroup 9. Can anyone verify or dispel filburt's possibility?

Xenon
03-31-2003, 11:42 AM
you have to upgrade the forumpermission table, too.

but it's not needed, the val of the id is irrelevant.
here for example it's 9, too.

Boofo
03-31-2003, 11:51 AM
So I'd probably be better off to just go change the usergroupid for the banned group in the php files where I have coded things for that group instead of changing the actual usergroupid number then?

Xenon
03-31-2003, 11:56 AM
yes :)

i won't make those things hardcoded....

just create a function isbanned() and use this function everywhere instead of $bbuserinfo[usergroupid]==8..

Boofo
03-31-2003, 12:04 PM
Ok, how would I go about making that function? That sounds like a better idea, anyway. But there are certain areas where it will not work. Like if you have USERGROUPID NOT IN (5,6,7,9). How would you do it then?

Xenon
03-31-2003, 04:26 PM
you're right some problems are still there...

add this to functions.php:


$bannedusergroupid = x;
function isbanned() {
global $bbuserinfo,$bannedusergroupid;
return $bbuserinfo['usergroupid'] == $bannedusergroupid;
}


so you can use $bannedusergroupid in your usergroupid NOT IN (5,6,7,$bannedusergroupid) :)

Boofo
03-31-2003, 06:08 PM
Today at 12:26 PM Xenon said this in Post #8 (https://vborg.vbsupport.ru/showthread.php?postid=375995#post375995)
you're right some problems are still there...

add this to functions.php:


$bannedusergroupid = x;
function isbanned() {
global $bbuserinfo,$bannedusergroupid;
return $bbuserinfo['usergroupid'] == $bannedusergroupid;
}


so you can use $bannedusergroupid in your usergroupid NOT IN (5,6,7,$bannedusergroupid) :)

I just need to change the x to the banned usergroupid number, right? Also, does it matter where it goes in functions?

Xenon
03-31-2003, 08:29 PM
right and no it doesn't matter :)