Ticket #520 (closed enhancement: fixed)
Categories
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | Back-end | Version: | |
| Severity: | minor | Keywords: | categories has-patch |
| Cc: |
Description
There are currently no categories allowed in bbPress; all forums must be under the "Forums" category. However, it would allow for more order if there could be multiple user-definable categories. Also on a side note, the ability to change the name of "Forums" to whatever the admin wanted would be nice.
Attachments
Change History
Well I think this differs from the other as this would allow you to change the name of that big "Forums" that shows up on your bbpress install, and allow you to make multiple different categories. Where as the other is just making forums within forums.
I am currently working on a patch for this functionality. Will it be accepted into the trunk or should I work on it as a plugin?
I am adding a categories table which (when categories exist) is looped through on the front-page. Then any contained forums are listed under each category.
Forums have an explicit category_id set (only one category per forum for now) this is editable through the admin pages. A forum count is kept in the category table (a recount option for that has been added in the admin area too).
Just like forums, categories can't be deleted yet, I know there is a patch to allow forum deletion - I'm waiting to see how that works before I implement it on the categories.
I'm almost able to release a patch file for all this functionality, I just have to finalize a few things like making empty categories disappear and how to neatly the case when there are no categories.
I've done enough work that if accepted this could be changed to be part of 0.80
I'm also mulling over whether there could be a separate category view (similar to the forum view), and whether to alter the breadcrumbs creation to insert the category in the trail. But this is not critical functionality.
I hesitate to add a new table. I'd rather see something like this accomplishe via sub-forums. Then we'd get very similar functionality just by adding a forum_parent column.
Though a forum obiously couldn't have multiple parents.
I thought about that (forum_parent column solution), but it is far easier to add another table. The new table also includes a forum count column. I find that when I start joining tables into themselves to get results your SQL gets messy very quickly. You should take a look at the patch before you decide. I'll add it here soon, and you can try it out.
OK, I'm done, I just have to re-merge the latest changes from SVN into my revisions and then create a patch file.
I've included the following functionality:
- Forums can be attached to categories
- Categories can be created, sorted and deleted in the admin area
- Category deletion gives option to orphan or move contained forums
- Forums can be moved between categories
- Orphaned forums are recoverable from the admin area
- Categories keep count of the number of forums they have
- Category pages with latest/stickies list for that category and forum list for that category
- RSS feeds for categories
- Forums nested in category optgroups in new topic forms where appropriate
- Breadcrumbs on forum pages include category where appropriate
comment:11
SamBauers — 5 years ago
To upgrade the standard database manually run this SQL:
CREATE TABLE `bb_categories` ( `category_id` int(10) NOT NULL auto_increment, `category_name` varchar(150) NOT NULL default '', `category_desc` text NOT NULL, `category_order` int(10) NOT NULL default '0', `forums` bigint(20) NOT NULL default '0', PRIMARY KEY (`category_id`) ); ALTER TABLE `bb_forums` ADD `category_id` int(10) NOT NULL default '0' AFTER `forum_id`; ALTER TABLE `bb_forums` ADD INDEX (`category_id`);
comment:12
SamBauers — 5 years ago
Had to re-upload the patch file to add a slight change to the admin area. Categories are different to forums in that you can have none. When there are no categories, the forums behave much like they do in the existing code.
comment:13
SamBauers — 5 years ago
Just found a bug in this patch on the new category pages. Will have to fix, do not use this patch yet!
comment:14
SamBauers — 5 years ago
Added new patch, don't use the old one. Fixed a few problems with the old one.
comment:15
so1o — 5 years ago
we can try testing something with tagging the forums.. that way we can theoretically have multiple parents for a forums and not really make and database changes..
tricky i know.. but a thought.
comment:16
spencerp — 5 years ago
This is SWEET!! I've just implemented the last patch, running 0.8alpha. Here's my site for view: http://spencerp.net/forums/
Only thing I'm waiting on now, is the: /bb-admin/content-categories.php page itself.. I'm getting a blog 404 when going there, but of course, didn't see that file included, so.. Anyway, hopefully this might push the "project" along a little quicker LoL!. ;) :)
comment:17
sambauers — 5 years ago
That file should have been in there... as well as a few others that I realise weren't included in the patch file. I'll attach them separately.
I've also done a little extra work on the rest of the files, so I might re-release the patch also.
comment:18
sambauers — 5 years ago
I've just added the files to the new patch. New patch is for build [629].
comment:19
sambauers — 5 years ago
Dodgy filename... sorry. Must inspire confidence. Re-uploading. If it's possible to delete the first three attachments, then can someone do that?
comment:20
SamBauers — 5 years ago
I've got a "vanilla" example of this patch in action here:
http://open.omnium.net.au/forum/
This is a pre-release site, so registration is disabled.
comment:21
SamBauers — 5 years ago
New patch file for latest build [641] added. Integrates with new template system.
comment:22
spencerp — 5 years ago
Is there any possible chance of squeezing this into .80? Please, please, pretty please?! I'm currently using it on my forums and I'm not having any problems with it, besides, if anything does pop-up someone can always submit a fix.. How about it Michael Adams..? :) ;)
comment:23
sambauers — 5 years ago
New patch file for build [656], makes use of new admin header hooks in bb-admin/content-categories.php
comment:24
spencerp — 5 years ago
Argh! I just spent a lot of time last night applying this to the latest SVN committed files too! Sam, which files were really changed since last patch? Maybe I won't have so much work cut out for me if I know.. =P
comment:25
spencerp — 5 years ago
[slaps self].. nevermind! I just woke up so the brain's still in bed sleeping lmao. Sorry folks!
comment:26
sambauers — 5 years ago
Added new patch for build [661], nothing has changed really, except exactly what lines the categories changes are patched into.
comment:27
sambauers — 5 years ago
Added new patch for build [670], the recent changes to the forum_dropdown functions and get_forums function needed to be integrated. Also added a couple of string translations on the "are you sure" pages in category admin that weren't there before.
comment:28
spencerp — 5 years ago
Sam, just to let you know, there is "unresolved conflicts" with line:952 in the bb-includes/functions.php file.. Looks like I'll have to manually adjust this sigh.. this sucks...*more work*..
comment:29
sambauers — 5 years ago
New patch for build [687], fully tested against a clean export from SVN.
Also just realised that to update the database to use categories after installation, one only has to run bb-admin/upgrade.php - despite some unassociated errors, it works great.
comment:30
sambauers — 5 years ago
Added patch file for version 0.8 (build 701) of bbPress, fully tested against a clean install of 0.8.
To patch, simply go to your install directory:
$ cd /path/to/installation/
Then (on Unix, Linux and OSX) patch using patch
$ patch -p0 < /path/to/patchfile/categories-build701.patch
Upgrade your database by running the upgrade script at /bb-admin/upgrade.php
Go to the category admin area and create a category/s, then go to the forum admin area and assign your forums to your category/s.
Done.
comment:31
sambauers — 5 years ago
comment:32
sambauers — 5 years ago
Added new patch file for build [719] i.e. 0.8.1
comment:33
sambauers — 5 years ago
comment:34
sambauers — 4 years ago
comment:35
sambauers — 4 years ago
- Owner set to sambauers
- Milestone changed from 1.0 to 1.0-beta & XML-RPC
comment:36
mdawaffe — 4 years ago
Should this be implemented with meta or with a taxonomy?
comment:37
follow-up:
↓ 38
sambauers — 4 years ago
I never considered putting it into taxonomy... I think it would be more awkward and possibly more expensive using taxonomy, as it has to be called during the forum loops. Having it pulled into the forum object during get_forum/get_forums and being part of the cache makes sense to me.
I think maybe we need to setup a guideline for ourselves which says what goes where, taxonomy or meta.
The differences as far as I can tell are:
- Taxonomy allows many to many relationships while meta is one to one
- Meta is appended to the basic objects and cached automatically, while taxonomy is not (???)
comment:38
in reply to:
↑ 37
sambauers — 4 years ago
Replying to sambauers:
Taxonomy allows many to many relationships while meta is one to one
Or potentially one to many in one ugly way - i.e. serialised arrays
comment:39
sambauers — 4 years ago
- Status changed from new to closed
- Resolution set to fixed
Let's call the current implementation good. If we change our minds we can open a new ticket.

This functionality is probably the same as #260.