diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-10 13:49:52 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-10 13:49:52 +0000 |
commit | 3d0759974b3679aa75f23840e0b2f7c725091560 (patch) | |
tree | a64df09fffc666a99f171237f4d262493e88e26b /phpBB/develop | |
parent | 805af6f437c393f520cda114c94fad8c96e6085c (diff) | |
download | forums-3d0759974b3679aa75f23840e0b2f7c725091560.tar forums-3d0759974b3679aa75f23840e0b2f7c725091560.tar.gz forums-3d0759974b3679aa75f23840e0b2f7c725091560.tar.bz2 forums-3d0759974b3679aa75f23840e0b2f7c725091560.tar.xz forums-3d0759974b3679aa75f23840e0b2f7c725091560.zip |
- some fixes
- added script for easy adjustement of username_clean column within the users table (please see the note i added to the utf8_clean_string() function)
git-svn-id: file:///svn/phpbb/trunk@6561 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/develop')
-rw-r--r-- | phpBB/develop/adjust_usernames.php | 52 | ||||
-rw-r--r-- | phpBB/develop/create_schema_files.php | 4 |
2 files changed, 54 insertions, 2 deletions
diff --git a/phpBB/develop/adjust_usernames.php b/phpBB/develop/adjust_usernames.php new file mode 100644 index 0000000000..1afa77af16 --- /dev/null +++ b/phpBB/develop/adjust_usernames.php @@ -0,0 +1,52 @@ +<?php +/** +* Adjust username_clean column. +* +* You should make a backup from your users table in case something goes wrong +*/ +die("Please read the first lines of this script for instructions on how to enable it"); + +set_time_limit(0); + +define('IN_PHPBB', true); +$phpbb_root_path = './../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.'.$phpEx); + +// Start session management +$user->session_begin(); +$auth->acl($user->data); +$user->setup(); + +$echos = 0; + +$sql = 'SELECT user_id, username + FROM ' . USERS_TABLE; +$result = $db->sql_query($sql); + +while ($row = $db->sql_fetchrow($result)) +{ + $sql = 'UPDATE ' . USERS_TABLE . " + SET username_clean = '" . $db->sql_escape(utf8_clean_string($row['username'])) . "' + 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); + +echo 'FINISHED'; + +// Done +$db->sql_close(); + +?>
\ No newline at end of file diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index f4a4f80e60..b6fe49ced1 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -12,7 +12,7 @@ * If you overwrite the original schema files please make sure you save the file with UNIX linefeeds. */ -//die("Please read the first lines of this script for instructions on how to enable it"); +die("Please read the first lines of this script for instructions on how to enable it"); set_time_limit(0); @@ -1899,7 +1899,7 @@ function get_schema_struct() 'user_birthday' => array('INDEX', 'user_birthday'), 'user_email_hash' => array('INDEX', 'user_email_hash'), 'user_type' => array('INDEX', 'user_type'), - 'username_clean' => array('INDEX', 'username_clean'), + 'username_clean' => array('INDEX', 'username_clean'), ), ); |