PDA

View Full Version : My PHP Forum Creation Breaks in 3.8.1


ShannonA
02-18-2009, 07:24 PM
I do some forum creation out in PHP.

My forum creation function does the minimal amount of working, not trying to build up any of the lists like the childlist or the parentlist, then runs some vBulletin functions to clean everything up:


require_once('./global.php');
require_once('includes/functions_databuild.php');

build_forum_counters($rebuildid, true);

vbflush();


Sadly, this worked in 3.7.2 and no longer seems to work in 3.8.1. Now newly created forums don't get their lists built out, and (presumably as a result) don't show up either in the forums or the forums administration tool.

Any idea what changed from 3.7.2 to 3.8.1 and what it'll take to fix it? (Else it backs to digging through the code.)

Here's the forum creation, for what it's worth:


function createForum($title,$desc,$order,$parentid,$options ,$daysprune) {

global $forumdbh, $dbForumName;

$title = addslashes(stripslashes($title));
$desc = addslashes(stripslashes($desc));

$clean_title = strip_tags($title);
$clean_desc = strip_tags($desc);

$SQL = "INSERT INTO forum ";
$SQL .= "(title,description,displayorder,parentid,options,d aysprune,title_clean,description_clean) ";
$SQL .= "VALUES ('$title','$desc',$order,$parentid,$options,$daysp rune,'$clean_title','$clean_desc') ";

$result = mysql_db_query($dbForumName,$SQL,$forumdbh);

$forumid = mysql_insert_id($forumdbh);

return $forumid;
}

Dismounted
02-19-2009, 04:18 AM
You should be using the vBulletin Data Managers to do this! Some documentation can be found in the manual, and some articles are available.