From ca791961aa9664a6138954015f48bd417d372150 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 25 Feb 2003 15:46:36 +0000 Subject: Not relevant to the 2.2 branch git-svn-id: file:///svn/phpbb/trunk@3523 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/convert_bbcodeuid.php | 96 ------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 phpBB/develop/convert_bbcodeuid.php (limited to 'phpBB/develop/convert_bbcodeuid.php') diff --git a/phpBB/develop/convert_bbcodeuid.php b/phpBB/develop/convert_bbcodeuid.php deleted file mode 100644 index 4a2a223e20..0000000000 --- a/phpBB/develop/convert_bbcodeuid.php +++ /dev/null @@ -1,96 +0,0 @@ -sql_query($sql)) - { - print "
\n"; - print "$errormsg
"; - $sql_error = $db->sql_error(); - print $sql_error['code'] .": ". $sql_error['message']. "
\n"; - print "
$sql
"; - print "
\n"; - return FALSE; - } - else - { - return $result; - } -} - -if($HTTP_GET_VARS['delete'] == 'true') -{ - $sql = "ALTER TABLE ".POSTS_TABLE." - DROP bbcode_uid"; - query($sql, "Didn't manage to drop the bbcode_uid table in ".POSTS_TABLE); - print "All done now. Deleted the bbcode_uid column from the posts table.

"; - exit; -} - - -$sql = "ALTER TABLE ".POSTS_TEXT_TABLE." - ADD bbcode_uid char(10) NOT NULL"; -print "Adding bbcode_uid field to ".POSTS_TEXT_TABLE.".
\n"; -$result = query($sql, "Couldn't get add bbcode_uid field to ".POSTS_TEXT_TABLE."."); - -$sql = " - SELECT - count(*) as total, - max(post_id) as maxid - FROM ". POSTS_TABLE; -$result = query($sql, "Couldn't get max post_id."); -$maxid = $db->sql_fetchrow($result); -$totalposts = $maxid['total']; -$maxid = $maxid['maxid']; - -$batchsize = 200; -print "Going to convert BBcode in posts with $batchsize messages at a time and $totalposts in total.
\n"; -for($i = 0; $i <= $maxid; $i += $batchsize) -{ - $batchstart = $i + 1; - $batchend = $i + $batchsize; - - print "Moving BBcode UID in post number $batchstart to $batchend
\n"; - flush(); - $sql = " - SELECT - post_id, - bbcode_uid - FROM " - .POSTS_TABLE." - WHERE - post_id BETWEEN $batchstart AND $batchend"; - $result = query($sql, "Couldn't get ". POSTS_TABLE .".post_id $batchstart to $batchend"); - while($row = mysql_fetch_array($result)) - { - query("UPDATE ".POSTS_TEXT_TABLE." set bbcode_uid = '". $row['bbcode_uid']. "' WHERE post_id = ".$row['post_id'], "Was unable to update the posts text table with the BBcode_uid"); - } -} - -echo "Click HERE to remove the bbcode_uid table from the POSTS table (if you didn't get any serious error messages).

"; - -$db->sql_close(); - -?> -- cgit v1.2.1