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.
Add-On Request: Sub-Categories
This discussion has been closed.
Comments
it could be implemented whilst maintaining compatibility)
Toiv: I'd LOVE to have a decent tagging system (especially FIXED tags, see previous post
Tagging mockups # 32)
VBulletin has a thing where even the parent category can have post's in it. (avcorse you can set individual permissions for every category/forum in vb);
jimw, I love your discussion tags add-on, but... it does not work with the tabled theme... (or delbat).
I'd be happy with any kind of cat-grouping method, e.g. tab-level king-cats with a page-manager-UI
(allowing for DIFFERENT cat groupings, incl. overlapping ones)
I'd also settle for a DTags-based king/subcat mechanism (assign king/subcats from list of fixed tags,
then create pages by 'filtering' on a certain tag search) etc. etc.
It really shouldn't be that difficult.
scenario where some form of subcats (as 'filters') would be very useful.
In our case, we run an expatriate community with 20k+ members world-wide and tremendous room for growth.
Most members are geographically dispersed and benefit from forum discussions on a macro level (practical
things like international movers, problems encountered, social contacts, etc.).
Close to 50% however are located in 30-odd metropolitan areas, and benefit from discussions on a 'micro-level'
(state /city) like tips on the best restaurants, doctors, car rental, nannies etc. etc.
Many times expats move from one location to the next, and would love input from a person who already resides
there. Instead of building a separate forum for every 'metropolitan area', which breaks up the community at
large, I'd prefer to create ONE BIG forum for all, but allow for 'KING CATS' that are nothing more than discussion
filters based on geographic location.
Thank you, jimw
To actually retrieve the list of categories, you could use this:
$cm = $Context->ObjectFactory->GetContextObject($Context, 'CategoryManager'); $CategoryList = $cm->GetCategories();
And if you wanted to modify the SQL for what that code returns you would do this:
function ChangeCategoryListSql(&$CategoryManager) { $sb = &$CategoryManager->DelegateParameters['SqlBuilder']; // Do your SqlBuilder stuff here, like $sb->AddSelect, $sb->AddWhere etc. } $Context->AddToDelegate('CategoryManager', 'PostGetCategoryBuilder', 'ChangeCategoryList');
Function AddPrototype(&$Head) { $PrototypeFound = 0; $ScriptCount = count($Head->Scripts); for ($i = 0; $i < $ScriptCount; $i++) { if (strstr($Head->Scripts[$i], 'prototype.js')) { $PrototypeFound = 1; $i = $ScriptCount; // break out of the loop early. Comment this out if you are checking for more than one script name. } } //If Prototype wasn't found, add it. if (!$PrototypeFound) $Head->AddScript('blah-blah/prototype.js'); } $Context->AddToDelegate('Head', 'PreRender', 'AddPrototype');
This is a touchy problem--I use a delegate to keep the possibility small that your extension would try to include prototype after all other extensions would have normally already added it.
There is still a possibility of a conflict: If some other extension doesn't check for prototype already in place, uses the same delegate to add the script (not likely), and is enabled after your extension is--then there will be a conflict, and there isn't much you can do--unless you could code a time machine to see what scripts are added after your extension runs. (OK, maybe not a time machine, but it would be something I would not want to code.)
Another issue to consider is what if some other extension uses a different version of prototype that is not compatible with your extension? Personally, I would just strip out the parts of prototype that I needed and include those alone.
P.s. Just noticed my code in my last comment has the wrong function name in the AddToDelegate line at the bottom.
$Head->Scripts = array_unique($Head->Scripts); // remove duplicated entries
This would only remove scripts with the same name and path. The rest of the code will check if the a file with the same name is already there--I.E. if someone names their custom code as prototype.js it would mistake that file for the 'real' prototype.