Hidden forums

From Pirates@Home

Jump to: navigation, search
BOINC Hacks
  

This page describes modifications you can make to customize your BOINC project or application.


Most BOINC projects will have a handful of forum rooms. There are usually rooms for getting started, discussing the science of the project, number crunching, a wish list, and perhaps help desk areas. There is often a "cafe" for off-topic discussion. But that's all.

It is possible, however, to have many more forum rooms, but not show them in the general listing. The way this is done is to use the orderID parameter, which is already used to decide what order the rooms are listed in, to decide whether they should be shown at all.

The basic idea is that if you set orderID less than zero then the room is "in the attic" and no longer in use. If you set the orderID greater than 100 then the room is not considered public, and is not shown in the usual listing of forums.

In either case, the title and contents of the forums can still be searched, because it's all in the database. (Though we could modify things so that's not the case too...)

forum_index.php

The file html/user/forum_index.php creates the main listing of active forums, so this is the file to modify. It basically consists of two loops, the first over forum categories, the second over the forums in those categories. Both categories and forums have a parameter called the "orderID", which determines the order in which they are presented. So all we need to do is insert tests to not show the item if the orderID is less than zero, or 100 or more.

For the outer loop, which runs over categories, add two lines like so:

$categories = BoincCategory::enum("is_helpdesk=0 order by orderID");
$first = true;
foreach ($categories as $category) {
   if( $category->orderID < 0 ) continue;
   if( $category->orderID > 99 ) break;
   if ($first) {

Then do the same for the inner loop, which runs over the forums in each category:

   $forums = BoincForum::enum("parent_type=0 and category=$category->id order by orderID");
   foreach ($forums as $forum) {
       if( $forum->orderID < 0 ) continue;
       if( $forum->orderID > 99 ) break;
       show_forum_summary($forum);
   }

Note: this is the basic idea, but I've not actually yet tested this.

forum_help_desk.php

The file forum_help_desk.php serves the same purpose as forum_index.php, but for forums classified as type "help desk". If you are using these, and if you want to be able to hide them by the same mechanism, then you just need to make the same alterations to both files.

Altering the database

There is at present no GUI tool or web page which lets you alter the orderID for forums or categories, so you will have to do this "by hand" using mysql. I'll post an example here at some point...

Personal tools