Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Hide discussions from a specific Category
Raize
✭✭
Helloo, I am using the BlogThis extension, so I would like to let members comment on posts which I "blog" but not have the posts from that category show up in the discussions view...any help?
0
Comments
Managed to achieve it using WallPhone's unrealeased (why?!) extension - Category Hider:
<?php /* Extension Name: Category Hider Extension Url: http://www.lussumo.com/addons Description: Hides certian categories from the discussion grid Version: 1.0 Author: WallPhone Author Url: http://wallphone.com/ */ // CONFIGURATION: Edit the two array() statements in the code to reflect the category IDs that should be blocked. // The code blocks categories 5 and 6, but if you wanted to instead block categories 1, 3, and 6, then use // array('1', '3', '6') in place of the other two array functions. if ( ('index.php' == $Context->SelfUrl) && !in_array(ForceIncomingString('CategoryID', ''), array('5', '6')) ) { function Category_HideFromDiscussions(&$DiscussionManager) { $SB = &$DiscussionManager->DelegateParameters['SqlBuilder']; foreach ( array('5', '6') as $CurrentBlock ) { $SB->AddWhere('t', 'CategoryID', '', $CurrentBlock, '<>', 'and', '', 0, 0); } } $Context->AddToDelegate('DiscussionManager', 'PostGetDiscussionBuilder', 'Category_HideFromDiscussions'); $Context->AddToDelegate('DiscussionManager', 'PreGetDiscussionCount', 'Category_HideFromDiscussions'); } ?>
WallPhone, I hope you don't mind me posting this code here, but this is really priceless! ;-)
I could have sworn it was already up. I'll have to do some testing and uploading. It will require Vanilla 1.1.4 or later.
The download link up there seems to be broken, so it's here in case anyone wants it before the official release by Wallphone:
Category Hider v 1.0
For those coming via Google looking where to find a related plugin (link above is dead):
Check peregrines: http://vanillaforums.org/addon/hidecategory-plugin