sort forums

  • Hi, when I create lots and lots of forums (I modify the SQL file by adding many rows and then import the database) the forums seem to be sorted randomly (see pic), although they are sorted alphabetically in the SQL file. Is there a way to sort these forums efficiently? In wbb_1_board there does not seem to be a variable for ordering forums, but obviously this variable has to be saved somewhere- how does WBB remember the forum positions? Thank you

  • Forums are ordered using the "showOrder" value. I assume all inserted rows have the same value, therefore it's completely random in which way the results are returned from database.

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • Well that is where I was looking before posting here, but it's not there- there are sortField, sortOrder and postSortOrder. I assume these are for Sorting of threads, Sort order of threads and Sort order of posts respectively.
    This is from my wbb1_1_board


    DROP TABLE IF EXISTS `wbb1_1_board`;
    CREATE TABLE IF NOT EXISTS `wbb1_1_board` (
    `boardID` int(10) NOT NULL auto_increment,
    `parentID` int(10) NOT NULL default '0',
    `title` varchar(255) NOT NULL default '',
    `description` mediumtext,
    `allowDescriptionHtml` tinyint(1) NOT NULL default '0',
    `boardType` tinyint(1) NOT NULL default '0',
    `image` varchar(255) NOT NULL default '',
    `imageNew` varchar(255) NOT NULL default '',
    `imageShowAsBackground` tinyint(1) NOT NULL default '1',
    `imageBackgroundRepeat` enum('no-repeat','repeat-y','repeat-x','repeat') NOT NULL default 'no-repeat',
    `externalURL` varchar(255) NOT NULL default '',
    `time` int(10) NOT NULL default '0',
    `prefixes` mediumtext,
    `prefixRequired` tinyint(1) NOT NULL default '0',
    `prefixMode` tinyint(1) NOT NULL default '0',
    `styleID` int(10) NOT NULL default '0',
    `enforceStyle` tinyint(1) NOT NULL default '0',
    `daysPrune` smallint(5) NOT NULL default '0',
    `sortField` varchar(20) NOT NULL default '',
    `sortOrder` varchar(4) NOT NULL default '',
    `postSortOrder` varchar(4) NOT NULL default '',
    `isClosed` tinyint(1) NOT NULL default '0',
    `countUserPosts` tinyint(1) NOT NULL default '1',
    `isInvisible` tinyint(1) NOT NULL default '0',
    `showSubBoards` tinyint(1) NOT NULL default '1',
    `clicks` int(10) NOT NULL default '0',
    `threads` int(10) NOT NULL default '0',
    `posts` int(10) NOT NULL default '0',
    `enableRating` tinyint(1) NOT NULL default '-1',
    `threadsPerPage` smallint(5) NOT NULL default '0',
    `postsPerPage` smallint(5) NOT NULL default '0',
    `searchable` tinyint(1) NOT NULL default '1',
    `searchableForSimilarThreads` tinyint(1) NOT NULL default '1',
    `ignorable` tinyint(1) NOT NULL default '1',
    `enableMarkingAsDone` tinyint(1) NOT NULL default '0',

  • You are right, that was my fault. With Burning Board 4.0 we've dropped the wbb1_1_board_structure-table and merged it with the board table, I simply confused myself :/

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • No worries. That's good it is like that in WBB4, because I wish Position was in the same table, that way I could do it all in one step.


    I have one more question, right now I have over a 1000 professor forums, I would like to add a Poll Thread (so that people can give thumbs up or thumbs down to the professor) to each one- obviously I am not going to do it manually, I looked into the SQL tables and it seems to me that I cannot do it by just importing into them- I don't think the counters would work, or maybe there would be other problems- it has to be a thread, new post, it has to have its own counter etc, so it needs to be present in many tables, right?


    Can you think of a fast way to include some poll into each of these forums? I know you mentioned some other way when we talked about creating the forums, I don't think I quite got that.

  • Basically you have to create a thread within each forum, then you can add a poll for each thread through the database. Each poll is based upon an entry within wcf1_poll as well as the desired options within the wcf1_poll_option-table. Please keep in mind that each option is tied to a specific poll id, therefore if you want to create 1k polls with 5 options each you end up having 5k options in total. This might sound a lot, but it's child play for the database server ;)


    Afterwards you should update the wbb1_thread-table to increment the polls-column in order to reflect the existence within the board's thread list. Furthermore you need to associate a specific poll with a post, this can be done by updating the pollID-column in the wbb1_1_post-table.

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • Ok so let's see if I got this straight:


    1) create 1k threads in wbb1_1_post
    2) create 1k polls in wcf1_poll
    3) create 2k poll options in wcf1_poll_option
    4) link each of the 1k threads to a pollID