PDA


View Full Version : Amount of sub categories


attroll
02-26-2007, 12:24 PM
Right now we can set the amount of categories a usergroup can create.

I would like to see it so that we can assign it by individual users. If we could have it default by user group, but have it so we could change it in the users profile and have it override the usergroup setting.

Brian
02-26-2007, 12:30 PM
Something like that would probably require changing vBulletin tables in order to add a new column for the number of categories, which is something we try to avoid whenever possible.

attroll
02-26-2007, 02:06 PM
If the user group is only allowed one category then I could create another category in ADMIN and assign the user as the owner of the category and this would be a way of overriding this wouldn't it?

Brian
02-26-2007, 02:25 PM
No, that would still count as the one of the users categories.
Any reason you couldn't just add another vB usergroup or two for those members and then add them to that group? If that wouldn't work, I could probably give you the code for a plugin that you could add to change the category limit for specific users.

attroll
02-26-2007, 02:35 PM
Yes your right that would count as as one of the users categories, but if they have already reached their category limit then the Admin can create another category and assign it them them and that will let them exceed their limit right?

Yes I could also assign another VB usergroup, but I don't want to keep adding usergroups just for added the amount of categories a person can have.

If that wouldn't work, I could probably give you the code for a plugin that you could add to change the category limit for specific users.
This would work also.

attroll
02-26-2007, 02:41 PM
I am so close to putting this on my real site now and asking for beta tester. I only need three things to complete that.
1. To get the categories that they can not submit to (http://www.vbadvanced.com/forum/showthread.php?t=20551), to not show up.
2. Need the time stamp (http://www.vbadvanced.com/forum/showthread.php?t=20595) option.
3. Need to be able to override or set users to amount of categories (http://www.vbadvanced.com/forum/showthread.php?t=20594) that can create.

Brian
02-26-2007, 02:49 PM
Ahh, sorry I misunderstood you. There are no checks for the number of categories a user has on the admin side, so yes, that would work.

Or a plugin that looks something like this should work:

Product: vBulletin
Hook Location: style_fetch
Title: (your choice)
Execution Order: 20
Plugin PHP Code:
if (VBA_SCRIPT == 'blogicles')
{
switch ($vbulletin->userinfo['userid'])
{
case 1:
case 2:
$vba_blog->_permissions['entries_maxcats'] = 500;
break;

case 831:
$vba_blog->_permissions['entries_maxcats'] = 25;
break;

case 99:
$vba_blog->_permissions['entries_maxcats'] = 20;
break;

}

}

Of course that's just an example of the code. If you have multiple users that you want to allow the same number of categories for, that's where you use this part of the code:
case 1:
case 2:
case 5:
$vba_blog->_permissions['entries_maxcats'] = 50;
break;

Userids 1,2, and 5 will be allowed a maximum of 50 categories with that code.

Then when you just have one user who will have a different allotment, you use the code:
case 831:
$vba_blog->_permissions['entries_maxcats'] = 25;
break;

That allows the userid 831 to have 25 categories.