From 3cf17049b5de84d10f6fbc805ecbccb81fa72185 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 30 Nov 2012 00:24:44 -0800 Subject: [PATCH] - server: fix create_forums.php --- checkin_notes | 6 ++++++ html/ops/create_forums.php | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 3c3c681ea5..3f21f7b282 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/html/ops/create_forums.php b/html/ops/create_forums.php index 3d148e5a6a..de56a5982b 100644 --- a/html/ops/create_forums.php +++ b/html/ops/create_forums.php @@ -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();