Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorVaz
    • CommentTimeAug 19th 2007 edited
     # 51
    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.
    • CommentAuthorMilingo
    • CommentTimeAug 19th 2007
     # 52
    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
  1.  # 53
    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.
    • CommentAuthorMilingo
    • CommentTimeAug 19th 2007
     # 54
    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!
  2.  # 55
    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.
    •  
      CommentAuthorVaz
    • CommentTimeAug 21st 2007
     # 56
    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.
  3.  # 57
    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.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeAug 21st 2007
     # 58
    I guess it needs to ignore -'s as subcategory indicators after there has been another character. Is that fixable with a little regex?

    [-Stash-] sucks at regex
  4.  # 59
    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.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeAug 21st 2007
     # 60
    Ah, I see how it all works now :D Nice and simple...
  5.  # 61
    Uploaded version 0.2.2 of SubCategories.
  6.  # 62
    Okay, this release should provide fixes for the above.
    •  
      CommentAuthorVaz
    • CommentTimeAug 21st 2007
     # 63
    Brilliant! It's working fine.
  7.  # 64
    Before I start, just like to let everyone know my first experience with Vanilla was a hot 30 minutes ago, so as far as newbies go, I'm the perfect definition.

    My questions:

    1. Anyway to get an aggregate of the 30 latest discussions within child categories and display them on the parent category page?
    2. How do you reference the parent category when building the headline for child category pages? In other words, how do you generate "Parent > Child : Entry"?

    Finally, this is outside the scope of this plugin but does involve it:

    3. If I wanted to limit the drop down list of available categories to child categories only when creating a discussion within the parent / child category, which theme files should I look to modify?

    Other than that, this plugin is brilliant, I love the "- " for sub categories.
  8.  # 65
    Hello cowboystyle, welcome. To your questions...

    1. This currently isn't possible. It would be doable, but would be quite a mission due to the complexity of having unlimited levels of attachment (if that makes sense). Perhaps someone might like to undertake this as an extension with a requirement of the SubCategories extension?

    2. Due to the nature of how Vanilla allows extensions to interact with the core (you are quite removed, and can only dip in at designated points to alter things) I had to do this by forceably altering the titles before they got rendered in the theme (it was best for compatibility). As such, it is quite difficult to alter how this works (you would need to modify my extension). Though, in the future, I would consider changing how this functions if more pragmatic suggestions are made.

    3. I am not sure if this is doable through theming. You would need to use an extension to overload the GetDiscussionForm function in the DiscussionForm class, it wouldn't be pretty.

    I think I can see what you want to get out of the SubCategories extension. It is doable, but not very easily... it might take creating an extension purely tailored to your requirement. One extension that might help that I am working on an update for at the moment, is MultiRoles - which I hope to provide the ability to make categories read only. That way you would be able to control where people post to through permissions.

    Hmm, I am being a bit incoherent, I apologise.

    Adam.
  9.  # 66
    @angelic_venus: Thanks for the pointers and prompt response, I completely understood everything you said.

    1. I could definitely see this as a plugin, something like SubCategoryAggregate, I'll take a look at how the discussions.php does it's magic and maybe come up with something.
    2. I only ask, because on the discussions page I'd like to present a complete category trace , as I have sub categories with the same name.
    3. The limit on child categories would be for presentation purposes only, I don't require a strict enforcement, I'll take a look behind the scenes and see whats up.
  10.  # 67
    This might be a bug, but it looks like Sub-Categories aren't viewable on the parent category page until you manually move the the child under the parent on the category creation page.
  11.  # 68
    Yes, I would quite like to attach categories at the very top of the list, but due to the way that I remove sub categories from the main list (using a reg exp that looks for categories with a lack of "- " at the beginning of category names) it would be quite difficult. I think them not being displayed unless you attach them to a parent (by reordering them to be below a main category) reinforces how the system works anyways.

    Adam.
  12.  # 69
    Adam:

    Just finished the alpha version of an XML RPC interface for some common functions for Vanilla, one of the functions being Category Creation. I can't get it to work with SubCategories (that is categories added with "- " don't register as sub categories) and I'm not quite sure where to begin for adding subcategories. Any advice?
    • CommentAuthorcowboystyle
    • CommentTimeAug 30th 2007 edited
     # 70
    Sent it out, thanks for the prompt reply

    whoops, whispered, ignore
  13.  # 71
    Uploaded version 0.2.2 of SubCategories.
  14.  # 72
    Version number changed from 0.2.2 to 0.2.3.
  15.  # 73
    SubCategories does not detect child categories with same name like so:

    Dakota
    - North
    - South
    Carolina
    - North
    - South

    Carolina's children will never show up, so I came up with a quick fix which passes around the Category object instead of just relying on the name.

    Quick fix to detect SubCategories with same names:

    In "default.php":
    ln160 : function IsSubCategory($Category, $CurrentName = '', $Zealous = false) {
    ln165 : $Level = CategoryLevel($Category->Name);
    ln172 : $Parent = GetParent($Category->CategoryID, $Category->Name, $Level);
    ln326 : if(IsSubCategory($DiscussionGrid->Category)) {

    In "sub-categories.php":
    ln41 : if(IsSubCategory($Category, $CurrentName)) {
    •  
      CommentAuthorVaz
    • CommentTimeSep 1st 2007 edited
     # 74
    I think I may have found another bug.

    If you use the symbol ' & ' as in a category name the category doesnt show up. You end up having to write AND instead.
  16.  # 75
    Okay, I will look in to these =), cheers guys.

    Adam.
  17.  # 76
    Whoops, note on my quick fix, throws an error when using strict error detection, use this instead:
    ln137 : function CategoryLevel($CategoryName = '') {
    ln165 : $Level = CategoryLevel(@$Category->Name);
    • CommentAuthorDemocritus
    • CommentTimeSep 16th 2007
     # 77
    Would it be possible to list the sub-categories on the main Category tab/page?

    I would like to have them displayed, as clicking into the categories first, then seeing the subtopics does not let you quickly peruse all available topics at a glance. To clarify, what I am asking if it is possible to have the Main Category page display in nested format all of the Categories, sub-cat topics.

    Thanks!!
  18.  # 78
    Currently not Democritus, because of the way I forcefully remove the categories on the main categories page. I have paused work on SubCats for the moment so that I can finish off some other stuff to be able to get my forum live. I will perhaps look in to your suggestion at a later day.

    As for the bug fixes, I should have some time to work on them soon.

    Adam.
    • CommentAuthorDemocritus
    • CommentTimeSep 17th 2007
     # 79
    Hey, thanks for quick reply. Completely understood. Will wait or find someone within my discussion group to hack at it.

    Demo-
  19.  # 80
    I'm sorry to call the emperor naked but apart from making things disappear in the categories page how is this different from just creating normal categories (albeit with a dash in front of their name)?

    The children seem not to inherit any of their parents access privileges and people can post in the parent just like a normal category.

    sorry if I'm missing the point here
  20.  # 81
    This is not about inheriting permissions, it is a stylistic change and only a stylistic change, it is designed to be a simplistic solution to SubCategories within Vanilla.

    Adam.
    •  
      CommentAuthorVaz
    • CommentTimeSep 30th 2007
     # 82
    Another bug: script seems to hate the following character:

    '
    • CommentAuthorhalo_12
    • CommentTimeOct 8th 2007
     # 83
    Anyone got a url of this in action please? Would love to see it working.
    • CommentAuthortata
    • CommentTimeNov 25th 2007
     # 84
    3. If I wanted to limit the drop down list of available categories to child categories only when creating a discussion within the parent / child category, which theme files should I look to modify?


    This would be a good addition to the plugin. Adam will you have time soon to continue to work on this much needed plugin...?
    •  
      CommentAuthorHamed
    • CommentTimeNov 27th 2007
     # 85
    this does nto really work for me
    any ideas why?
    • CommentAuthortimfire
    • CommentTimeNov 27th 2007 edited
     # 86
    tata said:If I wanted to limit the drop down list of available categories to child categories only when creating a discussion within the parent / child category, which theme files should I look to modify?

    Neither this extension nor Vanilla itself is really set up for this. As was stated earlier in this discussion, the SubCategories extension is really just stylistic, not structural. You would need to write a new extension to implement this effect.

    Hamed said:this does not really work for me
    any ideas why?

    Uhh... what's wrong? Did you install the theme files into the proper folder(s)? Did you add "(dash)(space)" to the front of your sub category name?

    It works perfect for me in v1.1.3 (except for the small bug Vaz mentions).
    • CommentAuthorrobbo
    • CommentTimeNov 28th 2007
     # 87
    Someone whispered me about my solution to this, but I thought maybe it was useful enough to post here too.

    I wanted to, instead of just showing a count of Sub Categories under the parent category, actually list out all the subcategories with links.

    My solution is below, although it should probably be generalized a bit more. Maybe it could be added to a future version of the extension?

    ------------------------------------------------------------------

    In default.php under Subcategories I added this function (right under the line that reads "// Theme functions"...around 199)


    function SubCatList ($CategoryID,
    $list_prefix="<div>",
    $list_suffix="</div>\n",
    $sub_cat_item_prefix="",
    $sub_cat_item_suffix="",
    $sub_cat_item_separator=", ")
    {
    global $Context;

    $CategoryManager = $Context->ObjectFactory->NewContextObject($Context, 'CategoryManager');
    $Data = $CategoryManager->GetCategories(1);

    $Category = $Context->ObjectFactory->NewObject($Context, 'Category');
    $BeginSubForums = 0;
    $SubForums = 0;
    $CurrentName = '';
    $return_list = '';

    $Count = 0;

    $Level = false;

    while ($Row = $Context->Database->GetRow($Data))
    {
    $Category->Clear();
    $Category->GetPropertiesFromDataSet($Row);
    $Category->FormatPropertiesForDisplay();

    if ($Category->CategoryID == $CategoryID)
    {
    $BeginSubForums = 1;
    $CurrentName = $Category->Name;
    $Level = CategoryLevel($CurrentName);
    $return_list = $list_prefix;

    }

    if($BeginSubForums == 1)
    {

    if($Category->Name != $CurrentName)
    {
    if(CategoryLevel($Category->Name) <= $Level)
    {
    $return_list .= $list_suffix;
    break;
    }

    if ($Count > 0)
    $return_list .= $sub_cat_item_separator;

    $return_list .= $sub_cat_item_prefix .
    '<a href="' .
    GetUrl($Context->Configuration, 'index.php', '',
    'CategoryID', $Category->CategoryID) .
    '">'.
    SubNameTidy($Category->Name) .'</a>' .
    $sub_cat_item_suffix;

    $Count++;
    }
    }

    }

    return $return_list;

    }




    Then in theme/subcategories.php were it's calling SubCount($Category->CategoryID, 'categories'), instead call SubCatList ($CategoryID)

    That'll more or less do it.
    •  
      CommentAuthorHamed
    • CommentTimeNov 28th 2007
     # 88
    @timfire

    theme files?
    i was supposed to upload files to the theme in adition to the extension folder?
    • CommentAuthortimfire
    • CommentTimeNov 28th 2007 edited
     # 89
    Hamed: Yes, there should be a "sub-categories.php" included with the add-on that needs to be uploaded to the appropriate theme folder(s). Certain options also require you to modify your categories.php file, check the readme.
    •  
      CommentAuthorHamed
    • CommentTimeDec 2nd 2007
     # 90
    ok thanxz
    it works now
    ^_^
    •  
      CommentAuthorPol
    • CommentTimeDec 3rd 2007 edited
     # 91
    Can this be used to do "sections" in the style of the more generic forum systems (vB, phpBB, PunBB, etc.)? That is, I basically want to have a few parent categories, which are just for visual organization -- you have to post in one of the subcategories. (It needs only be two levels deep. The top-level abstract sections, and the categories they contain.) And on the main Categories page, each should show its immediate subcategories.

    Is that possible?
    Well, I'm sure it is, but has anyone done it? :)
  21.  # 92
    I think Pol's request is similar to my own - that is to say, I don't want people posting in the 'parent' category
    • CommentAuthortimfire
    • CommentTimeDec 4th 2007
     # 93
    Structurally, that's real easy if you combine it with Category Roles. Just set the parent category to read-only. Visually/style-wise, getting the sub-categories to show up on the main category page will require some modification of categories.php and/or sub-categories.php.
  22.  # 94
    thanks timfire - do I need another add-on to make a category read only - as far as I know I can only make a category visible/invisible to certain roles and don't the ability to alter to read/write access so further info would be a great help, thanks.
    •  
      CommentAuthorPol
    • CommentTimeDec 4th 2007
     # 95
    @timfire: Yeah, I already got the Category Roles bit. Thanks. I'll see if I can figure out a way to get the templates to do what I want...

    @conradslater: It's a separate add-on.
  23.  # 96
    For anyone that is still having problems with SubCategories not showing up because there are special characters in a Category name, the solution is simple:

    Add the following:

    function IsSubCategory($Category, $CurrentName = '', $Zealous = 0) {
    $CurrentName = html_entity_decode($CurrentName,ENT_QUOTES);

    Note that this uses the fix I provided in the comments above, so be sure to check those out too.
    • CommentAuthorjherzog
    • CommentTimeDec 28th 2007
     # 97
    I don't think this extension is working for me but I want to make sure it does what I think it does before I start troubleshooting.

    What I have done...
    I have made the following categories:
    CO2 Incubators
    - Troubleshooting
    - - The Temperature is Too High
    - - The Temperature is Too Low
    Bactron User Group

    There are discussions in the Bactron User Group but that does not matter since I don't need subcategories there.

    In the CO2 Incubator category only the sub sub categories ("The Temperature is Too High" and "The Temperature is Too Low") have discussions in them.

    I have started a discussion in "The Temperature is Too High" titled "Possible Cause is the Controller"

    My Issues:
    In Vanilla, when I click on Categories I only see CO2 Incubators and Bactron User Group. If I click on CO2 Incubators I do not see the sub category. It says "No discussions found". Should I see the subcategory here?

    The discussion I started shows up on the front page of "Discussions". When I click on it I see the post. The breadcrumb shows the cat and the sub sub cat but is missing the sub category. It is "CO2 Incubators > The Temperature is Too High ยป Possible Cause is the Controller". Why is the subcategory "Troubleshooting" missing?

    Something is not right, correct?

    Any ideas what could be wrong. I have not made any mods to the system. I have added the following themes and extensions.

    Theme
    Blogger

    Extensions
    AjaxQuote
    Applicant Email Verification
    Html Formatter
    Notify
    Nuggets
    Preview Post
    SubCategories

    Everything is up to date.

    Thanks for any help
    Jed
    • CommentAuthorjherzog
    • CommentTimeDec 31st 2007
     # 98
    Thanks Peterbp. That worked and I saw that was even in the readme. So shame on me for not reading :).

    I wanted to mention this.

    As I added Categories and SubCategories they were in the correct order (just by chance). I still could not get this extension to work. I then reordered the categories (took them out of order) and then put them back in the correct order. Then everything started working. It seems (for me) that the reordering of the categories step is necessary even if they happen to be in the correct order upon creation. Might have just been my setup but I thought it might help someone else.

    Jed
    • CommentAuthormburns
    • CommentTimeJan 20th 2008
     # 99
    Installed it and worked great.

    One feature request: In the categories view, could each parent topic have a listing of the sub-categories in it? A forum listing might look like:

    # Support Questions
    # Category description Technical help about the XO laptop. Synced with the community-support@lists.laptop.org mailing list.
    # Discussions: 280 | Sub-forums: Software, Hardware, Networking

    If you give me some insight into *how* to implement that (any similar code samples I could use as a reference?) I would even be willing to try. From there are other neat things we could do form their (have discussion # for each sub-forum being listed, etc), but that is just my daydreaming.
  24.  # 100
    Subcategories has been working fine for me, but for some reason, recently the order of categories and subcategories has changed.
    Start a new discussion -> select the category for this discussion.
    From the drop down box, the categories are not in the same order as they have been placed.

    I have clicked on settings and categories and they are in the original order there.
    I have also tried to change the order from there, but they still show in the wrong order.

    Can anybody help, please ?
    Thanks in advance