diff --git a/phpBB/develop/bbcode_conversion.php b/phpBB/develop/bbcode_conversion.php deleted file mode 100644 index f340b7d18f..0000000000 --- a/phpBB/develop/bbcode_conversion.php +++ /dev/null @@ -1,218 +0,0 @@ -Creating backup table..

\n"; -flush(); - -$result = $db->sql_query($sql); -if (!$result) -{ - $db_error = $db->sql_error(); - die("Error doing DB backup table creation. Reason: " . $db_error["message"]); -} - -$sql = "insert into $backup_name select * from $table_name"; - -echo "

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("
", "\n", $text); - - // make a uid - $uid = make_bbcode_uid(); - - // do 2.x first-pass encoding.. - $text = bbencode_first_pass($text, $uid); - - $text = addslashes($text); - - // put the uid in the database. - $sql = "UPDATE " . POSTS_TABLE . " SET bbcode_uid='" . $uid . "' WHERE (post_id = $post_id)"; - $result = $db->sql_query($sql); - if (!$result) - { - $db_error = $db->sql_error(); - die("Error doing DB update in posts table. Reason: " . $db_error["message"] . " sql: $sql"); - } - // Put the post text back in the database. - $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_text='" . $text . "' WHERE (post_id = $post_id)"; - $result = $db->sql_query($sql); - if (!$result) - { - $db_error = $db->sql_error(); - die("Error doing DB update in post text table. Reason: " . $db_error["message"] . " sql: $sql"); - } - - if (($i % 100) == 0) - { - echo "Done post: $i
\n"; - flush(); - } - - -} - - - -echo "

Done.

\n"; - - - -// ------------------------------------------------------------------------------- -// Everything below here is 1.x BBCode functions. -// ------------------------------------------------------------------------------- - - -function bbdecode($message) { - - // Undo [code] - $code_start_html = "
Code:
";
-		$code_end_html = "

"; - $message = str_replace($code_start_html, "[code]", $message); - $message = str_replace($code_end_html, "[/code]", $message); - - // Undo [quote] - $quote_start_html = "
Quote:
"; - $quote_end_html = "

"; - $message = str_replace($quote_start_html, "[quote]", $message); - $message = str_replace($quote_end_html, "[/quote]", $message); - - // Undo [b] and [i] - $message = preg_replace("#(.*?)#s", "[b]\\1[/b]", $message); - $message = preg_replace("#(.*?)#s", "[i]\\1[/i]", $message); - - // Undo [url] (long form) - $message = preg_replace("#(.*?)#s", "[url=\\1\\2]\\3[/url]", $message); - - // Undo [url] (short form) - $message = preg_replace("#(.*?)#s", "[url]\\3[/url]", $message); - - // Undo [email] - $message = preg_replace("#(.*?)#s", "[email]\\1[/email]", $message); - - // Undo [img] - $message = preg_replace("##s", "[img]\\1[/img]", $message); - - // Undo lists (unordered/ordered) - - //
  • tags: - $message = str_replace("
  • ", "[*]", $message); - - // [list] tags: - $message = str_replace("", "[/list]", $message); - $message = str_replace("", "[/list]", $message); - - return($message); -} - - -/** - * Nathan Codding - Feb 6, 2001 - * Reverses the effects of make_clickable(), for use in editpost. - * - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs. - * - */ - -function undo_make_clickable($text) { - - $text = preg_replace("#.*?#i", "\\1", $text); - $text = preg_replace("#.*?#i", "\\1", $text); - - return $text; - -} - - - - -?> diff --git a/phpBB/develop/convert_avatars.php b/phpBB/develop/convert_avatars.php deleted file mode 100644 index 4f090451d6..0000000000 --- a/phpBB/develop/convert_avatars.php +++ /dev/null @@ -1,65 +0,0 @@ -sql_query($sql) ) -{ - die("Couldn't alter users table"); -} - -$sql = "SELECT user_id, user_avatar - FROM " . USERS_TABLE; -if( $result = $db->sql_query($sql) ) -{ - $rowset = $db->sql_fetchrowset($result); - - for($i = 0; $i < count($rowset); $i++) - { - if( ereg("^http", $rowset[$i]['user_avatar'])) - { - $sql_type = USER_AVATAR_REMOTE; - } - else if( $rowset[$i]['user_avatar'] != "" ) - { - $sql_type = USER_AVATAR_UPLOAD; - } - else - { - $sql_type = USER_AVATAR_NONE; - } - - $sql = "UPDATE " . USERS_TABLE . " - SET user_avatar_type = $sql_type - WHERE user_id = " . $rowset[$i]['user_id']; - if( !$result = $db->sql_query($sql) ) - { - die("Couldn't update users table- " . $i); - } - } -} - -echo "

    COMPLETE
    "; - -?> 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(); - -?> 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 @@ - - - 1, - "Feb" => 2, - "Mar" => 3, - "Apr" => 4, - "May" => 5, - "Jun" => 6, - "Jul" => 7, - "Aug" => 8, - "Sep" => 9, - "Oct" => 10, - "Nov" => 11, - "Dec" => 12 - ); - - $sql = "SELECT user_id, user_regdate FROM ".USERS_TABLE; - $result = $db->sql_query($sql); - if(!$result) - { - die("OOpppps, that didn't work!"); - } - - $all_old_dates = $db->sql_fetchrowset($result); - - $sql = "ALTER TABLE ".USERS_TABLE." - CHANGE user_regdate user_regdate INT (11) NOT NULL"; - $result = $db->sql_query($sql); - if(!$result) - { - die("Opps, that didn't work either ... oh damn!"); - } - - - for($i = 0; $i < count($all_old_dates); $i++) - { - if(is_string($all_old_dates[$i]['user_regdate'])) - { - if(eregi("^([a-zA-Z]{3}) ([0-9]+), ([0-9]{4})", $all_old_dates[$i]['user_regdate'], $result)) - { - echo $all_old_dates[$i]['user_regdate']." : "; - echo $new_time = gmmktime(0, 1, 0, $months[$result[1]], $result[2], $result[3]); - echo " : ".gmdate("M d, Y", $new_time)."
    "; - $sql = "UPDATE phpbb_users - SET user_regdate = '$new_time' - WHERE user_id = '".$all_old_dates[$i]['user_id']."'"; - $result = $db->sql_query($sql); - if(!$result) - { - die("Oh damn it, now that's really broken it!"); - } - } - } - } - - echo "
    That's All Folks!"; - -?> - - diff --git a/phpBB/develop/insert_server_info.php b/phpBB/develop/insert_server_info.php deleted file mode 100644 index f7d9fcc08e..0000000000 --- a/phpBB/develop/insert_server_info.php +++ /dev/null @@ -1,64 +0,0 @@ -
    \n"; - -echo "server_name :: "; -flush(); -$sql = "INSERT INTO " . CONFIG_TABLE . " - (config_name, config_value) VALUES ('server_name', 'www.myserver.tld')"; -if( !$db->sql_query($sql) ) -{ - print "Failed inserting server_name config ... probably exists already
    \n"; -} -else -{ - echo "DONE
    \n"; -} - -echo "script_path :: "; -flush(); -$sql = "INSERT INTO " . CONFIG_TABLE . " - (config_name, config_value) VALUES ('script_path', '/phpBB2/')"; -if( !$db->sql_query($sql) ) -{ - print "Failed inserting script_path config ... probably exists already
    \n"; -} -else -{ - echo "DONE
    \n"; -} - -echo "server_port :: "; -flush(); -$sql = "INSERT INTO " . CONFIG_TABLE . " - (config_name, config_value) VALUES ('server_port', '80')"; -if( !$db->sql_query($sql) ) -{ - print "Failed inserting server_port config ... probably exists already
    \n"; -} -else -{ - echo "DONE
    \n"; -} - -$db->sql_close(); - -echo "
    COMPLETE
    \n"; - -?> diff --git a/phpBB/develop/most_users_update.php b/phpBB/develop/most_users_update.php deleted file mode 100644 index b914424ce8..0000000000 --- a/phpBB/develop/most_users_update.php +++ /dev/null @@ -1,42 +0,0 @@ - - -\n" . $sql = "INSERT INTO " . CONFIG_TABLE . " - (config_name, config_value) VALUES ('record_online_users', '1')"; - if( !$result = $db->sql_query($sql) ) - { - - message_die(GENERAL_ERROR, "Couldn't insert config key 'record_online_users'", "", __LINE__, __FILE__, $sql); - } - - echo "\n
    \n" . $sql = "INSERT INTO " . CONFIG_TABLE . " - (config_name, config_value) VALUES ('record_online_date', '".time()."')"; - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't insert config key 'record_online_date'", "", __LINE__, __FILE__, $sql); - } - - echo "\n
    \nCOMPLETE"; - -?> - - diff --git a/phpBB/develop/revar_lang_files.php b/phpBB/develop/revar_lang_files.php deleted file mode 100644 index 628b8b5c58..0000000000 --- a/phpBB/develop/revar_lang_files.php +++ /dev/null @@ -1,82 +0,0 @@ - 'lang', 'lang_admin' => 'lang', 'lang_faq' => 'faq', 'lang_bbcode' => 'faq'); - -$dirname = "./../language"; -$dir = opendir($dirname); - -while ( $file = readdir($dir) ) -{ - if ( $file != 'CVS' && !is_file($dirname . "/" . $file) && !is_link($dirname . "/" . $file) ) - { - foreach($vars as $lang_file => $lang_var) - { - $$lang_var = array(); - - include($dirname . "/" . $file . "/" . $lang_file . '.php'); - - $store = ""; - while( list($key, $value) = each($$lang_var) ) - { - if ( !is_array($value) ) - { - $key = ( is_string($key) ) ? "'$key'" : $key; - $store .= ( ( $store != "" ) ? ", \n\t" : "" ) . "$key => '" . addslashes($value) . "'"; - } - else - { - $key = ( is_string($key) ) ? "'$key'" : $key; - $store .= ( ( $store != "" ) ? ", \n\t" : "" ) . "$key => array(\n\t\t"; - - $store2 = ""; - while( list($key2, $value2) = each($value) ) - { - $key2 = ( is_string($key) ) ? "'$key2'" : $key2; - $store2 .= ( ( $store2 != "" ) ? ", \n\t\t" : "" ) . "$key2 => '" . addslashes($value2) . "'"; - } - $store .= $store2 . "\n\t)"; - } - } - - $store = ""; - - $fp = fopen($dirname . "/" . $file . "/" . $lang_file . '.php', 'w'); - - fwrite($fp, $store); - - fclose($fp); - - } - } -} - -?> \ No newline at end of file