<?php

// Run this once from PHP via the command line to create the Help Desk
// and discussion forums.   Add new commands and run again to create new
// forum as you need them.
//
// This properly lives in html/project not html/ops


require_once("../inc/db.inc");

db_init();		// gota have Database access


// Create a new "Category" of forums, which may be a helpdesk (or not)

function create_category($orderID, $name, $is_helpdesk) {
    $q = "insert into category (orderID, lang, name, is_helpdesk) values ($orderID, 1, '$name', $is_helpdesk)";
    $result = mysql_query($q);
    if (!$result) {
        echo "can't create category\n";
        echo mysql_error();
        exit();
    }
    return mysql_insert_id();
}

// Create a new forum within a category

function create_forum($category, $orderID, $title, $description) {
    $q = "insert into forum (category, orderID, title, description) values ($category, $orderID, '$title', '$description')";
    $result = mysql_query($q);
    if (!$result) {
        echo "can't create forum\n";
        echo mysql_error();
        exit();
    }
    return mysql_insert_id();
}



//BEGIN:

// HELP DESK ====================================================

if (0) { // Added 12Oct2004 -EAM
  $catid = create_category(0, "General issues", 1);
  create_forum($catid, 9, "Credit",  
	       "Questions about credit ");
}

if (0) { 
  $catid = 4;
  create_forum($catid, 1, "BOINC Problems",  
	       "Installing and running BOINC");
  create_forum($catid, 3, PROJECT ." Problems",  
	       "Questions or Problems with ".PROJECT." applications or project");
}


if (0) {	// Platform Specific Problems:
  $catid = create_category(0, "Platform-specific problems", 1);
  create_forum($catid, 0, "Windows", PROJECT." on Windows");
  create_forum($catid, 1, "Unix/Linux", PROJECT." on Unix/Linux");
  create_forum($catid, 2, "Macintosh", PROJECT."on MacOS X");
}



// GENERAL DISCUSSION ==================================================


if (0) {	// GENERAL ISSUES
  $catid = create_category(1, "General Discussion", 0);

  create_forum(1, 11, "Announcements", 
	       "Announcements about the project");
  create_forum($catid, 13, "BOINC Beginners",
	       "Getting started with ".PROJECT." and other BOINC projects");
  create_forum($catid, 14, "Preferences",
	       "Using preferences to fine-tune BOINC");
  create_forum($catid, 15, "Wish list",
	       "What features would you like to see in BOINC and ".PROJECT);

}
if (0) { // Added 16Sep2004 -EAM
  create_forum(1, 7, "Pirate Talk",
	       "Scuttlebutt and general talk amongst the crew");
}

if (0) { // Added 08Oct2004 -EAM
  create_forum(1, 10, "Pirate Applications", 
     "Discussion on particular applications running on Pirates@Home");
}


if (0) { // Added on 10Jan1005 -EAM
create_forum(1, 6, "Team Talk",
	     "Team organization, invitations, and discussion");
}

if (1) { // Added on 24Jan1005 -EAM
create_forum(1, 5, "Number Crunching",
     "Discussion on Credit, leaderboards, and CPU performance");
}




// SCIENCE DISCUSSION ==================================================

if (0) {	//  GRAVITY WAVES 
  $catid = create_category(2, PROJECT." Science", 0);
  create_forum($catid, 21, "Gravity Waves", "");
  create_forum($catid, 22, "Cosmology and Astronomy", "");
  //create_forum($catid, 23, "General Relativity", "");
}


if (0) {	//  GRAVITY WAVES 
  create_forum(3, 22, "Cosmology and Astronomy", "");
}



// WORLD COMMUNITY ================================================


if (0) {	// added 10Jan2005 -EAM
  $catid = create_category(5, PROJECT." World Community", 0);
  create_forum($catid, 52, "Piraten auf Deutsch",
	       "");
  create_forum($catid, 54, "Pirates en Espa&ntilde;ol",
	       "");
  create_forum($catid, 56, "Pirates en Fran&ccedil;ais",
	       "");
  create_forum($catid, 58, "Pirates in Polish",
	       "");
  create_forum($catid, 60, "Pirates in Portugues",
	       "");
  create_forum($catid, 62, "Pirates in Russian",
	       "");
}




?>
