Ticket #520 (closed enhancement: fixed)

Opened 2 years ago

Last modified 3 months ago

Categories

Reported by: bbolman Assigned to: sambauers
Priority: low Milestone: 1.0-beta & XML-RPC
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

categories-build619.patch (33.4 kB) - added by SamBauers on 01/19/07 08:09:33.
categories-build622.patch (33.5 kB) - added by SamBauers on 01/19/07 11:06:22.
install-image-build629.patch (48.9 kB) - added by sambauers on 01/20/07 22:54:13.
categories-build629.patch (47.6 kB) - added by sambauers on 01/21/07 01:33:07.
categories-build641.patch (47.8 kB) - added by SamBauers on 01/23/07 01:53:04.
categories-build656.patch (47.7 kB) - added by sambauers on 02/02/07 06:36:34.
categories-build661.patch (47.7 kB) - added by sambauers on 02/04/07 23:13:35.
categories-build670.patch (48.6 kB) - added by sambauers on 02/05/07 23:43:07.
categories-build687.patch (48.6 kB) - added by sambauers on 02/07/07 13:55:13.
categories-build701.patch (49.2 kB) - added by sambauers on 02/13/07 06:30:31.
categories-build719.patch (50.0 kB) - added by sambauers on 02/23/07 00:06:01.

Change History

01/04/07 00:01:18 changed by mdawaffe

This functionality is probably the same as #260.

01/11/07 01:58:12 changed by bbolman

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.

01/18/07 16:52:02 changed by SamBauers

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?

01/18/07 17:50:14 changed by mdawaffe

Can you explain the methodology you're using?

01/18/07 23:05:16 changed by SamBauers

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

01/18/07 23:07:30 changed by SamBauers

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.

01/19/07 02:17:26 changed by mdawaffe

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.

01/19/07 04:17:56 changed by SamBauers

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.

01/19/07 06:16:16 changed by SamBauers

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

01/19/07 06:47:36 changed by SamBauers

  • keywords changed from categories to categories has-patch.

01/19/07 06:57:04 changed by SamBauers

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`);

01/19/07 08:09:33 changed by SamBauers

  • attachment categories-build619.patch added.

01/19/07 08:13:19 changed by SamBauers

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.

01/19/07 09:08:46 changed by SamBauers

Just found a bug in this patch on the new category pages. Will have to fix, do not use this patch yet!

01/19/07 11:06:22 changed by SamBauers

  • attachment categories-build622.patch added.

01/19/07 11:07:50 changed by SamBauers

Added new patch, don't use the old one. Fixed a few problems with the old one.

01/19/07 15:47:43 changed by so1o

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.

01/20/07 09:20:28 changed by spencerp

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!. ;) :)

01/20/07 22:29:11 changed by sambauers

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.

01/20/07 22:53:34 changed by sambauers

I've just added the files to the new patch. New patch is for build [629].

01/20/07 22:54:13 changed by sambauers

  • attachment install-image-build629.patch added.

01/20/07 23:02:32 changed by sambauers

Dodgy filename... sorry. Must inspire confidence. Re-uploading. If it's possible to delete the first three attachments, then can someone do that?

01/21/07 01:33:07 changed by sambauers

  • attachment categories-build629.patch added.

01/22/07 05:38:20 changed by SamBauers

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.

01/23/07 01:53:04 changed by SamBauers

  • attachment categories-build641.patch added.

01/23/07 01:54:21 changed by SamBauers

New patch file for latest build [641] added. Integrates with new template system.

01/26/07 04:48:26 changed by spencerp

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..? :) ;)

02/02/07 06:36:34 changed by sambauers

  • attachment categories-build656.patch added.

02/02/07 06:37:05 changed by sambauers

New patch file for build [656], makes use of new admin header hooks in bb-admin/content-categories.php

02/02/07 20:09:59 changed by spencerp

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

02/02/07 20:24:15 changed by spencerp

[slaps self].. nevermind! I just woke up so the brain's still in bed sleeping lmao. Sorry folks!

02/04/07 23:13:35 changed by sambauers

  • attachment categories-build661.patch added.

02/04/07 23:14:39 changed by sambauers

Added new patch for build [661], nothing has changed really, except exactly what lines the categories changes are patched into.

02/05/07 23:43:07 changed by sambauers

  • attachment categories-build670.patch added.

02/05/07 23:45:40 changed by sambauers

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.

02/06/07 11:08:34 changed by spencerp

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*..

02/07/07 13:55:13 changed by sambauers

  • attachment categories-build687.patch added.

02/07/07 14:11:05 changed by sambauers

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.

02/09/07 03:48:07 changed by sambauers

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.

02/13/07 06:30:31 changed by sambauers

  • attachment categories-build701.patch added.

02/13/07 06:32:59 changed by sambauers

Replaced patch file for build 701 with new file. This patch conforms to the new function naming guidelines being suggested in ticket #528. This should fix issues for those integrating their bbPress with WordPress as some function names in this patch clashed previously.

02/22/07 23:54:01 changed by sambauers

Added new patch file for build [719] i.e. 0.8.1

02/23/07 00:06:01 changed by sambauers

  • attachment categories-build719.patch added.

03/23/07 15:24:24 changed by sambauers

Separate forum hierarchies back-end introduced in [734]. See #620 for front-end patch.

These implementations are NOT based on the patches here.

05/14/08 17:18:17 changed by sambauers

(In [1531]) Enable categories using forum meta data. See #520

05/14/08 17:19:16 changed by sambauers

  • owner set to sambauers.
  • milestone changed from 1.0 to 1.0-beta & XML-RPC.

05/14/08 21:10:27 changed by mdawaffe

Should this be implemented with meta or with a taxonomy?

(follow-up: ↓ 38 ) 05/15/08 01:39:38 changed by sambauers

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 (???)

(in reply to: ↑ 37 ) 05/15/08 01:41:35 changed by sambauers

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

05/26/08 15:16:55 changed by sambauers

  • 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.