PDA

View Full Version : OK How did you do it? - Exclude categories in UserCP


agiacosa
03-14-2006, 12:01 PM
To the powers that be here at vb.org,

I love the option to hide categories. Can you share how you did it with the membership?

Thanks!

Xenon
03-14-2006, 12:30 PM
that's very easy to do

just set up a new profilefield with select boxes

and then put a small plugin into global_start check if a chackbox is checked, and if yes, just change the permission cache for that forum/category to 0 :)

agiacosa
03-14-2006, 01:35 PM
Stefan,

Thanks.

I do understand what you said and how it's done. However, not being a coder, I have no idea how to write the small plugin. Would you share the one you wrote?

Xenon
03-14-2006, 02:26 PM
well, it's not very much

the plugin looks like that:

// Exclude Forums except direct link to thread
if ($vbulletin->userinfo['fieldxx'] != 0 AND THIS_SCRIPT != 'showthread' AND THIS_SCRIPT != 'attachment')
{
$excludeforums = array();
if ($vbulletin->userinfo['fieldxx'] & (1 << 0)) // first checkbox
{
$excludeforums = array_merge($excludeforums, array(xy, xy, xy, xy));
}
if ($vbulletin->userinfo['fieldxx'] & (1 << 1)) // second checkbox
{
$excludeforums = array_merge($excludeforums, array(za, za, za, ta));
}
...
foreach ($excludeforums AS $fid)
{
$vbulletin->userinfo['forumpermissions']["$fid"] = 0;
}
}

hambil
03-26-2006, 11:36 AM
*clicks install*


Dang it, where's the install? ;)

mikeylikesitz
04-23-2006, 11:43 PM
i take it there is something to change to make that work?

Xenon
04-24-2006, 11:22 AM
the xes and xyes... of course ;)

agiacosa
06-08-2006, 10:02 AM
Xenon,

It isn't working for me for some reason. I set up new profile field with multiple checkboxes. Each checkbox is for each category that I want the option to exclude.

I then built the plugin you mentioned above. Fieldxx was changed to Field12 (the field I created). I then changed the xy with the forum ID for each forum within the category I want to hide if the box is checked.

Is that correct? Don't know what I'm doing wrong.

Mysticales
07-11-2006, 02:37 AM
I know on VB3.0x when you wanted to use a checkbox to do a option for "Save sent PM" choice.. you also had to make a SQL table by hand.

On 3.5x the plugin did that all for you, and it worked for the save sent PM.
My guess... the SAME plugin with renamed variables for the "Exclude Forums" options" would allow users to SAVE the options.
https://vborg.vbsupport.ru/showthread.php?t=98551

The question is.. how would it be applied to the user in the forums? "FORUMSHOME" template or what?

Also I would love to hear more about how this could be done.. is there a chance this could be done on a 3.0.9 vB without ftp access?