From ca791961aa9664a6138954015f48bd417d372150 Mon Sep 17 00:00:00 2001
From: "Paul S. Owen"
Populating backup table..
\n"; -flush(); - -$result = $db->sql_query($sql); -if (!$result) -{ - $db_error = $db->sql_error(); - die("Error doing DB backup table data moving. Reason: " . $db_error["message"]); -} - - -$sql = "SELECT p.post_id, t.post_text FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " t WHERE (p.post_id = t.post_id)"; -if(!$result = $db->sql_query($sql)) -{ - die("error getting posts to work on"); -} -if(!$total_rows = $db->sql_numrows($result)) -{ - die("error getting rowcount"); -} - -echo "Found $total_rows total rows to work on.
\n"; -flush(); - -$row = $db->sql_fetchrowset($result); - -for($i = 0; $i < $total_rows; $i++) -{ - $post_id = $row[$i]['post_id']; - $text = $row[$i]['post_text']; - - // undo 1.2.x encoding.. - $text = bbdecode($text); - $text = undo_make_clickable($text); - $text = str_replace("Done.
\n"; - - - -// ------------------------------------------------------------------------------- -// Everything below here is 1.x BBCode functions. -// ------------------------------------------------------------------------------- - - -function bbdecode($message) { - - // Undo [code] - $code_start_html = "Code: |
"; - $code_end_html = " |
Quote: |
"; - $quote_end_html = " |
$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();
-
-?>
diff --git a/phpBB/develop/convert_conf.php b/phpBB/develop/convert_conf.php
deleted file mode 100644
index 09c71e8c03..0000000000
--- a/phpBB/develop/convert_conf.php
+++ /dev/null
@@ -1,110 +0,0 @@
-sql_query($sql))
-{
- message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
-}
-else
-{
- $board_config = $db->sql_fetchrow($result);
-}
-
-$newconfigtable = $table_prefix . "newconfig";
-
-$sql = "SELECT config_name, config_value FROM ". CONFIG_TABLE;
-if( $result = $db->sql_query($sql) )
-{
- die("Don't run this script twice!
\n");
-}
-
-$sql = " CREATE TABLE $newconfigtable (
- config_name varchar(255) NOT NULL,
- config_value varchar(255) NOT NULL,
- PRIMARY KEY (config_name)
- )";
-print "Creating temporary table: $newconfigtable
\n";
-if( !$result = $db->sql_query($sql) )
-{
- print("Couldn't create new config table
\n");
-}
-
-$error = 0;
-while (list($name, $value) = each($board_config))
-{
- if(is_int($name))
- {
- // Skip numeric array elements (we only want the associative array)
- continue;
- }
-
- // Rename sys_template
- if ($name == 'sys_template')
- {
- $name = 'board_template';
- }
- // Rename system_timezone
- if ($name == 'system_timezone')
- {
- $name = 'board_timezone';
- }
- print "$name = $value
\n";
- $value = addslashes($value);
- $sql = "INSERT INTO $newconfigtable (config_name, config_value) VALUES ('$name', '$value')";
- if( !$result = $db->sql_query($sql) )
- {
- print("Couldn't insert '$name' into new config table");
- $error = 1;
- }
-}
-
-if ($error != 1)
-{
- print "Dropping old table
\n"; - $sql = "DROP TABLE ". CONFIG_TABLE; - if( !$result = $db->sql_query($sql) ) - { - die("Couldn't drop old table"); - } - print "Renaming $newconfigtable to ".CONFIG_TABLE."
\n";
- $sql = "ALTER TABLE $newconfigtable RENAME ".CONFIG_TABLE;
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't rename new config table");
- }
- print "Renaming ".SESSIONS_TABLE." to ".$table_prefix."sessions
\n";
- $sql = "ALTER TABLE ".SESSIONS_TABLE." RENAME ".$table_prefix."sessions";
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't rename session table");
- }
-
-}
-
-$db->sql_close();
-
- echo "
COMPLETE
";
-
-?>
diff --git a/phpBB/develop/convert_privmsgs.php b/phpBB/develop/convert_privmsgs.php
deleted file mode 100644
index df4f662c8e..0000000000
--- a/phpBB/develop/convert_privmsgs.php
+++ /dev/null
@@ -1,181 +0,0 @@
-sql_query($sql) )
-{
- die("Couldn't alter privmsgs table");
-}
-echo $sql = "ALTER TABLE " . PRIVMSGS_TEXT_TABLE . "
- ADD privmsgs_bbcode_uid CHAR(10) AFTER privmsgs_text_id";
-if( !$result = $db->sql_query($sql) )
-{
- die("Couldn't alter privmsgs text table");
-}
-echo "COMPLETE
";
-
-//
-// Move bbcode ...
-//
-echo "Move bbcode uid's ... ";
-
-$sql = "SELECT privmsgs_id, privmsgs_bbcode_uid
- FROM " . PRIVMSGS_TABLE;
-if( $result = $db->sql_query($sql) )
-{
- $rowset = $db->sql_fetchrowset($result);
-
- for($i = 0; $i < count($rowset); $i++)
- {
- $sql = "UPDATE " . PRIVMSGS_TEXT_TABLE . "
- SET privmsgs_bbcode_uid = '" . $rowset[$i]['privmsgs_bbcode_uid'] . "'
- WHERE privmsgs_text_id = " . $rowset[$i]['privmsgs_id'];
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't update privmsgs text bbcode - " . $i);
- }
- }
-
- $sql = "ALTER TABLE " . PRIVMSGS_TABLE . "
- DROP privmsgs_bbcode_uid";
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't alter privmsgs table - drop privmsgs_bbcode_uid");
- }
-}
-
-echo "COMPLETE
";
-
-//
-// Stripslashes from titles
-//
-echo "Strip subject slashes ... ";
-
-$sql = "SELECT privmsgs_subject , privmsgs_id, privmsgs_to_userid, privmsgs_from_userid
- FROM " . PRIVMSGS_TABLE;
-if( $result = $db->sql_query($sql) )
-{
- $rowset = $db->sql_fetchrowset($result);
-
- for($i = 0; $i < count($rowset); $i++)
- {
- $sql = "UPDATE " . PRIVMSGS_TABLE . "
- SET privmsgs_subject = '" . addslashes(stripslashes($rowset[$i]['privmsgs_subject'])) . "'
- WHERE privmsgs_id = " . $rowset[$i]['privmsgs_id'];
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't update subjects - $i");
- }
- }
-}
-echo "COMPLETE
";
-
-//
-// Update sigs
-//
-echo "Remove [addsig], stripslashes and update privmsgs table sig enable ...";
-
-$sql = "SELECT privmsgs_text_id , privmsgs_text
- FROM " . PRIVMSGS_TEXT_TABLE;
-if( $result = $db->sql_query($sql) )
-{
- $rowset = $db->sql_fetchrowset($result);
-
- $attach_sql = "";
- $non_attach_sql = "";
-
- for($i = 0; $i < count($rowset); $i++)
- {
- if( ereg("\[addsig]$", $rowset[$i]['privmsgs_text']))
- {
- if( $attach_sql != "" )
- {
- $attach_sql .= ", ";
- }
- $attach_sql .= $rowset[$i]['privmsgs_text_id'];
-
- $sql = "UPDATE " . PRIVMSGS_TEXT_TABLE . "
- SET privmsgs_text = '" . addslashes(preg_replace("/\[addsig\]/is", "", stripslashes($rowset[$i]['privmsgs_text']))) . "'
- WHERE privmsgs_text_id = " . $rowset[$i]['privmsgs_text_id'];
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't update privmsgs text - " . $i);
- }
-
- }
- else
- {
- $sql = "UPDATE " . PRIVMSGS_TEXT_TABLE . "
- SET privmsgs_text = '" . addslashes(stripslashes($rowset[$i]['privmsgs_text'])) . "'
- WHERE privmsgs_text_id = " . $rowset[$i]['privmsgs_text_id'];
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't update privmsgs text - " . $i);
- }
-
- if( $non_attach_sql != "" )
- {
- $non_attach_sql .= ", ";
- }
- $non_attach_sql .= $rowset[$i]['privmsgs_text_id'];
- }
- }
-
- if( $attach_sql != "" )
- {
- $sql = "UPDATE " . PRIVMSGS_TABLE . "
- SET privmsgs_attach_sig = 1
- WHERE privmsgs_id IN ($attach_sql)";
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't update privmsgs table attach_sig - ");
- }
- }
-
- if( $non_attach_sql != "" )
- {
- $sql = "UPDATE " . PRIVMSGS_TABLE . "
- SET privmsgs_attach_sig = 0
- WHERE privmsgs_id IN ($non_attach_sql)";
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't update privmsgs table non_attach_sig - ");
- }
- }
-
-}
-
-echo "COMPLETE
";
-
-$db->sql_close();
-
-?>
diff --git a/phpBB/develop/convert_sigs.php b/phpBB/develop/convert_sigs.php
deleted file mode 100644
index 501106fc10..0000000000
--- a/phpBB/develop/convert_sigs.php
+++ /dev/null
@@ -1,93 +0,0 @@
-sql_query($sql) )
-{
- $rowset = $db->sql_fetchrowset($result);
-
- $attach_sql = "";
- $non_attach_sql = "";
-
- for($i = 0; $i < count($rowset); $i++)
- {
- if( ereg("\[addsig]$", $rowset[$i]['post_text']))
- {
- if( $attach_sql != "" )
- {
- $attach_sql .= ", ";
- }
- $attach_sql .= $rowset[$i]['post_id'];
-
- $sql = "UPDATE " . POSTS_TEXT_TABLE . "
- SET post_text = '" . addslashes(preg_replace("/\[addsig\]/is", "", $rowset[$i]['post_text'])) . "'
- WHERE post_id = " . $rowset[$i]['post_id'];
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't update post_text - " . $i);
- }
-
- }
- else
- {
- if( $non_attach_sql != "" )
- {
- $non_attach_sql .= ", ";
- }
- $non_attach_sql .= $rowset[$i]['post_id'];
- }
- }
-
- echo "
";
-
- if( $attach_sql != "" )
- {
- echo $sql = "UPDATE " . POSTS_TABLE . "
- SET enable_sig = 1
- WHERE post_id IN ($attach_sql)";
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't update post table attach_sig - ");
- }
- }
-
- echo "
";
-
- if( $non_attach_sql != "" )
- {
- echo $sql = "UPDATE " . POSTS_TABLE . "
- SET enable_sig = 0
- WHERE post_id IN ($non_attach_sql)";
- if( !$result = $db->sql_query($sql) )
- {
- die("Couldn't update post table non_attach_sig - ");
- }
- }
-
-}
-
-$db->sql_close();
-
- echo "
COMPLETE
";
-
-?>
diff --git a/phpBB/develop/convert_user_regdates.php b/phpBB/develop/convert_user_regdates.php
deleted file mode 100644
index 21737edda4..0000000000
--- a/phpBB/develop/convert_user_regdates.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
-