The MU forums have moved to WordPress.org

global-categories.php what's it doing? (25 posts)

  1. Melodiefabrieknl
    Member
    Posted 17 years ago #

    By default the MU installation comes with global-categories.php included in the mu-plugins folder. What is it doing?

    I was expecting that when you're adding new categories as admin of the MU-website all subblogs would be able to use this category, but that's not the case.

  2. andrea_r
    Moderator
    Posted 17 years ago #

    At the moment, nothing. It's there and seemingly adds all user categories to one table (wp_sitecategories) but other than that, it's unused in the code.

    At least I haven't found it yet.

    I think someone got partway through implementing global categories and decided to ditch it and left those bits in hoping maybe someone else would write a plugin that uses it. I do remember Donncha saying that it was resource intensive if you had a lot of blogs.

  3. quenting
    Member
    Posted 17 years ago #

    isn't it on that that wp.com tags displayed on homepage are based ?

  4. Melodiefabrieknl
    Member
    Posted 17 years ago #

    I also feel that it might be interesting for sitewide categories. Mmm... interesting!

  5. helmi
    Member
    Posted 17 years ago #

    i think the plugin manages that two categories with the same name don't become two categories but only one for global functions.

    i just tested in on my MU install and added two categories with the same name from two different blogs - they got the same id'.

    I'm just a bit curious why this is managed through a plugin . Sound like a basic function.

  6. andrea_r
    Moderator
    Posted 17 years ago #

    But it's an *included* plugin. ;)
    (that was me being smart this time)

    When I do get time, I think this is what I'm gonna be looking at to do my own site tags. Although a quick browse of a few tag cloud plugins shows many of them just go to the db and haul info out of one blog's category table, why not just point it to this one instead?

  7. suleiman
    Member
    Posted 17 years ago #

    andrea, i know you were following the other thread where deltakid produced a working tag cloud implementation.

    If I may be so bold as to ask, what's keeping you back from using that? It works great as far as I can tell!

  8. Melodiefabrieknl
    Member
    Posted 17 years ago #

    Helmi is right. I have checked the database also:
    - for all blogs a special wp_[blognumber]_categories table is created
    - all categories with the same name are using the same ID

    If you want to use global-tags, it's already build in!

    I want to hack http://www.thunderguy.com/semicolon/wordpress/top-cat-wordpress-plugin/ so it can work on MU. This would set one main-category for all posts and still have the tag/category functionality for extra tags/categories.

    Might be cool. For me adding a tag-system to MU feels like redundancy.

  9. andrea_r
    Moderator
    Posted 17 years ago #

    "If I may be so bold as to ask, what's keeping you back from using that?"

    Haven't tried it yet is all. :) Honestly, I forgot all about it when I answered. There's a couple things I want to fix on my install before I go adding a bunch more tables to the database too, so that's why. No inherent bias or anything. :)

    And there's also the above-mentioned redundancy. I know deltakid said he wanted to add more fields, so he just aded anothe table, but to me it just felt sloppy. (and he did say it was a quick job) You can add more fields to an already existing table... Let's just say we're all about streamlined elegant code here. ;)

  10. nims
    Member
    Posted 16 years ago #

    I wonder if anyone has taken this plugin global-categories.php any further ?

  11. lunabyte
    Member
    Posted 16 years ago #

    Why?

  12. mysorehead
    Member
    Posted 16 years ago #

    I haven't checked since the last upgrade but when you renamed a category, the id didn't change which led to an inconsistency with the global_catgeories ids.

    This is not ideal.

    Richard

  13. drmiketemp
    Member
    Posted 16 years ago #

    Hmm, I had thought they had fixed that. Was an issue on wp.com months ago where someone had a category labeled "norfolk" and it was tied to "blowjobs at weddings" or some other nonsense in the tag system.

  14. lunabyte
    Member
    Posted 16 years ago #

    Ah yes, blowjobs at Norfolk weddings. Always a nice past time.

    I still see no relevance for global category id's, really. Not like you're going to use that to query every single blog to make a tag list from it. That would be insane,

  15. drmiketemp
    Member
    Posted 16 years ago #

    I;d have to check but I could have sworn that the names of the categories within individual blogs aren't stored with the individual blog's db tables.

  16. mysorehead
    Member
    Posted 16 years ago #

    Hmm, I had thought they had fixed that.

    Yes they have I checked it out when I found the problem, they use ajax to rename the categories, mu doesn't (or didn't -- I haven't checked lately)

    That would be insane,

    Gee whiz!

    Again, there is a global catgeories table and also individual categories table, when you add a new category if it is already in the gloabal categories table it is given the same id. If it is not in the global categories then it is added to it. If you change the name of a category then the id is not changed and no longer matches the category in the global categories.

    The relevance is...

    If you have created a plugin (as I have) which makes cross posts to class blogs, section blogs and a whole school blog then you cannot rely on the category id, when duplicating the posts. if it was updated (as it is in wp.com) then you could.

    I;d have to check but I could have sworn that the names of the categories within individual blogs aren't stored with the individual blog's db tables.

    No need to check -- they are.

    Richard

  17. softlord
    Member
    Posted 16 years ago #

    Is there any way to integrate this data into the GUI (i.e. having all categories of all blogs available to select from in the categories list for a new post)?

  18. lunabyte
    Member
    Posted 16 years ago #

    Sure, with a little hacking goodness, except that would end up being quite a long list.

  19. softlord
    Member
    Posted 16 years ago #

    I dont mind that, we can parse using plugins.

    Any ideas on where to start? I can't imagine its just me looking for something like that.

  20. softlord
    Member
    Posted 16 years ago #

    Anyone?

  21. worldblogosphere
    Member
    Posted 15 years ago #

    Well, this might be the post I am looking for. Although it really gives no answer to my problem as of yet.

    I was thinking that the Category Mapping plugin was what I needed, but it is not.

    What I want is what softlord asked about and got ignored. (at least in this post, maybe soft found the answer somewhere else)

    I have 139 categories on my main blog. I want those 139 categories to be listed in every blog in the network for user to place them in the categories of their choosing. If they are all listed in one big database file and given the same ID if created in the sub blogs that is fine. However, is there a way for me to avoid sitting here and having to create them all in every blog within the network? Can I just copy a file somewhere within my main blog that lists all the created categories into the sub blog so they all show there too? If so, what file is it? I certainly can't seem to find it.

    Thanks for any help.

  22. redsoxmaniac
    Member
    Posted 15 years ago #

    " I want those 139 categories to be listed in every blog in the network for user to place them in the categories of their choosing."

    I don't really understand this, but I think you mean every time a blog is created then these categories would automatically exist, and from there the blogger can pick and choose the categories to delete.

    You can use the MU default categories plugin that creates default categories every time a blog is created. Can't think of the link, but you can search for it on here.

  23. Ovidiu
    Member
    Posted 15 years ago #

    yeah that would work that way, but how would one stop users creating new categories?

  24. worldblogosphere
    Member
    Posted 15 years ago #

    I actually found and tried the default categories plugin on about the sixth or seventh page of search results after a few hours of dredging through the rest. I put it in and I thought I could work around it not doing subcategories. figure I could just go to each blog and move then into their parent categories.

    That didn't work and actually caused the current problem I am having in my other post about the category slugs now being all messed up.

    It is a good plugin that works. Just wish it'd have the sub category option added in to it.

    As for keeping users from adding (or deleting) categories - I have a plugin that lets you shutoff most of the menus in the left column of the admin page. I can't remember the name of it at the moment. But if you search "remove delete blog link" you should be able to find it.

  25. Ovidiu
    Member
    Posted 15 years ago #

    yeah, I know the plugin but as far as I rememebr, you can also create categories while writing a new post...

About this Topic

  • Started 17 years ago by Melodiefabrieknl
  • Latest reply from Ovidiu