- server: fix create_forums.php

This commit is contained in:
David Anderson 2012-11-30 00:24:44 -08:00 committed by Oliver Bock
parent 300fa71763
commit 3cf17049b5
2 changed files with 11 additions and 1 deletions

View File

@ -7168,3 +7168,9 @@ David 29 Nov 2012
filesys.cpp,h
html/ops/
mass_email.php
David 30 Nov 2012
- server: fix create_forums.php
html/ops/
create_forums.php

View File

@ -24,13 +24,15 @@
die("edit script to use your forum names, and remove the die()\n");
$cli_only = true;
require_once("../inc/db.inc");
require_once("../inc/forum_db.inc");
require_once("../inc/util_ops.inc");
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) {
$cat = BoincCategory::lookup("name='$name' and is_helpdesk=$is_helpdesk");
if ($cat) return $cat->id;
echo "can't create category\n";
echo mysql_error();
exit();
@ -42,6 +44,8 @@ function create_forum($category, $orderID, $title, $description, $is_dev_blog=0)
$q = "insert into forum (category, orderID, title, description, is_dev_blog) values ($category, $orderID, '$title', '$description', $is_dev_blog)";
$result = mysql_query($q);
if (!$result) {
$forum = BoincForum::lookup("category=$category and title='$title'");
if ($forum) return $forum->id;
echo "can't create forum\n";
echo mysql_error();
exit();