mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Not relevant to the 2.2 branch
git-svn-id: file:///svn/phpbb/trunk@3523 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
1e5de88c6f
commit
ca791961aa
10 changed files with 0 additions and 1035 deletions
|
@ -1,218 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* bbcode_conversion.php
|
||||
* -------------------
|
||||
* begin : Tuesday, March 20, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id:
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
//
|
||||
// Do not change anything below this line.
|
||||
//
|
||||
|
||||
include('../extension.inc');
|
||||
include('../config.'.$phpEx);
|
||||
include('../includes/constants.'.$phpEx);
|
||||
include('../functions/functions.'.$phpEx);
|
||||
include('../includes/db.'.$phpEx);
|
||||
include('../functions/bbcode.'.$phpEx);
|
||||
|
||||
set_time_limit(60*60); // Increase maximum execution time to 60 minutes.
|
||||
|
||||
|
||||
|
||||
$backup_name = "backup_post_text";
|
||||
$table_name = POSTS_TEXT_TABLE;
|
||||
$sql = "CREATE TABLE $backup_name (
|
||||
post_id int(10) DEFAULT '0' NOT NULL,
|
||||
post_text text,
|
||||
PRIMARY KEY (post_id)
|
||||
);";
|
||||
|
||||
echo "<p>Creating backup table.. </p>\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 "<p>Populating backup table.. </p>\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 "<p><b>Found $total_rows total rows to work on. </b></p>\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("<BR>", "\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: <b> $i </b><br>\n";
|
||||
flush();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo "<p><b>Done.</b></p>\n";
|
||||
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// Everything below here is 1.x BBCode functions.
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
|
||||
function bbdecode($message) {
|
||||
|
||||
// Undo [code]
|
||||
$code_start_html = "<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font size=-1>Code:</font><HR></TD></TR><TR><TD><FONT SIZE=-1><PRE>";
|
||||
$code_end_html = "</PRE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode End -->";
|
||||
$message = str_replace($code_start_html, "[code]", $message);
|
||||
$message = str_replace($code_end_html, "[/code]", $message);
|
||||
|
||||
// Undo [quote]
|
||||
$quote_start_html = "<!-- BBCode Quote Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font size=-1>Quote:</font><HR></TD></TR><TR><TD><FONT SIZE=-1><BLOCKQUOTE>";
|
||||
$quote_end_html = "</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode Quote End -->";
|
||||
$message = str_replace($quote_start_html, "[quote]", $message);
|
||||
$message = str_replace($quote_end_html, "[/quote]", $message);
|
||||
|
||||
// Undo [b] and [i]
|
||||
$message = preg_replace("#<!-- BBCode Start --><B>(.*?)</B><!-- BBCode End -->#s", "[b]\\1[/b]", $message);
|
||||
$message = preg_replace("#<!-- BBCode Start --><I>(.*?)</I><!-- BBCode End -->#s", "[i]\\1[/i]", $message);
|
||||
|
||||
// Undo [url] (long form)
|
||||
$message = preg_replace("#<!-- BBCode u2 Start --><A HREF=\"([a-z]+?://)(.*?)\" TARGET=\"_blank\">(.*?)</A><!-- BBCode u2 End -->#s", "[url=\\1\\2]\\3[/url]", $message);
|
||||
|
||||
// Undo [url] (short form)
|
||||
$message = preg_replace("#<!-- BBCode u1 Start --><A HREF=\"([a-z]+?://)(.*?)\" TARGET=\"_blank\">(.*?)</A><!-- BBCode u1 End -->#s", "[url]\\3[/url]", $message);
|
||||
|
||||
// Undo [email]
|
||||
$message = preg_replace("#<!-- BBCode Start --><A HREF=\"mailto:(.*?)\">(.*?)</A><!-- BBCode End -->#s", "[email]\\1[/email]", $message);
|
||||
|
||||
// Undo [img]
|
||||
$message = preg_replace("#<!-- BBCode Start --><IMG SRC=\"(.*?)\" BORDER=\"0\"><!-- BBCode End -->#s", "[img]\\1[/img]", $message);
|
||||
|
||||
// Undo lists (unordered/ordered)
|
||||
|
||||
// <li> tags:
|
||||
$message = str_replace("<!-- BBCode --><LI>", "[*]", $message);
|
||||
|
||||
// [list] tags:
|
||||
$message = str_replace("<!-- BBCode ulist Start --><UL>", "[list]", $message);
|
||||
|
||||
// [list=x] tags:
|
||||
$message = preg_replace("#<!-- BBCode olist Start --><OL TYPE=([A1])>#si", "[list=\\1]", $message);
|
||||
|
||||
// [/list] tags:
|
||||
$message = str_replace("</UL><!-- BBCode ulist End -->", "[/list]", $message);
|
||||
$message = str_replace("</OL><!-- BBCode olist End -->", "[/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("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text);
|
||||
$text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text);
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
|
@ -1,65 +0,0 @@
|
|||
<?php
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
//
|
||||
// Do not change anything below this line.
|
||||
//
|
||||
|
||||
|
||||
$phpbb_root_path = "../";
|
||||
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/constants.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/db.'.$phpEx);
|
||||
|
||||
|
||||
$sql = "ALTER TABLE " . USERS_TABLE . "
|
||||
ADD user_avatar_type TINYINT(4) DEFAULT '0' NOT NULL";
|
||||
if( !$result = $db->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 "<BR><BR>COMPLETE<BR>";
|
||||
|
||||
?>
|
|
@ -1,96 +0,0 @@
|
|||
<?php
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
//
|
||||
// Do not change anything below this line.
|
||||
//
|
||||
|
||||
|
||||
$phpbb_root_path = "../";
|
||||
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/constants.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/db.'.$phpEx);
|
||||
|
||||
function query($sql, $errormsg)
|
||||
{
|
||||
global $db;
|
||||
if(!$result = $db->sql_query($sql))
|
||||
{
|
||||
print "<br><font color=\"red\">\n";
|
||||
print "$errormsg<br>";
|
||||
$sql_error = $db->sql_error();
|
||||
print $sql_error['code'] .": ". $sql_error['message']. "<br>\n";
|
||||
print "<pre>$sql</pre>";
|
||||
print "</font>\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.<p>";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$sql = "ALTER TABLE ".POSTS_TEXT_TABLE."
|
||||
ADD bbcode_uid char(10) NOT NULL";
|
||||
print "Adding bbcode_uid field to ".POSTS_TEXT_TABLE.".<br>\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.<br>\n";
|
||||
for($i = 0; $i <= $maxid; $i += $batchsize)
|
||||
{
|
||||
$batchstart = $i + 1;
|
||||
$batchend = $i + $batchsize;
|
||||
|
||||
print "Moving BBcode UID in post number $batchstart to $batchend<br>\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 <a href=\"$PHP_SELF?delete=true\">HERE</a> to remove the bbcode_uid table from the POSTS table (if you didn't get any serious error messages).<p>";
|
||||
|
||||
$db->sql_close();
|
||||
|
||||
?>
|
|
@ -1,110 +0,0 @@
|
|||
<?php
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
//
|
||||
// Do not change anything below this line.
|
||||
//
|
||||
|
||||
|
||||
$phpbb_root_path = "../";
|
||||
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/constants.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/db.'.$phpEx);
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . CONFIG_TABLE;
|
||||
if(!$result = $db->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!<br>\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<p>\n";
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
{
|
||||
print("Couldn't create new config table<br>\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<br>\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<p>\n";
|
||||
$sql = "DROP TABLE ". CONFIG_TABLE;
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
{
|
||||
die("Couldn't drop old table");
|
||||
}
|
||||
print "Renaming $newconfigtable to ".CONFIG_TABLE."<p>\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<br>\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 "<BR><BR>COMPLETE<BR>";
|
||||
|
||||
?>
|
|
@ -1,181 +0,0 @@
|
|||
<?php
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
//
|
||||
// Do not change anything below this line.
|
||||
//
|
||||
|
||||
|
||||
$phpbb_root_path = "../";
|
||||
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/constants.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/db.'.$phpEx);
|
||||
|
||||
//
|
||||
// Alter table ...
|
||||
//
|
||||
echo "Alter tables ... ";
|
||||
|
||||
echo $sql = "ALTER TABLE " . PRIVMSGS_TABLE . "
|
||||
ADD privmsgs_enable_bbcode TINYINT(1) DEFAULT '1' NOT NULL,
|
||||
ADD privmsgs_enable_html TINYINT(1) DEFAULT '0' NOT NULL,
|
||||
ADD privmsgs_enable_smilies TINYINT(1) DEFAULT '1' NOT NULL,
|
||||
ADD privmsgs_attach_sig TINYINT(1) DEFAULT '1' NOT NULL";
|
||||
if( !$result = $db->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<BR>";
|
||||
|
||||
//
|
||||
// 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<BR>";
|
||||
|
||||
//
|
||||
// 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<BR>";
|
||||
|
||||
//
|
||||
// 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<BR>";
|
||||
|
||||
$db->sql_close();
|
||||
|
||||
?>
|
|
@ -1,93 +0,0 @@
|
|||
<?php
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
//
|
||||
// Do not change anything below this line.
|
||||
//
|
||||
|
||||
$phpbb_root_path = "../";
|
||||
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/constants.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/db.'.$phpEx);
|
||||
|
||||
$sql = "SELECT post_id, post_text
|
||||
FROM " . POSTS_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]['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 "<BR>";
|
||||
|
||||
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 "<BR>";
|
||||
|
||||
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 "<BR><BR>COMPLETE<BR>";
|
||||
|
||||
?>
|
|
@ -1,84 +0,0 @@
|
|||
<html>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
//
|
||||
// Do not change anything below this line.
|
||||
//
|
||||
|
||||
|
||||
chdir("../");
|
||||
|
||||
include('extension.inc');
|
||||
include('config.'.$phpEx);
|
||||
include('includes/constants.'.$phpEx);
|
||||
include('includes/db.'.$phpEx);
|
||||
|
||||
$months = array(
|
||||
"Jan" => 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)."<br>";
|
||||
$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 "<br>That's All Folks!";
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
|
@ -1,64 +0,0 @@
|
|||
<?php
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
//
|
||||
// Do not change anything below this line.
|
||||
//
|
||||
$phpbb_root_path = "../";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
echo "Inserting new config vars<br /><br />\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<br />\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "DONE<br />\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<br />\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "DONE<br />\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<br />\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "DONE<br />\n";
|
||||
}
|
||||
|
||||
$db->sql_close();
|
||||
|
||||
echo "<br />COMPLETE<br />\n";
|
||||
|
||||
?>
|
|
@ -1,42 +0,0 @@
|
|||
<html>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
//
|
||||
// Do not change anything below this line.
|
||||
//
|
||||
|
||||
$phpbb_root_path = "../";
|
||||
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
echo "\n<br >\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<br >\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<br />\nCOMPLETE";
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
|
@ -1,82 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* revar_lang_files.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
//die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
$vars = array('lang_main' => '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 = "<?php\n\$$lang_var = array(\n\t$store\n);\n?".">";
|
||||
|
||||
$fp = fopen($dirname . "/" . $file . "/" . $lang_file . '.php', 'w');
|
||||
|
||||
fwrite($fp, $store);
|
||||
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Reference in a new issue