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 | |
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')
-rw-r--r-- | phpBB/develop/add_permissions.php | 396 | ||||
-rw-r--r-- | phpBB/develop/adjust_avatars.php | 147 | ||||
-rw-r--r-- | phpBB/develop/adjust_bbcodes.php | 174 | ||||
-rw-r--r-- | phpBB/develop/adjust_magic_urls.php | 126 | ||||
-rw-r--r-- | phpBB/develop/adjust_sizes.php | 132 | ||||
-rw-r--r-- | phpBB/develop/adjust_smilies.php | 130 | ||||
-rw-r--r-- | phpBB/develop/adjust_uids.php | 129 | ||||
-rw-r--r-- | phpBB/develop/adjust_usernames.php | 52 | ||||
-rw-r--r-- | phpBB/develop/calc_email_hash.php | 64 | ||||
-rw-r--r-- | phpBB/develop/change_smiley_ref.php | 48 | ||||
-rw-r--r-- | phpBB/develop/create_variable_overview.php | 547 | ||||
-rw-r--r-- | phpBB/develop/fill.php | 190 | ||||
-rw-r--r-- | phpBB/develop/lang_duplicates.php | 140 |
13 files changed, 0 insertions, 2275 deletions
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php deleted file mode 100644 index 40ece4000d..0000000000 --- a/phpBB/develop/add_permissions.php +++ /dev/null @@ -1,396 +0,0 @@ -<?php -// ------------------------------------------------------------- -// -// $Id$ -// -// FILENAME : add_permissions.php -// STARTED : Sat Nov 06, 2004 -// COPYRIGHT : © 2004 phpBB Group -// WWW : http://www.phpbb.com/ -// LICENCE : GPL vs2.0 [ see /docs/COPYING ] -// -// ------------------------------------------------------------- - -// -// 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"); - -define('IN_PHPBB', 1); -define('PHPBB_ROOT_PATH', './../'); -define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); -require(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); - -// auth => is_local, is_global -$f_permissions = array( - 'f_' => array(1, 0), - 'f_list' => array(1, 0), - 'f_read' => array(1, 0), - 'f_post' => array(1, 0), - 'f_reply' => array(1, 0), - 'f_edit' => array(1, 0), - 'f_user_lock' => array(1, 0), - 'f_delete' => array(1, 0), - 'f_bump' => array(1, 0), - 'f_poll' => array(1, 0), - 'f_vote' => array(1, 0), - 'f_votechg' => array(1, 0), - 'f_announce'=> array(1, 0), - 'f_sticky' => array(1, 0), - 'f_attach' => array(1, 0), - 'f_download'=> array(1, 0), - 'f_icons' => array(1, 0), - 'f_bbcode' => array(1, 0), - 'f_smilies' => array(1, 0), - 'f_img' => array(1, 0), - 'f_flash' => array(1, 0), - 'f_sigs' => array(1, 0), - 'f_search' => array(1, 0), - 'f_email' => array(1, 0), - 'f_print' => array(1, 0), - 'f_ignoreflood' => array(1, 0), - 'f_postcount' => array(1, 0), - 'f_noapprove'=> array(1, 0), - 'f_report' => array(1, 0), - 'f_subscribe' => array(1, 0), -); - -$m_permissions = array( - 'm_' => array(1, 1), - 'm_edit' => array(1, 1), - 'm_delete' => array(1, 1), - 'm_move' => array(1, 1), - 'm_lock' => array(1, 1), - 'm_split' => array(1, 1), - 'm_merge' => array(1, 1), - 'm_approve' => array(1, 1), - 'm_unrate' => array(1, 1), - 'm_auth' => array(1, 1), - 'm_ip' => array(1, 1), - 'm_info' => array(1, 1), -); - -$a_permissions = array( - 'a_' => array(0, 1), - 'a_server' => array(0, 1), - 'a_board' => array(0, 1), - 'a_clearlogs' => array(0, 1), - 'a_words' => array(0, 1), - 'a_icons' => array(0, 1), - 'a_bbcode' => array(0, 1), - 'a_attach' => array(0, 1), - 'a_email' => array(0, 1), - 'a_styles' => array(0, 1), - 'a_user' => array(0, 1), - 'a_useradd' => array(0, 1), - 'a_userdel' => array(0, 1), - 'a_ranks' => array(0, 1), - 'a_ban' => array(0, 1), - 'a_names' => array(0, 1), - 'a_group' => array(0, 1), - 'a_groupadd'=> array(0, 1), - 'a_groupdel'=> array(0, 1), - 'a_forum' => array(0, 1), - 'a_forumadd'=> array(0, 1), - 'a_forumdel'=> array(0, 1), - 'a_prune' => array(0, 1), - 'a_auth' => array(0, 1), - 'a_authmods'=> array(0, 1), - 'a_authadmins' => array(0, 1), - 'a_authusers' => array(0, 1), - 'a_authgroups' => array(0, 1), - 'a_authdeps'=> array(0, 1), - 'a_backup' => array(0, 1), - 'a_restore' => array(0, 1), - 'a_search' => array(0, 1), - 'a_events' => array(0, 1), - 'a_cron' => array(0, 1), -); - -$u_permissions = array( - 'u_' => array(0, 1), - 'u_sendemail' => array(0, 1), - 'u_readpm' => array(0, 1), - 'u_sendpm' => array(0, 1), - 'u_sendim' => array(0, 1), - 'u_hideonline' => array(0, 1), - 'u_viewonline' => array(0, 1), - 'u_viewprofile' => array(0, 1), - 'u_chgavatar' => array(0, 1), - 'u_chggrp' => array(0, 1), - 'u_chgemail' => array(0, 1), - 'u_chgname' => array(0, 1), - 'u_chgpasswd' => array(0, 1), - 'u_chgcensors' => array(0, 1), - 'u_search' => array(0, 1), - 'u_savedrafts' => array(0, 1), - 'u_download' => array(0, 1), - 'u_attach' => array(0, 1), - 'u_sig' => array(0, 1), - 'u_pm_attach' => array(0, 1), - 'u_pm_bbcode' => array(0, 1), - 'u_pm_smilies' => array(0, 1), - 'u_pm_download' => array(0, 1), - 'u_pm_edit' => array(0, 1), - 'u_pm_printpm' => array(0, 1), - 'u_pm_emailpm' => array(0, 1), - 'u_pm_forward' => array(0, 1), - 'u_pm_delete' => array(0, 1), - 'u_pm_img' => array(0, 1), - 'u_pm_flash' => array(0, 1), -); - -echo "<p><b>Determining existing permissions</b></p>\n"; - -$sql = 'SELECT auth_option_id, auth_option FROM ' . ACL_OPTIONS_TABLE; -$result = $db->sql_query($sql); - -$remove_auth_options = array(); -while ($row = $db->sql_fetchrow($result)) -{ - if (!in_array($row['auth_option'], array_keys(${substr($row['auth_option'], 0, 2) . 'permissions'}))) - { - $remove_auth_options[$row['auth_option']] = $row['auth_option_id']; - } - unset(${substr($row['auth_option'], 0, 2) . 'permissions'}[$row['auth_option']]); -} -$db->sql_freeresult($result); - -if (sizeof($remove_auth_options)) -{ - $db->sql_query('DELETE FROM ' . ACL_USERS_TABLE . ' WHERE auth_option_id IN (' . implode(', ', $remove_auth_options) . ')'); - $db->sql_query('DELETE FROM ' . ACL_GROUPS_TABLE . ' WHERE auth_option_id IN (' . implode(', ', $remove_auth_options) . ')'); - $db->sql_query('DELETE FROM ' . ACL_OPTIONS_TABLE . ' WHERE auth_option_id IN (' . implode(', ', $remove_auth_options) . ')'); - - echo '<p><b>Removed the following auth options... [<i>' . implode(', ', array_keys($remove_auth_options)) . "</i>]</b></p>\n\n"; -} - -$prefixes = array('f_', 'a_', 'm_', 'u_'); - -foreach ($prefixes as $prefix) -{ - $var = $prefix . 'permissions'; - if (sizeof($$var)) - { - foreach ($$var as $auth_option => $l_ary) - { - $sql_ary = array( - 'auth_option' => $auth_option, - 'is_local' => $l_ary[0], - 'is_global' => $l_ary[1] - ); - - $db->sql_query('INSERT INTO ' . ACL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); - - echo "<p><b>Adding $auth_option...</b></p>\n"; - - mass_auth('group', 0, 'guests', $auth_option, ACL_NEVER); - mass_auth('group', 0, 'inactive', $auth_option, ACL_NEVER); - mass_auth('group', 0, 'inactive_coppa', $auth_option, ACL_NEVER); - mass_auth('group', 0, 'registered_coppa', $auth_option, ACL_NEVER); - mass_auth('group', 0, 'registered', $auth_option, (($prefix != 'm_' && $prefix != 'a_') ? ACL_YES : ACL_NEVER)); - mass_auth('group', 0, 'global_moderators', $auth_option, (($prefix != 'a_') ? ACL_YES : ACL_NEVER)); - mass_auth('group', 0, 'administrators', $auth_option, ACL_YES); - mass_auth('group', 0, 'bots', $auth_option, (($prefix != 'm_' && $prefix != 'a_') ? ACL_YES : ACL_NEVER)); - } - } -} - -$sql = 'UPDATE ' . USERS_TABLE . " SET user_permissions = ''"; -$db->sql_query($sql); - -$cache->destroy('_acl_options'); - -echo "<p><b>Done</b></p>\n"; - -/* - $ug_type = user|group - $forum_id = forum ids (array|int|0) -> 0 == all forums - $ug_id = [int] user_id|group_id : [string] usergroup name - $acl_list = [string] acl entry : [array] acl entries - $setting = ACL_YES|ACL_NEVER|ACL_NO -*/ -function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting) -{ - global $db; - static $acl_option_ids, $group_ids; - - if ($ug_type == 'group' && is_string($ug_id)) - { - if (!isset($group_ids[$ug_id])) - { - $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " - WHERE group_name = '" . strtoupper($ug_id) . "'"; - $result = $db->sql_query_limit($sql, 1); - $id = (int) $db->sql_fetchfield('group_id', $result); - $db->sql_freeresult($result); - - if (!$id) - { - return; - } - - $group_ids[$ug_id] = $id; - } - - $ug_id = (int) $group_ids[$ug_id]; - } - - // Build correct parameters - $auth = array(); - - if (!is_array($acl_list)) - { - $auth = array($acl_list => $setting); - } - else - { - foreach ($acl_list as $auth_option) - { - $auth[$auth_option] = $setting; - } - } - unset($acl_list); - - if (!is_array($forum_id)) - { - $forum_id = array($forum_id); - } - - // Set any flags as required - foreach ($auth as $auth_option => $acl_setting) - { - $flag = substr($auth_option, 0, strpos($auth_option, '_') + 1); - if (empty($auth[$flag])) - { - $auth[$flag] = $acl_setting; - } - } - - if (!is_array($acl_option_ids) || empty($acl_option_ids)) - { - $sql = 'SELECT auth_option_id, auth_option - FROM ' . ACL_OPTIONS_TABLE; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $acl_option_ids[$row['auth_option']] = $row['auth_option_id']; - } - $db->sql_freeresult($result); - } - - $sql_forum = 'AND a.forum_id IN (' . implode(', ', array_map('intval', $forum_id)) . ')'; - - $sql = ($ug_type == 'user') ? 'SELECT o.auth_option_id, o.auth_option, a.forum_id, a.auth_setting FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o WHERE a.auth_option_id = o.auth_option_id $sql_forum AND a.user_id = $ug_id" : 'SELECT o.auth_option_id, o.auth_option, a.forum_id, a.auth_setting FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o WHERE a.auth_option_id = o.auth_option_id $sql_forum AND a.group_id = $ug_id"; - $result = $db->sql_query($sql); - - $cur_auth = array(); - while ($row = $db->sql_fetchrow($result)) - { - $cur_auth[$row['forum_id']][$row['auth_option_id']] = $row['auth_setting']; - } - $db->sql_freeresult($result); - - $table = ($ug_type == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE; - $id_field = $ug_type . '_id'; - - $sql_ary = array(); - foreach ($forum_id as $forum) - { - foreach ($auth as $auth_option => $setting) - { - $auth_option_id = $acl_option_ids[$auth_option]; - - if (!$auth_option_id) - { - continue; - } - - switch ($setting) - { - case ACL_NO: - if (isset($cur_auth[$forum][$auth_option_id])) - { - $sql_ary['delete'][] = "DELETE FROM $table - WHERE forum_id = $forum - AND auth_option_id = $auth_option_id - AND $id_field = $ug_id"; - } - break; - - default: - if (!isset($cur_auth[$forum][$auth_option_id])) - { - $sql_ary['insert'][] = "$ug_id, $forum, $auth_option_id, $setting"; - } - else if ($cur_auth[$forum][$auth_option_id] != $setting) - { - $sql_ary['update'][] = "UPDATE " . $table . " - SET auth_setting = $setting - WHERE $id_field = $ug_id - AND forum_id = $forum - AND auth_option_id = $auth_option_id"; - } - } - } - } - unset($cur_auth); - - $sql = ''; - foreach ($sql_ary as $sql_type => $sql_subary) - { - switch ($sql_type) - { - case 'insert': - switch ($db->sql_layer) - { - case 'mysql': - case 'mysql4': - $sql = 'VALUES ' . implode(', ', preg_replace('#^(.*?)$#', '(\1)', $sql_subary)); - break; - - case 'mssql': - case 'sqlite': - $sql = implode(' UNION ALL ', preg_replace('#^(.*?)$#', 'SELECT \1', $sql_subary)); - break; - - default: - foreach ($sql_subary as $sql) - { - $sql = "INSERT INTO $table ($id_field, forum_id, auth_option_id, auth_setting) VALUES ($sql)"; - $result = $db->sql_query($sql); - $sql = ''; - } - } - - if ($sql != '') - { - $sql = "INSERT INTO $table ($id_field, forum_id, auth_option_id, auth_setting) $sql"; - $result = $db->sql_query($sql); - } - break; - - case 'update': - case 'delete': - foreach ($sql_subary as $sql) - { - $result = $db->sql_query($sql); - $sql = ''; - } - break; - } - unset($sql_ary[$sql_type]); - } - unset($sql_ary); - -} - -garbage_collection(); -exit_handler(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_avatars.php b/phpBB/develop/adjust_avatars.php deleted file mode 100644 index 976f7dfb7e..0000000000 --- a/phpBB/develop/adjust_avatars.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php -/** -* Corrects avatar filenames to match the new avatar delivery method. -* -* You should make a backup from your users table and the avatar directory 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); -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; - -if (!isset($config['avatar_salt'])) -{ - $cache->purge(); - if (!isset($config['avatar_salt'])) - { - die('database not up to date'); - } - die('database not up to date'); -} - -// let's start with the users using a group_avatar. -$sql = 'SELECT group_id, group_avatar - FROM ' . GROUPS_TABLE . ' - WHERE group_avatar_type = ' . AVATAR_UPLOAD; - -// We'll skip these, so remember them -$group_avatars = array(); - -echo '<br /> Updating groups' . "\n"; - -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $new_avatar_name = adjust_avatar($row['group_avatar'], 'g' . $row['group_id']); - $group_avatars[] = $new_avatar_name; - - // failure is probably due to the avatar name already being adjusted - if ($new_avatar_name !== false) - { - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_avatar = '" . $db->sql_escape($new_avatar_name) . "' - WHERE user_avatar = '" . $db->sql_escape($row['group_avatar']) . "' - AND user_avatar_type = " . AVATAR_UPLOAD; - $db->sql_query($sql); - - $sql = 'UPDATE ' . GROUPS_TABLE . " - SET group_avatar = '" . $db->sql_escape($new_avatar_name) . "' - WHERE group_id = {$row['group_id']}"; - $db->sql_query($sql); - } - else - { - echo '<br /> Failed updating group ' . $row['group_id'] . "\n"; - } - - if ($echos > 200) - { - echo '<br />' . "\n"; - $echos = 0; - } - - echo '.'; - $echos++; - - flush(); -} -$db->sql_freeresult($result); - -$sql = 'SELECT user_id, username, user_avatar, user_avatar_type - FROM ' . USERS_TABLE . ' - WHERE user_avatar_type = ' . AVATAR_UPLOAD . ' - AND ' . $db->sql_in_set('user_avatar', $group_avatars, true, true); -$result = $db->sql_query($sql); - -echo '<br /> Updating users' . "\n"; - -while ($row = $db->sql_fetchrow($result)) -{ - $new_avatar_name = adjust_avatar($row['user_avatar'], $row['user_id']); - - // failure is probably due to the avatar name already being adjusted - if ($new_avatar_name !== false) - { - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_avatar = '" . $db->sql_escape($new_avatar_name) . "' - WHERE user_id = {$row['user_id']}"; - $db->sql_query($sql); - } - else - { - // nuke this avatar - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_avatar = '', user_avatar_type = 0 - WHERE user_id = {$row['user_id']}"; - $db->sql_query($sql); - echo '<br /> Failed updating user ' . $row['user_id'] . "\n"; - } - - if ($echos > 200) - { - echo '<br />' . "\n"; - $echos = 0; - } - - echo '.'; - $echos++; - - flush(); -} - -$db->sql_freeresult($result); - -echo 'FINISHED'; - -// Done -$db->sql_close(); - -function adjust_avatar($old_name, $midfix) -{ - global $config; - - $avatar_path = PHPBB_ROOT_PATH . $config['avatar_path']; - $extension = strtolower(substr(strrchr($old_name, '.'), 1)); - $new_name = $config['avatar_salt'] . '_' . $midfix . '.' . $extension; - - if (@file_exists($avatar_path . '/' . $old_name) && @is_writable($avatar_path . '/' . $old_name) && @is_writable($avatar_path . '/' . $new_name)) - { - @rename($avatar_path . '/' . $old_name, $avatar_path . '/' . $new_name); - return $midfix . '.' . $extension; - } - return false; -} - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_bbcodes.php b/phpBB/develop/adjust_bbcodes.php deleted file mode 100644 index 27af105f28..0000000000 --- a/phpBB/develop/adjust_bbcodes.php +++ /dev/null @@ -1,174 +0,0 @@ -<?php -/** -* Only adjust bitfields, do not rewrite text... -* All new parsings have the img, flash and quote modes set to true -* -* 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. -*/ -die("Please read the first lines of this script for instructions on how to enable it"); - -set_time_limit(0); - -define('IN_PHPBB', true); -define('PHPBB_ROOT_PATH', './../'); -define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); -include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); -include(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT); - -// Start session management -$user->session_begin(); -$auth->acl($user->data); -$user->setup(); - -$echos = 0; - -// Adjust user signatures -$message_parser = new parse_message(); -$message_parser->mode = 'sig'; -$message_parser->bbcode_init(); - -$sql = 'SELECT user_id, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield - FROM ' . USERS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - // Convert bbcodes back to their normal form - if ($row['user_sig_bbcode_uid'] && $row['user_sig']) - { - decode_message($row['user_sig'], $row['user_sig_bbcode_uid']); - - $message_parser->message = $row['user_sig']; - - $message_parser->prepare_bbcodes(); - $message_parser->parse_bbcode(); - - $bitfield = $message_parser->bbcode_bitfield; - - $sql = 'UPDATE ' . USERS_TABLE . " SET user_sig_bbcode_bitfield = '" . $db->sql_escape($bitfield) . "' - WHERE user_id = " . $row['user_id']; - $db->sql_query($sql); - - if ($echos > 200) - { - echo '<br />' . "\n"; - $echos = 0; - } - - echo '.'; - $echos++; - - flush(); - } - else - { - $sql = 'UPDATE ' . USERS_TABLE . " SET user_sig_bbcode_bitfield = '' - WHERE user_id = " . $row['user_id']; - $db->sql_query($sql); - } -} -$db->sql_freeresult($result); - - -// Now adjust posts - -$message_parser = new parse_message(); -$message_parser->mode = 'post'; -$message_parser->bbcode_init(); - -// Update posts -$sql = 'SELECT post_id, post_text, bbcode_uid, enable_bbcode, enable_smilies, enable_sig - FROM ' . POSTS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - // Convert bbcodes back to their normal form - if ($row['enable_bbcode']) - { - decode_message($row['post_text'], $row['bbcode_uid']); - - $message_parser->message = $row['post_text']; - - $message_parser->prepare_bbcodes(); - $message_parser->parse_bbcode(); - - $bitfield = $message_parser->bbcode_bitfield; - - $sql = 'UPDATE ' . POSTS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($bitfield) . "' - WHERE post_id = " . $row['post_id']; - $db->sql_query($sql); - - if ($echos > 200) - { - echo '<br />' . "\n"; - $echos = 0; - } - - echo '.'; - $echos++; - - flush(); - } - else - { - $sql = 'UPDATE ' . POSTS_TABLE . " SET bbcode_bitfield = '' - WHERE post_id = " . $row['post_id']; - $db->sql_query($sql); - } -} -$db->sql_freeresult($result); - -// Now to the private messages -$message_parser = new parse_message(); -$message_parser->mode = 'post'; -$message_parser->bbcode_init(); - -// Update pms -$sql = 'SELECT msg_id, message_text, bbcode_uid, enable_bbcode - FROM ' . PRIVMSGS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - // Convert bbcodes back to their normal form - if ($row['enable_bbcode']) - { - decode_message($row['message_text'], $row['bbcode_uid']); - - $message_parser->message = $row['message_text']; - - $message_parser->prepare_bbcodes(); - $message_parser->parse_bbcode(); - - $bitfield = $message_parser->bbcode_bitfield; - - $sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($bitfield) . "' - WHERE msg_id = " . $row['msg_id']; - $db->sql_query($sql); - - if ($echos > 200) - { - echo '<br />' . "\n"; - $echos = 0; - } - - echo '.'; - $echos++; - - flush(); - } - else - { - $sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = '' - WHERE msg_id = " . $row['msg_id']; - $db->sql_query($sql); - } -} -$db->sql_freeresult($result); - -// Done -$db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_magic_urls.php b/phpBB/develop/adjust_magic_urls.php deleted file mode 100644 index 94a32283e0..0000000000 --- a/phpBB/develop/adjust_magic_urls.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php -/** -* Adds class="postlink" to magic urls -* -* 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. -*/ -die("Please read the first lines of this script for instructions on how to enable it"); - -set_time_limit(0); - -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; - -$replace = array( - '<!-- l --><a href="', - '<!-- m --><a href="', - '<!-- w --><a href="', -); -$with = array( - '<!-- l --><a class="postlink-local" href="', - '<!-- m --><a class="postlink" href="', - '<!-- w --><a class="postlink" href="', -); - -// Adjust user signatures -$sql = 'SELECT user_id, user_sig - FROM ' . USERS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $new_content = str_replace($replace, $with, $row['user_sig']); - - if ($new_content != $row['user_sig']) - { - $sql = 'UPDATE ' . USERS_TABLE . " SET user_sig = '" . $db->sql_escape($new_content) . "' - 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 - FROM ' . POSTS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $new_content = str_replace($replace, $with, $row['post_text']); - - if ($row['post_text'] != $new_content) - { - $sql = 'UPDATE ' . POSTS_TABLE . " SET post_text = '" . $db->sql_escape($new_content) . "' - 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 - FROM ' . PRIVMSGS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $new_content = str_replace($replace, $with, $row['message_text']); - - if ($row['message_text'] != $new_content) - { - $sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($new_content) . "' - 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 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 diff --git a/phpBB/develop/adjust_smilies.php b/phpBB/develop/adjust_smilies.php deleted file mode 100644 index bc8ac7be95..0000000000 --- a/phpBB/develop/adjust_smilies.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php -/** -* Updates smilies that were changed to the new ones -*/ -die("Please read the first lines of this script for instructions on how to enable it"); - -set_time_limit(0); - -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; - -$replace = array( - '<img src="{SMILIES_PATH}/icon_biggrin.gif', - '<img src="{SMILIES_PATH}/icon_confused.gif', - '<img src="{SMILIES_PATH}/icon_sad.gif', - '<img src="{SMILIES_PATH}/icon_smile.gif', - '<img src="{SMILIES_PATH}/icon_surprised.gif', - '<img src="{SMILIES_PATH}/icon_wink.gif', -); - -$with = array( - '<img src="{SMILIES_PATH}/icon_e_biggrin.gif', - '<img src="{SMILIES_PATH}/icon_e_confused.gif', - '<img src="{SMILIES_PATH}/icon_e_sad.gif', - '<img src="{SMILIES_PATH}/icon_e_smile.gif', - '<img src="{SMILIES_PATH}/icon_e_surprised.gif', - '<img src="{SMILIES_PATH}/icon_e_wink.gif', -); - -// Adjust user signatures -$sql = 'SELECT user_id, user_sig - FROM ' . USERS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $new_content = str_replace($replace, $with, $row['user_sig']); - - if ($new_content != $row['user_sig']) - { - $sql = 'UPDATE ' . USERS_TABLE . " SET user_sig = '" . $db->sql_escape($new_content) . "' - 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 - FROM ' . POSTS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $new_content = str_replace($replace, $with, $row['post_text']); - - if ($row['post_text'] != $new_content) - { - $sql = 'UPDATE ' . POSTS_TABLE . " SET post_text = '" . $db->sql_escape($new_content) . "' - 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 - FROM ' . PRIVMSGS_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $new_content = str_replace($replace, $with, $row['message_text']); - - if ($row['message_text'] != $new_content) - { - $sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($new_content) . "' - 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 diff --git a/phpBB/develop/adjust_uids.php b/phpBB/develop/adjust_uids.php deleted file mode 100644 index 999d9a076a..0000000000 --- a/phpBB/develop/adjust_uids.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php -/** -* Repair bbcodes converted with RC6 -* -* 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 -* -*/ -die("Please read the first lines of this script for instructions on how to enable it"); - -set_time_limit(0); -@ini_set('memory_limit', '512M'); - -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; - - -// Adjust user signatures -$sql = 'SELECT user_id, user_sig, user_sig_bbcode_uid - FROM ' . USERS_TABLE . ' - ORDER BY user_id ASC'; -$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 (!empty($bbcode_uid) && strpos($row['user_sig'], $bbcode_uid) === false) - { - $row['user_sig'] = preg_replace('/\:[0-9a-z]{8}\]/', ":$bbcode_uid]", $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 />User: ' . "{$row['user_id']}\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 . ' - ORDER BY post_id ASC'; -$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'] && !empty($bbcode_uid) && strpos($row['post_text'], $bbcode_uid) === false) - { - $row['post_text'] = preg_replace('/\:[0-9a-z]{8}\]/', ":$bbcode_uid]", $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 />Post: ' . "{$row['post_id']} \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'] && !empty($bbcode_uid) && strpos($row['message_text'], $bbcode_uid) === false) - { - $row['message_text'] = preg_replace('/\:[0-9a-z]{8}\]/', ":$bbcode_uid]", $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(); -echo 'done'; -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_usernames.php b/phpBB/develop/adjust_usernames.php deleted file mode 100644 index 4bae774634..0000000000 --- a/phpBB/develop/adjust_usernames.php +++ /dev/null @@ -1,52 +0,0 @@ -<?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); -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; - -$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/calc_email_hash.php b/phpBB/develop/calc_email_hash.php deleted file mode 100644 index cf2bb5c418..0000000000 --- a/phpBB/develop/calc_email_hash.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -// ------------------------------------------------------------- -// -// $Id$ -// -// FILENAME : calc_email_hash.php -// STARTED : Tue Feb 03, 2004 -// COPYRIGHT : © 2004 phpBB Group -// WWW : http://www.phpbb.com/ -// LICENCE : GPL vs2.0 [ see /docs/COPYING ] -// -// ------------------------------------------------------------- - -// -// 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"); -@set_time_limit(300); - -define('IN_PHPBB', 1); -define('PHPBB_ROOT_PATH', './../'); -define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); -include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); - -$start = 0; -do -{ - // Batch query for group members, call group_user_del - $sql = "SELECT user_id, user_email - FROM {$table_prefix}users - LIMIT $start, 100"; - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - do - { - $sql = "UPDATE {$table_prefix}users - SET user_email_hash = " . (crc32(strtolower($row['user_email'])) . strlen($row['user_email'])) . ' - WHERE user_id = ' . $row['user_id']; - $db->sql_query($sql); - - $start++; - } - while ($row = $db->sql_fetchrow($result)); - - echo "<br />Batch -> $start\n"; - flush(); - } - else - { - $start = 0; - } - $db->sql_freeresult($result); -} -while ($start); - -echo "<p><b>Done</b></p>\n"; - -?>
\ No newline at end of file diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php deleted file mode 100644 index 4620b9c2c4..0000000000 --- a/phpBB/develop/change_smiley_ref.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/*************************************************************************** - * merge_clean_posts.php - * ------------------- - * begin : Tuesday, February 25, 2003 - * copyright : (C) 2003 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"); - -@set_time_limit(2400); - -define('PHPBB_ROOT_PATH', './../'); -define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); -include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); - -$sql = "SELECT post_id, post_text FROM {$table_prefix}posts WHERE post_text LIKE '%{SMILE_PATH}%'"; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $db->sql_query("UPDATE {$table_prefix}posts SET post_text = '" . $db->sql_escape(str_replace('{SMILE_PATH}', '{SMILIES_PATH}', $row['post_text'])) . "' WHERE post_id = " . $row['post_id']); -} -$db->sql_freeresult($result); - -echo "<p><b>Done</b></p>\n"; - -?>
\ No newline at end of file diff --git a/phpBB/develop/create_variable_overview.php b/phpBB/develop/create_variable_overview.php deleted file mode 100644 index 3782f53e4c..0000000000 --- a/phpBB/develop/create_variable_overview.php +++ /dev/null @@ -1,547 +0,0 @@ -<?php -// ------------------------------------------------------------- -// -// $Id$ -// -// FILENAME : create_variable_overview.php -// STARTED : Fri Aug 15 2003 -// COPYRIGHT : © 2003 phpBB Group -// WWW : http://www.phpbb.com/ -// LICENCE : GPL vs2.0 [ see /docs/COPYING ] -// -// ------------------------------------------------------------- - -/* - This script generates an index of some template vars and their use within the templates. - It writes down all language variables used by various templates. -*/ - -// -// 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"); - -$directory = '../styles/subSilver/template/'; -$ext = 'html'; -$store_dir = '../store/'; - -$phpfiles_directories = array('../', '../includes/', '../includes/acm/', '../includes/auth/', '../includes/mcp/', '../includes/ucp/'); -// Template Files beginning with this names are merged together -$merge = array('gcp', 'login', 'mcp', 'memberlist', 'posting', 'ucp'); - -if (!is_writable($store_dir)) -{ - die("Directory $store_dir is not writable!"); -} - -$contents = implode('', file('../adm/subSilver.css', filesize('../adm/subSilver.css'))); -$fp = fopen($store_dir . 'subSilver.css', 'w'); -fwrite($fp, $contents); -fclose($fp); - -$html_skeleton = ' -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<link rel="stylesheet" href="subSilver.css" type="text/css"> -<style type="text/css"> -<!-- -th { background-image: url(\'cellpic3.gif\') } -td.cat { background-image: url(\'cellpic1.gif\') } -//--> -</style> -<title>{FILENAME}</title> -</head> -<body> - -<table width="100%" cellspacing="0" cellpadding="0" border="0"> - <tr> - <td><img src="header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></td> - <td width="100%" background="header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle">File {FILENAME}</span> </td> - </tr> -</table> - -<table width="95%" cellspacing="0" cellpadding="0" border="0" align="center"> - <tr> - <td><br clear="all" /> - -'; -$html_skeleton .= '<br><a href="./index.html" class="gen">Back to Contents</a><br><br>'; -$html_skeleton .= '<br><a href="#lang" class="gen">Language Variables</a> :: <a href="#includes" class="gen">Includes</a> :: <a href="#cond" class="gen">Conditionals</a><br><a href="#remain" class="gen">Remaining Vars</a> :: <a href="#usedby" class="gen">phpBB File Usage</a> :: <a href="#ref" class="gen">References</a>'; -$html_skeleton .= '<br><br><a name="lang"></a><b>Language Variables</b><br><br>{LANGUAGE_VARIABLES}'; -$html_skeleton .= '<br><br><a name="includes"></a><b>Included Files</b><br><br>{INCLUDES}'; -$html_skeleton .= '<br><br><a name="cond"></a><b>Used Conditionals</b><br><br>{CONDITIONALS}'; -$html_skeleton .= '<br><br><a name="remain"></a><b>Remaining Vars used</b><br><br>{REMAINING_VARS}'; -$html_skeleton .= '<br><br><a name="usedby"></a><b>This Template File is used by the following phpBB Files</b><br><br>{USED_BY}'; -$html_skeleton .= '<br><br><a name="ref"></a><b>References: </b>{SEE_FILES}'; - -//$html_skeleton .= "</body>\n</html>\n"; - -$html_skeleton .= ' -<br><br> -<div class="copyright" align="center">Powered by phpBB 2.2 © <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB Group</a>, 2003</div> - - <br clear="all" /></td> - </tr> -</table> - -</body> -</html> -'; - -// Open Language File -include('../language/en/lang_main.php'); -include('../language/en/lang_admin.php'); - -$files_to_parse = $php_files = array(); - -$dhandler = opendir($directory); -if (!$dhandler) -{ - die("Unable to open $directory"); -} - -$num = 0; -while ($file = readdir($dhandler)) -{ - if (is_file($directory . $file) && preg_match('#\.' . $ext . '$#i', $file)) - { - $files_to_parse[$num]['filename'] = $directory . $file; - $files_to_parse[$num]['single_filename'] = $file; - $files_to_parse[$num]['destfile'] = str_replace(".{$ext}", '', $file) . '_' . $num . '.html'; - $file_to_destfile[$file] = $files_to_parse[$num]['destfile']; - $num++; - } -} -closedir($dhandler); - -$num = 0; -foreach ($phpfiles_directories as $directory) -{ - $dhandler = opendir($directory); - if (!$dhandler) - { - die("Unable to open $directory"); - } - - while ($file = readdir($dhandler)) - { - if (is_file($directory . $file) && preg_match('#\.php$#i', $file)) - { - $php_files[$num]['filename'] = $directory . $file; - $php_files[$num]['single_filename'] = $file; - $num++; - } - } - closedir($dhandler); -} - -$php_files_includes = $lang_references = array(); - -//$php_files_includes['viewtopic_attach_body.html'][0] = filename - -echo '<br>Parsing PHP Files'; - -// Parse PHP Files and get our filenames -foreach ($php_files as $file_num => $data) -{ - echo '.'; - flush(); - $contents = implode('', file($data['filename'], filesize($data['filename']))); - - $html_files = array(); - preg_match_all('#([a-zA-Z0-9\-_]*?)\.' . $ext . '#s', $contents, $html_files); - $html_files = array_unique($html_files[1]); - - foreach ($html_files as $html_file) - { - $html_file = trim($html_file); - if ($html_file != '') - { - $php_files_includes[$html_file . '.' . $ext][] = $data['filename']; - } - } -} - -echo '<br>Parsing HTML Files'; -foreach ($files_to_parse as $file_num => $data) -{ - echo '.'; - flush(); - $contents = implode('', file($data['filename'], filesize($data['filename']))); - - // Language Variables -> [0]:tpl [1]:lang - $lang_vars = array(); - preg_match_all('#{L_([a-z0-9\-_]*?)\}#is', $contents, $lang_vars); - $contents = preg_replace('#{L_([a-z0-9\-_]*?)\}#is', '', $contents); - $lang_vars[0] = array_unique($lang_vars[0]); - $lang_vars[1] = array_unique($lang_vars[1]); - - // Includes - $includes = array(); - preg_match_all('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\.]+?) -->#s', $contents, $includes); - $contents = preg_replace('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\.]+?) -->#', '', $contents); - $includes = $includes[1]; - $includes = array_unique($includes); - - // IF Conditions - $switches = array(); - preg_match_all('#<!-- [IF]|[ELSEIF] ([a-zA-Z0-9\-_\.]+?) (.*?)?[ ]?-->#', $contents, $switches); - $contents = preg_replace('#<!-- [IF]|[ELSEIF] ([a-zA-Z0-9\-_]) (.*?)?[ ]?-->#s', '', $contents); - $switches[0] = array_unique($switches[1]); // No resorting please - $switches[1] = $switches[2]; - unset($switches[2]); - - // Remaining Vars - $remaining_vars = array(); - preg_match_all('#{([a-z0-9\-_\.]*?)\}#is', $contents, $remaining_vars); - $contents = preg_replace('#{([a-z0-9\-_]*?)\}#is', '', $contents); - $remaining_vars = array_unique($remaining_vars[1]); - sort($remaining_vars, SORT_STRING); - - // Now build the filename specific site - $fp = fopen($store_dir . $data['destfile'], 'w'); - $html_data = $html_skeleton; - - $html_data = str_replace('{FILENAME}', $data['single_filename'], $html_data); - - // Write up the Language Variables - if (count($lang_vars[0])) - { - $lang_data = '<ul>'; - for ($num = 0; $num <= count($lang_vars[0]); $num++) - { - $var = $lang_vars[0][$num]; - if ($var != '') - { - $_var = str_replace(array('{', '}'), array('', ''), $var); - $lang_references[$_var][] = $data['single_filename']; - $lang_data .= '<li>' . $var . '<br>' . "\n" . ((isset($lang[$_var])) ? htmlspecialchars(str_replace("\\'", "'", $lang[$_var])) : '<span style="color:red">No Language Variable available</span>') . '<br></li><br>' . "\n"; - } - } - $lang_data .= '</ul>'; - } - else - { - $lang_data = '<b>NONE</b><br>' . "\n"; - } - - $html_data = str_replace('{LANGUAGE_VARIABLES}', $lang_data, $html_data); - - // Write up the Includes - echo '.'; - flush(); - if (count($includes)) - { - $includes_data = '<ul>'; - $see_files = ''; - for ($num = 0; $num <= count($includes); $num++) - { - $var = $includes[$num]; - if ($var != '') - { - $includes_data .= '<li><a href="./' . $file_to_destfile[$var] . '" class="gen">' . $var . '</a></li><br>' . "\n"; - $see_files .= ($see_files != '') ? ' :: ' : ''; - $see_files .= '<a href="./' . $file_to_destfile[$var] . '" class="gen">' . $var . '</a>'; - } - } - $includes_data .= '</ul>'; - } - else - { - $includes_data = '<b>NONE</b><br>' . "\n"; - $see_files = '<b>NONE</b>'; - } - - $html_data = str_replace('{INCLUDES}', $includes_data, $html_data); - $html_data = str_replace('{SEE_FILES}', $see_files, $html_data); - - // Write up Conditionals - echo '.'; - flush(); - if (count($switches[0])) - { - $conditionals = '<ul>'; - for ($num = 0; $num <= count($switches[0]); $num++) - { - $var = trim($switches[0][$num]); - if ($var != '') - { - if ($var == 'not') - { - $conditionals .= '<li>' . trim($switches[1][$num]) . '<br><b>Negation</b><br>' . "\n"; - $block_var = explode('.', trim($switches[1][$num])); - unset($block_var[0]); - } - else - { - $conditionals .= '<li>' . $var . ((trim($switches[1][$num]) != '') ? '<br>' . "\n" . '<i>Compared with</i> -> <b>' . trim($switches[1][$num]) . '</b>' : '') . '<br>' . "\n"; - $block_var = explode('.', $var); - unset($block_var[count($block_var)-1]); - } - - if (count($block_var)) - { - for ($_num = count($block_var)-1; $_num >= 0; $_num--) - { - $conditionals .= ($_num == count($block_var)-1) ? '<i>Element of Block</i> -> <b>' . $block_var[$_num] . '</b><br>' . "\n" : '<i>...which is an element of</i> -> <b>' . $block_var[$_num] . '</b><br>' . "\n"; - } - } - $conditionals .= '<br></li>' . "\n"; - } - } - $conditionals .= '</ul>'; - } - else - { - $conditionals = '<b>NONE</b><br>' . "\n"; - } - - $html_data = str_replace('{CONDITIONALS}', $conditionals, $html_data); - - // Write up Remaining Vars - echo '.'; - flush(); - if (count($remaining_vars)) - { - $remaining = '<ul>'; - for ($num = 0; $num <= count($remaining_vars); $num++) - { - $var = trim($remaining_vars[$num]); - if ($var != '') - { - $remaining .= '<li>' . $var . '<br>' . "\n"; - $block_var = explode('.', $var); - unset($block_var[count($block_var)-1]); - - if (count($block_var)) - { - for ($_num = count($block_var)-1; $_num >= 0; $_num--) - { - $remaining .= ($_num == count($block_var)-1) ? '<i>Element of Block</i> -> <b>' . $block_var[$_num] . '</b><br>' . "\n" : '<i>...which is an element of</i> -> <b>' . $block_var[$_num] . '</b><br>' . "\n"; - } - } - $remaining .= '<br></li>' . "\n"; - } - } - $remaining .= '</ul>'; - } - else - { - $remaining = '<b>NONE</b><br>' . "\n"; - } - - $html_data = str_replace('{REMAINING_VARS}', $remaining, $html_data); - - if (isset($php_files_includes[$data['single_filename']]) && count($php_files_includes[$data['single_filename']])) - { - $usedby = '<ul>'; - foreach ($php_files_includes[$data['single_filename']] as $php_filename) - { - $usedby .= '<li>' . str_replace('../', '', $php_filename) . '</li>'; - } - $usedby .= '</ul>'; - } - else - { - $usedby = '<b>NONE</b><br>' . "\n"; - } - - $html_data = str_replace('{USED_BY}', $usedby, $html_data); - - fwrite($fp, $html_data); - fclose($fp); -} - -echo '<br>Store Files'; - -$fp = fopen($store_dir . 'index.html', 'w'); - -$html_data = ' -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<link rel="stylesheet" href="subSilver.css" type="text/css"> -<style type="text/css"> -<!-- -th { background-image: url(\'cellpic3.gif\') } -td.cat { background-image: url(\'cellpic1.gif\') } -//--> -</style> -<title>Contents</title> -</head> -<body> - -<table width="100%" cellspacing="0" cellpadding="0" border="0"> - <tr> - <td><img src="header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></td> - <td width="100%" background="header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle">Available Template Files</span> </td> - </tr> -</table> - -<table width="95%" cellspacing="0" cellpadding="0" border="0" align="center"> - <tr> - <td><br clear="all" /> -<br>This Style Document is 100% auto-generated... no human interaction included. :D<br> -<h2>phpBB 2.2 Template</h2> -<br> -<ol> -'; - -sort($files_to_parse); -foreach ($files_to_parse as $file_num => $data) -{ - echo '.'; - flush(); - $var = $data['single_filename']; - $html_data .= '<li><a href="./' . $file_to_destfile[$var] . '" class="gen">' . $var . '</a></li><br>' . "\n"; -} - -$html_data .= '<br><li><a href="./lang_index.html" class="gen">Appendix A: Language Variable Index</a></li><br>'; - -$html_data .= ' -</ol><br><br> -<div class="copyright" align="center">Powered by phpBB 2.2 © <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB Group</a>, 2003</div> - - <br clear="all" /></td> - </tr> -</table> - -</body> -</html> -'; - -fwrite($fp, $html_data); -fclose($fp); - -// Not only write down all language files, place them into a specific array, named by the template file -// All Language vars assigned to more than one template will be placed into a common file -$entry = array(); -$common_fp = fopen($store_dir . 'lang_common.php', 'w'); -fwrite($common_fp, "<?php\n\n \$lang = array(\n"); - -$fp = fopen($store_dir . 'lang_index.html', 'w'); - -$html_data = ' -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<link rel="stylesheet" href="subSilver.css" type="text/css"> -<style type="text/css"> -<!-- -th { background-image: url(\'cellpic3.gif\') } -td.cat { background-image: url(\'cellpic1.gif\') } -//--> -</style> -<title>Appendix A :: Language Variable Index</title> -</head> -<body> - -<table width="100%" cellspacing="0" cellpadding="0" border="0"> - <tr> - <td><img src="header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></td> - <td width="100%" background="header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle">Language Variable Index</span> </td> - </tr> -</table> - -<table width="95%" cellspacing="0" cellpadding="0" border="0" align="center"> - <tr> - <td><br clear="all" /> -<br><a href="./index.html" class="gen">Back to Contents</a><br><br> -<br> -'; - -echo '<br>Write Language Files'; - -asort($lang_references); -ksort($lang_references); -$_index = ''; -$old_char = ''; -foreach ($lang_references as $lang_var => $filenames) -{ - $var = preg_replace('#^L_(.*?)#', '\1', $lang_var); - $char = $var{0}; - if ($old_char != $char) - { - $old_char = $char; - $_index .= ($_index != '') ? ' :: ' : ''; - $_index .= '<a href="#' . $char . '" class="gen"><b>' . $char . '</b></a>'; - } -} - -$html_data .= $_index . '<br><br><br>'; -$old_char = ''; -foreach ($lang_references as $lang_var => $filenames) -{ - echo '.'; - flush(); - $var = preg_replace('#^L_(.*?)#', '\1', $lang_var); - $char = $var{0}; - if ($old_char != $char) - { - $old_char = $char; - $html_data .= '<br><hr><br><a name="' . $char . '"></a><h2>Letter ' . $char . '</h2><br><br>'; - } - - $html_data .= '<b>' . $lang_var . '</b><ul>'; - - if (sizeof($filenames) != 1) - { - fwrite($common_fp, (($entry['common']) ? ",\n" : '') . "\t'$var' => '" . $lang[$var] . "'"); - $entry['common'] = true; - } - else if (sizeof($filenames) == 1) - { - // Merge logical - hardcoded - $fname = (preg_match('#^(' . implode('|', $merge) . ')#', $filenames[0], $match)) ? $match[0] . '.php' : str_replace($ext, 'php', $filenames[0]); - - if (!$lang_fp[$fname]) - { - $lang_fp[$fname] = fopen($store_dir . 'lang_' . $fname, 'w'); - fwrite($lang_fp[$fname], "<?php\n\n\$lang = array(\n"); - $entry[$fname] = false; - } - fwrite($lang_fp[$fname], (($entry[$fname]) ? ",\n" : '') . "\t'$var' => '" . $lang[$var] . "'"); - $entry[$fname] = true; - } - - foreach ($filenames as $f_name) - { - $var = trim($f_name); - $html_data .= '<li><a href="./' . $file_to_destfile[$var] . '" class="gen">' . $var . '</a></li><br>' . "\n"; - } - $html_data .= '</ul><br><br>'; -} - -fwrite($common_fp, ")\n);\n?>"); -fclose($common_fp); - -foreach ($lang_fp as $filepointer) -{ - fwrite($filepointer, ")\n);\n?>"); - fclose($filepointer); -} - -$html_data .= ' -<br><br> -<div class="copyright" align="center">Powered by phpBB 2.2 © <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB Group</a>, 2003</div> - - <br clear="all" /></td> - </tr> -</table> - -</body> -</html> -'; - -fwrite($fp, $html_data); -fclose($fp); - -echo '<br>Finished!'; -flush(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php deleted file mode 100644 index 39a9b128f5..0000000000 --- a/phpBB/develop/fill.php +++ /dev/null @@ -1,190 +0,0 @@ -<?php -// ------------------------------------------------------------- -// -// $Id$ -// -// FILENAME : fill.php -// STARTED : Mon Sep 15, 2003 -// COPYRIGHT : © 2001, 2003 phpBB Group -// WWW : http://www.phpbb.com/ -// LICENCE : GPL vs2.0 [ see /docs/COPYING ] -// -// ------------------------------------------------------------- -// -// 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"); - - -define('IN_PHPBB', true); -define('PHPBB_ROOT_PATH', './../'); -define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); -include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); -include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT); - -set_time_limit(0); -header('Expires: 0'); -ignore_user_abort(true); - -// number of topics to create -$num_topics = 10000; - -// number of topics to be generated per call -$batch_size = 2000; - -// max number of posts per topic -$posts_per_topic = 500; - - -// general vars -$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'generate'; -$start = (isset($_REQUEST['start'])) ? intval($_REQUEST['start']) : 0; - -switch ($mode) -{ - case 'generate': - $user_ids = $forum_ids = $topic_rows = array(); - - $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') OR user_id = ' . ANONYMOUS; - $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) - { - $user_ids[] = $row['user_id']; - } - $db->sql_freeresult($result); - - $sql = 'SELECT forum_id FROM ' . FORUMS_TABLE . ' WHERE forum_type = ' . FORUM_POST; - $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) - { - $forum_ids[$row['forum_id']] = $row['forum_id']; - } - $db->sql_freeresult($result); - - if (!$start) - { - $db->sql_query('TRUNCATE TABLE ' . POSTS_TABLE); - $db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE); -// $db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE . '_prefetch'); - } - - $db->sql_query('LOCK TABLES ' . POSTS_TABLE . ' WRITE, ' . TOPICS_TABLE . ' WRITE'); - - for ($topic_id = $start + 1; $topic_id < min($start + $batch_size, $num_topics + 1); ++$topic_id) - { - $forum_id = array_rand($forum_ids); - - if (count($topic_rows) == 10) - { - $sql = 'INSERT IGNORE INTO ' . TOPICS_TABLE . " (topic_id, forum_id, topic_title, topic_reported) - VALUES " . implode(', ', $topic_rows); - $db->sql_query($sql); - - $topic_rows = array(); - } - - $topic_rows[] = "($topic_id, $forum_id, '$forum_id-$topic_id', " . (($topic_id % 34) ? '0' : '1') . ')'; - - $sql = 'INSERT IGNORE INTO ' . POSTS_TABLE . ' (topic_id, forum_id, poster_id, post_subject, post_text, post_username, post_approved, post_time, post_reported) - VALUES '; - - $rows = array(); - $post_time = mt_rand(0, time()); - - $num_posts = $posts_per_topic; //mt_rand(1, $posts_per_topic); - for ($i = 0; $i < $num_posts; ++$i) - { - $poster_id = $user_ids[array_rand($user_ids)]; - $poster_name = ($poster_id == ANONYMOUS) ? rndm_username() : ''; - $rows[] = "($topic_id, $forum_id, $poster_id, '$forum_id-$topic_id-$i', '$forum_id-$topic_id-$i', '$poster_name', " . (mt_rand(0, 12) ? '1' : '0') . ', ' . ($post_time + $i * 60) . ', ' . (mt_rand(0, 32) ? '0' : '1') . ')'; - } - - $db->sql_query($sql . implode(', ', $rows)); - } - - if (count($topic_rows)) - { - $sql = 'INSERT IGNORE INTO ' . TOPICS_TABLE . " (topic_id, forum_id, topic_title, topic_reported) - VALUES " . implode(', ', $topic_rows); - $db->sql_query($sql); - } - - $db->sql_query('UNLOCK TABLES'); - - if ($topic_id >= $num_topics) - { - echo '<meta http-equiv="refresh" content="10; url=fill.' . PHP_EXT . '?mode=sync&' . time() . '">And now for something completely different...'; - - $db->sql_query('ANALYZE TABLES ' . TOPICS_TABLE . ', ' . POSTS_TABLE); - flush(); - } - else - { - echo '<meta http-equiv="refresh" content="10; url=fill.' . PHP_EXT . '?start=' . $topic_id . '&' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')'; - flush(); - } - break; - - case 'sync': -/* error_reporting(E_ALL); - $sync_all = TRUE; - - if ($sync_all) - { - $s = explode(' ', microtime()); - sync('topic', '', '', TRUE, FALSE); -// sync('forum'); - $e = explode(' ', microtime()); - - echo '<pre><b>' . ($e[0] + $e[1] - $s[0] - $s[1]) . '</b></pre>'; - echo '<a href="fill.' . PHP_EXT . '">Here we go again</a>'; - } - else - { - $batch_size = $batch_size * 10; - $end = $start + $batch_size; - - $s = explode(' ', microtime()); - sync('topic', 'range', "topic_id BETWEEN $start AND $end", TRUE, FALSE); - $e = explode(' ', microtime()); - - echo '<pre>Time taken: <b>' . ($e[0] + $e[1] - $s[0] - $s[1]) . '</b></pre>'; - - if ($end < $num_topics) - { - $start += $batch_size; - echo '<meta http-equiv="refresh" content="0; url=fill.' . PHP_EXT . "?mode=sync&start=$start&" . time() . "\">And now for something completely different... ($start/$num_topics)"; - } - else - { - echo '<a href="fill.' . PHP_EXT . '">Here we go again</a>'; - } - } - - if (isset($_GET['explain'])) - { - trigger_error('Done'); - } - */ -} - -$db->sql_close(); - -function rndm_username() -{ - static $usernames; - - if (!isset($usernames)) - { - $usernames = get_defined_functions(); - $usernames = $usernames['internal']; - } - - return $usernames[array_rand($usernames)]; -} - -?>
\ No newline at end of file diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php deleted file mode 100644 index 09ac34e159..0000000000 --- a/phpBB/develop/lang_duplicates.php +++ /dev/null @@ -1,140 +0,0 @@ -<html> - <head> - <title>Duplicate Language Keys</title> - </head> - <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"); - -// ------------------------------------------------------------- -// -// $Id$ -// -// @copyright (c) 2005 phpBB Group -// @license http://opensource.org/licenses/gpl-license.php GNU Public License -// -// ------------------------------------------------------------- -// Thanks to arod-1 - -define('IN_PHPBB', 1); -define('PHPBB_ROOT_PATH', './../'); -define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); -include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); - -$mode = request_var('mode', ''); - -$modules = find_modules(PHPBB_ROOT_PATH . 'language/en'); - -$kkeys = $keys = array(); -$langdir = dirname(__FILE__); - -if (isset($lang)) -{ - unset($lang); -} - -foreach($modules as $module) -{ - require_once("$langdir$module"); - if (isset($lang)) - { - $kkeys[$module] = $lang; - $keys[] = $module; - unset($lang); - } -} - -$equal = $case = $diff = 0; -$output = array(); - -while ($module = array_shift($keys)) -{ - $keys_1 = array_keys($kkeys[$module]); - - foreach ($keys as $other_module) - { - $keys_2 = array_keys($kkeys[$other_module]); - - foreach(array_intersect($keys_1, $keys_2) as $dup) - { - if ($kkeys[$module][$dup] == $kkeys[$other_module][$dup]) - { - $compare = "Equal"; - $equal++; - } - else if (strcasecmp($kkeys[$module][$dup], $kkeys[$other_module][$dup]) == 0) - { - $compare = "Differ in case"; - $case++; - } - else - { - $compare = "'{$kkeys[$module][$dup]}' - '{$kkeys[$other_module][$dup]}'"; - $diff++; - } - - $color = ''; - if ((basename($module) == "common." . PHP_EXT) || (basename($other_module) == "common." . PHP_EXT)) - { - $color = ' style="color:#B00000;"'; - } - - switch ($mode) - { - case 'module': - $output[$module][] = "<tr$color><td>" . ((isset($output[$module])) ? ' ' : "<b>$module</b>" ) . "</td><td>$dup</td><td>$other_module</td><td>$compare</td></tr>"; - break; - - default: - $output[$dup][] = "<tr$color><td><b>$dup</b></td><td>$module</td><td>$other_module</td><td>$compare</td></tr>"; - break; - } - } - } -}//var_dump($output); - -echo "<p><a href=\"lang_duplicates.php\">By Key</a> <a href=\"lang_duplicates.php?mode=module\">By Module</a></p><p>Equal: <b>$equal</b>, Differ in case only: $case, differ in content: $diff</p>"; -switch ($mode) -{ - case 'module': - echo "<table cellpadding=\"4\"><tr><th>Key</th><th>First File</th><th>Second File</th><th>Difference</th></tr>"; - foreach ($output as $module => $html) - { - echo implode('', $html); - } - break; - - default: - ksort($output); - echo "<table cellpadding=\"4\"><tr><th>File</th><th>Key</th><th>Conflicting File</th><th>Difference</th></tr>"; - foreach ($output as $dup) - { - echo implode('', $dup); - } - break; -} - -echo "</table>"; - - -function find_modules($dirname) -{ - $list = glob("$dirname/*.php"); - - foreach(glob("$dirname/*", GLOB_ONLYDIR) as $name) - { - $list = array_merge($list, find_modules($name)); - } - return $list; -} - -?> - </body> -</html>
\ No newline at end of file |