Fork me on GitHub
Current releases are 2.1 (gold) and 2.0.18.11 (security patch for 2.0)
Ready for 2.1? Find out if your favorite plugins are compatible.
The 2.0 branch will no longer receive updates after Dec 2014.

SubCategories

245

Comments

  • Uploaded version 0.2.0b of SubCategories.
  • Version History:
    • 0.1.0b - First Beta
    • 0.1.0 - First Release: Added parent categories links, finished removal of redundant dashes.
    • 0.1.1 - Fixed one bug with categories beginning with only "-" and showing up as sub-categories in some places and another with category counts. General tidy up. Extrapolated SubCategories definition, and added a message to the Categories List Settings page. Also fixed a conflict with the Blog add-on (checks whether CategoryManager class exists before trying to include it).
    • 0.1.2 - Added some functions to ease theming, see readme.txt
    • 0.2.0b - Added the ability to have unlimited levels of sub-categories. Extrapolated sub-categories theme into overridable theme file (see readme.txt). Blocking sub-categories now works.
    Okay, another beta release. This edition includes unlimited levels of sub-categories, you can now go as deep with them as you require, just add more "- "s to the beginning of your category name. I have also fixed the problem stopping sub-categories from being "blocked" from the main discussion list. Not only that, but I have made it so that you can override the look of the sub-categories, by overriding the theme that I have provided in the theme folder - just copy it into your theme folder, and edit away.

    See the readme.txt for more information of how the new features work.

    NOTE: This is a beta release! Do not update if you are planning to use it on a production server, but do install it on a development server to give me feedback on the enhancements I have made, so that we can get 0.2.0 final released.

    Enjoy!

    Adam.
  • Uploaded version 0.2.0b of SubCategories.
  • Help if I upped the version number in default.php.
  • Alright, everything seems to work great.
  • AV, if this works the way I think it will, I'll be back with Vanilla (and on these boards) in no time. Thanks in advance!
  • Let me know how it goes TomTester. I am almost ready to release the final of 0.2.0, which is just a clean up, and some fixes to the ability to theme and position sub-categories.

    Adam.
  • Uploaded version 0.2.0 of SubCategories.
  • Version History:
    • 0.1.0b - First Beta
    • 0.1.0 - First Release: Added parent categories links, finished removal of redundant dashes.
    • 0.1.1 - Fixed one bug with categories beginning with only "-" and showing up as sub-categories in some places and another with category counts. General tidy up. Extrapolated SubCategories definition, and added a message to the Categories List Settings page. Also fixed a conflict with the Blog add-on (checks whether CategoryManager class exists before trying to include it).
    • 0.1.2 - Added some functions to ease theming, see readme.txt
    • 0.2.0b - Added the ability to have unlimited levels of sub-categories. Extrapolated sub-categories theme into overridable theme file (see readme.txt). Blocking sub-categories now works.
    • 0.2.0 - Tidy up. Sub-categories now render by attaching to a delegate, which is overridable by altering configuration variables. Orphaned categories are now detected and displayed in some way. Problems with sub-categories being missed off of the end of sub-category list when after further nesting of categories fixed. Fixed problems with breadcrumb links in titles on discussions and comments pages. Fixed statistics for multiple nested categories.
    This is the second release of SubCategories, only a few days on, and double the size of the first release. I have learned a lot in creating this extension, and am now more confident to get cracking with the many other Vanilla-related projects I have planned.

    This release fixes a lot of issues I was having behind the scenes with having unlimited nesting of sub-categories. The logic is quite complicated, because I didn't want to make any inherent alterations to the way Vanilla handles categories (so that compatibility with other extensions is less of a problem).

    One of the main updates in this release (bar the obvious - infinite nesting), is how the sub-categories are rendered. They are now attached to a delegate (it is more compatible than the previous method), it also means, that by overriding some configuration options, you can add sub-categories to any delegate you like.

    For instance, I have added a delegate to my discussions.php theme just below the header called SubCategories:
    $this->CallDelegate('SubCategories');
    and overloaded the $Configuration['SUBCATEGORIES_DELEGATE'] in conf/settings.php with "SubCategories". Some minor alterations to the sub-categories.php theme file (which I copied into my theme folder to overload it) later, and I have them just where I wanted them.

    Please let me know if you find any bugs =) (hopefully there shouldn't be any)

    Adam.
  • I've uploaded the new version and my previous categories no longer display. Only the parent category displays.

    I have not moved the sub-cat theme or done anything of the sort. Is there something I should be doing to bring them back?
  • Have you overloaded the theme, Vaz? I forgot to mention, that you will need to re-pull the theme for this version to work (due to structural changes).

    Adam.
  • So the theme overload IS compulsary? Unfortunately my sites down I can't test it out. Will get back to you. I've currently just uploaded the file.
  • It's not compulsory, I was just wondering if you have overloaded the theme from a previous version. If you have, the old theme will not work work with the new version (and so you should replace sub-categores.php with the new one in your theme folder). If you haven't then it is a different problem - if so, could you post the outline of your categories.

    Let me know when your site is back up.

    Thanks,

    Adam.
  • Hi Adam, The site is back. I'm sorry but I'm just getting confused now. Right now all I have done is uploaded: /SubCategories/default.php /SubCategories/categories.php /SubCategories/theme/sub-categories.php & then enabled extension. Where do I go from here? Thanks again.
  • Okay, it is my fault, I will release 0.2.1 in a minute which should resolve the problem. My apologies.

    Adam.
  • Hmm, you know I cannot find what might be causing this Vaz. Are you sure you don't have a sub-categories.php in any other theme folders? Could you please post the outline of your categories (just a list of their full names from the settings pages) so that I can try and work out what the problem is.

    It might be worth disabling the extension, deleting the files from the extension folder and trying over again.

    Adam.
  • Hi, Well I disabled the extension, deleted it and went back to my category page and got the following error: Fatal error: Call to undefined function subdiscussioncount() in /home/.pilar/xxxx/xxxxxx.com/forums/themes/categories.php on line 27. I'm presuming this is due to that variable change we made earlier on to show the number of total discussions within a category. Could this be conflicting with the new updated version? (which I tried again and didnt work for me).
  • Yes, once the extension is gone, so is the function that was added to make discussion counts cumulate with subcategory discussions I am afraid.

    I am really quite stumped as to what could be causing the issues you are experiencing so I am going to release 0.2.1 in hope that it fixes your problems.
  • Uploaded version 0.2.1 of SubCategories.
  • ok I've restored categories.php (theme file) back to how it was. Error has now gone. Testing new extention.. please wait. edit- didnt work for me. I bet it's going to turn out to be something really silly. Do you have msn or another form of contact? Do you mind taking a look and trying to get it running? thanks again.
  • is it possible to have the nesting in the "all discussion" page, just like the discussion page? I haven't figured how to make it. thanks
  • I will whisper you my MSN, Vaz.

    Milingo, I don't see how nesting would work on the main discussion page. As the whole point of seeing sub-categories is that you are within a category. Or am I misunderstanding you?

    Adam.
  • Hi, Pretend I have this menu in my post /comments.php?DiscussionID=1&page=1 Movies > Public Domain: "Movie title" in the "home page (/)" of the forum it appears as "Movie title" Category Public Domain But I'd like to see the full tree as "Movie title": Movies > Public Domain Is that possible? thanks!
  • Okay, Vaz's problem is due to using the > character in his parent category name. Not sure why this is yet, I presume it has something to do with Vanilla stripping HTML from category titles, interfering with the rendering on the discussions pages, when I know the problem and have fixed it, I will make another release (but till now, try to avoid using the > character).

    Adam.
  • Hi Adam, Well I removed the > and it has had an effect. Some sub-categories are now showing but not all. One of my parent category has about 5-7 sub categories. However, just one sub-category is showing.
  • These seem to be due to the dashes in the sub-category names. I will also look into this when I look into the issue later today. It seems to be a general issue with special characters in names.

    This one seems a little more obvious to fix. It is thinking they are sub sub categories, which is a problem (generally, it is making a mince meat of things... but at least I know what it is down to).

    I have a fix in progress.

    Adam.
  • I guess it needs to ignore -'s as subcategory indicators after there has been another character. Is that fixable with a little regex? /me sucks at regex
  • I am just going to count all -'s that are not at the front, and subtract them from the overall count. I don't want to get into regex, it is slow, and I am not great at it either ;-).

    Adam.
  • Ah, I see how it all works now :D Nice and simple...
  • Uploaded version 0.2.2 of SubCategories.
Sign In or Register to comment.