jQuery in Action, 3rd edition
The moose likes JForum and the fly likes mysql - creating new categories Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "mysql - creating new categories" Watch "mysql - creating new categories" New topic

mysql - creating new categories

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424

I am was trying to customize the front end part of the jforum project to show multiple topics divided on the basis of their categories like we have on the jforum.net under the community section.

Like on jforum.net under the communities section we have category name JForum General, Development, Help and Support, and under each category we have sub topics related to that catgory.

I also wish to do similar kind of thing, so i added the new category in the jforum_category table in mysql database. But when i re compile the code i dont see the new category on the page.

Secondly when i try to add a topic under existing category that is (category test) by making entries in the jforum_forums, i still cant see the topics.

The queries i am executing are as follows:

insert into jforum_categories (categories_id, title, display_order, moderated) values (2, "Windows", 1, 0);

INSERT INTO jforum_forums VALUES (2,1,'Windows Forum','This is a Windows forum',1,1,1,0);

Also can you tell me what does the column name display_order as well as forum_order signify in the mysql tables jforum_categories and jforum_forums respectively.

Thanks a lot for the help.

[originally posted on jforum.net by ankitoshniwal]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
There's a lot more to making categories and forums than just adding them to those tables.

First, there are also a lot of permission settings that go along with creating a new category/forum. If you are manually doing this you will also have to set this stuff up in the jforum_roles and jforum_role_values tables. This has to be done for every group you want this forum / category to be visible to. Se the initial data sql script for an example of this.

Second, all this information is cached in memory. So, just adding it to the DB will not update the memory cache. You will need to restart the jForum application for the new stuff in the DB to appear.

FWIW, the best practice for adding forums and categories is to use the Jforum system via some HTTPClient software (e.g. apache.org's Java packages.) This will add the forums with all the desired priviledges, etc. Plus the memory cache will be updated.

display_order is the order in which you want the categories to be displayed. There is an order by display_order asc clause on the selectAll query. forum_order is the same thing, except for forums.

[originally posted on jforum.net by monroe]
I agree. Here's the link: http://aspose.com/file-tools
subject: mysql - creating new categories
It's not a secret anymore!