diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2008-12-24 13:14:24 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-12-24 13:14:24 +0000 |
commit | e85f9f79bc892533e8b67d80ae265167f2e5d4cd (patch) | |
tree | c6d6e55e75c2cf80cc380f5540a8e62b54e0c3c3 /phpBB/develop/adjust_sizes.php | |
parent | 8c9af252cba9c0d61351f7eb14e983b23b0c4256 (diff) | |
download | forums-e85f9f79bc892533e8b67d80ae265167f2e5d4cd.tar forums-e85f9f79bc892533e8b67d80ae265167f2e5d4cd.tar.gz forums-e85f9f79bc892533e8b67d80ae265167f2e5d4cd.tar.bz2 forums-e85f9f79bc892533e8b67d80ae265167f2e5d4cd.tar.xz forums-e85f9f79bc892533e8b67d80ae265167f2e5d4cd.zip |
remove no longer necessary files... hooray
git-svn-id: file:///svn/phpbb/trunk@9221 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/develop/adjust_sizes.php')
-rw-r--r-- | phpBB/develop/adjust_sizes.php | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/phpBB/develop/adjust_sizes.php b/phpBB/develop/adjust_sizes.php deleted file mode 100644 index 5b4678c621..0000000000 --- a/phpBB/develop/adjust_sizes.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php -/** -* Only adjust the [size] bbcode tag from pc to percent. -* -* You should make a backup from your users, posts and privmsgs table in case something goes wrong -* Forum descriptions and rules need to be re-submitted manually if they use the [size] tag. -* -* Since we limit the match to the sizes from 0 to 29 no newly applied sizes should be affected... -*/ -die("Please read the first lines of this script for instructions on how to enable it"); - -set_time_limit(0); -@ini_set('memory_limit', '128M'); - -define('IN_PHPBB', true); -define('PHPBB_ROOT_PATH', './../'); -define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); -include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); - -// Start session management -$user->session_begin(); -$auth->acl($user->data); -$user->setup(); - -$echos = 0; - -function replace_size($matches) -{ - return '[size=' . ceil(100.0 * (((double) $matches[1])/12.0)) . ':' . $matches[2] . ']'; -} - -// Adjust user signatures -$sql = 'SELECT user_id, user_sig, user_sig_bbcode_uid - FROM ' . USERS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $bbcode_uid = $row['user_sig_bbcode_uid']; - - // Only if a bbcode uid is present, the signature present and a size tag used... - if ($bbcode_uid && $row['user_sig'] && strpos($row['user_sig'], '[size=') !== false) - { - $row['user_sig'] = preg_replace_callback('/\[size=(\d*):(' . $bbcode_uid . ')\]/', 'replace_size', $row['user_sig']); - - $sql = 'UPDATE ' . USERS_TABLE . " SET user_sig = '" . $db->sql_escape($row['user_sig']) . "' - WHERE user_id = " . $row['user_id']; - $db->sql_query($sql); - - if ($echos > 200) - { - echo '<br />' . "\n"; - $echos = 0; - } - - echo '.'; - $echos++; - - flush(); - } -} -$db->sql_freeresult($result); - - -// Now adjust posts -$sql = 'SELECT post_id, post_text, bbcode_uid, enable_bbcode - FROM ' . POSTS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $bbcode_uid = $row['bbcode_uid']; - - // Only if a bbcode uid is present, bbcode enabled and a size tag used... - if ($row['enable_bbcode'] && $bbcode_uid && strpos($row['post_text'], '[size=') !== false) - { - $row['post_text'] = preg_replace_callback('/\[size=(\d*):' . $bbcode_uid . '\]/', 'replace_size', $row['post_text']); - - $sql = 'UPDATE ' . POSTS_TABLE . " SET post_text = '" . $db->sql_escape($row['post_text']) . "' - WHERE post_id = " . $row['post_id']; - $db->sql_query($sql); - - if ($echos > 200) - { - echo '<br />' . "\n"; - $echos = 0; - } - - echo '.'; - $echos++; - - flush(); - } -} -$db->sql_freeresult($result); - -// Now to the private messages -$sql = 'SELECT msg_id, message_text, bbcode_uid, enable_bbcode - FROM ' . PRIVMSGS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $bbcode_uid = $row['bbcode_uid']; - - // Only if a bbcode uid is present, bbcode enabled and a size tag used... - if ($row['enable_bbcode'] && $bbcode_uid && strpos($row['message_text'], '[size=') !== false) - { - $row['message_text'] = preg_replace_callback('/\[size=(\d*):' . $bbcode_uid . '\]/', 'replace_size', $row['message_text']); - - $sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET message_text = '" . $db->sql_escape($row['message_text']) . "' - WHERE msg_id = " . $row['msg_id']; - $db->sql_query($sql); - - if ($echos > 200) - { - echo '<br />' . "\n"; - $echos = 0; - } - - echo '.'; - $echos++; - - flush(); - } -} -$db->sql_freeresult($result); - -// Done -$db->sql_close(); - -?>
\ No newline at end of file |