Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

mysql - creating new categories

Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 under the community section.

Like on 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 by ankitoshniwal]
Migrated From
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.'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 by monroe]
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic