aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-05-29 12:25:56 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-05-29 12:25:56 +0000
commit2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04 (patch)
tree3b7ea329bf35eab5ddab9b0b5eb790e45e283a5c
parent91b4fe1868ca2c4d81111943f781e3cfd0262ef2 (diff)
downloadforums-2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04.tar
forums-2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04.tar.gz
forums-2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04.tar.bz2
forums-2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04.tar.xz
forums-2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04.zip
ok... i hope i haven't messed too much with the code and everything is still working.
Changes: - Ascraeus now uses constants for the phpbb root path and the php extension. This ensures more security for external applications and modifications (no more overwriting of root path and extension possible through insecure mods and register globals enabled) as well as no more globalizing needed. - A second change implemented here is an additional short-hand-notation for append_sid(). It is allowed to omit the root path and extension now (for example calling append_sid('memberlist')) - in this case the root path and extension get added automatically. The hook is called after these are added. git-svn-id: file:///svn/phpbb/trunk@8572 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/adm/index.php83
-rw-r--r--phpBB/adm/swatch.php10
-rw-r--r--phpBB/common.php34
-rw-r--r--phpBB/cron.php20
-rw-r--r--phpBB/develop/add_permissions.php33
-rwxr-xr-xphpBB/develop/adjust_avatars.php10
-rw-r--r--phpBB/develop/adjust_bbcodes.php8
-rw-r--r--phpBB/develop/adjust_magic_urls.php6
-rw-r--r--phpBB/develop/adjust_sizes.php6
-rw-r--r--phpBB/develop/adjust_smilies.php6
-rwxr-xr-xphpBB/develop/adjust_uids.php6
-rw-r--r--phpBB/develop/adjust_usernames.php6
-rw-r--r--phpBB/develop/benchmark.php462
-rw-r--r--phpBB/develop/calc_email_hash.php18
-rw-r--r--phpBB/develop/change_smiley_ref.php20
-rw-r--r--phpBB/develop/fill.php18
-rw-r--r--phpBB/develop/generate_utf_casefold.php14
-rw-r--r--phpBB/develop/generate_utf_confusables.php14
-rw-r--r--phpBB/develop/generate_utf_tables.php24
-rw-r--r--phpBB/develop/lang_duplicates.php10
-rw-r--r--phpBB/develop/merge_attachment_tables.php80
-rw-r--r--phpBB/develop/merge_post_tables.php209
-rw-r--r--phpBB/develop/mysql_upgrader.php5
-rw-r--r--phpBB/develop/posting-api.php6
-rwxr-xr-xphpBB/develop/repair_bots.php8
-rw-r--r--phpBB/develop/search_fill.php10
-rw-r--r--phpBB/develop/unicode_testing.php3
-rw-r--r--phpBB/develop/utf_normalizer_test.php16
-rw-r--r--phpBB/docs/coding-guidelines.html14
-rw-r--r--phpBB/docs/hook_system.html6
-rw-r--r--phpBB/download/file.php75
-rw-r--r--phpBB/faq.php8
-rw-r--r--phpBB/includes/acm/acm_apc.php15
-rw-r--r--phpBB/includes/acm/acm_eaccelerator.php15
-rw-r--r--phpBB/includes/acm/acm_file.php50
-rw-r--r--phpBB/includes/acm/acm_memcache.php13
-rw-r--r--phpBB/includes/acm/acm_xcache.php15
-rw-r--r--phpBB/includes/acp/acp_attachments.php29
-rw-r--r--phpBB/includes/acp/acp_ban.php5
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php3
-rw-r--r--phpBB/includes/acp/acp_board.php25
-rw-r--r--phpBB/includes/acp/acp_bots.php3
-rw-r--r--phpBB/includes/acp/acp_captcha.php9
-rw-r--r--phpBB/includes/acp/acp_database.php12
-rw-r--r--phpBB/includes/acp/acp_disallow.php5
-rw-r--r--phpBB/includes/acp/acp_email.php14
-rw-r--r--phpBB/includes/acp/acp_forums.php17
-rw-r--r--phpBB/includes/acp/acp_groups.php25
-rw-r--r--phpBB/includes/acp/acp_icons.php23
-rwxr-xr-xphpBB/includes/acp/acp_inactive.php11
-rw-r--r--phpBB/includes/acp/acp_jabber.php5
-rw-r--r--phpBB/includes/acp/acp_language.php123
-rw-r--r--phpBB/includes/acp/acp_logs.php3
-rw-r--r--phpBB/includes/acp/acp_main.php21
-rw-r--r--phpBB/includes/acp/acp_modules.php13
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php7
-rw-r--r--phpBB/includes/acp/acp_permissions.php11
-rw-r--r--phpBB/includes/acp/acp_php_info.php3
-rw-r--r--phpBB/includes/acp/acp_profile.php7
-rw-r--r--phpBB/includes/acp/acp_prune.php16
-rw-r--r--phpBB/includes/acp/acp_ranks.php11
-rw-r--r--phpBB/includes/acp/acp_reasons.php3
-rw-r--r--phpBB/includes/acp/acp_search.php30
-rw-r--r--phpBB/includes/acp/acp_styles.php147
-rw-r--r--phpBB/includes/acp/acp_update.php3
-rw-r--r--phpBB/includes/acp/acp_users.php55
-rw-r--r--phpBB/includes/acp/acp_words.php3
-rw-r--r--phpBB/includes/acp/auth.php18
-rw-r--r--phpBB/includes/auth.php6
-rw-r--r--phpBB/includes/auth/auth_apache.php4
-rw-r--r--phpBB/includes/auth/auth_db.php3
-rw-r--r--phpBB/includes/bbcode.php4
-rw-r--r--phpBB/includes/cache.php14
-rw-r--r--phpBB/includes/db/db2.php2
-rw-r--r--phpBB/includes/db/dbal.php4
-rw-r--r--phpBB/includes/db/firebird.php2
-rw-r--r--phpBB/includes/db/mssql.php2
-rw-r--r--phpBB/includes/db/mssql_2005.php2
-rw-r--r--phpBB/includes/db/mssql_odbc.php2
-rw-r--r--phpBB/includes/db/mysql.php2
-rw-r--r--phpBB/includes/db/mysqli.php2
-rw-r--r--phpBB/includes/db/oracle.php2
-rw-r--r--phpBB/includes/db/postgres.php2
-rw-r--r--phpBB/includes/db/sqlite.php2
-rw-r--r--phpBB/includes/functions.php172
-rw-r--r--phpBB/includes/functions_admin.php28
-rw-r--r--phpBB/includes/functions_compress.php24
-rw-r--r--phpBB/includes/functions_content.php31
-rw-r--r--phpBB/includes/functions_convert.php58
-rw-r--r--phpBB/includes/functions_display.php67
-rw-r--r--phpBB/includes/functions_install.php4
-rw-r--r--phpBB/includes/functions_messenger.php140
-rw-r--r--phpBB/includes/functions_module.php25
-rw-r--r--phpBB/includes/functions_posting.php67
-rw-r--r--phpBB/includes/functions_privmsgs.php34
-rw-r--r--phpBB/includes/functions_profile_fields.php4
-rw-r--r--phpBB/includes/functions_template.php4
-rw-r--r--phpBB/includes/functions_transfer.php36
-rw-r--r--phpBB/includes/functions_upload.php8
-rw-r--r--phpBB/includes/functions_user.php68
-rw-r--r--phpBB/includes/mcp/mcp_ban.php7
-rw-r--r--phpBB/includes/mcp/mcp_forum.php29
-rw-r--r--phpBB/includes/mcp/mcp_front.php31
-rwxr-xr-xphpBB/includes/mcp/mcp_logs.php3
-rw-r--r--phpBB/includes/mcp/mcp_main.php49
-rwxr-xr-xphpBB/includes/mcp/mcp_notes.php12
-rw-r--r--phpBB/includes/mcp/mcp_post.php52
-rw-r--r--phpBB/includes/mcp/mcp_queue.php52
-rwxr-xr-xphpBB/includes/mcp/mcp_reports.php43
-rw-r--r--phpBB/includes/mcp/mcp_topic.php49
-rwxr-xr-xphpBB/includes/mcp/mcp_warn.php55
-rw-r--r--phpBB/includes/message_parser.php16
-rw-r--r--phpBB/includes/search/fulltext_mysql.php2
-rwxr-xr-xphpBB/includes/search/fulltext_native.php11
-rwxr-xr-xphpBB/includes/search/search.php12
-rw-r--r--phpBB/includes/session.php69
-rw-r--r--phpBB/includes/template.php24
-rw-r--r--phpBB/includes/ucp/ucp_activate.php11
-rw-r--r--phpBB/includes/ucp/ucp_attachments.php10
-rw-r--r--phpBB/includes/ucp/ucp_confirm.php6
-rw-r--r--phpBB/includes/ucp/ucp_groups.php27
-rw-r--r--phpBB/includes/ucp/ucp_main.php48
-rw-r--r--phpBB/includes/ucp/ucp_pm.php20
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php45
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php12
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewfolder.php21
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php26
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php2
-rw-r--r--phpBB/includes/ucp/ucp_profile.php30
-rw-r--r--phpBB/includes/ucp/ucp_register.php30
-rw-r--r--phpBB/includes/ucp/ucp_remind.php15
-rw-r--r--phpBB/includes/ucp/ucp_resend.php21
-rw-r--r--phpBB/includes/ucp/ucp_zebra.php8
-rw-r--r--phpBB/includes/utf/utf_normalizer.php33
-rw-r--r--phpBB/includes/utf/utf_tools.php20
-rw-r--r--phpBB/index.php16
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php2
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php12
-rw-r--r--phpBB/install/database_update.php443
-rwxr-xr-xphpBB/install/index.php72
-rw-r--r--phpBB/install/install_convert.php90
-rwxr-xr-xphpBB/install/install_install.php112
-rwxr-xr-xphpBB/install/install_main.php2
-rw-r--r--phpBB/install/install_update.php119
-rw-r--r--phpBB/mcp.php22
-rw-r--r--phpBB/memberlist.php86
-rw-r--r--phpBB/posting.php57
-rw-r--r--phpBB/report.php12
-rw-r--r--phpBB/search.php36
-rw-r--r--phpBB/style.php383
-rwxr-xr-xphpBB/ucp.php48
-rw-r--r--phpBB/viewforum.php38
-rw-r--r--phpBB/viewonline.php56
-rw-r--r--phpBB/viewtopic.php90
154 files changed, 1999 insertions, 3439 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index 358e5a4bf2..50f1cc715f 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -15,11 +15,11 @@ define('ADMIN_START', true);
define('NEED_SID', true);
// Include files
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-require($phpbb_root_path . 'common.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/functions_module.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -42,7 +42,7 @@ if (!$auth->acl_get('a_'))
// We define the admin variables now, because the user is now able to use the admin related features...
define('IN_ADMIN', true);
-$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './';
+if (!defined('PHPBB_ADMIN_PATH')) define('PHPBB_ADMIN_PATH', './');
// Some oft used variables
$safe_mode = (@ini_get('safe_mode') == '1' || @strtolower(ini_get('safe_mode')) === 'on') ? true : false;
@@ -51,8 +51,8 @@ $module_id = request_var('i', '');
$mode = request_var('mode', '');
// Set custom template for admin area
-$template->set_custom_template($phpbb_admin_path . 'style', 'admin');
-$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
+$template->set_custom_template(PHPBB_ADMIN_PATH . 'style', 'admin');
+$template->assign_var('T_TEMPLATE_PATH', PHPBB_ADMIN_PATH . 'style');
// the acp template is never stored in the database
$user->theme['template_storedb'] = false;
@@ -68,7 +68,7 @@ $module->set_active($module_id, $mode);
// Assign data to the template engine for the list of modules
// We do this before loading the active module for correct menu display in trigger_error
-$module->assign_tpl_vars(append_sid("{$phpbb_admin_path}index.$phpEx"));
+$module->assign_tpl_vars(append_sid('index'));
// Load and execute the relevant module
$module->load_active();
@@ -88,7 +88,7 @@ adm_page_footer();
function adm_page_header($page_title)
{
global $config, $db, $user, $template;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
+ global $SID, $_SID;
if (defined('HEADER_INC'))
{
@@ -113,30 +113,30 @@ function adm_page_header($page_title)
'SID' => $SID,
'_SID' => $_SID,
'SESSION_ID' => $user->session_id,
- 'ROOT_PATH' => $phpbb_admin_path,
-
- 'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'),
- 'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"),
- 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
-
- 'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
- 'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
- 'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/",
- 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
- 'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
- 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
- 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
-
- 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
- 'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
- 'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
- 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
- 'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
- 'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
- 'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
- 'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
- 'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
- 'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
+ 'ROOT_PATH' => PHPBB_ADMIN_PATH,
+
+ 'U_LOGOUT' => append_sid('ucp', 'mode=logout'),
+ 'U_ADM_INDEX' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT),
+ 'U_INDEX' => append_sid('index'),
+
+ 'T_IMAGES_PATH' => PHPBB_ROOT_PATH . 'images/',
+ 'T_SMILIES_PATH' => PHPBB_ROOT_PATH . $config['smilies_path'] . '/',
+ 'T_AVATAR_PATH' => PHPBB_ROOT_PATH . $config['avatar_path'] . '/',
+ 'T_AVATAR_GALLERY_PATH' => PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/',
+ 'T_ICONS_PATH' => PHPBB_ROOT_PATH . $config['icons_path'] . '/',
+ 'T_RANKS_PATH' => PHPBB_ROOT_PATH . $config['ranks_path'] . '/',
+ 'T_UPLOAD_PATH' => PHPBB_ROOT_PATH . $config['upload_path'] . '/',
+
+ 'ICON_MOVE_UP' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
+ 'ICON_MOVE_UP_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
+ 'ICON_MOVE_DOWN' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
+ 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
+ 'ICON_EDIT' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
+ 'ICON_EDIT_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
+ 'ICON_DELETE' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
+ 'ICON_DELETE_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
+ 'ICON_SYNC' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
+ 'ICON_SYNC_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
'S_USER_LANG' => $user->lang['USER_LANG'],
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
@@ -161,7 +161,7 @@ function adm_page_header($page_title)
function adm_page_footer($copyright_html = true)
{
global $db, $config, $template, $user, $auth, $cache;
- global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $starttime;
// Output page creation time
if (defined('DEBUG'))
@@ -372,7 +372,8 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
*/
function validate_config_vars($config_vars, &$cfg_array, &$error)
{
- global $phpbb_root_path, $user;
+ global $user;
+
$type = 0;
$min = 1;
$max = 2;
@@ -465,13 +466,13 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
$cfg_array[$config_name] = basename($cfg_array[$config_name]);
- if (!file_exists($phpbb_root_path . 'language/' . $cfg_array[$config_name] . '/'))
+ if (!file_exists(PHPBB_ROOT_PATH . 'language/' . $cfg_array[$config_name] . '/'))
{
$error[] = $user->lang['WRONG_DATA_LANG'];
}
break;
- // Relative path (appended $phpbb_root_path)
+ // Relative path (appended PHPBB_ROOT_PATH)
case 'rpath':
case 'rwpath':
if (!$cfg_array[$config_name])
@@ -513,12 +514,12 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
break;
}
- if (!file_exists($phpbb_root_path . $cfg_array[$config_name]))
+ if (!file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
{
$error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
}
- if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name]))
+ if (file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]) && !is_dir(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
{
$error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
}
@@ -526,7 +527,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
// Check if the path is writable
if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
{
- if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !@is_writable($phpbb_root_path . $cfg_array[$config_name]))
+ if (file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]) && !@is_writable(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
{
$error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
}
diff --git a/phpBB/adm/swatch.php b/phpBB/adm/swatch.php
index e372c16b9b..7ee6d7d0c0 100644
--- a/phpBB/adm/swatch.php
+++ b/phpBB/adm/swatch.php
@@ -13,9 +13,9 @@
*/
define('IN_PHPBB', true);
define('ADMIN_START', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin(false);
@@ -23,7 +23,7 @@ $auth->acl($user->data);
$user->setup();
// Set custom template for admin area
-$template->set_custom_template($phpbb_root_path . 'adm/style', 'admin');
+$template->set_custom_template(PHPBB_ROOT_PATH . CONFIG_ADM_FOLDER . '/style', 'admin');
$template->set_filenames(array(
'body' => 'colour_swatch.html')
@@ -39,7 +39,7 @@ $name = (!preg_match('/^[a-z0-9_-]+$/i', $name)) ? '' : $name;
$template->assign_vars(array(
'OPENER' => $form,
'NAME' => $name,
- 'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
+ 'T_IMAGES_PATH' => PHPBB_ROOT_PATH . 'images/',
'S_USER_LANG' => $user->lang['USER_LANG'],
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
diff --git a/phpBB/common.php b/phpBB/common.php
index 285bc3a7ad..de4d41beae 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -117,15 +117,15 @@ else
if (defined('IN_CRON'))
{
- $phpbb_root_path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
+ @define('PHPBB_ROOT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
}
-if (!file_exists($phpbb_root_path . 'config.' . $phpEx))
+if (!file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT))
{
- die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>");
+ die('<p>The config.' . PHP_EXT . ' file could not be found.</p><p><a href="' . PHPBB_ROOT_PATH . 'install/index.' . PHP_EXT . '">Click here to install phpBB</a></p>');
}
-require($phpbb_root_path . 'config.' . $phpEx);
+require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
if (!defined('PHPBB_INSTALLED'))
{
@@ -144,7 +144,7 @@ if (!defined('PHPBB_INSTALLED'))
// Replace any number of consecutive backslashes and/or slashes with a single slash
// (could happen on some proxy setups and/or Windows servers)
- $script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx;
+ $script_path = trim(dirname($script_name)) . '/install/index.' . PHP_EXT;
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
$url = (($secure) ? 'https://' : 'http://') . $server_name;
@@ -184,18 +184,18 @@ if (!empty($load_extensions))
}
// Include files
-require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
-require($phpbb_root_path . 'includes/cache.' . $phpEx);
-require($phpbb_root_path . 'includes/template.' . $phpEx);
-require($phpbb_root_path . 'includes/session.' . $phpEx);
-require($phpbb_root_path . 'includes/auth.' . $phpEx);
+require(PHPBB_ROOT_PATH . 'includes/acm/acm_' . $acm_type . '.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/cache.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/template.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/session.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/auth.' . PHP_EXT);
-require($phpbb_root_path . 'includes/functions.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
+require(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/functions_content.' . PHP_EXT);
-require($phpbb_root_path . 'includes/constants.' . $phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
-require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/utf/utf_tools.' . PHP_EXT);
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
@@ -217,12 +217,12 @@ unset($dbpasswd);
$config = cache::obtain_config();
// Add own hook handler
-require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
+require(PHPBB_ROOT_PATH . 'includes/hooks/index.' . PHP_EXT);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
foreach (cache::obtain_hooks() as $hook)
{
- @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
+ @include(PHPBB_ROOT_PATH . 'includes/hooks/' . $hook . '.' . PHP_EXT);
}
?> \ No newline at end of file
diff --git a/phpBB/cron.php b/phpBB/cron.php
index 3993a149b5..3cba9e3f5e 100644
--- a/phpBB/cron.php
+++ b/phpBB/cron.php
@@ -12,9 +12,9 @@
*/
define('IN_PHPBB', true);
define('IN_CRON', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Do not update users last page entry
$user->session_begin(false);
@@ -74,7 +74,7 @@ switch ($cron_type)
{
case 'queue':
- if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
+ if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists(PHPBB_ROOT_PATH . 'cache/queue.' . PHP_EXT))
{
break;
}
@@ -85,7 +85,7 @@ switch ($cron_type)
$use_shutdown_function = false;
}
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$queue = new queue();
if ($use_shutdown_function)
@@ -122,12 +122,12 @@ switch ($cron_type)
// Select the search method
$search_type = basename($config['search_type']);
- if (time() - $config['search_gc'] <= $config['search_last_gc'] || !file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (time() - $config['search_gc'] <= $config['search_last_gc'] || !file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
{
break;
}
- include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+ include_once(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT);
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;
@@ -156,7 +156,7 @@ switch ($cron_type)
break;
}
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
if ($use_shutdown_function)
{
@@ -176,7 +176,7 @@ switch ($cron_type)
break;
}
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
if ($use_shutdown_function)
{
@@ -226,7 +226,7 @@ switch ($cron_type)
// Do the forum Prune thang
if ($row['prune_next'] < time() && $row['enable_prune'])
{
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
if ($row['prune_days'])
{
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php
index 956b830465..40ece4000d 100644
--- a/phpBB/develop/add_permissions.php
+++ b/phpBB/develop/add_permissions.php
@@ -20,34 +20,10 @@
//
die("Please read the first lines of this script for instructions on how to enable it");
-
-// This script adds missing permissions
-$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
-
define('IN_PHPBB', 1);
-define('ANONYMOUS', 1);
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-$phpbb_root_path='./../';
-include($phpbb_root_path . 'config.'.$phpEx);
-require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
-include($phpbb_root_path . 'includes/functions.'.$phpEx);
-
-define('ACL_NEVER', 0);
-define('ACL_YES', 1);
-define('ACL_NO', -1);
-
-define('ACL_GROUPS_TABLE', $table_prefix.'acl_groups');
-define('ACL_OPTIONS_TABLE', $table_prefix.'acl_options');
-define('ACL_USERS_TABLE', $table_prefix.'acl_users');
-define('GROUPS_TABLE', $table_prefix.'groups');
-define('USERS_TABLE', $table_prefix.'users');
-
-$cache = new acm();
-$db = new sql_db();
-
-// Connect to DB
-$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
+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(
@@ -414,4 +390,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
}
+garbage_collection();
+exit_handler();
+
?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_avatars.php b/phpBB/develop/adjust_avatars.php
index 81599e694b..976f7dfb7e 100755
--- a/phpBB/develop/adjust_avatars.php
+++ b/phpBB/develop/adjust_avatars.php
@@ -9,9 +9,9 @@ die("Please read the first lines of this script for instructions on how to enabl
set_time_limit(0);
define('IN_PHPBB', true);
-$phpbb_root_path = './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.'.$phpEx);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -130,9 +130,9 @@ $db->sql_close();
function adjust_avatar($old_name, $midfix)
{
- global $config, $phpbb_root_path;
+ global $config;
- $avatar_path = $phpbb_root_path . $config['avatar_path'];
+ $avatar_path = PHPBB_ROOT_PATH . $config['avatar_path'];
$extension = strtolower(substr(strrchr($old_name, '.'), 1));
$new_name = $config['avatar_salt'] . '_' . $midfix . '.' . $extension;
diff --git a/phpBB/develop/adjust_bbcodes.php b/phpBB/develop/adjust_bbcodes.php
index f06f0112ab..27af105f28 100644
--- a/phpBB/develop/adjust_bbcodes.php
+++ b/phpBB/develop/adjust_bbcodes.php
@@ -11,10 +11,10 @@ die("Please read the first lines of this script for instructions on how to enabl
set_time_limit(0);
define('IN_PHPBB', true);
-$phpbb_root_path = './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.'.$phpEx);
-include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+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();
diff --git a/phpBB/develop/adjust_magic_urls.php b/phpBB/develop/adjust_magic_urls.php
index 1430a47a12..94a32283e0 100644
--- a/phpBB/develop/adjust_magic_urls.php
+++ b/phpBB/develop/adjust_magic_urls.php
@@ -10,9 +10,9 @@ die("Please read the first lines of this script for instructions on how to enabl
set_time_limit(0);
define('IN_PHPBB', true);
-$phpbb_root_path = './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.'.$phpEx);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
diff --git a/phpBB/develop/adjust_sizes.php b/phpBB/develop/adjust_sizes.php
index 7d72813056..5b4678c621 100644
--- a/phpBB/develop/adjust_sizes.php
+++ b/phpBB/develop/adjust_sizes.php
@@ -13,9 +13,9 @@ set_time_limit(0);
@ini_set('memory_limit', '128M');
define('IN_PHPBB', true);
-$phpbb_root_path = './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.'.$phpEx);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
diff --git a/phpBB/develop/adjust_smilies.php b/phpBB/develop/adjust_smilies.php
index 774c8834f6..bc8ac7be95 100644
--- a/phpBB/develop/adjust_smilies.php
+++ b/phpBB/develop/adjust_smilies.php
@@ -7,9 +7,9 @@ die("Please read the first lines of this script for instructions on how to enabl
set_time_limit(0);
define('IN_PHPBB', true);
-$phpbb_root_path = './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.'.$phpEx);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
diff --git a/phpBB/develop/adjust_uids.php b/phpBB/develop/adjust_uids.php
index d301f3cadb..999d9a076a 100755
--- a/phpBB/develop/adjust_uids.php
+++ b/phpBB/develop/adjust_uids.php
@@ -12,9 +12,9 @@ set_time_limit(0);
@ini_set('memory_limit', '512M');
define('IN_PHPBB', true);
-$phpbb_root_path = './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.'.$phpEx);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
diff --git a/phpBB/develop/adjust_usernames.php b/phpBB/develop/adjust_usernames.php
index 1afa77af16..4bae774634 100644
--- a/phpBB/develop/adjust_usernames.php
+++ b/phpBB/develop/adjust_usernames.php
@@ -9,9 +9,9 @@ die("Please read the first lines of this script for instructions on how to enabl
set_time_limit(0);
define('IN_PHPBB', true);
-$phpbb_root_path = './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.'.$phpEx);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php
deleted file mode 100644
index 5bbe6f53be..0000000000
--- a/phpBB/develop/benchmark.php
+++ /dev/null
@@ -1,462 +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);
-include($phpbb_root_path . 'includes/post.'.$phpEx);
-include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
-
-srand ((double) microtime() * 1000000);
-set_time_limit(240*60);
-
-// Here's the text we stick in posts..
-$bigass_text = '
-phpBB BBCode test suite v0.0.2
-auto-linkification:
-http://something.com
-www.something.com
-nate@phpbb.com
-http://something.com/foo.php?this=that&theother=some%20encoded%20string is a link.
-[code]
-Simple code block with some <html> <tags>.
-[/code]
-[b]bolded[/b], [i]italic[/i]
-[email]james@totalgeek.org[/email]
-[url=http://www.totalgeek.org]totalgeek.org[/url]
-[url]www.totalgeek.org[/url]
-[list]
-[*] This is the first bulleted item.
-[*] This is the second bulleted item.
-[/list]
-[list=A]
-[*] This is the first bulleted item.
-[*] This is the second bulleted item.
-[/list]
-[quote]
-And a quote!
-[/quote]
-';
-
-
-// The script expects the ID's in the tables to sequential (1,2,3,4,5),
-// so no holes please (1,4,5,8)...
-$nr_of_users = nrof(USERS_TABLE);
-$nr_of_cats = nrof(CATEGORIES_TABLE);
-$nr_of_forums = nrof(FORUMS_TABLE);
-$nr_of_posts = nrof(POSTS_TABLE);
-
-$u = $users;
-
-$starttime = microtime();
-
-$usercreationcount = 0;
-while($users > 0)
-{
-
- $name = "testuser_" . substr(md5(uniqid(rand())), 0, 10);
- if (make_user($name))
- {
- $usercreationcount++;
- $users--;
- }
- if (($usercreationcount % 500) == 0)
- {
- echo "status: $usercreationcount <br>\n";
- flush();
- }
-
-}
-
-if ($posts > 0)
-{
- filldb($posts);
-}
-
-$endtime = microtime();
-
-if ($submit="" || !isset($submit))
-{
- ?>
-Hello, welcome to this little phpBB Benchmarking script :)<p>
-
-At the moment there are:<br>
-
-<table>
-<tr><td align="right"><?php echo $nr_of_users?></td><td>Users</td></tr>
-<tr><td align="right"><?php echo $nr_of_forums?></td><td>Forums</td></tr>
-<tr><td align="right"><?php echo $nr_of_posts?></td><td>Posts</td></tr>
-</table>
-<p>
-What do you want to create?<p>
-
-<form method="get" action="<?php echo $PHP_SELF?>">
-<input type="text" name="users" size="3"> Users<br>
-<input type="text" name="posts" size="3"> Posts/topics (optional: post size in <input type="text" name="size" size="3"> bytes)<br>
-<input type="submit" name="submit">
-</form>
-
- <?php
-}
-else
-{
-
- list ($starttime_msec,$starttime_sec) = explode(" ",$starttime);
- list ($endtime_msec,$endtime_sec) = explode(" ",$endtime);
- $timetaken_sec = ($endtime_sec+$endtime_msec) - ($starttime_sec+$starttime_msec);
- print "<B>TIME TAKEN : ".$timetaken_sec."s</B><BR>\n";
-
- print "<p>\n<a href=\"$PHP_SELF\">Back to the overview page</a>\n";
-}
-
-
-function filldb($newposts)
-{
- global $nr_of_forums;
- global $nr_of_users;
-
- $forum_topic_counts = array();
-
- for ($i = 1; $i <= $nr_of_forums; $i++)
- {
- $forum_topic_counts[$i] = get_topic_count($i);
- }
-
- for($i = 0; $i < $newposts; $i++)
- {
- $userid = rand(2, $nr_of_users - 1);
- $forum = rand(1,$nr_of_forums);
-
- if ((rand(0,30) < 1) || ($forum_topic_count[$forum] == 0))
- {
- // create a new topic 1 in 30 times (or when there are none);
- $topic = make_topic($userid, "Testing topic $i", $forum);
- $forum_topic_count[$forum]++;
- }
- else
- {
- // Otherwise create a reply(posting) somewhere.
- $topic = get_smallest_topic($forum);
- create_posting($userid, $topic, $forum, "reply");
- }
-
- if (($i % 1000) == 0)
- {
- echo "status: $i <br>";
- flush();
- }
-
- }
-}
-
-
-function get_smallest_topic($forum_id)
-{
- global $db;
-
- $sql = "SELECT topic_id
- FROM " . TOPICS_TABLE . "
- WHERE (forum_id = $forum_id)
- ORDER BY topic_replies ASC LIMIT 1";
- if($result = $db->sql_query($sql))
- {
- $row = $db->sql_fetchrow($result);
- $topic_id = $row['topic_id'];
-
- unset($result);
- unset($row);
- return $topic_id;
- }
- else
- {
- message_die(GENERAL_ERROR, "Couldn't get smallest topic.", "", __LINE__, __FILE__, $sql);
- }
-
-}
-
-
-function get_topic_count($forum_id)
-{
- global $db;
-
- $sql = "SELECT forum_topics
- FROM " . FORUMS_TABLE . "
- WHERE (forum_id = $forum_id)";
- if($result = $db->sql_query($sql))
- {
- $row = $db->sql_fetchrow($result);
- $topic_count = $row['forum_topics'];
-
- unset($result);
- unset($row);
- return $topic_count;
- }
- else
- {
- message_die(GENERAL_ERROR, "Couldn't get topic count.", "", __LINE__, __FILE__, $sql);
- }
-
-}
-
-
-function make_topic($user_id, $subject, $forum_id)
-{
- global $db;
- $topic_type = POST_NORMAL;
- $topic_vote = 0;
- $current_time = time();
-
- $sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote)
- VALUES ('$subject', $user_id, $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)";
-
- if( $result = $db->sql_query($sql, BEGIN_TRANSACTION) )
- {
- $new_topic_id = $db->sql_nextid();
- }
- else
- {
- message_die(GENERAL_ERROR, "Error inserting data into topics table", "", __LINE__, __FILE__, $sql);
- }
-
- create_posting($user_id, $new_topic_id, $forum_id);
-
- return $new_topic_id;
-}
-
-
-
-function create_posting($userid, $topic_id, $forum, $mode='newtopic')
-{
- $message = generatepost();
-
- return make_post($topic_id, $forum, $userid, "", $message, $mode);
-
-}
-
-
-
-function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $mode='newtopic')
-{
- global $db;
- $current_time = time();
- $user_ip = "ac100202";
- $bbcode_on = 1;
- $html_on = 1;
- $smilies_on = 1;
- $attach_sig = 1;
- $bbcode_uid = make_bbcode_uid();
-
- $post_subject = 'random subject';
-
- $post_message = prepare_message($text, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
-
- $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, attach_id, icon_id, post_username, post_time, poster_ip, post_approved, bbcode_uid, enable_bbcode, enable_html, enable_smilies, enable_sig, post_subject, post_text)
- VALUES ($new_topic_id, $forum_id, $user_id, 0, 0, '$post_username', $current_time, '$user_ip', 1, '$bbcode_uid', $bbcode_on, $html_on, $smilies_on, $attach_sig, '$post_subject', '$post_message')";
- $result = $db->sql_query($sql);
-
- if ($result)
- {
- $new_post_id = $db->sql_nextid();
-
- $sql = "UPDATE " . TOPICS_TABLE . "
- SET topic_last_post_id = $new_post_id";
- if($mode == "reply")
- {
- $sql .= ", topic_replies = topic_replies + 1 ";
- }
- $sql .= " WHERE topic_id = $new_topic_id";
-
- if($db->sql_query($sql))
- {
- $sql = "UPDATE " . FORUMS_TABLE . "
- SET forum_last_post_id = $new_post_id, forum_posts = forum_posts + 1";
- if($mode == "newtopic")
- {
- $sql .= ", forum_topics = forum_topics + 1";
- }
- $sql .= " WHERE forum_id = $forum_id";
-
- if($db->sql_query($sql))
- {
- $sql = "UPDATE " . USERS_TABLE . "
- SET user_posts = user_posts + 1
- WHERE user_id = " . $user_id;
-
- if($db->sql_query($sql, END_TRANSACTION))
- {
- // SUCCESS.
- return true;
- }
- else
- {
- message_die(GENERAL_ERROR, "Error updating users table", "", __LINE__, __FILE__, $sql);
- }
- }
- else
- {
- message_die(GENERAL_ERROR, "Error updating forums table", "", __LINE__, __FILE__, $sql);
- }
- }
- else
- {
- // Rollback
- if($db->sql_layer == "mysql")
- {
- $sql = "DELETE FROM " . POSTS_TABLE . "
- WHERE post_id = $new_post_id";
- $db->sql_query($sql);
- }
- message_die(GENERAL_ERROR, "Error updating topics table", "", __LINE__, __FILE__, $sql);
- }
- }
- else
- {
- message_die(GENERAL_ERROR, "Error inserting data into posts table", "", __LINE__, __FILE__, $sql);
- }
-}
-
-
-function generatepost($size=850)
-{
- global $bigass_text;
- // Returns a string with a length between $size and $size*0.2
- $size = rand(0.2*$size, $size);
-
- $textsize = strlen($bigass_text);
- $currentsize = 0;
- // Add whole $text multiple times
- while($currentsize < $size && $size-$currentsize <= $textsize)
- {
- $message .= $bigass_text;
- $currentsize += $textsize;
- }
- // Add the remainder number of chars and return it.
- $message .= substr($bigass_text, 0, $size-$currentsize);
-
- return (addslashes($message));
-}
-
-
-function nrof($table)
-{
- global $db;
- $sql = "SELECT count(*) AS counted FROM $table";
- $result = $db->sql_query($sql);
- $topics = $db->sql_fetchrow($result);
- return $topics[counted];
-}
-
-
-function make_user($username)
-{
- global $db, $board_config;
-
- $password = md5("benchpass");
- $email = "nobody@localhost";
- $icq = "12345678";
- $website = "http://www.phpbb.com";
- $occupation = "phpBB tester";
- $location = "phpBB world hq";
- $interests = "Eating, sleeping, living, and breathing phpBB";
- $signature = "$username: phpBB tester.";
- $signature_bbcode_uid = "";
- $avatar_filename = "";
- $viewemail = 0;
- $aim = 0;
- $yim = 0;
- $msn = 0;
- $attachsig = 1;
- $allowsmilies = 1;
- $allowhtml = 1;
- $allowbbcode = 1;
- $allowviewonline = 1;
- $notifyreply = 0;
- $notifypm = 0;
- $user_timezone = $board_config['board_timezone'];
- $user_dateformat = $board_config['default_dateformat'];
- $user_lang = $board_config['default_lang'];
- $user_style = $board_config['default_style'];
-
-
- $sql = "SELECT MAX(user_id) AS total
- FROM " . USERS_TABLE;
- if($result = $db->sql_query($sql))
- {
- $row = $db->sql_fetchrow($result);
- $new_user_id = $row['total'] + 1;
-
- unset($result);
- unset($row);
- }
- else
- {
- message_die(GENERAL_ERROR, "Couldn't obtained next user_id information.", "", __LINE__, __FILE__, $sql);
- }
-
- $sql = "SELECT MAX(group_id) AS total
- FROM " . GROUPS_TABLE;
- if($result = $db->sql_query($sql))
- {
- $row = $db->sql_fetchrow($result);
- $new_group_id = $row['total'] + 1;
-
- unset($result);
- unset($row);
- }
- else
- {
- message_die(GENERAL_ERROR, "Couldn't obtained next user_id information.", "", __LINE__, __FILE__, $sql);
- }
-
-
- $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
- VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$icq', '$website', '$occupation', '$location', '$interests', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, ";
-
-
- $sql .= "1, '')";
-
- if($result = $db->sql_query($sql, BEGIN_TRANSACTION))
- {
- $sql = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_name, group_description, group_single_user, group_moderator)
- VALUES ($new_group_id, '', 'Personal User', 1, 0)";
- if($result = $db->sql_query($sql))
- {
- $sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
- VALUES ($new_user_id, $new_group_id, 0)";
- if($result = $db->sql_query($sql, END_TRANSACTION))
- {
-
- // SUCCESS.
- return true;
- }
- else
- {
- message_die(GENERAL_ERROR, "Couldn't insert data into user_group table", "", __LINE__, __FILE__, $sql);
- }
- }
- else
- {
- message_die(GENERAL_ERROR, "Couldn't insert data into groups table", "", __LINE__, __FILE__, $sql);
- }
- }
- else
- {
- message_die(GENERAL_ERROR, "Couldn't insert data into users table", "", __LINE__, __FILE__, $sql);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/calc_email_hash.php b/phpBB/develop/calc_email_hash.php
index a67b0f52a3..cf2bb5c418 100644
--- a/phpBB/develop/calc_email_hash.php
+++ b/phpBB/develop/calc_email_hash.php
@@ -21,22 +21,10 @@
die("Please read the first lines of this script for instructions on how to enable it");
@set_time_limit(300);
-$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
-
define('IN_PHPBB', 1);
-define('ANONYMOUS', 1);
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-$phpbb_root_path='./../';
-include($phpbb_root_path . 'config.'.$phpEx);
-require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
-include($phpbb_root_path . 'includes/functions.'.$phpEx);
-
-$cache = new acm();
-$db = new sql_db();
-
-// Connect to DB
-$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
$start = 0;
do
diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php
index db65dd52d4..4620b9c2c4 100644
--- a/phpBB/develop/change_smiley_ref.php
+++ b/phpBB/develop/change_smiley_ref.php
@@ -30,23 +30,9 @@ die("Please read the first lines of this script for instructions on how to enabl
@set_time_limit(2400);
-// This script adds missing permissions
-$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
-
-define('IN_PHPBB', 1);
-define('ANONYMOUS', 1);
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-$phpbb_root_path='./../';
-include($phpbb_root_path . 'config.'.$phpEx);
-require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
-include($phpbb_root_path . 'includes/functions.'.$phpEx);
-
-$cache = new acm();
-$db = new $sql_db();
-
-// Connect to DB
-$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
+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);
diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php
index 336e510d06..39a9b128f5 100644
--- a/phpBB/develop/fill.php
+++ b/phpBB/develop/fill.php
@@ -21,10 +21,10 @@ die("Please read the first lines of this script for instructions on how to enabl
define('IN_PHPBB', true);
-$phpbb_root_path = './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.'.$phpEx);
-include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
+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');
@@ -117,14 +117,14 @@ switch ($mode)
if ($topic_id >= $num_topics)
{
- echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?mode=sync&amp;' . time() . '">And now for something completely different...';
+ echo '<meta http-equiv="refresh" content="10; url=fill.' . PHP_EXT . '?mode=sync&amp;' . 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.' . $phpEx . '?start=' . $topic_id . '&amp;' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')';
+ echo '<meta http-equiv="refresh" content="10; url=fill.' . PHP_EXT . '?start=' . $topic_id . '&amp;' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')';
flush();
}
break;
@@ -141,7 +141,7 @@ switch ($mode)
$e = explode(' ', microtime());
echo '<pre><b>' . ($e[0] + $e[1] - $s[0] - $s[1]) . '</b></pre>';
- echo '<a href="fill.' . $phpEx . '">Here we go again</a>';
+ echo '<a href="fill.' . PHP_EXT . '">Here we go again</a>';
}
else
{
@@ -157,11 +157,11 @@ switch ($mode)
if ($end < $num_topics)
{
$start += $batch_size;
- echo '<meta http-equiv="refresh" content="0; url=fill.' . $phpEx . "?mode=sync&amp;start=$start&amp;" . time() . "\">And now for something completely different... ($start/$num_topics)";
+ echo '<meta http-equiv="refresh" content="0; url=fill.' . PHP_EXT . "?mode=sync&amp;start=$start&amp;" . time() . "\">And now for something completely different... ($start/$num_topics)";
}
else
{
- echo '<a href="fill.' . $phpEx . '">Here we go again</a>';
+ echo '<a href="fill.' . PHP_EXT . '">Here we go again</a>';
}
}
diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php
index 89c4aec01a..bbf0a0a75d 100644
--- a/phpBB/develop/generate_utf_casefold.php
+++ b/phpBB/develop/generate_utf_casefold.php
@@ -25,8 +25,8 @@ die("Please read the first lines of this script for instructions on how to enabl
set_time_limit(0);
define('IN_PHPBB', true);
-$phpbb_root_path = '../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
echo "Checking for required files\n";
download('http://unicode.org/Public/UNIDATA/CaseFolding.txt');
@@ -71,8 +71,8 @@ foreach ($array as $value)
foreach ($uniarray as $idx => $contents)
{
- echo "Writing to case_fold_$idx.$phpEx\n";
- $fp = fopen($phpbb_root_path . 'includes/utf/data/case_fold_' . strtolower($idx) . '.' . $phpEx, 'wb');
+ echo "Writing to case_fold_$idx." . PHP_EXT . "\n";
+ $fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/case_fold_' . strtolower($idx) . '.' . PHP_EXT, 'wb');
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
fclose($fp);
}
@@ -116,9 +116,7 @@ function my_var_export($var)
*/
function download($url)
{
- global $phpbb_root_path;
-
- if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
+ if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
{
return;
}
@@ -130,7 +128,7 @@ function download($url)
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
}
- if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
+ if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
{
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
}
diff --git a/phpBB/develop/generate_utf_confusables.php b/phpBB/develop/generate_utf_confusables.php
index f79471afc6..a70fca9110 100644
--- a/phpBB/develop/generate_utf_confusables.php
+++ b/phpBB/develop/generate_utf_confusables.php
@@ -25,8 +25,8 @@ die("Please read the first lines of this script for instructions on how to enabl
set_time_limit(0);
define('IN_PHPBB', true);
-$phpbb_root_path = '../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
echo "Checking for required files\n";
download('http://unicode.org/reports/tr39/data/confusables.txt');
@@ -155,9 +155,9 @@ foreach ($array as $value)
$uniarray[utf8_chr(hexdec((string)$value[1]))] = $temp_hold;
}
-echo "Writing to confusables.$phpEx\n";
+echo "Writing to confusables." . PHP_EXT . "\n";
-$fp = fopen($phpbb_root_path . 'includes/utf/data/confusables.' . $phpEx, 'wb');
+$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/confusables.' . PHP_EXT, 'wb');
fwrite($fp, '<?php return ' . my_var_export($uniarray) . ';');
fclose($fp);
@@ -200,9 +200,7 @@ function my_var_export($var)
*/
function download($url)
{
- global $phpbb_root_path;
-
- if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
+ if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
{
return;
}
@@ -214,7 +212,7 @@ function download($url)
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
}
- if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
+ if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
{
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
}
diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php
index 3d5188163d..fcf6395b24 100644
--- a/phpBB/develop/generate_utf_tables.php
+++ b/phpBB/develop/generate_utf_tables.php
@@ -25,8 +25,8 @@ die("Please read the first lines of this script for instructions on how to enabl
set_time_limit(0);
define('IN_PHPBB', true);
-$phpbb_root_path = '../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
echo "Checking for required files\n";
download('http://www.unicode.org/Public/UNIDATA/CompositionExclusions.txt');
@@ -34,7 +34,7 @@ download('http://www.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt');
download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt');
echo "\n";
-require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
+require_once(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
$file_contents = array();
/**
@@ -172,7 +172,7 @@ fclose($fp);
* Do mappings
*/
echo "Loading Unicode decomposition mappings\n";
-$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
+$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt');
$map = array();
while (!feof($fp))
@@ -266,9 +266,9 @@ foreach ($file_contents as $file => $contents)
/**
* Generate a new file
*/
- echo "Writing to $file.$phpEx\n";
+ echo "Writing to $file." . PHP_EXT . "\n";
- if (!$fp = fopen($phpbb_root_path . 'includes/utf/data/' . $file . '.' . $phpEx, 'wb'))
+ if (!$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/' . $file . '.' . PHP_EXT, 'wb'))
{
trigger_error('Cannot open ' . $file . ' for write');
}
@@ -288,7 +288,7 @@ echo "\n*** UTF-8 normalization tables done\n\n";
*/
echo "Generating search indexer tables\n";
-$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
+$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt');
$map = array();
while ($line = fgets($fp, 1024))
@@ -406,8 +406,8 @@ unset($map);
foreach ($file_contents as $idx => $contents)
{
- echo "Writing to search_indexer_$idx.$phpEx\n";
- $fp = fopen($phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $phpEx, 'wb');
+ echo "Writing to search_indexer_$idx." . PHP_EXT . "\n";
+ $fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/search_indexer_' . $idx . '.' . PHP_EXT, 'wb');
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
fclose($fp);
}
@@ -486,9 +486,7 @@ function my_var_export($var)
*/
function download($url)
{
- global $phpbb_root_path;
-
- if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
+ if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
{
return;
}
@@ -500,7 +498,7 @@ function download($url)
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
}
- if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
+ if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
{
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
}
diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php
index 5be48f69f0..09ac34e159 100644
--- a/phpBB/develop/lang_duplicates.php
+++ b/phpBB/develop/lang_duplicates.php
@@ -24,13 +24,13 @@ die("Please read the first lines of this script for instructions on how to enabl
// Thanks to arod-1
define('IN_PHPBB', 1);
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-$phpbb_root_path='./../';
-include($phpbb_root_path . 'common.'.$phpEx);
+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');
+$modules = find_modules(PHPBB_ROOT_PATH . 'language/en');
$kkeys = $keys = array();
$langdir = dirname(__FILE__);
@@ -81,7 +81,7 @@ while ($module = array_shift($keys))
}
$color = '';
- if ((basename($module) == "common.$phpEx") || (basename($other_module) == "common.$phpEx"))
+ if ((basename($module) == "common." . PHP_EXT) || (basename($other_module) == "common." . PHP_EXT))
{
$color = ' style="color:#B00000;"';
}
diff --git a/phpBB/develop/merge_attachment_tables.php b/phpBB/develop/merge_attachment_tables.php
deleted file mode 100644
index ae7fe57be4..0000000000
--- a/phpBB/develop/merge_attachment_tables.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-// -------------------------------------------------------------
-//
-// $Id$
-//
-// FILENAME : merge_attachment_tables.php
-// STARTED : Tue Nov 04, 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");
-
-$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
-
-define('IN_PHPBB', 1);
-define('ANONYMOUS', 1);
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-$phpbb_root_path='./../';
-include($phpbb_root_path . 'config.'.$phpEx);
-require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
-include($phpbb_root_path . 'includes/functions.'.$phpEx);
-
-$cache = new acm();
-$db = new sql_db();
-
-// Connect to DB
-$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
-
-// Rename the attachments table...
-$sql = "RENAME TABLE {$table_prefix}attachments TO {$table_prefix}attach_temp";
-$db->sql_query($sql);
-
-$sql = "CREATE TABLE {$table_prefix}attachments
- SELECT d.*, a.post_id, a.user_id_from as poster_id, p.topic_id
- FROM {$table_prefix}attach_desc d, {$table_prefix}attach_temp a, {$table_prefix}posts p
- WHERE a.attach_id = d.attach_id
- AND a.post_id = p.post_id";
-$db->sql_query($sql);
-
-switch ($db->sql_layer)
-{
- case 'mysql':
- case 'mysql4':
- $sql = 'ALTER TABLE ' . $table_prefix . 'attachments
- ADD PRIMARY KEY (attach_id),
- ADD INDEX filetime (filetime),
- ADD INDEX post_id (post_id),
- ADD INDEX poster_id (poster_id),
- ADD INDEX physical_filename (physical_filename(10)),
- ADD INDEX filesize (filesize),
- ADD INDEX topic_id (topic_id),
- MODIFY COLUMN attach_id mediumint(8) UNSIGNED NOT NULL auto_increment';
- break;
-
- case 'mssql':
- case 'mssql-odbc':
- case 'msaccess':
- break;
-
- case 'postgresql':
- break;
-}
-$db->sql_query($sql);
-
-//$db->sql_query("DROP TABLE {$table_prefix}attach_temp");
-
-echo "<p><b>Done</b></p>\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php
deleted file mode 100644
index 3567a569c6..0000000000
--- a/phpBB/develop/merge_post_tables.php
+++ /dev/null
@@ -1,209 +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);
-
-$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
-
-define('IN_PHPBB', 1);
-define('ANONYMOUS', 1);
-$phpbb_root_path='./../';
-include($phpbb_root_path . 'extension.inc');
-include($phpbb_root_path . 'config.'.$phpEx);
-include($phpbb_root_path . 'includes/functions.'.$phpEx);
-require($phpbb_root_path . 'includes/acm/cache_' . $acm_type . '.'.$phpEx);
-include($phpbb_root_path . 'db/' . $dbms . '.'.$phpEx);
-
-$cache = new acm();
-$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
-
-// Just Do it (tm)
-$sql = "RENAME TABLE {$table_prefix}posts TO {$table_prefix}posts_temp";
-$db->sql_query($sql);
-
-$sql = "CREATE TABLE {$table_prefix}posts
- SELECT p.*, pt.post_subject, pt.post_text, pt.post_checksum, pt.bbcode_bitfield, pt.bbcode_uid
- FROM {$table_prefix}posts_temp p, {$table_prefix}posts_text pt
- WHERE pt.post_id = p.post_id";
-$db->sql_query($sql);
-
-switch ($db->sql_layer)
-{
- case 'mysql':
- case 'mysql4':
- $sql = 'ALTER TABLE ' . $table_prefix . 'posts
- ADD PRIMARY KEY (post_id),
- ADD INDEX topic_id (topic_id),
- ADD INDEX poster_ip (poster_ip),
- ADD INDEX post_approved (post_approved),
- MODIFY COLUMN post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- ADD COLUMN post_encoding varchar(11) DEFAULT \'iso-8859-15\' NOT NULL';
- break;
-
- case 'mssql':
- case 'mssql-odbc':
- case 'msaccess':
- break;
-
- case 'postgresql':
- break;
-}
-$db->sql_query($sql);
-
-$sql = "UPDATE {$table_prefix}topics SET topic_poster = 1 WHERE topic_poster = 0 OR topic_poster IS NULL";
-$db->sql_query($sql);
-$sql = "UPDATE {$table_prefix}topics SET topic_last_poster_id = 1 WHERE topic_last_poster_id = 0 OR topic_last_poster_id IS NULL";
-$db->sql_query($sql);
-$sql = "UPDATE {$table_prefix}posts SET poster_id = 1 WHERE poster_id = 0 OR poster_id IS NULL";
-$db->sql_query($sql);
-$sql = "UPDATE {$table_prefix}users SET user_id = 1 WHERE user_id = 0";
-$db->sql_query($sql);
-
-$sql = "SELECT t.topic_id
- FROM {$table_prefix}topics t
- LEFT JOIN {$table_prefix}posts p ON p.topic_id = t.topic_id
- WHERE p.topic_id IS NULL";
-$result = $db->sql_query($sql);
-
-if ($row = $db->sql_fetchrow($result))
-{
- $del_sql = '';
- do
- {
- $del_sql .= (($del_sql != '') ? ', ' : '') . $row['topic_id'];
- }
- while ($row = $db->sql_fetchrow($result));
-
- $sql = "DELETE FROM {$table_prefix}topics
- WHERE topic_id IN ($del_sql)";
- $db->sql_query($sql);
-}
-$db->sql_freeresult($result);
-
-$del_sql = '';
-$sql = "SELECT topic_id, MIN(post_id) AS first_post_id, MAX(post_id) AS last_post_id, COUNT(post_id) AS total_posts
- FROM {$table_prefix}posts
- GROUP BY topic_id";
-$result = $db->sql_query($sql);
-
-while ($row = $db->sql_fetchrow($result))
-{
- $del_sql .= (($del_sql != '') ? ', ' : '') . $row['topic_id'];
-
- $sql = "UPDATE {$table_prefix}topics
- SET topic_first_post_id = " . $row['first_post_id'] . ", topic_last_post_id = " . $row['last_post_id'] . ", topic_replies = " . ($row['total_posts'] - 1) . "
- WHERE topic_id = " . $row['topic_id'];
- $db->sql_query($sql);
-}
-$db->sql_freeresult($result);
-
-$sql = "DELETE FROM {$table_prefix}topics WHERE topic_id NOT IN ($del_sql)";
-$db->sql_query($sql);
-
-$topic_count = $post_count = array();
-$sql = "SELECT forum_id, COUNT(topic_id) AS topics
- FROM {$table_prefix}topics
- GROUP BY forum_id";
-$result = $db->sql_query($sql);
-
-while ($row = $db->sql_fetchrow($result))
-{
- $topic_count[$row['forum_id']] = $row['topics'];
-}
-$db->sql_freeresult($result);
-
-$sql = "SELECT forum_id, COUNT(post_id) AS posts
- FROM {$table_prefix}posts
- GROUP BY forum_id";
-$result = $db->sql_query($sql);
-
-while ($row = $db->sql_fetchrow($result))
-{
- $post_count[$row['forum_id']] = $row['posts'];
-}
-$db->sql_freeresult($result);
-
-switch ($db->sql_layer)
-{
- case 'oracle':
- $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
- FROM " . $table_prefix . "forums f, " . $table_prefix . "posts p, " . $table_prefix . "users u
- WHERE p.post_id = f.forum_last_post_id(+)
- AND u.user_id = p.poster_id(+)";
- break;
-
- default:
- $sql = "SELECT f.forum_id, p.post_time, p.post_username, u.username, u.user_id
- FROM ((" . $table_prefix . "forums f
- LEFT JOIN " . $table_prefix . "posts p ON p.post_id = f.forum_last_post_id)
- LEFT JOIN " . $table_prefix . "users u ON u.user_id = p.poster_id)";
- break;
-}
-$result = $db->sql_query($sql);
-
-$sql_ary = array();
-while ($row = $db->sql_fetchrow($result))
-{
- $forum_id = $row['forum_id'];
-
- $sql_ary[] = "UPDATE " . $table_prefix . "forums
- SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
- WHERE forum_id = $forum_id";
-
- $sql = "SELECT t.topic_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
- FROM " . $table_prefix . "topics t, " . $table_prefix . "users u, " . $table_prefix . "posts p, " . $table_prefix . "posts p2, " . $table_prefix . "users u2
- WHERE t.forum_id = $forum_id
- AND u.user_id = t.topic_poster
- AND p.post_id = t.topic_first_post_id
- AND p2.post_id = t.topic_last_post_id
- AND u2.user_id = p2.poster_id";
- $result2 = $db->sql_query($sql);
-
- while ($row2 = $db->sql_fetchrow($result2))
- {
- $sql_ary[] = "UPDATE " . $table_prefix . "topics
- SET topic_poster = " . $row2['user_id'] . ", topic_first_poster_name = '" . ((!empty($row2['user_id']) && $row2['user_id'] != ANONYMOUS) ? addslashes($row2['username']) : addslashes($row2['post_username'])) . "', topic_last_poster_id = " . ((!empty($row2['id2']) && $row2['id2'] != ANONYMOUS) ? $row2['id2'] : ANONYMOUS) . ", topic_last_post_time = " . $row2['post_time'] . ", topic_last_poster_name = '" . ((!empty($row2['id2']) && $row2['id2'] != ANONYMOUS) ? addslashes($row2['user2']) : addslashes($row2['post_username2'])) . "'
- WHERE topic_id = " . $row2['topic_id'];
- }
- $db->sql_freeresult($result2);
-
- unset($row2);
-}
-$db->sql_freeresult($result);
-
-foreach ($sql_ary as $sql)
-{
- $sql . "<br />";
- $db->sql_query($sql);
-}
-
-echo "<p><b>Done</b></p>\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index ea64a1a94f..7762858b58 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -21,8 +21,9 @@
die("Please read the first lines of this script for instructions on how to enable it");
define('IN_PHPBB', true);
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
$prefix = $table_prefix;
diff --git a/phpBB/develop/posting-api.php b/phpBB/develop/posting-api.php
index a966383df9..494cb9773d 100644
--- a/phpBB/develop/posting-api.php
+++ b/phpBB/develop/posting-api.php
@@ -1,8 +1,8 @@
<?php
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
//$db = new dbal_mysqli();
diff --git a/phpBB/develop/repair_bots.php b/phpBB/develop/repair_bots.php
index 4dae1e1091..21c6652243 100755
--- a/phpBB/develop/repair_bots.php
+++ b/phpBB/develop/repair_bots.php
@@ -11,10 +11,10 @@ die("Please read the first lines of this script for instructions on how to enabl
set_time_limit(0);
define('IN_PHPBB', true);
-$phpbb_root_path = './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.'.$phpEx);
-include($phpbb_root_path . '/includes/functions_user.'.$phpEx);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
// Start session management
diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php
index 371c8c74cc..23acee6a1a 100644
--- a/phpBB/develop/search_fill.php
+++ b/phpBB/develop/search_fill.php
@@ -23,9 +23,9 @@ die("Please read the first lines of this script for instructions on how to enabl
set_time_limit(0);
define('IN_PHPBB', true);
-$phpbb_root_path = '../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.'.$phpEx);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -34,12 +34,12 @@ $user->setup();
$search_type = $config['search_type'];
-if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
-require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx);
+require(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT);
$error = false;
$search = new $search_type($error);
diff --git a/phpBB/develop/unicode_testing.php b/phpBB/develop/unicode_testing.php
index 25a13d1325..c8712ba53f 100644
--- a/phpBB/develop/unicode_testing.php
+++ b/phpBB/develop/unicode_testing.php
@@ -98,8 +98,7 @@ function utf8_normalize_nfkc($strings)
if (!class_exists('utf_normalizer'))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
}
if (!is_array($strings))
diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php
index cf381e58fa..8a7c31a1b0 100644
--- a/phpBB/develop/utf_normalizer_test.php
+++ b/phpBB/develop/utf_normalizer_test.php
@@ -26,8 +26,8 @@ set_time_limit(0);
error_reporting(E_ALL);
define('IN_PHPBB', true);
-$phpbb_root_path = '../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
+define('PHPBB_ROOT_PATH', './../');
+define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
/**
@@ -77,13 +77,13 @@ $test_suite = array(
)
);
-require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
+require_once(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
$i = $n = 0;
$failed = false;
$tested_chars = array();
-$fp = fopen($phpbb_root_path . 'develop/NormalizationTest.txt', 'rb');
+$fp = fopen(PHPBB_ROOT_PATH . 'develop/NormalizationTest.txt', 'rb');
while (!feof($fp))
{
$line = fgets($fp);
@@ -158,7 +158,7 @@ fclose($fp);
*/
echo "\n\nTesting for invariants...\n\n";
-$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
+$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt');
$n = 0;
while (!feof($fp))
@@ -227,9 +227,7 @@ die("\n\nALL TESTS PASSED SUCCESSFULLY\n");
*/
function download($url)
{
- global $phpbb_root_path;
-
- if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
+ if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
{
return;
}
@@ -241,7 +239,7 @@ function download($url)
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
}
- if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
+ if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
{
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
}
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 837ae55227..38410fd0cc 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -399,12 +399,12 @@ do_stuff($str);
<p class="bad">// Sometimes single quotes are just not right</p>
<div class="codebox"><pre>
-$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;amp;start=' . $start;
+$some_string = $board_url . 'someurl.php?mode=' . $mode . '&amp;amp;start=' . $start;
</pre></div>
<p class="good">// Double quotes are sometimes needed to not overcroud the line with concentinations</p>
<div class="codebox"><pre>
-$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;amp;start=$start";
+$some_string = "{$board_url}someurl.php?mode=$mode&amp;amp;start=$start";
</pre></div>
<p>In SQL Statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL Formatting), else it should be tryed to only use one method - mostly single quotes.</p>
@@ -925,12 +925,18 @@ trigger_error('NO_MODE', E_USER_ERROR);
<h4>Url formatting</h4>
- <p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p>
+ <p>All urls pointing to internal files need to be prepended by the <code>PHPBB_ROOT_PATH</code> constant. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>PHPBB_ADMIN_PATH</code> constant. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p>
<p>The <code>append_sid()</code> function from 2.0.x is available too, though does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
<div class="codebox"><pre>
-append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;g=' . $row['group_id'])
+append_sid(PHPBB_ROOT_PATH . 'memberlist.' . PHP_EXT, 'mode=group&amp;amp;g=' . $row['group_id'])
+ </pre></div>
+
+ <p>For shorter writing internal urls are allowed to be written in short notation, not providing the root path and the extension. The append_sid() function will prepend the root path and append the extension automatically (and before calling the hook).</p>
+
+ <div class="codebox"><pre>
+append_sid('memberlist', 'mode=group&amp;amp;g=' . $row['group_id'])
</pre></div>
<h4>General function usage: </h4>
diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html
index 565e0096fc..78e3014adb 100644
--- a/phpBB/docs/hook_system.html
+++ b/phpBB/docs/hook_system.html
@@ -383,10 +383,10 @@ a:active { color: #368AD2; }
<p>There are also valid external constants you may want to use if you embed phpBB3 into your application:</p>
<div class="codebox"><pre>
-PHPBB_MSG_HANDLER (overwrite message handler)
+PHPBB_MSG_HANDLER (define own message handler)
PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect)
-PHPBB_ROOT_PATH (overwrite $phpbb_root_path)
-PHPBB_ADMIN_PATH (overwrite $phpbb_admin_path)
+PHPBB_ROOT_PATH (define own PHPBB_ROOT_PATH)
+PHPBB_ADMIN_PATH (define own PHPBB_ADMIN_PATH)
</pre></div>
</div>
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index f40f3cf09d..2fb42033cd 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -12,33 +12,12 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
if (isset($_GET['avatar']))
{
- require($phpbb_root_path . 'config.' . $phpEx);
-
- if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
- {
- exit;
- }
-
- require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
- require($phpbb_root_path . 'includes/cache.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- require($phpbb_root_path . 'includes/constants.' . $phpEx);
-
- $db = new $sql_db();
- $cache = new acm();
-
- // Connect to DB
- if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
- {
- exit;
- }
- unset($dbpasswd);
-
// worst-case default
$browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0';
@@ -92,43 +71,21 @@ if (isset($_GET['avatar']))
}
}
- if (!in_array($ext, array('png', 'gif', 'jpg', 'jpeg')))
+ if (!in_array($ext, array('png', 'gif', 'jpg', 'jpeg')) || !$filename)
{
// no way such an avatar could exist. They are not following the rules, stop the show.
- header("HTTP/1.0 403 forbidden");
- if (!empty($cache))
- {
- $cache->unload();
- }
- $db->sql_close();
- exit;
- }
-
- if (!$filename)
- {
- // no way such an avatar could exist. They are not following the rules, stop the show.
- header("HTTP/1.0 403 forbidden");
- if (!empty($cache))
- {
- $cache->unload();
- }
- $db->sql_close();
- exit;
+ header("HTTP/1.0 403 Forbidden");
+ garbage_collection();
+ exit_handler();
}
send_avatar_to_browser(($avatar_group ? 'g' : '') . $filename . '.' . $ext, $browser);
- if (!empty($cache))
- {
- $cache->unload();
- }
- $db->sql_close();
- exit;
+ garbage_collection();
+ exit_handler();
}
// implicit else: we are not in avatar mode
-include($phpbb_root_path . 'common.' . $phpEx);
-
$download_id = request_var('id', 0);
$mode = request_var('mode', '');
$thumbnail = request_var('t', false);
@@ -299,7 +256,7 @@ else if (($display_cat == ATTACHMENT_CATEGORY_NONE || $display_cat == ATTACHMENT
if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && strpos(strtolower($user->browser), 'msie') !== false)
{
- wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
+ wrap_img_in_html(append_sid('download/file', 'id=' . $attachment['attach_id']), $attachment['real_filename']);
}
else
{
@@ -307,12 +264,12 @@ else
if ($download_mode == PHYSICAL_LINK)
{
// This presenting method should no longer be used
- if (!@is_dir($phpbb_root_path . $config['upload_path']))
+ if (!@is_dir(PHPBB_ROOT_PATH . $config['upload_path']))
{
trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']);
}
- redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']);
+ redirect(PHPBB_ROOT_PATH . $config['upload_path'] . '/' . $attachment['physical_filename']);
exit;
}
else
@@ -329,7 +286,7 @@ else
*/
function send_avatar_to_browser($file, $browser)
{
- global $config, $phpbb_root_path;
+ global $config;
$prefix = $config['avatar_salt'] . '_';
$image_dir = $config['avatar_path'];
@@ -345,7 +302,7 @@ function send_avatar_to_browser($file, $browser)
{
$image_dir = '';
}
- $file_path = $phpbb_root_path . $image_dir . '/' . $prefix . $file;
+ $file_path = PHPBB_ROOT_PATH . $image_dir . '/' . $prefix . $file;
if ((@file_exists($file_path) && @is_readable($file_path)) && !headers_sent())
{
@@ -427,9 +384,9 @@ function wrap_img_in_html($src, $title)
*/
function send_file_to_browser($attachment, $upload_dir, $category)
{
- global $user, $db, $config, $phpbb_root_path;
+ global $user, $db, $config;
- $filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];
+ $filename = PHPBB_ROOT_PATH . $upload_dir . '/' . $attachment['physical_filename'];
if (!@file_exists($filename))
{
diff --git a/phpBB/faq.php b/phpBB/faq.php
index da064e4452..f8d1f1d459 100644
--- a/phpBB/faq.php
+++ b/phpBB/faq.php
@@ -12,9 +12,9 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -67,7 +67,7 @@ page_header($l_title);
$template->set_filenames(array(
'body' => 'faq_body.html')
);
-make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
+make_jumpbox(append_sid('viewforum'));
page_footer();
diff --git a/phpBB/includes/acm/acm_apc.php b/phpBB/includes/acm/acm_apc.php
index 15f3705d9e..e4c4b79de3 100644
--- a/phpBB/includes/acm/acm_apc.php
+++ b/phpBB/includes/acm/acm_apc.php
@@ -33,8 +33,7 @@ class acm
*/
function __construct()
{
- global $phpbb_root_path;
- $this->cache_dir = $phpbb_root_path . 'cache/';
+ $this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
}
/**
@@ -42,8 +41,6 @@ class acm
*/
private function load()
{
- global $phpEx;
-
// grab the global cache
if ($this->vars = apc_fetch('global'))
{
@@ -86,8 +83,6 @@ class acm
*/
public function tidy()
{
- global $phpEx;
-
// cache has auto GC, no need to have any code here :)
set_config('cache_last_gc', time(), true);
@@ -100,8 +95,6 @@ class acm
{
if ($var_name[0] === '_')
{
- global $phpEx;
-
return apc_fetch($var_name);
}
else
@@ -171,8 +164,6 @@ class acm
*/
public function destroy($var_name, $table = '')
{
- global $phpEx;
-
if ($var_name === 'sql' && !empty($table))
{
if (!is_array($table))
@@ -221,8 +212,6 @@ class acm
*/
public function sql_load($query)
{
- global $phpEx;
-
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
$query_id = sizeof($this->sql_rowset);
@@ -244,7 +233,7 @@ class acm
*/
public function sql_save($query, &$query_result, $ttl)
{
- global $db, $phpEx;
+ global $db;
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
diff --git a/phpBB/includes/acm/acm_eaccelerator.php b/phpBB/includes/acm/acm_eaccelerator.php
index 8592658e51..00d08f70d3 100644
--- a/phpBB/includes/acm/acm_eaccelerator.php
+++ b/phpBB/includes/acm/acm_eaccelerator.php
@@ -33,8 +33,7 @@ class acm
*/
function __construct()
{
- global $phpbb_root_path;
- $this->cache_dir = $phpbb_root_path . 'cache/';
+ $this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
}
/**
@@ -42,8 +41,6 @@ class acm
*/
private function load()
{
- global $phpEx;
-
// grab the global cache
if ($this->vars = eaccelerator_get('global'))
{
@@ -86,8 +83,6 @@ class acm
*/
public function tidy()
{
- global $phpEx;
-
eaccelerator_gc();
set_config('cache_last_gc', time(), true);
@@ -100,8 +95,6 @@ class acm
{
if ($var_name[0] === '_')
{
- global $phpEx;
-
$temp = eaccelerator_get($var_name);
if ($temp !== null)
@@ -183,8 +176,6 @@ class acm
*/
public function destroy($var_name, $table = '')
{
- global $phpEx;
-
if ($var_name === 'sql' && !empty($table))
{
if (!is_array($table))
@@ -237,8 +228,6 @@ class acm
*/
public function sql_load($query)
{
- global $phpEx;
-
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
$query_id = sizeof($this->sql_rowset);
@@ -260,7 +249,7 @@ class acm
*/
public function sql_save($query, &$query_result, $ttl)
{
- global $db, $phpEx;
+ global $db;
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
index f952b372c6..9376549cba 100644
--- a/phpBB/includes/acm/acm_file.php
+++ b/phpBB/includes/acm/acm_file.php
@@ -34,8 +34,7 @@ class acm
*/
function __construct()
{
- global $phpbb_root_path;
- $this->cache_dir = $phpbb_root_path . 'cache/';
+ $this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
}
/**
@@ -43,12 +42,10 @@ class acm
*/
private function load()
{
- global $phpEx;
-
// grab the global cache
- if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
+ if (file_exists($this->cache_dir . 'data_global.' . PHP_EXT))
{
- @include($this->cache_dir . 'data_global.' . $phpEx);
+ @include($this->cache_dir . 'data_global.' . PHP_EXT);
return true;
}
@@ -80,16 +77,14 @@ class acm
return;
}
- global $phpEx;
-
- if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb'))
+ if ($fp = @fopen($this->cache_dir . 'data_global.' . PHP_EXT, 'wb'))
{
@flock($fp, LOCK_EX);
fwrite($fp, "<?php\n\$this->vars = unserialize('" . serialize($this->vars) . "');\n\$this->var_expires = unserialize('" . serialize($this->var_expires) . "');");
@flock($fp, LOCK_UN);
fclose($fp);
- @chmod($this->cache_dir . 'data_global.' . $phpEx, 0666);
+ @chmod($this->cache_dir . 'data_global.' . PHP_EXT, 0666);
}
else
{
@@ -99,7 +94,7 @@ class acm
trigger_error($this->cache_dir . ' is NOT writable.', E_USER_ERROR);
}
- trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx, E_USER_ERROR);
+ trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . PHP_EXT, E_USER_ERROR);
}
$this->is_modified = false;
@@ -110,8 +105,6 @@ class acm
*/
public function tidy()
{
- global $phpEx;
-
$dir = @opendir($this->cache_dir);
if (!$dir)
@@ -135,7 +128,7 @@ class acm
}
closedir($dir);
- if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
+ if (file_exists($this->cache_dir . 'data_global.' . PHP_EXT))
{
if (!sizeof($this->vars))
{
@@ -161,14 +154,12 @@ class acm
{
if ($var_name[0] === '_')
{
- global $phpEx;
-
if (!$this->_exists($var_name))
{
return false;
}
- @include($this->cache_dir . "data{$var_name}.$phpEx");
+ @include($this->cache_dir . "data{$var_name}." . PHP_EXT);
return (isset($data)) ? $data : false;
}
else
@@ -184,16 +175,14 @@ class acm
{
if ($var_name[0] === '_')
{
- global $phpEx;
-
- if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb'))
+ if ($fp = @fopen($this->cache_dir . "data{$var_name}." . PHP_EXT, 'wb'))
{
@flock($fp, LOCK_EX);
fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\$data = " . (sizeof($var) ? "unserialize('" . serialize($var) . "');" : 'array();'));
@flock($fp, LOCK_UN);
fclose($fp);
- @chmod($this->cache_dir . "data{$var_name}.$phpEx", 0666);
+ @chmod($this->cache_dir . "data{$var_name}." . PHP_EXT, 0666);
}
}
else
@@ -244,8 +233,6 @@ class acm
*/
public function destroy($var_name, $table = '')
{
- global $phpEx;
-
if ($var_name === 'sql' && !empty($table))
{
if (!is_array($table))
@@ -306,7 +293,7 @@ class acm
if ($var_name[0] === '_')
{
- $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx", true);
+ $this->remove_file($this->cache_dir . 'data' . $var_name . '.' . PHP_EXT, true);
}
else if (isset($this->vars[$var_name]))
{
@@ -326,8 +313,7 @@ class acm
{
if ($var_name[0] === '_')
{
- global $phpEx;
- return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
+ return file_exists($this->cache_dir . 'data' . $var_name . '.' . PHP_EXT);
}
else
{
@@ -350,18 +336,16 @@ class acm
*/
public function sql_load($query)
{
- global $phpEx;
-
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
$query_id = sizeof($this->sql_rowset);
- if (!file_exists($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"))
+ if (!file_exists($this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT))
{
return false;
}
- @include($this->cache_dir . 'sql_' . md5($query) . ".$phpEx");
+ @include($this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT);
if (!isset($expired))
{
@@ -369,7 +353,7 @@ class acm
}
else if ($expired)
{
- $this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx", true);
+ $this->remove_file($this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT, true);
return false;
}
@@ -382,11 +366,11 @@ class acm
*/
public function sql_save($query, &$query_result, $ttl)
{
- global $db, $phpEx;
+ global $db;
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
- $filename = $this->cache_dir . 'sql_' . md5($query) . '.' . $phpEx;
+ $filename = $this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT;
if ($fp = @fopen($filename, 'wb'))
{
diff --git a/phpBB/includes/acm/acm_memcache.php b/phpBB/includes/acm/acm_memcache.php
index fc17b04942..bbb556f173 100644
--- a/phpBB/includes/acm/acm_memcache.php
+++ b/phpBB/includes/acm/acm_memcache.php
@@ -34,7 +34,6 @@ class acm
*/
function __construct()
{
- global $phpbb_root_path;
$this->memcache = memcache_connect('localhost', 11211);
}
@@ -43,8 +42,6 @@ class acm
*/
private function load()
{
- global $phpEx;
-
// grab the global cache
if ($this->vars = memcache_get($this->memcache, 'global'))
{
@@ -87,8 +84,6 @@ class acm
*/
public function tidy()
{
- global $phpEx;
-
// cache has auto GC, no need to have any code here :)
set_config('cache_last_gc', time(), true);
@@ -101,8 +96,6 @@ class acm
{
if ($var_name[0] === '_')
{
- global $phpEx;
-
return memcache_get($this->memcache, $var_name);
}
else
@@ -172,8 +165,6 @@ class acm
*/
public function destroy($var_name, $table = '')
{
- global $phpEx;
-
if ($var_name === 'sql' && !empty($table))
{
if (!is_array($table))
@@ -222,8 +213,6 @@ class acm
*/
public function sql_load($query)
{
- global $phpEx;
-
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
$query_id = sizeof($this->sql_rowset);
@@ -246,7 +235,7 @@ class acm
*/
public function sql_save($query, &$query_result, $ttl)
{
- global $db, $phpEx;
+ global $db;
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
diff --git a/phpBB/includes/acm/acm_xcache.php b/phpBB/includes/acm/acm_xcache.php
index 542dc60abb..38db4d27d8 100644
--- a/phpBB/includes/acm/acm_xcache.php
+++ b/phpBB/includes/acm/acm_xcache.php
@@ -33,8 +33,7 @@ class acm
*/
function __construct()
{
- global $phpbb_root_path;
- $this->cache_dir = $phpbb_root_path . 'cache/';
+ $this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
}
/**
@@ -42,8 +41,6 @@ class acm
*/
private function load()
{
- global $phpEx;
-
// grab the global cache
if (xcache_isset('global'))
{
@@ -87,8 +84,6 @@ class acm
*/
public function tidy()
{
- global $phpEx;
-
// cache has auto GC, no need to have any code here :)
set_config('cache_last_gc', time(), true);
@@ -101,8 +96,6 @@ class acm
{
if ($var_name[0] === '_')
{
- global $phpEx;
-
return (xcache_isset($var_name)) ? xcache_get($var_name) : false;
}
else
@@ -176,8 +169,6 @@ class acm
*/
public function destroy($var_name, $table = '')
{
- global $phpEx;
-
if ($var_name === 'sql' && !empty($table))
{
if (!is_array($table))
@@ -226,8 +217,6 @@ class acm
*/
public function sql_load($query)
{
- global $phpEx;
-
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
$query_id = sizeof($this->sql_rowset);
@@ -250,7 +239,7 @@ class acm
*/
public function sql_save($query, &$query_result, $ttl)
{
- global $db, $phpEx;
+ global $db;
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 89769552bd..8d6e91a71c 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -26,8 +26,7 @@ class acp_attachments
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
@@ -79,7 +78,7 @@ class acp_attachments
{
case 'attach':
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$sql = 'SELECT group_name, cat_id
FROM ' . EXTENSION_GROUPS_TABLE . '
@@ -696,7 +695,7 @@ class acp_attachments
$filename_list = '';
$no_image_select = false;
- $imglist = filelist($phpbb_root_path . $img_path);
+ $imglist = filelist(PHPBB_ROOT_PATH . $img_path);
if (sizeof($imglist))
{
@@ -742,14 +741,14 @@ class acp_attachments
}
$template->assign_vars(array(
- 'PHPBB_ROOT_PATH' => $phpbb_root_path,
+ 'PHPBB_ROOT_PATH' => PHPBB_ROOT_PATH,
'IMG_PATH' => $img_path,
'ACTION' => $action,
'GROUP_ID' => $group_id,
'GROUP_NAME' => $ext_group_row['group_name'],
'ALLOW_GROUP' => $ext_group_row['allow_group'],
'ALLOW_IN_PM' => $ext_group_row['allow_in_pm'],
- 'UPLOAD_ICON_SRC' => $phpbb_root_path . $img_path . '/' . $ext_group_row['upload_icon'],
+ 'UPLOAD_ICON_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $ext_group_row['upload_icon'],
'EXTGROUP_FILESIZE' => $ext_group_row['max_filesize'],
'ASSIGNED_EXTENSIONS' => $assigned_extensions,
@@ -761,7 +760,7 @@ class acp_attachments
'S_NO_IMAGE' => $no_image_select,
'S_FORUM_IDS' => (sizeof($forum_ids)) ? true : false,
- 'U_EXTENSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;mode=extensions"),
+ 'U_EXTENSIONS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&amp;mode=extensions"),
'U_BACK' => $this->u_action,
'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP'])
@@ -1032,7 +1031,7 @@ class acp_attachments
'PHYSICAL_FILENAME' => basename($row['physical_filename']),
'ATTACH_ID' => $row['attach_id'],
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
- 'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&amp;id=' . $row['attach_id']))
+ 'U_FILE' => append_sid('download/file', 'mode=view&amp;id=' . $row['attach_id']))
);
}
$db->sql_freeresult($result);
@@ -1192,31 +1191,31 @@ class acp_attachments
*/
function test_upload(&$error, $upload_dir, $create_directory = false)
{
- global $user, $phpbb_root_path;
+ global $user;
// Does the target directory exist, is it a directory and writable.
if ($create_directory)
{
- if (!file_exists($phpbb_root_path . $upload_dir))
+ if (!file_exists(PHPBB_ROOT_PATH . $upload_dir))
{
- @mkdir($phpbb_root_path . $upload_dir, 0777);
- @chmod($phpbb_root_path . $upload_dir, 0777);
+ @mkdir(PHPBB_ROOT_PATH . $upload_dir, 0777);
+ @chmod(PHPBB_ROOT_PATH . $upload_dir, 0777);
}
}
- if (!file_exists($phpbb_root_path . $upload_dir))
+ if (!file_exists(PHPBB_ROOT_PATH . $upload_dir))
{
$error[] = sprintf($user->lang['NO_UPLOAD_DIR'], $upload_dir);
return;
}
- if (!is_dir($phpbb_root_path . $upload_dir))
+ if (!is_dir(PHPBB_ROOT_PATH . $upload_dir))
{
$error[] = sprintf($user->lang['UPLOAD_NOT_DIR'], $upload_dir);
return;
}
- if (!is_writable($phpbb_root_path . $upload_dir))
+ if (!is_writable(PHPBB_ROOT_PATH . $upload_dir))
{
$error[] = sprintf($user->lang['NO_WRITE_UPLOAD'], $upload_dir);
return;
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index 77fb44dda9..3d60ffbe09 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -26,9 +26,8 @@ class acp_ban
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$bansubmit = (isset($_POST['bansubmit'])) ? true : false;
$unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
@@ -112,7 +111,7 @@ class acp_ban
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
'U_ACTION' => $this->u_action,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_ban&amp;field=ban'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=acp_ban&amp;field=ban'),
));
}
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 33e8fe7ec1..e0d478689e 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -25,8 +25,7 @@ class acp_bbcodes
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('acp/posting');
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 800abd875a..6d3fd34263 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -27,8 +27,7 @@ class acp_board
function main($id, $mode)
{
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $config;
$user->add_lang('acp/board');
@@ -418,15 +417,15 @@ class acp_board
// Retrieve a list of auth plugins and check their config values
$auth_plugins = array();
- $dp = @opendir($phpbb_root_path . 'includes/auth');
+ $dp = @opendir(PHPBB_ROOT_PATH . 'includes/auth');
if ($dp)
{
while (($file = readdir($dp)) !== false)
{
- if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
+ if (preg_match('#^auth_(.*?)\.' . PHP_EXT . '$#', $file))
{
- $auth_plugins[] = basename(preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file));
+ $auth_plugins[] = basename(preg_replace('#^auth_(.*?)\.' . PHP_EXT . '$#', '\1', $file));
}
}
closedir($dp);
@@ -438,9 +437,9 @@ class acp_board
$old_auth_config = array();
foreach ($auth_plugins as $method)
{
- if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
+ if ($method && file_exists(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT))
{
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
$method = 'acp_' . $method;
if (function_exists($method))
@@ -481,7 +480,7 @@ class acp_board
$method = basename($cfg_array['auth_method']);
if ($method && in_array($method, $auth_plugins))
{
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
$method = 'init_' . $method;
if (function_exists($method))
@@ -579,7 +578,7 @@ class acp_board
foreach ($auth_plugins as $method)
{
- if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
+ if ($method && file_exists(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT))
{
$method = 'acp_' . $method;
if (function_exists($method))
@@ -604,11 +603,9 @@ class acp_board
*/
function select_auth_method($selected_method, $key = '')
{
- global $phpbb_root_path, $phpEx;
-
$auth_plugins = array();
- $dp = @opendir($phpbb_root_path . 'includes/auth');
+ $dp = @opendir(PHPBB_ROOT_PATH . 'includes/auth');
if (!$dp)
{
@@ -617,9 +614,9 @@ class acp_board
while (($file = readdir($dp)) !== false)
{
- if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
+ if (preg_match('#^auth_(.*?)\.' . PHP_EXT . '$#', $file))
{
- $auth_plugins[] = preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file);
+ $auth_plugins[] = preg_replace('#^auth_(.*?)\.' . PHP_EXT . '$#', '\1', $file);
}
}
closedir($dp);
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index 81ac239358..672fb39c1d 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -26,7 +26,6 @@ class acp_bots
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
@@ -141,7 +140,7 @@ class acp_bots
case 'edit':
case 'add':
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$bot_row = array(
'bot_name' => utf8_normalize_nfc(request_var('bot_name', '', true)),
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index 5b2b345ef8..8a93f887f1 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -24,8 +24,7 @@ class acp_captcha
function main($id, $mode)
{
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $config;
$user->add_lang('acp/board');
@@ -47,11 +46,11 @@ class acp_captcha
if ($config['captcha_gd'])
{
- include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/captcha/captcha_gd.' . PHP_EXT);
}
else
{
- include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/captcha/captcha_non_gd.' . PHP_EXT);
}
captcha::execute(gen_rand_string(mt_rand(5, 8)), time());
@@ -92,7 +91,7 @@ class acp_captcha
else
{
- $preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;demo=demo"));
+ $preview_image_src = append_sid(append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&amp;demo=demo"));
if (@extension_loaded('gd'))
{
$template->assign_var('GD', true);
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 98c2decbf6..561e88bbbf 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -25,8 +25,7 @@ class acp_database
function main($id, $mode)
{
- global $cache, $db, $user, $auth, $template, $table_prefix;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $cache, $db, $user, $auth, $template, $table_prefix, $config;
$user->add_lang('acp/database');
@@ -171,7 +170,7 @@ class acp_database
break;
default:
- include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_install.' . PHP_EXT);
$tables = get_tables($db);
asort($tables);
foreach ($tables as $table_name)
@@ -225,7 +224,7 @@ class acp_database
trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $file_name = $phpbb_root_path . 'store/' . $matches[0];
+ $file_name = PHPBB_ROOT_PATH . 'store/' . $matches[0];
if (!file_exists($file_name) || !is_readable($file_name))
{
@@ -420,7 +419,7 @@ class acp_database
$methods[] = $type;
}
- $dir = $phpbb_root_path . 'store/';
+ $dir = PHPBB_ROOT_PATH . 'store/';
$dh = @opendir($dir);
if ($dh)
@@ -529,8 +528,7 @@ class base_extractor
if ($store == true)
{
- global $phpbb_root_path;
- $file = $phpbb_root_path . 'store/' . $filename . $ext;
+ $file = PHPBB_ROOT_PATH . 'store/' . $filename . $ext;
$this->fp = $open($file, 'w');
diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php
index 9549955cc8..abcb964906 100644
--- a/phpBB/includes/acp/acp_disallow.php
+++ b/phpBB/includes/acp/acp_disallow.php
@@ -25,10 +25,9 @@ class acp_disallow
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$user->add_lang('acp/posting');
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index c964530c32..b8672a1c03 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -26,7 +26,6 @@ class acp_email
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$user->add_lang('acp/email');
$this->tpl_name = 'acp_email';
@@ -148,8 +147,8 @@ class acp_email
$db->sql_freeresult($result);
// Send the messages
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$messenger = new messenger($use_queue);
$errored = false;
@@ -218,7 +217,7 @@ class acp_email
}
else
{
- $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=critical') . '">', '</a>');
+ $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=logs&amp;mode=critical') . '">', '</a>');
trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -250,12 +249,11 @@ class acp_email
'U_ACTION' => $this->u_action,
'S_GROUP_OPTIONS' => $select_list,
'USERNAMES' => $usernames,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_email&amp;field=usernames'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=acp_email&amp;field=usernames'),
'SUBJECT' => $subject,
'MESSAGE' => $message,
- 'S_PRIORITY_OPTIONS' => $s_priority_options)
- );
-
+ 'S_PRIORITY_OPTIONS' => $s_priority_options,
+ ));
}
}
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 6f11c88d60..4a5db8f7a0 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -26,8 +26,7 @@ class acp_forums
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('acp/forums');
$this->tpl_name = 'acp_forums';
@@ -253,13 +252,13 @@ class acp_forums
// Redirect to permissions
if ($auth->acl_get('a_fauth'))
{
- $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions' . $acl_url) . '">', '</a>');
}
// redirect directly to permission settings screen if authed
if ($action == 'add' && !$forum_perm_from && $auth->acl_get('a_fauth'))
{
- meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url));
+ meta_refresh(4, append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions' . $acl_url));
}
trigger_error($message . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
@@ -636,7 +635,7 @@ class acp_forums
'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_DATA_LINK' => $forum_data['forum_link'],
'FORUM_IMAGE' => $forum_data['forum_image'],
- 'FORUM_IMAGE_SRC' => ($forum_data['forum_image']) ? $phpbb_root_path . $forum_data['forum_image'] : '',
+ 'FORUM_IMAGE_SRC' => ($forum_data['forum_image']) ? PHPBB_ROOT_PATH . $forum_data['forum_image'] : '',
'FORUM_POST' => FORUM_POST,
'FORUM_LINK' => FORUM_LINK,
'FORUM_CAT' => FORUM_CAT,
@@ -810,8 +809,8 @@ class acp_forums
$template->assign_block_vars('forums', array(
'FOLDER_IMAGE' => $folder_image,
- 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="" />' : '',
- 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
+ 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="" />' : '',
+ 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
'FORUM_NAME' => $row['forum_name'],
'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
'FORUM_TOPICS' => $row['forum_topics'],
@@ -1620,9 +1619,9 @@ class acp_forums
*/
function delete_forum_content($forum_id)
{
- global $db, $config, $phpbb_root_path, $phpEx;
+ global $db, $config;
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$db->sql_transaction('begin');
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index eb785ced23..f43c3de484 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -25,8 +25,7 @@ class acp_groups
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
+ global $config, $db, $user, $auth, $template, $cache, $file_uploads;
$user->add_lang('acp/groups');
$this->tpl_name = 'acp_groups';
@@ -35,7 +34,7 @@ class acp_groups
$form_key = 'acp_groups';
add_form_key($form_key);
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
// Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''));
@@ -49,7 +48,7 @@ class acp_groups
// Clear some vars
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
+ $can_upload = (file_exists(PHPBB_ROOT_PATH . $config['avatar_path']) && @is_writable(PHPBB_ROOT_PATH . $config['avatar_path']) && $file_uploads) ? true : false;
$group_row = array();
// Grab basic data for group, if group_id is set and exists
@@ -247,7 +246,7 @@ class acp_groups
case 'edit':
case 'add':
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
$data = $submit_ary = array();
@@ -330,11 +329,11 @@ class acp_groups
else if ($avatar_select && $config['allow_avatar_local'])
{
// check avatar gallery
- if (is_dir($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category))
+ if (is_dir(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category))
{
$submit_ary['avatar_type'] = AVATAR_GALLERY;
- list($submit_ary['avatar_width'], $submit_ary['avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_select);
+ list($submit_ary['avatar_width'], $submit_ary['avatar_height']) = getimagesize(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_select);
$submit_ary['avatar'] = $category . '/' . $avatar_select;
}
}
@@ -505,7 +504,7 @@ class acp_groups
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
- $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
+ $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . PHPBB_ADMIN_PATH . 'images/no_avatar.gif" alt="" />';
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
@@ -519,7 +518,7 @@ class acp_groups
switch ($back_link)
{
case 'acp_users_groups':
- $u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=groups&amp;u=' . request_var('u', 0));
+ $u_back = append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&amp;mode=groups&amp;u=' . request_var('u', 0));
break;
default:
@@ -574,7 +573,7 @@ class acp_groups
'GROUP_HIDDEN' => $type_hidden,
'U_BACK' => $u_back,
- 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&amp;name=group_colour'),
+ 'U_SWATCH' => append_sid(PHPBB_ADMIN_PATH . 'swatch.' . PHP_EXT, 'form=settings&amp;name=group_colour'),
'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;g=$group_id",
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),
)
@@ -604,7 +603,7 @@ class acp_groups
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('leader', array(
- 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;action=edit&amp;u={$row['user_id']}"),
+ 'U_USER_EDIT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&amp;action=edit&amp;u={$row['user_id']}"),
'USERNAME' => $row['username'],
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
@@ -643,7 +642,7 @@ class acp_groups
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
'U_BACK' => $this->u_action,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=list&amp;field=usernames'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=list&amp;field=usernames'),
'U_DEFAULT_ALL' => "{$this->u_action}&amp;action=default&amp;g=$group_id",
));
@@ -670,7 +669,7 @@ class acp_groups
}
$template->assign_block_vars('member', array(
- 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;action=edit&amp;u={$row['user_id']}"),
+ 'U_USER_EDIT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&amp;action=edit&amp;u={$row['user_id']}"),
'USERNAME' => $row['username'],
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 4f16c0c83d..e9b24155c8 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -26,8 +26,7 @@ class acp_icons
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('acp/posting');
@@ -69,13 +68,13 @@ class acp_icons
// Grab file list of paks and images
if ($action == 'edit' || $action == 'add' || $action == 'import')
{
- $imglist = filelist($phpbb_root_path . $img_path, '');
+ $imglist = filelist(PHPBB_ROOT_PATH . $img_path, '');
foreach ($imglist as $path => $img_ary)
{
foreach ($img_ary as $img)
{
- $img_size = getimagesize($phpbb_root_path . $img_path . '/' . $path . $img);
+ $img_size = getimagesize(PHPBB_ROOT_PATH . $img_path . '/' . $path . $img);
if (!$img_size[0] || !$img_size[1] || strlen($img) > 255)
{
@@ -89,11 +88,11 @@ class acp_icons
}
unset($imglist);
- if ($dir = @opendir($phpbb_root_path . $img_path))
+ if ($dir = @opendir(PHPBB_ROOT_PATH . $img_path))
{
while (($file = readdir($dir)) !== false)
{
- if (is_file($phpbb_root_path . $img_path . '/' . $file) && preg_match('#\.pak$#i', $file))
+ if (is_file(PHPBB_ROOT_PATH . $img_path . '/' . $file) && preg_match('#\.pak$#i', $file))
{
$_paks[] = $file;
}
@@ -254,7 +253,7 @@ class acp_icons
$template->assign_block_vars('items', array(
'IMG' => $img,
'A_IMG' => addslashes($img),
- 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $img,
+ 'IMG_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $img,
'CODE' => ($mode == 'smilies' && isset($img_row['code'])) ? $img_row['code'] : '',
'EMOTION' => ($mode == 'smilies' && isset($img_row['emotion'])) ? $img_row['emotion'] : '',
@@ -278,9 +277,9 @@ class acp_icons
'S_ADD_ORDER_LIST_DISPLAY' => $add_order_list . $add_order_lists[1],
'S_ADD_ORDER_LIST_UNDISPLAY' => $add_order_list . $add_order_lists[0],
- 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'],
+ 'IMG_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $default_row['smiley_url'],
'IMG_PATH' => $img_path,
- 'PHPBB_ROOT_PATH' => $phpbb_root_path,
+ 'PHPBB_ROOT_PATH' => PHPBB_ROOT_PATH,
'CODE' => $default_row['code'],
'EMOTION' => $default_row['emotion'],
@@ -352,7 +351,7 @@ class acp_icons
{
if ($image_width[$image] == 0 || $image_height[$image] == 0)
{
- $img_size = getimagesize($phpbb_root_path . $img_path . '/' . $image);
+ $img_size = getimagesize(PHPBB_ROOT_PATH . $img_path . '/' . $image);
$image_width[$image] = $img_size[0];
$image_height[$image] = $img_size[1];
}
@@ -461,7 +460,7 @@ class acp_icons
{
$order = 0;
- if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak)))
+ if (!($pak_ary = @file(PHPBB_ROOT_PATH . $img_path . '/' . $pak)))
{
trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -833,7 +832,7 @@ class acp_icons
$template->assign_block_vars('items', array(
'S_SPACER' => (!$spacer && !$row['display_on_posting']) ? true : false,
'ALT_TEXT' => $alt_text,
- 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $row[$fields . '_url'],
+ 'IMG_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $row[$fields . '_url'],
'WIDTH' => $row[$fields . '_width'],
'HEIGHT' => $row[$fields . '_height'],
'CODE' => (isset($row['code'])) ? $row['code'] : '',
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php
index 90f326b099..1a1ff3ecf7 100755
--- a/phpBB/includes/acp/acp_inactive.php
+++ b/phpBB/includes/acp/acp_inactive.php
@@ -32,9 +32,8 @@ class acp_inactive
function main($id, $mode)
{
global $config, $db, $user, $auth, $template;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$user->add_lang('memberlist');
@@ -98,7 +97,7 @@ class acp_inactive
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !empty($inactive_users))
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger();
@@ -167,7 +166,7 @@ class acp_inactive
if ($row = $db->sql_fetchrow($result))
{
// Send the messages
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger();
$usernames = array();
@@ -182,7 +181,7 @@ class acp_inactive
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username']),
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
- 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
+ 'U_ACTIVATE' => generate_board_url() . '/ucp.' . PHP_EXT . '?mode=activate&u=' . $row['user_id'] . '&k=' . $row['user_actkey'])
);
$messenger->send($row['user_notify_type']);
@@ -228,7 +227,7 @@ class acp_inactive
'REASON' => $row['inactive_reason'],
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
- 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
+ 'U_USER_ADMIN' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
);
}
diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php
index 3862ee1ee8..a8b55ab397 100644
--- a/phpBB/includes/acp/acp_jabber.php
+++ b/phpBB/includes/acp/acp_jabber.php
@@ -26,12 +26,11 @@ class acp_jabber
function main($id, $mode)
{
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $config;
$user->add_lang('acp/board');
- include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_jabber.' . PHP_EXT);
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index fc2ae11b1e..66f201dbed 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -32,10 +32,9 @@ class acp_language
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
global $safe_mode, $file_uploads;
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$this->default_variables();
@@ -61,7 +60,7 @@ class acp_language
list($_REQUEST['language_file'], ) = array_keys($missing_file);
}
- $selected_lang_file = request_var('language_file', '|common.' . $phpEx);
+ $selected_lang_file = request_var('language_file', '|common.' . PHP_EXT);
list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file);
@@ -78,7 +77,7 @@ class acp_language
$action = 'upload_file';
$method = request_var('method', '');
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
switch ($method)
{
@@ -103,7 +102,7 @@ class acp_language
{
case 'upload_file':
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
$method = request_var('method', '');
@@ -219,7 +218,7 @@ class acp_language
{
case 'email':
// Get email templates
- $email_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt');
+ $email_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'email', 'txt');
$email_files = $email_files['email/'];
if (!in_array($this->language_file, $email_files))
@@ -230,7 +229,7 @@ class acp_language
case 'acp':
// Get acp files
- $acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx);
+ $acp_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'acp', PHP_EXT);
$acp_files = $acp_files['acp/'];
if (!in_array($this->language_file, $acp_files))
@@ -241,7 +240,7 @@ class acp_language
case 'mods':
// Get mod files
- $mods_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx);
+ $mods_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'mods', PHP_EXT);
$mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array();
if (!in_array($this->language_file, $mods_files))
@@ -269,7 +268,7 @@ class acp_language
foreach ($mkdir_ary as $dir)
{
- $dir = $phpbb_root_path . 'store/' . $dir;
+ $dir = PHPBB_ROOT_PATH . 'store/' . $dir;
if (!is_dir($dir))
{
@@ -284,7 +283,7 @@ class acp_language
// Get target filename for storage folder
$filename = $this->get_filename($row['lang_iso'], $this->language_directory, $this->language_file, true, true);
- $fp = @fopen($phpbb_root_path . $filename, 'wb');
+ $fp = @fopen(PHPBB_ROOT_PATH . $filename, 'wb');
if (!$fp)
{
@@ -354,7 +353,7 @@ class acp_language
header('Content-Type: application/octetstream; name="' . $this->language_file . '"');
header('Content-disposition: attachment; filename=' . $this->language_file);
- $fp = @fopen($phpbb_root_path . $filename, 'rb');
+ $fp = @fopen(PHPBB_ROOT_PATH . $filename, 'rb');
while ($buffer = fread($fp, 1024))
{
echo $buffer;
@@ -382,7 +381,7 @@ class acp_language
$old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true);
$lang_path = 'language/' . $row['lang_iso'] . '/' . (($dir) ? $dir . '/' : '');
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
$method = request_var('method', '');
if ($method != 'ftp' && $method != 'ftp_fsock')
@@ -412,9 +411,9 @@ class acp_language
$transfer->close_session();
// Remove from storage folder
- if (file_exists($phpbb_root_path . 'store/' . $lang_path . $file))
+ if (file_exists(PHPBB_ROOT_PATH . 'store/' . $lang_path . $file))
{
- @unlink($phpbb_root_path . 'store/' . $lang_path . $file);
+ @unlink(PHPBB_ROOT_PATH . 'store/' . $lang_path . $file);
}
add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file);
@@ -447,15 +446,15 @@ class acp_language
$missing_vars = $missing_files = array();
// Get email templates
- $email_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'email', 'txt');
+ $email_files = filelist(PHPBB_ROOT_PATH . 'language/' . $config['default_lang'], 'email', 'txt');
$email_files = $email_files['email/'];
// Get acp files
- $acp_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'acp', $phpEx);
+ $acp_files = filelist(PHPBB_ROOT_PATH . 'language/' . $config['default_lang'], 'acp', PHP_EXT);
$acp_files = $acp_files['acp/'];
// Get mod files
- $mods_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'mods', $phpEx);
+ $mods_files = filelist(PHPBB_ROOT_PATH . 'language/' . $config['default_lang'], 'mods', PHP_EXT);
$mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array();
// Check if our current filename matches the files
@@ -493,13 +492,13 @@ class acp_language
{
$store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true);
- if (file_exists($phpbb_root_path . $store_filename))
+ if (file_exists(PHPBB_ROOT_PATH . $store_filename))
{
- @unlink($phpbb_root_path . $store_filename);
+ @unlink(PHPBB_ROOT_PATH . $store_filename);
}
}
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
$methods = transfer::methods();
@@ -529,7 +528,7 @@ class acp_language
foreach ($this->main_files as $file)
{
- if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file)))
+ if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, '', $file)))
{
$missing_vars[$file] = $this->compare_language_files($config['default_lang'], $lang_iso, '', $file);
@@ -547,7 +546,7 @@ class acp_language
// Now go through acp/mods directories
foreach ($acp_files as $file)
{
- if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'acp', $file)))
+ if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'acp', $file)))
{
$missing_vars['acp/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'acp', $file);
@@ -566,7 +565,7 @@ class acp_language
{
foreach ($mods_files as $file)
{
- if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'mods', $file)))
+ if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'mods', $file)))
{
$missing_vars['mods/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'mods', $file);
@@ -585,7 +584,7 @@ class acp_language
// More missing files... for example email templates?
foreach ($email_files as $file)
{
- if (!file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'email', $file)))
+ if (!file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'email', $file)))
{
$missing_files[] = $this->get_filename($lang_iso, 'email', $file);
}
@@ -625,7 +624,7 @@ class acp_language
}
// Main language files
- $s_lang_options = '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['LANGUAGE_FILES'] . '</option>';
+ $s_lang_options = '<option value="|common.' . PHP_EXT . '" class="sep">' . $user->lang['LANGUAGE_FILES'] . '</option>';
foreach ($this->main_files as $file)
{
if (strpos($file, 'help_') === 0)
@@ -633,14 +632,14 @@ class acp_language
continue;
}
- $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
+ $prefix = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
}
// Help Files
- $s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
+ $s_lang_options .= '<option value="|common.' . PHP_EXT . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
foreach ($this->main_files as $file)
{
if (strpos($file, 'help_') !== 0)
@@ -648,7 +647,7 @@ class acp_language
continue;
}
- $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
+ $prefix = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
@@ -664,11 +663,11 @@ class acp_language
continue;
}
- $s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
+ $s_lang_options .= '<option value="|common.' . PHP_EXT . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
foreach (${$check . '_files'} as $file)
{
- $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : '';
+ $prefix = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : '';
$selected = ($this->language_directory == $check && $this->language_file == $file) ? ' selected="selected"' : '';
$s_lang_options .= '<option value="' . $check . '|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
@@ -681,10 +680,10 @@ class acp_language
$is_email_file = ($this->language_directory == 'email') ? true : false;
$is_help_file = (strpos($this->language_file, 'help_') === 0) ? true : false;
- $file_from_store = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true))) ? true : false;
+ $file_from_store = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true))) ? true : false;
$no_store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file);
- if (!$file_from_store && !file_exists($phpbb_root_path . $no_store_filename))
+ if (!$file_from_store && !file_exists(PHPBB_ROOT_PATH . $no_store_filename))
{
$print_message = sprintf($user->lang['MISSING_LANGUAGE_FILE'], $no_store_filename);
}
@@ -692,12 +691,12 @@ class acp_language
{
if ($is_email_file)
{
- $lang = file_get_contents($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
+ $lang = file_get_contents(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
}
else
{
$help = array();
- include($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
+ include(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
if ($is_help_file)
{
@@ -794,12 +793,12 @@ class acp_language
$lang_iso = request_var('iso', '');
$lang_iso = basename($lang_iso);
- if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt"))
+ if (!$lang_iso || !file_exists(PHPBB_ROOT_PATH . "language/$lang_iso/iso.txt"))
{
trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $file = file("{$phpbb_root_path}language/$lang_iso/iso.txt");
+ $file = file(PHPBB_ROOT_PATH . "language/$lang_iso/iso.txt");
$lang_pack = array(
'iso' => $lang_iso,
@@ -849,9 +848,9 @@ class acp_language
$result = $db->sql_query($sql);
while ($imageset_row = $db->sql_fetchrow($result))
{
- if (@file_exists("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg"))
+ if (@file_exists(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg"))
{
- $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg");
+ $cfg_data_imageset_data = parse_cfg_file(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg");
foreach ($cfg_data_imageset_data as $image_name => $value)
{
if (strpos($value, '*') !== false)
@@ -994,41 +993,41 @@ class acp_language
$use_method = '.tar';
}
- include_once($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_compress.' . PHP_EXT);
if ($use_method == '.zip')
{
- $compress = new compress_zip('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
+ $compress = new compress_zip('w', PHPBB_ROOT_PATH . 'store/lang_' . $row['lang_iso'] . $use_method);
}
else
{
- $compress = new compress_tar('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method, $use_method);
+ $compress = new compress_tar('w', PHPBB_ROOT_PATH . 'store/lang_' . $row['lang_iso'] . $use_method, $use_method);
}
// Get email templates
- $email_templates = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt');
+ $email_templates = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'email', 'txt');
$email_templates = $email_templates['email/'];
// Get acp files
- $acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx);
+ $acp_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'acp', PHP_EXT);
$acp_files = $acp_files['acp/'];
// Get mod files
- $mod_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx);
+ $mod_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'mods', PHP_EXT);
$mod_files = (isset($mod_files['mods/'])) ? $mod_files['mods/'] : array();
// Add main files
$this->add_to_archive($compress, $this->main_files, $row['lang_iso']);
// Add search files if they exist...
- if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_ignore_words.' . $phpEx))
+ if (file_exists(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'] . '/search_ignore_words.' . PHP_EXT))
{
- $this->add_to_archive($compress, array("search_ignore_words.$phpEx"), $row['lang_iso']);
+ $this->add_to_archive($compress, array('search_ignore_words.' . PHP_EXT), $row['lang_iso']);
}
- if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_synonyms.' . $phpEx))
+ if (file_exists(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'] . '/search_synonyms.' . PHP_EXT))
{
- $this->add_to_archive($compress, array("search_synonyms.$phpEx"), $row['lang_iso']);
+ $this->add_to_archive($compress, array('search_synonyms.' . PHP_EXT), $row['lang_iso']);
}
// Write files in folders
@@ -1055,7 +1054,7 @@ class acp_language
$compress->close();
$compress->download('lang_' . $row['lang_iso']);
- @unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
+ @unlink(PHPBB_ROOT_PATH . 'store/lang_' . $row['lang_iso'] . $use_method);
exit;
@@ -1101,17 +1100,17 @@ class acp_language
$db->sql_freeresult($result);
$new_ary = $iso = array();
- $dp = @opendir("{$phpbb_root_path}language");
+ $dp = @opendir(PHPBB_ROOT_PATH . 'language');
if ($dp)
{
while (($file = readdir($dp)) !== false)
{
- if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
+ if ($file[0] != '.' && file_exists(PHPBB_ROOT_PATH . "language/$file/iso.txt"))
{
if (!in_array($file, $installed))
{
- if ($iso = file("{$phpbb_root_path}language/$file/iso.txt"))
+ if ($iso = file(PHPBB_ROOT_PATH . "language/$file/iso.txt"))
{
if (sizeof($iso) == 3)
{
@@ -1153,8 +1152,6 @@ class acp_language
*/
function default_variables()
{
- global $phpEx;
-
$this->language_file_header = '<?php
/**
*
@@ -1199,7 +1196,7 @@ $lang = array_merge($lang, array(
';
// Language files in language root directory
- $this->main_files = array("common.$phpEx", "groups.$phpEx", "install.$phpEx", "mcp.$phpEx", "memberlist.$phpEx", "posting.$phpEx", "search.$phpEx", "ucp.$phpEx", "viewforum.$phpEx", "viewtopic.$phpEx", "help_bbcode.$phpEx", "help_faq.$phpEx");
+ $this->main_files = array('common.' . PHP_EXT, 'groups.' . PHP_EXT, 'install.' . PHP_EXT, 'mcp.' . PHP_EXT, 'memberlist.' . PHP_EXT, 'posting.' . PHP_EXT, 'search.' . PHP_EXT, 'ucp.' . PHP_EXT, 'viewforum.' . PHP_EXT, 'viewtopic.' . PHP_EXT, 'help_bbcode.' . PHP_EXT, 'help_faq.' . PHP_EXT);
}
/**
@@ -1207,7 +1204,7 @@ $lang = array_merge($lang, array(
*/
function get_filename($lang_iso, $directory, $filename, $check_store = false, $only_return_filename = false)
{
- global $phpbb_root_path, $safe_mode;
+ global $safe_mode;
$check_filename = "language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename;
@@ -1215,7 +1212,7 @@ $lang = array_merge($lang, array(
{
$check_store_filename = ($safe_mode) ? "store/langfile_{$lang_iso}" . (($directory) ? '_' . $directory : '') . "_{$filename}" : "store/language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename;
- if (!$only_return_filename && file_exists($phpbb_root_path . $check_store_filename))
+ if (!$only_return_filename && file_exists(PHPBB_ROOT_PATH . $check_store_filename))
{
return $check_store_filename;
}
@@ -1233,8 +1230,6 @@ $lang = array_merge($lang, array(
*/
function add_to_archive(&$compress, $filelist, $lang_iso, $directory = '')
{
- global $phpbb_root_path;
-
foreach ($filelist as $file)
{
// Get source filename
@@ -1242,7 +1237,7 @@ $lang = array_merge($lang, array(
$destination = 'language/' . $lang_iso . '/' . (($directory) ? $directory . '/' : '') . $file;
// Add file to archive
- $compress->add_custom_file($phpbb_root_path . $source, $destination);
+ $compress->add_custom_file(PHPBB_ROOT_PATH . $source, $destination);
}
}
@@ -1359,22 +1354,20 @@ $lang = array_merge($lang, array(
*/
function compare_language_files($source_lang, $dest_lang, $directory, $file)
{
- global $phpbb_root_path, $phpEx;
-
$return_ary = array();
$lang = array();
- include("{$phpbb_root_path}language/{$source_lang}/" . (($directory) ? $directory . '/' : '') . $file);
+ include(PHPBB_ROOT_PATH . "language/{$source_lang}/" . (($directory) ? $directory . '/' : '') . $file);
$lang_entry_src = $lang;
$lang = array();
- if (!file_exists($phpbb_root_path . $this->get_filename($dest_lang, $directory, $file, true)))
+ if (!file_exists(PHPBB_ROOT_PATH . $this->get_filename($dest_lang, $directory, $file, true)))
{
return array();
}
- include($phpbb_root_path . $this->get_filename($dest_lang, $directory, $file, true));
+ include(PHPBB_ROOT_PATH . $this->get_filename($dest_lang, $directory, $file, true));
$lang_entry_dst = $lang;
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index 12953173f1..7ad0734151 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -25,8 +25,7 @@ class acp_logs
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('mcp');
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index bf6e8a39b5..3e24898908 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -26,7 +26,6 @@ class acp_main
function main($id, $mode)
{
global $config, $db, $user, $auth, $template;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx;
// Show restore permissions notice
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
@@ -42,16 +41,16 @@ class acp_main
$db->sql_freeresult($result);
$perm_from = '<strong' . (($user_row['user_colour']) ? ' style="color: #' . $user_row['user_colour'] . '">' : '>');
- $perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_row['user_id']) . '">' : '';
+ $perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid('memberlist', 'mode=viewprofile&amp;u=' . $user_row['user_id']) . '">' : '';
$perm_from .= $user_row['username'];
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '</a>' : '';
$perm_from .= '</strong>';
$template->assign_vars(array(
'S_RESTORE_PERMISSIONS' => true,
- 'U_RESTORE_PERMISSIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm'),
+ 'U_RESTORE_PERMISSIONS' => append_sid('ucp', 'mode=restore_perm'),
'PERM_FROM' => $perm_from,
- 'L_PERMISSIONS_TRANSFERRED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERRED_EXPLAIN'], $perm_from, append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm')),
+ 'L_PERMISSIONS_TRANSFERRED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERRED_EXPLAIN'], $perm_from, append_sid('ucp', 'mode=restore_perm')),
));
return;
@@ -162,7 +161,7 @@ class acp_main
if (!function_exists('update_last_username'))
{
- include($phpbb_root_path . "includes/functions_user.$phpEx");
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
}
update_last_username();
@@ -311,13 +310,13 @@ class acp_main
$avatar_dir_size = 0;
- if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path']))
+ if ($avatar_dir = @opendir(PHPBB_ROOT_PATH . $config['avatar_path']))
{
while (($file = readdir($avatar_dir)) !== false)
{
if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false)
{
- $avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
+ $avatar_dir_size += filesize(PHPBB_ROOT_PATH . $config['avatar_path'] . '/' . $file);
}
}
closedir($avatar_dir);
@@ -387,8 +386,8 @@ class acp_main
'BOARD_VERSION' => $config['version'],
'U_ACTION' => $this->u_action,
- 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
- 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
+ 'U_ADMIN_LOG' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=logs&amp;mode=admin'),
+ 'U_INACTIVE_USERS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=inactive&amp;mode=list'),
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
@@ -429,7 +428,7 @@ class acp_main
'REASON' => $row['inactive_reason'],
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
- 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
+ 'U_USER_ADMIN' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
);
}
@@ -446,7 +445,7 @@ class acp_main
}
// Warn if install is still present
- if (file_exists($phpbb_root_path . 'install'))
+ if (file_exists(PHPBB_ROOT_PATH . 'install'))
{
$template->assign_var('S_REMOVE_INSTALL', true);
}
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index f3540941df..0ab8ac6f6b 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -37,8 +37,7 @@ class acp_modules
function main($id, $mode)
{
- global $db, $user, $auth, $template, $module;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $db, $user, $auth, $template, $module, $config;
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
define('MODULE_INCLUDE', true);
@@ -530,11 +529,9 @@ class acp_modules
*/
function get_module_infos($module = '', $module_class = false)
{
- global $phpbb_root_path, $phpEx;
-
$module_class = ($module_class === false) ? $this->module_class : $module_class;
- $directory = $phpbb_root_path . 'includes/' . $module_class . '/info/';
+ $directory = PHPBB_ROOT_PATH . 'includes/' . $module_class . '/info/';
$fileinfo = array();
if (!$module)
@@ -549,9 +546,9 @@ class acp_modules
while (($file = readdir($dh)) !== false)
{
// Is module?
- if (preg_match('/^' . $module_class . '_.+\.' . $phpEx . '$/', $file))
+ if (preg_match('/^' . $module_class . '_.+\.' . PHP_EXT . '$/', $file))
{
- $class = str_replace(".$phpEx", '', $file) . '_info';
+ $class = str_replace('.' . PHP_EXT, '', $file) . '_info';
if (!class_exists($class))
{
@@ -578,7 +575,7 @@ class acp_modules
if (!class_exists($class))
{
- include($directory . $filename . '.' . $phpEx);
+ include($directory . $filename . '.' . PHP_EXT);
}
// Get module title tag
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index 03ea5a39dd..cdc276ad01 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -25,11 +25,10 @@ class acp_permission_roles
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
$auth_admin = new auth_admin();
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 9240db271c..ed7ca5e942 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -26,11 +26,10 @@ class acp_permissions
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
$auth_admin = new auth_admin();
@@ -354,7 +353,7 @@ class acp_permissions
$template->assign_vars(array(
'S_SELECT_USER' => true,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_victim&amp;field=username&amp;select_single=true'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=select_victim&amp;field=username&amp;select_single=true'),
));
break;
@@ -416,7 +415,7 @@ class acp_permissions
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'],
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], (($user->data['user_type'] == USER_FOUNDER) ? false : 0)),
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=add_user&amp;field=username&amp;select_single=true'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=add_user&amp;field=username&amp;select_single=true'),
));
break;
diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php
index 9935c0466e..3df63edc17 100644
--- a/phpBB/includes/acp/acp_php_info.php
+++ b/phpBB/includes/acp/acp_php_info.php
@@ -25,8 +25,7 @@ class acp_php_info
function main($id, $mode)
{
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $config;
if ($mode != 'info')
{
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 253308d153..a05766f4a6 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -29,11 +29,10 @@ class acp_profile
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
- include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
$user->add_lang(array('ucp', 'acp/profile'));
$this->tpl_name = 'acp_profile';
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index a82a438db7..a1e4620377 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -25,10 +25,10 @@ class acp_prune
function main($id, $mode)
{
- global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path;
+ global $user;
$user->add_lang('acp/prune');
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
switch ($mode)
{
@@ -51,8 +51,7 @@ class acp_prune
*/
function prune_forums($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$all_forums = request_var('all_forums', 0);
$forum_id = request_var('f', array(0));
@@ -228,8 +227,7 @@ class acp_prune
*/
function prune_users($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('memberlist');
@@ -300,8 +298,8 @@ class acp_prune
{
$template->assign_block_vars('users', array(
'USERNAME' => $usernames[$user_id],
- 'U_PROFILE' => append_sid($phpbb_root_path . 'memberlist.' . $phpEx, 'mode=viewprofile&amp;u=' . $user_id),
- 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : '',
+ 'U_PROFILE' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $user_id),
+ 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : '',
));
}
@@ -358,7 +356,7 @@ class acp_prune
'S_JOINED_OPTIONS' => $s_find_join_time,
'S_ACTIVE_OPTIONS' => $s_find_active_time,
'S_COUNT_OPTIONS' => $s_find_count,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_prune&amp;field=users'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=acp_prune&amp;field=users'),
));
}
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index 41ed5b0fba..aa827d646c 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -25,8 +25,7 @@ class acp_ranks
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('acp/posting');
@@ -157,7 +156,7 @@ class acp_ranks
}
$db->sql_freeresult($result);
- $imglist = filelist($phpbb_root_path . $config['ranks_path'], '');
+ $imglist = filelist(PHPBB_ROOT_PATH . $config['ranks_path'], '');
$edit_img = $filename_list = '';
foreach ($imglist as $path => $img_ary)
@@ -196,12 +195,12 @@ class acp_ranks
$template->assign_vars(array(
'S_EDIT' => true,
'U_BACK' => $this->u_action,
- 'RANKS_PATH' => $phpbb_root_path . $config['ranks_path'],
+ 'RANKS_PATH' => PHPBB_ROOT_PATH . $config['ranks_path'],
'U_ACTION' => $this->u_action . '&amp;id=' . $rank_id,
'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '',
'S_FILENAME_LIST' => $filename_list,
- 'RANK_IMAGE' => ($edit_img) ? $phpbb_root_path . $config['ranks_path'] . '/' . $edit_img : $phpbb_admin_path . 'images/spacer.gif',
+ 'RANK_IMAGE' => ($edit_img) ? PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $edit_img : PHPBB_ADMIN_PATH . 'images/spacer.gif',
'S_SPECIAL_RANK' => (!isset($ranks['rank_special']) || $ranks['rank_special']) ? true : false,
'MIN_POSTS' => (isset($ranks['rank_min']) && !$ranks['rank_special']) ? $ranks['rank_min'] : 0)
);
@@ -227,7 +226,7 @@ class acp_ranks
'S_RANK_IMAGE' => ($row['rank_image']) ? true : false,
'S_SPECIAL_RANK' => ($row['rank_special']) ? true : false,
- 'RANK_IMAGE' => $phpbb_root_path . $config['ranks_path'] . '/' . $row['rank_image'],
+ 'RANK_IMAGE' => PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $row['rank_image'],
'RANK_TITLE' => $row['rank_title'],
'MIN_POSTS' => $row['rank_min'],
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index 7a74c29631..c7706402be 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -25,8 +25,7 @@ class acp_reasons
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang(array('mcp', 'acp/posting'));
diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php
index dc6f3d1c44..a593afc648 100644
--- a/phpBB/includes/acp/acp_search.php
+++ b/phpBB/includes/acp/acp_search.php
@@ -50,8 +50,7 @@ class acp_search
function settings($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$submit = (isset($_POST['submit'])) ? true : false;
@@ -159,7 +158,7 @@ class acp_search
{
add_log('admin', 'LOG_CONFIG_SEARCH');
}
- $extra_message = '<br />' . $user->lang['SWITCHED_SEARCH_BACKEND'] . '<br /><a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=search&amp;mode=index') . '">&raquo; ' . $user->lang['GO_TO_SEARCH_INDEX'] . '</a>';
+ $extra_message = '<br />' . $user->lang['SWITCHED_SEARCH_BACKEND'] . '<br /><a href="' . append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=search&amp;mode=index') . '">&raquo; ' . $user->lang['GO_TO_SEARCH_INDEX'] . '</a>';
}
else
{
@@ -227,8 +226,7 @@ class acp_search
function index($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
if (isset($_REQUEST['action']) && is_array($_REQUEST['action']))
{
@@ -297,7 +295,7 @@ class acp_search
if (method_exists($this->search, 'delete_index'))
{
// pass a reference to myself so the $search object can make use of save_state() and attributes
- if ($error = $this->search->delete_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=delete", false)))
+ if ($error = $this->search->delete_index($this, append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&mode=$mode&action=delete", false)))
{
$this->state = array('');
$this->save_state();
@@ -360,7 +358,7 @@ class acp_search
if (method_exists($this->search, 'create_index'))
{
// pass a reference to acp_search so the $search object can make use of save_state() and attributes
- if ($error = $this->search->create_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=create", false)))
+ if ($error = $this->search->create_index($this, append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&mode=$mode&action=create", false)))
{
$this->state = array('');
$this->save_state();
@@ -500,8 +498,8 @@ class acp_search
$template->assign_vars(array(
'S_INDEX' => true,
'U_ACTION' => $this->u_action,
- 'U_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;mode=$mode&amp;action=progress_bar"),
- 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;mode=$mode&amp;action=progress_bar")),
+ 'U_PROGRESS_BAR' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&amp;mode=$mode&amp;action=progress_bar"),
+ 'UA_PROGRESS_BAR' => addslashes(append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&amp;mode=$mode&amp;action=progress_bar")),
));
if (isset($this->state[1]))
@@ -546,19 +544,17 @@ class acp_search
function get_search_types()
{
- global $phpbb_root_path, $phpEx;
-
$search_types = array();
- $dp = @opendir($phpbb_root_path . 'includes/search');
+ $dp = @opendir(PHPBB_ROOT_PATH . 'includes/search');
if ($dp)
{
while (($file = readdir($dp)) !== false)
{
- if ((preg_match('#\.' . $phpEx . '$#', $file)) && ($file != "search.$phpEx"))
+ if ((preg_match('#\.' . PHP_EXT . '$#', $file)) && ($file != 'search.' . PHP_EXT))
{
- $search_types[] = preg_replace('#^(.*?)\.' . $phpEx . '$#', '\1', $file);
+ $search_types[] = preg_replace('#^(.*?)\.' . PHP_EXT . '$#', '\1', $file);
}
}
closedir($dp);
@@ -601,15 +597,15 @@ class acp_search
*/
function init_search($type, &$search, &$error)
{
- global $phpbb_root_path, $phpEx, $user;
+ global $user;
- if (!preg_match('#^\w+$#', $type) || !file_exists("{$phpbb_root_path}includes/search/$type.$phpEx"))
+ if (!preg_match('#^\w+$#', $type) || !file_exists(PHPBB_ROOT_PATH . "includes/search/$type." . PHP_EXT))
{
$error = $user->lang['NO_SUCH_SEARCH_MODULE'];
return $error;
}
- include_once("{$phpbb_root_path}includes/search/$type.$phpEx");
+ include_once(PHPBB_ROOT_PATH . "includes/search/$type." . PHP_EXT);
if (!class_exists($type))
{
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 538114de6a..e5002a3de6 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -31,8 +31,7 @@ class acp_styles
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
// Hardcoded template bitfield to add for new templates
$bitfield = new bitfield();
@@ -246,7 +245,7 @@ parse_css_file = {PARSE_CSS_FILE}
$template_refreshed = '';
// Only refresh database if the template is stored in the database
- if ($template_row['template_storedb'] && file_exists("{$phpbb_root_path}styles/{$template_row['template_path']}/template/"))
+ if ($template_row['template_storedb'] && file_exists(PHPBB_ROOT_PATH . "styles/{$template_row['template_path']}/template/"))
{
$filelist = array('' => array());
@@ -257,7 +256,7 @@ parse_css_file = {PARSE_CSS_FILE}
while ($row = $db->sql_fetchrow($result))
{
-// if (@filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/" . $row['template_filename']) > $row['template_mtime'])
+// if (@filemtime(PHPBB_ROOT_PATH . "styles/{$template_row['template_path']}/template/" . $row['template_filename']) > $row['template_mtime'])
// {
// get folder info from the filename
if (($slash_pos = strrpos($row['template_filename'], '/')) === false)
@@ -325,11 +324,11 @@ parse_css_file = {PARSE_CSS_FILE}
if (confirm_box(true))
{
- if ($theme_row['theme_storedb'] && file_exists("{$phpbb_root_path}styles/{$theme_row['theme_path']}/theme/stylesheet.css"))
+ if ($theme_row['theme_storedb'] && file_exists(PHPBB_ROOT_PATH . "styles/{$theme_row['theme_path']}/theme/stylesheet.css"))
{
// Save CSS contents
$sql_ary = array(
- 'theme_mtime' => (int) filemtime("{$phpbb_root_path}styles/{$theme_row['theme_path']}/theme/stylesheet.css"),
+ 'theme_mtime' => (int) filemtime(PHPBB_ROOT_PATH . "styles/{$theme_row['theme_path']}/theme/stylesheet.css"),
'theme_data' => $this->db_theme_data($theme_row)
);
@@ -386,7 +385,7 @@ parse_css_file = {PARSE_CSS_FILE}
$imageset_definitions = array_merge($imageset_definitions, $key_array);
}
- $cfg_data_imageset = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/imageset.cfg");
+ $cfg_data_imageset = parse_cfg_file(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/imageset.cfg");
$db->sql_transaction('begin');
@@ -437,9 +436,9 @@ parse_css_file = {PARSE_CSS_FILE}
while ($row = $db->sql_fetchrow($result))
{
- if (@file_exists("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$row['lang_dir']}/imageset.cfg"))
+ if (@file_exists(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$row['lang_dir']}/imageset.cfg"))
{
- $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$row['lang_dir']}/imageset.cfg");
+ $cfg_data_imageset_data = parse_cfg_file(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$row['lang_dir']}/imageset.cfg");
foreach ($cfg_data_imageset_data as $image_name => $value)
{
if (strpos($value, '*') !== false)
@@ -511,7 +510,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function frontend($mode, $options, $actions)
{
- global $user, $template, $db, $config, $phpbb_root_path, $phpEx;
+ global $user, $template, $db, $config;
$sql_from = '';
$style_count = array();
@@ -600,7 +599,7 @@ parse_css_file = {PARSE_CSS_FILE}
'L_STYLE_ACT_DEACT' => $user->lang['STYLE_' . strtoupper($stylevis)],
'S_OPTIONS' => implode(' | ', $s_options),
'S_ACTIONS' => implode(' | ', $s_actions),
- 'U_PREVIEW' => ($mode == 'style') ? append_sid("{$phpbb_root_path}index.$phpEx", "$mode=" . $row[$mode . '_id']) : '',
+ 'U_PREVIEW' => ($mode == 'style') ? append_sid('index', "style=" . $row[$mode . '_id']) : '',
'NAME' => $row[$mode . '_name'],
'STYLE_COUNT' => ($mode == 'style' && isset($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : 0,
@@ -612,16 +611,16 @@ parse_css_file = {PARSE_CSS_FILE}
// Grab uninstalled items
$new_ary = $cfg = array();
- $dp = @opendir("{$phpbb_root_path}styles");
+ $dp = @opendir(PHPBB_ROOT_PATH . 'styles');
if ($dp)
{
while (($file = readdir($dp)) !== false)
{
$subpath = ($mode != 'style') ? "$mode/" : '';
- if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
+ if ($file[0] != '.' && file_exists(PHPBB_ROOT_PATH . "styles/$file/$subpath$mode.cfg"))
{
- if ($cfg = file("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
+ if ($cfg = file(PHPBB_ROOT_PATH . "styles/$file/$subpath$mode.cfg"))
{
$items = parse_cfg_file('', $cfg);
$name = (isset($items['name'])) ? trim($items['name']) : false;
@@ -668,7 +667,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function edit_template($template_id)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template, $safe_mode;
+ global $config, $db, $cache, $user, $template, $safe_mode;
$this->page_title = 'EDIT_TEMPLATE';
@@ -709,7 +708,7 @@ parse_css_file = {PARSE_CSS_FILE}
if ($save_changes && $template_file)
{
// Get the filesystem location of the current file
- $file = "{$phpbb_root_path}styles/{$template_info['template_path']}/template/$template_file";
+ $file = PHPBB_ROOT_PATH . "styles/{$template_info['template_path']}/template/$template_file";
$additional = '';
// If the template is stored on the filesystem try to write the file else store it in the database
@@ -734,7 +733,7 @@ parse_css_file = {PARSE_CSS_FILE}
WHERE template_id = ' . $template_id;
$db->sql_query($sql);
- $filelist = filelist("{$phpbb_root_path}styles/{$template_info['template_path']}/template", '', 'html');
+ $filelist = filelist(PHPBB_ROOT_PATH . "styles/{$template_info['template_path']}/template", '', 'html');
$this->store_templates('insert', $template_id, $template_info['template_path'], $filelist);
add_log('admin', 'LOG_TEMPLATE_EDIT_DETAILS', $template_info['template_name']);
@@ -763,7 +762,7 @@ parse_css_file = {PARSE_CSS_FILE}
// Generate a category array containing template filenames
if (!$template_info['template_storedb'])
{
- $template_path = "{$phpbb_root_path}styles/{$template_info['template_path']}/template";
+ $template_path = PHPBB_ROOT_PATH . "styles/{$template_info['template_path']}/template";
$filelist = filelist($template_path, '', 'html');
$filelist[''] = array_diff($filelist[''], array('bbcode.html'));
@@ -898,7 +897,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function template_cache($template_id)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
+ global $config, $db, $cache, $user, $template;
$source = str_replace('/', '.', request_var('source', ''));
$file_ary = array_diff(request_var('delete', array('')), array(''));
@@ -928,7 +927,7 @@ parse_css_file = {PARSE_CSS_FILE}
// Someone wants to see the cached source ... so we'll highlight it,
// add line numbers and indent it appropriately. This could be nasty
// on larger source files ...
- if ($source && file_exists("{$phpbb_root_path}cache/{$cache_prefix}_$source.html.$phpEx"))
+ if ($source && file_exists(PHPBB_ROOT_PATH . "cache/{$cache_prefix}_$source.html." . PHP_EXT))
{
adm_page_header($user->lang['TEMPLATE_CACHE']);
@@ -940,7 +939,7 @@ parse_css_file = {PARSE_CSS_FILE}
'FILENAME' => str_replace('.', '/', $source) . '.html')
);
- $code = str_replace(array("\r\n", "\r"), array("\n", "\n"), file_get_contents("{$phpbb_root_path}cache/{$cache_prefix}_$source.html.$phpEx"));
+ $code = str_replace(array("\r\n", "\r"), array("\n", "\n"), file_get_contents(PHPBB_ROOT_PATH . "cache/{$cache_prefix}_$source.html." . PHP_EXT));
$conf = array('highlight.bg', 'highlight.comment', 'highlight.default', 'highlight.html', 'highlight.keyword', 'highlight.string');
foreach ($conf as $ini_var)
@@ -1000,9 +999,9 @@ parse_css_file = {PARSE_CSS_FILE}
$tpl_file = str_replace('.', '/', $file);
$tpl_file = str_replace('///', '../', $tpl_file);
- $filename = "{$cache_prefix}_$file.html.$phpEx";
+ $filename = "{$cache_prefix}_$file.html." . PHP_EXT;
- if (!file_exists("{$phpbb_root_path}cache/$filename"))
+ if (!file_exists(PHPBB_ROOT_PATH . "cache/$filename"))
{
continue;
}
@@ -1010,10 +1009,10 @@ parse_css_file = {PARSE_CSS_FILE}
$template->assign_block_vars('file', array(
'U_VIEWSOURCE' => $this->u_action . "&amp;action=cache&amp;id=$template_id&amp;source=$file",
- 'CACHED' => $user->format_date(filemtime("{$phpbb_root_path}cache/$filename")),
+ 'CACHED' => $user->format_date(filemtime(PHPBB_ROOT_PATH . "cache/$filename")),
'FILENAME' => $file,
- 'FILESIZE' => sprintf('%.1f ' . $user->lang['KIB'], filesize("{$phpbb_root_path}cache/$filename") / 1024),
- 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/$tpl_file.html") : $filemtime[$file . '.html']))
+ 'FILESIZE' => sprintf('%.1f ' . $user->lang['KIB'], filesize(PHPBB_ROOT_PATH . "cache/$filename") / 1024),
+ 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime(PHPBB_ROOT_PATH . "styles/{$template_row['template_path']}/template/$tpl_file.html") : $filemtime[$file . '.html']))
);
}
unset($filemtime);
@@ -1034,7 +1033,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function edit_theme($theme_id)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template, $safe_mode;
+ global $config, $db, $cache, $user, $template, $safe_mode;
$this->page_title = 'EDIT_THEME';
@@ -1065,7 +1064,7 @@ parse_css_file = {PARSE_CSS_FILE}
if ($save_changes)
{
// Get the filesystem location of the current file
- $file = "{$phpbb_root_path}styles/{$theme_info['theme_path']}/theme/$theme_file";
+ $file = PHPBB_ROOT_PATH . "styles/{$theme_info['theme_path']}/theme/$theme_file";
$additional = '';
$message = $user->lang['THEME_UPDATED'];
@@ -1110,7 +1109,7 @@ parse_css_file = {PARSE_CSS_FILE}
// Generate a category array containing theme filenames
if (!$theme_info['theme_storedb'])
{
- $theme_path = "{$phpbb_root_path}styles/{$theme_info['theme_path']}/theme";
+ $theme_path = PHPBB_ROOT_PATH ."styles/{$theme_info['theme_path']}/theme";
$filelist = filelist($theme_path, '', 'css');
@@ -1218,7 +1217,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function edit_imageset($imageset_id)
{
- global $db, $user, $phpbb_root_path, $cache, $template;
+ global $db, $user, $cache, $template;
$this->page_title = 'EDIT_IMAGESET';
@@ -1293,7 +1292,7 @@ parse_css_file = {PARSE_CSS_FILE}
$imgheight = request_var('imgheight', 0);
$imglang = '';
- if ($imgpath && !file_exists("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath"))
+ if ($imgpath && !file_exists(PHPBB_ROOT_PATH . "styles/$imageset_path/imageset/$imgpath"))
{
trigger_error($user->lang['NO_IMAGE_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -1302,7 +1301,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
if (!$imgwidth || !$imgheight)
{
- list($imgwidth_file, $imgheight_file) = getimagesize("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath");
+ list($imgwidth_file, $imgheight_file) = getimagesize(PHPBB_ROOT_PATH . "styles/$imageset_path/imageset/$imgpath");
$imgwidth = ($imgwidth) ? $imgwidth : $imgwidth_file;
$imgheight = ($imgheight) ? $imgheight : $imgheight_file;
}
@@ -1361,7 +1360,7 @@ parse_css_file = {PARSE_CSS_FILE}
$imagesetlist = array('nolang' => array(), 'lang' => array());
$langs = array();
- $dir = "{$phpbb_root_path}styles/$imageset_path/imageset";
+ $dir = PHPBB_ROOT_PATH . "styles/$imageset_path/imageset";
$dp = @opendir($dir);
if ($dp)
@@ -1487,7 +1486,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function remove($mode, $style_id)
{
- global $db, $template, $user, $phpbb_root_path, $cache, $config;
+ global $db, $template, $user, $cache, $config;
$new_id = request_var('new_id', 0);
$update = (isset($_POST['update'])) ? true : false;
@@ -1623,7 +1622,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function export($mode, $style_id)
{
- global $db, $template, $user, $phpbb_root_path, $cache, $phpEx, $config;
+ global $db, $template, $user, $cache, $config;
$update = (isset($_POST['update'])) ? true : false;
@@ -1866,7 +1865,7 @@ parse_css_file = {PARSE_CSS_FILE}
end($data);
- $imageset_root = "{$phpbb_root_path}styles/{$style_row['imageset_path']}/imageset/";
+ $imageset_root = PHPBB_ROOT_PATH . "styles/{$style_row['imageset_path']}/imageset/";
if ($dh = @opendir($imageset_root))
{
@@ -1946,7 +1945,7 @@ parse_css_file = {PARSE_CSS_FILE}
if (!sizeof($error))
{
- include($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_compress.' . PHP_EXT);
if ($mode == 'style')
{
@@ -1959,11 +1958,11 @@ parse_css_file = {PARSE_CSS_FILE}
if ($format == 'zip')
{
- $compress = new compress_zip('w', $phpbb_root_path . "store/$path$ext");
+ $compress = new compress_zip('w', PHPBB_ROOT_PATH . "store/$path$ext");
}
else
{
- $compress = new compress_tar('w', $phpbb_root_path . "store/$path$ext", $ext);
+ $compress = new compress_tar('w', PHPBB_ROOT_PATH . "store/$path$ext", $ext);
}
if (sizeof($files))
@@ -1989,7 +1988,7 @@ parse_css_file = {PARSE_CSS_FILE}
if (!$store)
{
$compress->download($path);
- @unlink("{$phpbb_root_path}store/$path$ext");
+ @unlink(PHPBB_ROOT_PATH . "store/$path$ext");
exit;
}
@@ -2040,7 +2039,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function details($mode, $style_id)
{
- global $template, $db, $config, $user, $safe_mode, $cache, $phpbb_root_path;
+ global $template, $db, $config, $user, $safe_mode, $cache;
$update = (isset($_POST['update'])) ? true : false;
$l_type = strtoupper($mode);
@@ -2112,7 +2111,7 @@ parse_css_file = {PARSE_CSS_FILE}
if ($mode === 'theme' || $mode === 'template')
{
// a rather elaborate check we have to do here once to avoid trouble later
- $check = "{$phpbb_root_path}styles/" . $style_row["{$mode}_path"] . (($mode === 'theme') ? '/theme/stylesheet.css' : '/template');
+ $check = PHPBB_ROOT_PATH . "styles/" . $style_row["{$mode}_path"] . (($mode === 'theme') ? '/theme/stylesheet.css' : '/template');
if (($style_row["{$mode}_storedb"] != $store_db) && !$store_db && ($safe_mode || !@is_writable($check)))
{
$error[] = $user->lang['EDIT_' . strtoupper($mode) . '_STORED_DB'];
@@ -2122,7 +2121,7 @@ parse_css_file = {PARSE_CSS_FILE}
// themes which have to be parsed have to go into db
if ($mode == 'theme')
{
- $cfg = parse_cfg_file("{$phpbb_root_path}styles/" . $style_row["{$mode}_path"] . "/theme/theme.cfg");
+ $cfg = parse_cfg_file(PHPBB_ROOT_PATH . "styles/" . $style_row["{$mode}_path"] . "/theme/theme.cfg");
if (isset($cfg['parse_css_file']) && $cfg['parse_css_file'] && !$store_db)
{
@@ -2193,12 +2192,12 @@ parse_css_file = {PARSE_CSS_FILE}
{
$theme_data = $this->db_theme_data($style_row);
}
- else if (!$store_db && !$safe_mode && @is_writable("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css"))
+ else if (!$store_db && !$safe_mode && @is_writable(PHPBB_ROOT_PATH . "styles/{$style_row['theme_path']}/theme/stylesheet.css"))
{
$store_db = 1;
$theme_data = $style_row['theme_data'];
- if ($fp = @fopen("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css", 'wb'))
+ if ($fp = @fopen(PHPBB_ROOT_PATH . "styles/{$style_row['theme_path']}/theme/stylesheet.css", 'wb'))
{
$store_db = (@fwrite($fp, str_replace("styles/{$style_row['theme_path']}/theme/", './', $theme_data))) ? 0 : 1;
}
@@ -2206,7 +2205,7 @@ parse_css_file = {PARSE_CSS_FILE}
}
$sql_ary += array(
- 'theme_mtime' => ($store_db) ? filemtime("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css") : 0,
+ 'theme_mtime' => ($store_db) ? filemtime(PHPBB_ROOT_PATH . "styles/{$style_row['theme_path']}/theme/stylesheet.css") : 0,
'theme_storedb' => $store_db,
'theme_data' => ($store_db) ? $theme_data : '',
);
@@ -2217,7 +2216,7 @@ parse_css_file = {PARSE_CSS_FILE}
if ($style_row['template_storedb'] != $store_db)
{
- if (!$store_db && !$safe_mode && @is_writable("{$phpbb_root_path}styles/{$style_row['template_path']}/template"))
+ if (!$store_db && !$safe_mode && @is_writable(PHPBB_ROOT_PATH . "styles/{$style_row['template_path']}/template"))
{
$sql = 'SELECT *
FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
@@ -2226,7 +2225,7 @@ parse_css_file = {PARSE_CSS_FILE}
while ($row = $db->sql_fetchrow($result))
{
- if (!($fp = @fopen("{$phpbb_root_path}styles/{$style_row['template_path']}/template/" . $row['template_filename'], 'wb')))
+ if (!($fp = @fopen(PHPBB_ROOT_PATH . "styles/{$style_row['template_path']}/template/" . $row['template_filename'], 'wb')))
{
$store_db = 1;
$error[] = $user->lang['EDIT_TEMPLATE_STORED_DB'];
@@ -2247,7 +2246,7 @@ parse_css_file = {PARSE_CSS_FILE}
}
else if ($store_db)
{
- $filelist = filelist("{$phpbb_root_path}styles/{$style_row['template_path']}/template", '', 'html');
+ $filelist = filelist(PHPBB_ROOT_PATH . "styles/{$style_row['template_path']}/template", '', 'html');
$this->store_templates('insert', $style_id, $style_row['template_path'], $filelist);
}
else
@@ -2350,9 +2349,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function load_css_file($path, $filename)
{
- global $phpbb_root_path;
-
- $file = "{$phpbb_root_path}styles/$path/theme/$filename";
+ $file = PHPBB_ROOT_PATH . "styles/$path/theme/$filename";
if (file_exists($file) && ($content = file_get_contents($file)))
{
@@ -2372,17 +2369,15 @@ parse_css_file = {PARSE_CSS_FILE}
*
* @param array $theme_row is an associative array containing the theme's current database entry
* @param mixed $stylesheet can either be the new content for the stylesheet or false to load from the standard file
- * @param string $root_path should only be used in case you want to use a different root path than "{$phpbb_root_path}styles/{$theme_row['theme_path']}"
+ * @param string $root_path should only be used in case you want to use a different root path than PHPBB_ROOT_PATH . "styles/{$theme_row['theme_path']}"
*
* @return string Stylesheet data for theme_data column in the theme table
*/
function db_theme_data($theme_row, $stylesheet = false, $root_path = '')
{
- global $phpbb_root_path;
-
if (!$root_path)
{
- $root_path = $phpbb_root_path . 'styles/' . $theme_row['theme_path'];
+ $root_path = PHPBB_ROOT_PATH . 'styles/' . $theme_row['theme_path'];
}
if (!$stylesheet)
@@ -2415,7 +2410,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function store_templates($mode, $style_id, $template_path, $filelist)
{
- global $phpbb_root_path, $phpEx, $db;
+ global $db;
$template_path = $template_path . '/template/';
$includes = array();
@@ -2423,11 +2418,11 @@ parse_css_file = {PARSE_CSS_FILE}
{
foreach ($file_ary as $file)
{
- if (!($fp = @fopen("{$phpbb_root_path}styles/$template_path$pathfile$file", 'r')))
+ if (!($fp = @fopen(PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file", 'r')))
{
- trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR);
+ trigger_error('Could not open ' . PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file", E_USER_ERROR);
}
- $template_data = fread($fp, filesize("{$phpbb_root_path}styles/$template_path$pathfile$file"));
+ $template_data = fread($fp, filesize(PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file"));
fclose($fp);
if (preg_match_all('#<!-- INCLUDE (.*?\.html) -->#is', $template_data, $matches))
@@ -2456,8 +2451,8 @@ parse_css_file = {PARSE_CSS_FILE}
'template_id' => (int) $style_id,
'template_filename' => "$pathfile$file",
'template_included' => (isset($includes[$file])) ? implode(':', $includes[$file]) . ':' : '',
- 'template_mtime' => (int) filemtime("{$phpbb_root_path}styles/$template_path$pathfile$file"),
- 'template_data' => (string) file_get_contents("{$phpbb_root_path}styles/$template_path$pathfile$file"),
+ 'template_mtime' => (int) filemtime(PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file"),
+ 'template_data' => (string) file_get_contents(PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file"),
);
if ($mode == 'insert')
@@ -2484,11 +2479,11 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function template_cache_filelist($template_path)
{
- global $phpbb_root_path, $phpEx, $user;
+ global $user;
$cache_prefix = 'tpl_' . $template_path;
- if (!($dp = @opendir("{$phpbb_root_path}cache")))
+ if (!($dp = @opendir(PHPBB_ROOT_PATH . 'cache')))
{
trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -2501,9 +2496,9 @@ parse_css_file = {PARSE_CSS_FILE}
continue;
}
- if (is_file($phpbb_root_path . 'cache/' . $file) && (strpos($file, $cache_prefix) === 0))
+ if (is_file(PHPBB_ROOT_PATH . 'cache/' . $file) && (strpos($file, $cache_prefix) === 0))
{
- $file_ary[] = str_replace('.', '/', preg_replace('#^' . preg_quote($cache_prefix, '#') . '_(.*?)\.html\.' . $phpEx . '$#i', '\1', $file));
+ $file_ary[] = str_replace('.', '/', preg_replace('#^' . preg_quote($cache_prefix, '#') . '_(.*?)\.html\.' . PHP_EXT . '$#i', '\1', $file));
}
}
closedir($dp);
@@ -2520,7 +2515,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function clear_template_cache($template_row, $file_ary = false)
{
- global $phpbb_root_path, $phpEx, $user;
+ global $user;
$cache_prefix = 'tpl_' . $template_row['template_path'];
@@ -2538,7 +2533,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
$file = str_replace('/', '.', $file);
- $file = "{$phpbb_root_path}cache/{$cache_prefix}_$file.html.$phpEx";
+ $file = PHPBB_ROOT_PATH . "cache/{$cache_prefix}_$file.html." . PHP_EXT;
if (file_exists($file) && is_file($file))
{
@unlink($file);
@@ -2554,7 +2549,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function install($mode)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
+ global $config, $db, $cache, $user, $template;
$l_type = strtoupper($mode);
@@ -2568,7 +2563,7 @@ parse_css_file = {PARSE_CSS_FILE}
// Installing, obtain cfg file contents
if ($install_path)
{
- $root_path = $phpbb_root_path . 'styles/' . $install_path . '/';
+ $root_path = PHPBB_ROOT_PATH . 'styles/' . $install_path . '/';
$cfg_file = ($mode == 'style') ? "$root_path$mode.cfg" : "$root_path$mode/$mode.cfg";
if (!file_exists($cfg_file))
@@ -2617,7 +2612,7 @@ parse_css_file = {PARSE_CSS_FILE}
$element . '_copyright' => '')
);
- $this->test_installed($element, $error, (${'reqd_' . $element}) ? $phpbb_root_path . 'styles/' . $reqd_template . '/' : $root_path, ${'reqd_' . $element}, $style_row[$element . '_id'], $style_row[$element . '_name'], $style_row[$element . '_copyright']);
+ $this->test_installed($element, $error, (${'reqd_' . $element}) ? PHPBB_ROOT_PATH . 'styles/' . $reqd_template . '/' : $root_path, ${'reqd_' . $element}, $style_row[$element . '_id'], $style_row[$element . '_name'], $style_row[$element . '_copyright']);
if (!$style_row[$element . '_name'])
{
@@ -2656,7 +2651,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
foreach ($element_ary as $element => $table)
{
- ${$element . '_root_path'} = (${'reqd_' . $element}) ? $phpbb_root_path . 'styles/' . ${'reqd_' . $element} . '/' : false;
+ ${$element . '_root_path'} = (${'reqd_' . $element}) ? PHPBB_ROOT_PATH . 'styles/' . ${'reqd_' . $element} . '/' : false;
${$element . '_path'} = (${'reqd_' . $element}) ? ${'reqd_' . $element} : false;
}
$this->install_style($error, 'install', $root_path, $style_row['style_id'], $style_row['style_name'], $install_path, $style_row['style_copyright'], $style_row['style_active'], $style_row['style_default'], $style_row, $template_root_path, $template_path, $theme_root_path, $theme_path, $imageset_root_path, $imageset_path);
@@ -2712,7 +2707,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function add($mode)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
+ global $config, $db, $cache, $user, $template;
$l_type = strtoupper($mode);
$element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE);
@@ -3031,7 +3026,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function install_element($mode, &$error, $action, $root_path, &$id, $name, $path, $copyright, $store_db = 0)
{
- global $phpbb_root_path, $db, $user;
+ global $db, $user;
switch ($mode)
{
@@ -3120,7 +3115,7 @@ parse_css_file = {PARSE_CSS_FILE}
case 'theme':
// We are only interested in the theme configuration for now
- $theme_cfg = parse_cfg_file("{$phpbb_root_path}styles/$path/theme/theme.cfg");
+ $theme_cfg = parse_cfg_file(PHPBB_ROOT_PATH . "styles/$path/theme/theme.cfg");
if (isset($theme_cfg['parse_css_file']) && $theme_cfg['parse_css_file'])
{
@@ -3130,7 +3125,7 @@ parse_css_file = {PARSE_CSS_FILE}
$sql_ary += array(
'theme_storedb' => $store_db,
'theme_data' => ($store_db) ? $this->db_theme_data($sql_ary, false, $root_path) : '',
- 'theme_mtime' => (int) filemtime("{$phpbb_root_path}styles/$path/theme/stylesheet.css")
+ 'theme_mtime' => (int) filemtime(PHPBB_ROOT_PATH . "styles/$path/theme/stylesheet.css")
);
break;
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
index dbb25bdbbd..a6440c8364 100644
--- a/phpBB/includes/acp/acp_update.php
+++ b/phpBB/includes/acp/acp_update.php
@@ -26,7 +26,6 @@ class acp_update
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('install');
@@ -48,7 +47,7 @@ class acp_update
$latest_version = trim($info[0]);
$announcement_url = trim($info[1]);
- $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
+ $update_link = append_sid('install/index', 'mode=update');
// Determine automatic update...
$sql = 'SELECT config_value
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 3ad8c88fb9..667cd6a64b 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -31,8 +31,7 @@ class acp_users
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
+ global $config, $db, $user, $auth, $template, $cache, $file_uploads;
$user->add_lang(array('posting', 'ucp', 'acp/users'));
$this->tpl_name = 'acp_users';
@@ -51,7 +50,7 @@ class acp_users
// Whois (special case)
if ($action == 'whois')
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$this->page_title = 'WHOIS';
$this->tpl_name = 'simple_body';
@@ -78,7 +77,7 @@ class acp_users
'ANONYMOUS_USER_ID' => ANONYMOUS,
'S_SELECT_USER' => true,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_user&amp;field=username&amp;select_single=true'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=select_user&amp;field=username&amp;select_single=true'),
));
return;
@@ -146,7 +145,7 @@ class acp_users
$template->assign_vars(array(
'U_BACK' => $this->u_action,
- 'U_MODE_SELECT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;u=$user_id"),
+ 'U_MODE_SELECT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&amp;u=$user_id"),
'U_ACTION' => $this->u_action . '&amp;u=' . $user_id,
'S_FORM_OPTIONS' => $s_form_options,
'MANAGED_USERNAME' => $user_row['username'])
@@ -162,7 +161,7 @@ class acp_users
{
case 'overview':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$user->add_lang('acp/ban');
@@ -303,7 +302,7 @@ class acp_users
if ($config['email_enable'])
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$server_url = generate_board_url();
@@ -347,7 +346,7 @@ class acp_users
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
'USERNAME' => htmlspecialchars_decode($user_row['username']),
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
+ 'U_ACTIVATE' => "$server_url/ucp." . PHP_EXT . "?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
);
$messenger->send(NOTIFY_EMAIL);
@@ -906,7 +905,7 @@ class acp_users
'U_SHOW_IP' => $this->u_action . "&amp;u=$user_id&amp;ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
'U_WHOIS' => $this->u_action . "&amp;action=whois&amp;user_ip={$user_row['user_ip']}",
- 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_row['user_id']}") : '',
+ 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid('ucp', "mode=switch_perm&amp;u={$user_row['user_id']}") : '',
'USER' => $user_row['username'],
'USER_REGISTERED' => $user->format_date($user_row['user_regdate']),
@@ -1024,8 +1023,8 @@ class acp_users
case 'profile':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
$cp = new custom_profile();
@@ -1227,7 +1226,7 @@ class acp_users
case 'prefs':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$data = array(
'dateformat' => utf8_normalize_nfc(request_var('dateformat', $user_row['user_dateformat'], true)),
@@ -1438,10 +1437,10 @@ class acp_users
case 'avatar':
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
+ $can_upload = (file_exists(PHPBB_ROOT_PATH . $config['avatar_path']) && @is_writable(PHPBB_ROOT_PATH . $config['avatar_path']) && $file_uploads) ? true : false;
if ($submit)
{
@@ -1461,7 +1460,7 @@ class acp_users
}
// Generate users avatar
- $avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
+ $avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '<img src="' . PHPBB_ADMIN_PATH . 'images/no_avatar.gif" alt="" />';
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
$avatar_select = basename(request_var('avatar_select', ''));
@@ -1532,8 +1531,8 @@ class acp_users
case 'sig':
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
$enable_bbcode = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false;
$enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false;
@@ -1544,7 +1543,7 @@ class acp_users
if ($submit || $preview)
{
- include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
$message_parser = new parse_message($signature);
@@ -1602,7 +1601,7 @@ class acp_users
'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '',
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' checked="checked"' : '',
- 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid('faq', 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid('faq', 'mode=bbcode') . '">', '</a>'),
'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
@@ -1734,11 +1733,11 @@ class acp_users
{
if ($row['in_message'])
{
- $view_topic = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;p={$row['post_msg_id']}");
+ $view_topic = append_sid('ucp', "i=pm&amp;p={$row['post_msg_id']}");
}
else
{
- $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&amp;p={$row['post_msg_id']}") . '#p' . $row['post_msg_id'];
+ $view_topic = append_sid('viewtopic', "t={$row['topic_id']}&amp;p={$row['post_msg_id']}") . '#p' . $row['post_msg_id'];
}
$template->assign_block_vars('attach', array(
@@ -1756,7 +1755,7 @@ class acp_users
'S_IN_MESSAGE' => $row['in_message'],
- 'U_DOWNLOAD' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&amp;id=' . $row['attach_id']),
+ 'U_DOWNLOAD' => append_sid('download/file', 'mode=view&amp;id=' . $row['attach_id']),
'U_VIEW_TOPIC' => $view_topic)
);
}
@@ -1775,7 +1774,7 @@ class acp_users
case 'groups':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$user->add_lang(array('groups', 'acp/groups'));
$group_id = request_var('g', 0);
@@ -1933,7 +1932,7 @@ class acp_users
foreach ($data_ary as $data)
{
$template->assign_block_vars('group', array(
- 'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g={$data['group_id']}&amp;back_link=acp_users_groups"),
+ 'U_EDIT_GROUP' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g={$data['group_id']}&amp;back_link=acp_users_groups"),
'U_DEFAULT' => $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_DEMOTE_PROMOTE' => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id'],
@@ -1957,7 +1956,7 @@ class acp_users
case 'perm':
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
$auth_admin = new auth_admin();
@@ -2015,8 +2014,8 @@ class acp_users
'S_FORUM_OPTIONS' => $s_forum_options,
'U_ACTION' => $this->u_action . '&amp;u=' . $user_id,
- 'U_USER_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx" ,'i=permissions&amp;mode=setting_user_global&amp;user_id[]=' . $user_id),
- 'U_USER_FORUM_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions&amp;mode=setting_user_local&amp;user_id[]=' . $user_id))
+ 'U_USER_PERMISSIONS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions&amp;mode=setting_user_global&amp;user_id[]=' . $user_id),
+ 'U_USER_FORUM_PERMISSIONS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions&amp;mode=setting_user_local&amp;user_id[]=' . $user_id))
);
break;
diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php
index 596c2fc743..5db6bef3e5 100644
--- a/phpBB/includes/acp/acp_words.php
+++ b/phpBB/includes/acp/acp_words.php
@@ -26,8 +26,7 @@ class acp_words
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('acp/posting');
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 5c81092a65..0fd78981a9 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -262,7 +262,7 @@ class auth_admin extends auth
*/
public function display_mask($mode, $permission_type, array $hold_ary, $user_mode = 'user', $local = false, $group_display = true)
{
- global $template, $user, $db, $phpbb_root_path, $phpEx;
+ global $template, $user, $db;
// Define names for template loops, might be able to be set
$tpl_pmask = 'p_mask';
@@ -606,7 +606,7 @@ class auth_admin extends auth
*/
public function display_role_mask(array $hold_ary)
{
- global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $template, $user;
if (!sizeof($hold_ary))
{
@@ -650,7 +650,7 @@ class auth_admin extends auth
$template->assign_block_vars('role_mask.users', array(
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
- 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&amp;u={$row['user_id']}"))
+ 'U_PROFILE' => append_sid('memberlist', "mode=viewprofile&amp;u={$row['user_id']}"))
);
}
$db->sql_freeresult($result);
@@ -669,7 +669,7 @@ class auth_admin extends auth
$template->assign_block_vars('role_mask.groups', array(
'GROUP_ID' => $row['group_id'],
'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],
- 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&amp;g={$row['group_id']}"))
+ 'U_PROFILE' => append_sid('memberlist', "mode=group&amp;g={$row['group_id']}"))
);
}
$db->sql_freeresult($result);
@@ -1076,7 +1076,7 @@ class auth_admin extends auth
*/
private static function assign_cat_array(array $category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view)
{
- global $template, $user, $phpbb_admin_path, $phpEx;
+ global $template, $user;
@reset($category_array);
while (list($cat, $cat_array) = each($category_array))
@@ -1118,8 +1118,8 @@ class auth_admin extends auth
'FIELD_NAME' => $permission,
'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
- 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
- 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
+ 'U_TRACE' => ($show_trace) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
+ 'UA_TRACE' => ($show_trace) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
);
@@ -1136,8 +1136,8 @@ class auth_admin extends auth
'FIELD_NAME' => $permission,
'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
- 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
- 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
+ 'U_TRACE' => ($show_trace) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
+ 'UA_TRACE' => ($show_trace) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
);
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php
index 3512d14d56..6f6a7f3ba9 100644
--- a/phpBB/includes/auth.php
+++ b/phpBB/includes/auth.php
@@ -848,10 +848,10 @@ class auth
*/
public function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)
{
- global $config, $db, $user, $phpbb_root_path, $phpEx;
+ global $config, $db, $user;
$method = trim(basename($config['auth_method']));
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
$method = 'login_' . $method;
if (function_exists($method))
@@ -864,7 +864,7 @@ class auth
// we are going to use the user_add function so include functions_user.php if it wasn't defined yet
if (!function_exists('user_add'))
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
}
user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false);
diff --git a/phpBB/includes/auth/auth_apache.php b/phpBB/includes/auth/auth_apache.php
index acdd4e3386..c57a06a46d 100644
--- a/phpBB/includes/auth/auth_apache.php
+++ b/phpBB/includes/auth/auth_apache.php
@@ -165,9 +165,7 @@ function autologin_apache()
if (!function_exists('user_add'))
{
- global $phpbb_root_path, $phpEx;
-
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
}
// create the user if he does not exist yet
diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php
index 00dd438210..fa99a2fe4c 100644
--- a/phpBB/includes/auth/auth_db.php
+++ b/phpBB/includes/auth/auth_db.php
@@ -137,8 +137,7 @@ function login_db(&$username, &$password)
{
if (!function_exists('utf8_to_cp1252'))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/recode_basic.' . PHP_EXT);
}
// cp1252 is phpBB2's default encoding, characters outside ASCII range might work when converted into that encoding
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 354885143c..d688f660f2 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -128,12 +128,12 @@ class bbcode
*/
function bbcode_cache_init()
{
- global $user, $phpbb_root_path;
+ global $user;
if (empty($this->template_filename))
{
$this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
- $this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';
+ $this->template_filename = PHPBB_ROOT_PATH . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';
if (!@file_exists($this->template_filename))
{
diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php
index af2c0ab9fa..879fbb6a80 100644
--- a/phpBB/includes/cache.php
+++ b/phpBB/includes/cache.php
@@ -324,7 +324,7 @@ class cache
*/
public static function obtain_cfg_item($theme, $item = 'theme')
{
- global $config, $phpbb_root_path, $cache;
+ global $config, $cache;
$parsed_array = $cache->get('_cfg_' . $item . '_' . $theme[$item . '_path']);
@@ -334,7 +334,7 @@ class cache
}
$reparse = false;
- $filename = $phpbb_root_path . 'styles/' . $theme[$item . '_path'] . '/' . $item . '/' . $item . '.cfg';
+ $filename = PHPBB_ROOT_PATH . 'styles/' . $theme[$item . '_path'] . '/' . $item . '/' . $item . '.cfg';
if (!file_exists($filename))
{
@@ -395,22 +395,18 @@ class cache
if (($hook_files = $cache->get('_hooks')) === false)
{
- global $phpbb_root_path;
-
$hook_files = array();
// Now search for hooks...
- $dh = @opendir($phpbb_root_path . 'includes/hooks/');
+ $dh = @opendir(PHPBB_ROOT_PATH . 'includes/hooks/');
if ($dh)
{
- global $phpEx;
-
while (($file = readdir($dh)) !== false)
{
- if (strpos($file, 'hook_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx)
+ if (strpos($file, 'hook_') === 0 && substr($file, -(strlen(PHP_EXT) + 1)) === '.' . PHP_EXT)
{
- $hook_files[] = substr($file, 0, -(strlen($phpEx) + 1));
+ $hook_files[] = substr($file, 0, -(strlen(PHP_EXT) + 1));
}
}
closedir($dh);
diff --git a/phpBB/includes/db/db2.php b/phpBB/includes/db/db2.php
index ecabc1c2e1..8a5ce0103d 100644
--- a/phpBB/includes/db/db2.php
+++ b/phpBB/includes/db/db2.php
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
/**
* MSSQL Database Abstraction Layer
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index d385b98f55..4082edf24a 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -618,7 +618,7 @@ class dbal
*/
function sql_report($mode, $query = '')
{
- global $cache, $starttime, $phpbb_root_path, $user;
+ global $cache, $starttime, $user;
if (empty($_REQUEST['explain']))
{
@@ -649,7 +649,7 @@ class dbal
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<title>SQL Report</title>
- <link href="' . $phpbb_root_path . 'adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
+ <link href="' . PHPBB_ROOT_PATH . 'adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body id="errorpage">
<div id="wrap">
diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php
index 48eb22046e..7760666ea1 100644
--- a/phpBB/includes/db/firebird.php
+++ b/phpBB/includes/db/firebird.php
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
/**
* Firebird/Interbase Database Abstraction Layer
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index a6c8d26a4d..f842cb06d6 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
/**
* MSSQL Database Abstraction Layer
diff --git a/phpBB/includes/db/mssql_2005.php b/phpBB/includes/db/mssql_2005.php
index 9fc2e7027f..730013c6f5 100644
--- a/phpBB/includes/db/mssql_2005.php
+++ b/phpBB/includes/db/mssql_2005.php
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
/**
* MSSQL Database Abstraction Layer
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index f79cd55af4..86faf82036 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
/**
* Unified ODBC functions
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 1e32b8178a..fd4dc74674 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
/**
* MySQL Database Abstraction Layer
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
index 48ea8d3c53..a7ba07b8a5 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/mysqli.php
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
/**
* MySQLi Database Abstraction Layer
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
index 09648d9841..a66dfcce8b 100644
--- a/phpBB/includes/db/oracle.php
+++ b/phpBB/includes/db/oracle.php
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
/**
* Oracle Database Abstraction Layer
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index f4237999ff..4c3e4729fa 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
/**
* PostgreSQL Database Abstraction Layer
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php
index 64621496c4..f887e4e3b1 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/sqlite.php
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
/**
* Sqlite Database Abstraction Layer
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index a42d773286..a61c1ed1a3 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1581,16 +1581,37 @@ function on_page($num_items, $per_page, $start)
*
* Examples:
* <code>
-* append_sid("{$phpbb_root_path}viewtopic.$phpEx?t=1&amp;f=2");
-* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&amp;f=2');
-* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2', false);
-* append_sid("{$phpbb_root_path}viewtopic.$phpEx", array('t' => 1, 'f' => 2));
+* append_sid(PHPBB_ROOT_PATH . 'viewtopic.' . PHP_EXT . '?t=1&amp;f=2');
+* append_sid(PHPBB_ROOT_PATH . 'viewtopic.' . PHP_EXT, 't=1&amp;f=2');
+* append_sid('viewtopic', 't=1&amp;f=2'); // short notation of the above example
+* append_sid('viewtopic', 't=1&f=2', false);
+* append_sid('viewtopic', array('t' => 1, 'f' => 2));
* </code>
*
*/
function append_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $_SID, $_EXTRA_URL, $phpbb_hook;
+ static $parsed_urls = array();
+
+ // Adjust internal url before calling the hook - we are able to just leave out any path and extension.
+ // In this case the root path and extension are added before going through this function.
+ if (isset($parsed_urls[$url]))
+ {
+ $url = $parsed_urls[$url];
+ }
+ else
+ {
+ if (strpos($url, '.' . PHP_EXT) === false && $url[0] != '.' && $url[0] != '/')
+ {
+ $parsed_urls[$url] = $url = PHPBB_ROOT_PATH . $url . '.' . PHP_EXT;
+ }
+ }
+
+ if (empty($params))
+ {
+ $params = false;
+ }
// Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropiatly.
// They could mimick most of what is within this function
@@ -1727,7 +1748,7 @@ function generate_board_url($without_script_path = false)
*/
function redirect($url, $return = false)
{
- global $db, $cache, $config, $user, $phpbb_root_path;
+ global $db, $cache, $config, $user;
if (empty($user->lang))
{
@@ -1786,8 +1807,8 @@ function redirect($url, $return = false)
}
else
{
- // Used ./ before, but $phpbb_root_path is working better with urls within another root path
- $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($phpbb_root_path)));
+ // Used ./ before, but PHPBB_ROOT_PATH is working better with urls within another root path
+ $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath(PHPBB_ROOT_PATH)));
$page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($pathinfo['dirname'])));
$intersection = array_intersect_assoc($root_dirs, $page_dirs);
@@ -1871,15 +1892,13 @@ function redirect($url, $return = false)
*/
function reapply_sid($url)
{
- global $phpEx, $phpbb_root_path;
-
- if ($url === "index.$phpEx")
+ if ($url === 'index.' . PHP_EXT)
{
- return append_sid("index.$phpEx");
+ return append_sid('index.' . PHP_EXT);
}
- else if ($url === "{$phpbb_root_path}index.$phpEx")
+ else if ($url === PHPBB_ROOT_PATH . 'index.' . PHP_EXT)
{
- return append_sid("{$phpbb_root_path}index.$phpEx");
+ return append_sid('index');
}
// Remove previously added sid
@@ -1904,7 +1923,7 @@ function reapply_sid($url)
*/
function build_url($strip_vars = false)
{
- global $user, $phpbb_root_path;
+ global $user;
// Append SID
$redirect = append_sid($user->page['page'], false, false);
@@ -1957,7 +1976,7 @@ function build_url($strip_vars = false)
$redirect .= ($query) ? '?' . $query : '';
}
- return $phpbb_root_path . str_replace('&', '&amp;', $redirect);
+ return PHPBB_ROOT_PATH . str_replace('&', '&amp;', $redirect);
}
/**
@@ -2055,7 +2074,6 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
{
global $user, $template, $db;
- global $phpEx, $phpbb_root_path;
if (isset($_POST['cancel']))
{
@@ -2125,7 +2143,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
}
// re-add sid / transform & to &amp; for user->page (user->page is always using &)
- $use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&amp;', $user->page['page']);
+ $use_page = ($u_action) ? PHPBB_ROOT_PATH . $u_action : PHPBB_ROOT_PATH . str_replace('&', '&amp;', $user->page['page']);
$u_action = reapply_sid($use_page);
$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&amp;') . 'confirm_key=' . $confirm_key;
@@ -2157,7 +2175,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
*/
function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)
{
- global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config;
+ global $db, $user, $template, $auth, $config;
$err = '';
@@ -2241,9 +2259,9 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
// The result parameter is always an array, holding the relevant information...
if ($result['status'] == LOGIN_SUCCESS)
{
- $redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx");
+ $redirect = request_var('redirect', PHPBB_ROOT_PATH . 'index.' . PHP_EXT);
$message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT'];
- $l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "{$phpbb_root_path}index.$phpEx" || $redirect === "index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']);
+ $l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === PHPBB_ROOT_PATH . 'index.' . PHP_EXT || $redirect === "index." . PHP_EXT) ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']);
// append/replace SID (may change during the session for AOL users)
$redirect = reapply_sid($redirect);
@@ -2295,7 +2313,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$template->assign_vars(array(
'S_CONFIRM_CODE' => true,
'CONFIRM_ID' => $confirm_id,
- 'CONFIRM_IMAGE' => '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_LOGIN) . '" alt="" title="" />',
+ 'CONFIRM_IMAGE' => '<img src="' . append_sid('ucp', 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_LOGIN) . '" alt="" title="" />',
'L_LOGIN_CONFIRM_EXPLAIN' => sprintf($user->lang['LOGIN_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
));
@@ -2306,7 +2324,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
case LOGIN_ERROR_PASSWORD_CONVERT:
$err = sprintf(
$user->lang[$result['error_msg']],
- ($config['email_enable']) ? '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') . '">' : '',
+ ($config['email_enable']) ? '<a href="' . append_sid('ucp', 'mode=sendpassword') . '">' : '',
($config['email_enable']) ? '</a>' : '',
($config['board_contact']) ? '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">' : '',
($config['board_contact']) ? '</a>' : ''
@@ -2360,13 +2378,13 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
'LOGIN_ERROR' => $err,
'LOGIN_EXPLAIN' => $l_explain,
- 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '',
- 'U_RESEND_ACTIVATION' => ($config['require_activation'] != USER_ACTIVATION_NONE && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
- 'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
- 'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
+ 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid('ucp', 'mode=sendpassword') : '',
+ 'U_RESEND_ACTIVATION' => ($config['require_activation'] != USER_ACTIVATION_NONE && $config['email_enable']) ? append_sid('ucp', 'mode=resend_act') : '',
+ 'U_TERMS_USE' => append_sid('ucp', 'mode=terms'),
+ 'U_PRIVACY' => append_sid('ucp', 'mode=privacy'),
'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false,
- 'S_LOGIN_ACTION' => (!$admin) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id), // Needs to stay index.$phpEx because we are within the admin directory
+ 'S_LOGIN_ACTION' => (!$admin) ? append_sid('ucp', 'mode=login') : append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, false, true, $user->session_id),
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_ADMIN_AUTH' => $admin,
@@ -2381,7 +2399,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$template->set_filenames(array(
'body' => 'login_body.html')
);
- make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
+ make_jumpbox(append_sid('viewforum'));
page_footer();
}
@@ -2391,7 +2409,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
*/
function login_forum_box($forum_data)
{
- global $db, $config, $user, $template, $phpEx;
+ global $db, $config, $user, $template;
$password = request_var('password', '', true);
@@ -2628,11 +2646,9 @@ function add_log()
*/
function get_backtrace()
{
- global $phpbb_root_path;
-
$output = '<div style="font-family: monospace;">';
$backtrace = debug_backtrace();
- $path = phpbb_realpath($phpbb_root_path);
+ $path = phpbb_realpath(PHPBB_ROOT_PATH);
foreach ($backtrace as $number => $trace)
{
@@ -2835,7 +2851,7 @@ function phpbb_checkdnsrr($host, $type = '')
function msg_handler($errno, $msg_text, $errfile, $errline)
{
global $cache, $db, $auth, $template, $config, $user;
- global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text;
+ global $msg_title, $msg_long_text;
// Do not display notices if we suppress them via @
if (error_reporting() == 0)
@@ -2880,8 +2896,8 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
}
// remove complete path to installation, with the risk of changing backslashes meant to be there
- $errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile);
- $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
+ $errfile = str_replace(array(phpbb_realpath(PHPBB_ROOT_PATH), '\\'), array('', '/'), $errfile);
+ $msg_text = str_replace(array(phpbb_realpath(PHPBB_ROOT_PATH), '\\'), array('', '/'), $msg_text);
echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
}
@@ -2898,7 +2914,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
$msg_text = (!empty($user->lang[$msg_text])) ? $user->lang[$msg_text] : $msg_text;
$msg_title = (!isset($msg_title)) ? $user->lang['GENERAL_ERROR'] : ((!empty($user->lang[$msg_title])) ? $user->lang[$msg_title] : $msg_title);
- $l_return_index = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $phpbb_root_path . '">', '</a>');
+ $l_return_index = sprintf($user->lang['RETURN_INDEX'], '<a href="' . PHPBB_ROOT_PATH . '">', '</a>');
$l_notify = '';
if (!empty($config['board_contact']))
@@ -2909,7 +2925,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
else
{
$msg_title = 'General Error';
- $l_return_index = '<a href="' . $phpbb_root_path . '">Return to index page</a>';
+ $l_return_index = '<a href="' . PHPBB_ROOT_PATH . '">Return to index page</a>';
$l_notify = '';
if (!empty($config['board_contact']))
@@ -3034,7 +3050,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
*/
function page_header($page_title = '', $display_online_list = true)
{
- global $db, $config, $template, $SID, $_SID, $user, $auth, $phpEx, $phpbb_root_path;
+ global $db, $config, $template, $SID, $_SID, $user, $auth;
if (defined('HEADER_INC'))
{
@@ -3055,12 +3071,12 @@ function page_header($page_title = '', $display_online_list = true)
// Generate logged in/logged out status
if ($user->data['user_id'] != ANONYMOUS)
{
- $u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id);
+ $u_login_logout = append_sid('ucp', 'mode=logout', true, $user->session_id);
$l_login_logout = sprintf($user->lang['LOGOUT_USER'], $user->data['username']);
}
else
{
- $u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login');
+ $u_login_logout = append_sid('ucp', 'mode=login');
$l_login_logout = $user->lang['LOGIN'];
}
@@ -3272,7 +3288,7 @@ function page_header($page_title = '', $display_online_list = true)
$user_lang = $user->lang['USER_LANG'];
if (strpos($user_lang, '-x-') !== false)
{
- $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-'));
+ $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-'));
}
// The following assigns all _common_ variables that may be used at any point in a template.
@@ -3280,7 +3296,7 @@ function page_header($page_title = '', $display_online_list = true)
'SITENAME' => $config['sitename'],
'SITE_DESCRIPTION' => $config['site_desc'],
'PAGE_TITLE' => $page_title,
- 'SCRIPT_NAME' => str_replace('.' . $phpEx, '', $user->page['page_name']),
+ 'SCRIPT_NAME' => str_replace('.' . PHP_EXT, '', $user->page['page_name']),
'LAST_VISIT_DATE' => sprintf($user->lang['YOU_LAST_VISIT'], $s_last_visit),
'LAST_VISIT_YOU' => $s_last_visit,
'CURRENT_TIME' => sprintf($user->lang['CURRENT_TIME'], $user->format_date(time(), false, true)),
@@ -3296,32 +3312,32 @@ function page_header($page_title = '', $display_online_list = true)
'SID' => $SID,
'_SID' => $_SID,
'SESSION_ID' => $user->session_id,
- 'ROOT_PATH' => $phpbb_root_path,
+ 'ROOT_PATH' => PHPBB_ROOT_PATH,
'L_LOGIN_LOGOUT' => $l_login_logout,
'L_INDEX' => $user->lang['FORUM_INDEX'],
'L_ONLINE_EXPLAIN' => $l_online_time,
- 'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
- 'U_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
- 'U_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=popup'),
- 'UA_POPUP_PM' => addslashes(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=popup')),
- 'U_MEMBERLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"),
- 'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$phpbb_root_path}viewonline.$phpEx") : '',
+ 'U_PRIVATEMSGS' => append_sid('ucp', 'i=pm&amp;folder=inbox'),
+ 'U_RETURN_INBOX' => append_sid('ucp', 'i=pm&amp;folder=inbox'),
+ 'U_POPUP_PM' => append_sid('ucp', 'i=pm&amp;mode=popup'),
+ 'UA_POPUP_PM' => addslashes(append_sid('ucp', 'i=pm&amp;mode=popup')),
+ 'U_MEMBERLIST' => append_sid('memberlist'),
+ 'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid('viewonline') : '',
'U_LOGIN_LOGOUT' => $u_login_logout,
- 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
- 'U_SEARCH' => append_sid("{$phpbb_root_path}search.$phpEx"),
- 'U_REGISTER' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
- 'U_PROFILE' => append_sid("{$phpbb_root_path}ucp.$phpEx"),
- 'U_MODCP' => append_sid("{$phpbb_root_path}mcp.$phpEx", false, true, $user->session_id),
- 'U_FAQ' => append_sid("{$phpbb_root_path}faq.$phpEx"),
- 'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=egosearch'),
- 'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts'),
- 'U_SEARCH_UNANSWERED' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered'),
- 'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),
- 'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'),
- 'U_TEAM' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders'),
- 'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '',
+ 'U_INDEX' => append_sid('index'),
+ 'U_SEARCH' => append_sid('search'),
+ 'U_REGISTER' => append_sid('ucp', 'mode=register'),
+ 'U_PROFILE' => append_sid('ucp'),
+ 'U_MODCP' => append_sid('mcp', false, true, $user->session_id),
+ 'U_FAQ' => append_sid('faq'),
+ 'U_SEARCH_SELF' => append_sid('search', 'search_id=egosearch'),
+ 'U_SEARCH_NEW' => append_sid('search', 'search_id=newposts'),
+ 'U_SEARCH_UNANSWERED' => append_sid('search', 'search_id=unanswered'),
+ 'U_SEARCH_ACTIVE_TOPICS'=> append_sid('search', 'search_id=active_topics'),
+ 'U_DELETE_COOKIES' => append_sid('ucp', 'mode=delete_cookies'),
+ 'U_TEAM' => append_sid('memberlist', 'mode=leaders'),
+ 'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid('ucp', 'mode=restore_perm') : '',
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false,
@@ -3347,18 +3363,18 @@ function page_header($page_title = '', $display_online_list = true)
'S_NEW_PM' => ($s_privmsg_new) ? 1 : 0,
'S_REGISTER_ENABLED' => ($config['require_activation'] != USER_ACTIVATION_DISABLE) ? true : false,
- 'T_THEME_PATH' => "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme',
- 'T_TEMPLATE_PATH' => "{$phpbb_root_path}styles/" . $user->theme['template_path'] . '/template',
- 'T_IMAGESET_PATH' => "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset',
- 'T_IMAGESET_LANG_PATH' => "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->data['user_lang'],
- 'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
- 'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
- 'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/",
- 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
- 'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
- 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
- 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
- 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&amp;id=" . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang'],
+ 'T_THEME_PATH' => PHPBB_ROOT_PATH . 'styles/' . $user->theme['theme_path'] . '/theme',
+ 'T_TEMPLATE_PATH' => PHPBB_ROOT_PATH . 'styles/' . $user->theme['template_path'] . '/template',
+ 'T_IMAGESET_PATH' => PHPBB_ROOT_PATH . 'styles/' . $user->theme['imageset_path'] . '/imageset',
+ 'T_IMAGESET_LANG_PATH' => PHPBB_ROOT_PATH . 'styles/' . $user->theme['imageset_path'] . '/imageset/' . $user->data['user_lang'],
+ 'T_IMAGES_PATH' => PHPBB_ROOT_PATH . 'images/',
+ 'T_SMILIES_PATH' => PHPBB_ROOT_PATH . $config['smilies_path'] . '/',
+ 'T_AVATAR_PATH' => PHPBB_ROOT_PATH . $config['avatar_path'] . '/',
+ 'T_AVATAR_GALLERY_PATH' => PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/',
+ 'T_ICONS_PATH' => PHPBB_ROOT_PATH . $config['icons_path'] . '/',
+ 'T_RANKS_PATH' => PHPBB_ROOT_PATH . $config['ranks_path'] . '/',
+ 'T_UPLOAD_PATH' => PHPBB_ROOT_PATH . $config['upload_path'] . '/',
+ 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? PHPBB_ROOT_PATH . 'styles/' . $user->theme['theme_path'] . '/theme/stylesheet.css' : PHPBB_ROOT_PATH . 'style.' . PHP_EXT . "?sid=$user->session_id&amp;id=" . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang'],
'T_STYLESHEET_NAME' => $user->theme['theme_name'],
'SITE_LOGO_IMG' => $user->img('site_logo'))
@@ -3379,7 +3395,7 @@ function page_header($page_title = '', $display_online_list = true)
*/
function page_footer($run_cron = true)
{
- global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx;
+ global $db, $config, $template, $user, $auth, $cache, $starttime;
// Output page creation time
if (defined('DEBUG'))
@@ -3416,7 +3432,7 @@ function page_footer($run_cron = true)
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
- 'U_ACP' => ($auth->acl_get('a_') && $user->data['is_registered']) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id) : '')
+ 'U_ACP' => ($auth->acl_get('a_') && $user->data['is_registered']) ? append_sid(CONFIG_ADM_FOLDER . 'index', false, true, $user->session_id) : '')
);
// Call cron-type script
@@ -3424,7 +3440,7 @@ function page_footer($run_cron = true)
{
$cron_type = '';
- if (time() - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
+ if (time() - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists(PHPBB_ROOT_PATH . 'cache/queue.' . PHP_EXT))
{
// Process email queue
$cron_type = 'queue';
@@ -3455,7 +3471,7 @@ function page_footer($run_cron = true)
if ($cron_type)
{
- $template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=' . $cron_type) . '" width="1" height="1" alt="cron" />');
+ $template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid('cron', 'cron_type=' . $cron_type) . '" width="1" height="1" alt="cron" />');
}
}
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 52e266befb..05312d826f 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -630,7 +630,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
*/
function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true, $call_delete_topics = true)
{
- global $db, $config, $phpbb_root_path, $phpEx;
+ global $db, $config;
if ($where_type === 'range')
{
@@ -739,12 +739,12 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
// Remove the message from the search index
$search_type = basename($config['search_type']);
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
- include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+ include_once(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT);
$error = false;
$search = new $search_type($error);
@@ -1101,7 +1101,7 @@ function update_posted_info(&$topic_ids)
*/
function phpbb_unlink($filename, $mode = 'file', $entry_removed = false)
{
- global $db, $phpbb_root_path, $config;
+ global $db, $config;
// Because of copying topics or modifications a physical filename could be assigned more than once. If so, do not remove the file itself.
$sql = 'SELECT COUNT(attach_id) AS num_entries
@@ -1118,7 +1118,7 @@ function phpbb_unlink($filename, $mode = 'file', $entry_removed = false)
}
$filename = ($mode == 'thumbnail') ? 'thumb_' . basename($filename) : basename($filename);
- return @unlink($phpbb_root_path . $config['upload_path'] . '/' . $filename);
+ return @unlink(PHPBB_ROOT_PATH . $config['upload_path'] . '/' . $filename);
}
/**
@@ -2154,7 +2154,7 @@ function remove_comments(&$output)
*/
function cache_moderators()
{
- global $db, $cache, $auth, $phpbb_root_path, $phpEx;
+ global $db, $cache, $auth;
// Remove cached sql results
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
@@ -2323,11 +2323,11 @@ function cache_moderators()
*/
function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
{
- global $db, $user, $auth, $phpEx, $phpbb_root_path, $phpbb_admin_path;
+ global $db, $user, $auth;
$topic_id_list = $reportee_id_list = $is_auth = $is_mod = array();
- $profile_url = (defined('IN_ADMIN')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview') : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile');
+ $profile_url = (defined('IN_ADMIN')) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&amp;mode=overview') : append_sid('memberlist', 'mode=viewprofile');
switch ($mode)
{
@@ -2411,7 +2411,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
'forum_id' => $row['forum_id'],
'topic_id' => $row['topic_id'],
- 'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : false,
+ 'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? append_sid('viewforum', 'f=' . $row['forum_id']) : false,
'action' => (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
);
@@ -2498,8 +2498,8 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
foreach ($log as $key => $row)
{
- $log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $is_auth[$row['topic_id']] . '&amp;t=' . $row['topic_id']) : false;
- $log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&amp;mode=topic_logs&amp;t=' . $row['topic_id'], true, $user->session_id) : false;
+ $log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? append_sid('viewtopic', 'f=' . $is_auth[$row['topic_id']] . '&amp;t=' . $row['topic_id']) : false;
+ $log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid('mcp', 'i=logs&amp;mode=topic_logs&amp;t=' . $row['topic_id'], true, $user->session_id) : false;
}
}
@@ -3005,7 +3005,7 @@ function tidy_database()
*/
function add_permission_language()
{
- global $user, $phpEx;
+ global $user;
// First of all, our own file. We need to include it as the first file because it presets all relevant variables.
$user->add_lang('acp/permissions_phpbb');
@@ -3021,9 +3021,9 @@ function add_permission_language()
{
while (($file = readdir($dh)) !== false)
{
- if ($file !== 'permissions_phpbb.' . $phpEx && strpos($file, 'permissions_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx)
+ if ($file !== 'permissions_phpbb.' . PHP_EXT && strpos($file, 'permissions_') === 0 && substr($file, -(strlen(PHP_EXT) + 1)) === '.' . PHP_EXT)
{
- $files_to_add[] = $path . substr($file, 0, -(strlen($phpEx) + 1));
+ $files_to_add[] = $path . substr($file, 0, -(strlen(PHP_EXT) + 1));
}
}
closedir($dh);
diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php
index c439ed8390..f4efc6b5c9 100644
--- a/phpBB/includes/functions_compress.php
+++ b/phpBB/includes/functions_compress.php
@@ -29,8 +29,6 @@ class compress
*/
public function add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '')
{
- global $phpbb_root_path;
-
$skip_files = explode(',', $skip_files);
// Remove rm prefix from src path
@@ -40,22 +38,22 @@ class compress
// Remove initial "/" if present
$src_path = (substr($src_path, 0, 1) == '/') ? substr($src_path, 1) : $src_path;
- if (is_file($phpbb_root_path . $src))
+ if (is_file(PHPBB_ROOT_PATH . $src))
{
- $this->data($src_path, file_get_contents("$phpbb_root_path$src"), false, stat("$phpbb_root_path$src"));
+ $this->data($src_path, file_get_contents(PHPBB_ROOT_PATH . $src), false, stat(PHPBB_ROOT_PATH . $src));
}
- else if (is_dir($phpbb_root_path . $src))
+ else if (is_dir(PHPBB_ROOT_PATH . $src))
{
// Clean up path, add closing / if not present
$src_path = ($src_path && substr($src_path, -1) != '/') ? $src_path . '/' : $src_path;
$filelist = array();
- $filelist = filelist("$phpbb_root_path$src", '', '*');
+ $filelist = filelist(PHPBB_ROOT_PATH . $src, '', '*');
krsort($filelist);
if ($src_path)
{
- $this->data($src_path, '', true, stat("$phpbb_root_path$src"));
+ $this->data($src_path, '', true, stat(PHPBB_ROOT_PATH . $src));
}
foreach ($filelist as $path => $file_ary)
@@ -66,7 +64,7 @@ class compress
$path = (substr($path, 0, 1) == '/') ? substr($path, 1) : $path;
$path = ($path && substr($path, -1) != '/') ? $path . '/' : $path;
- $this->data("$src_path$path", '', true, stat("$phpbb_root_path$src$path"));
+ $this->data("$src_path$path", '', true, stat(PHPBB_ROOT_PATH . $src . $path));
}
foreach ($file_ary as $file)
@@ -76,7 +74,7 @@ class compress
continue;
}
- $this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), false, stat("$phpbb_root_path$src$path$file"));
+ $this->data("$src_path$path$file", file_get_contents(PHPBB_ROOT_PATH . $src . $path . $file), false, stat(PHPBB_ROOT_PATH . $src . $path . $file));
}
}
}
@@ -429,8 +427,6 @@ class compress_zip extends compress
*/
public function download($filename, $download_name = false)
{
- global $phpbb_root_path;
-
if ($download_name === false)
{
$download_name = $filename;
@@ -442,7 +438,7 @@ class compress_zip extends compress
header("Content-Type: $mimetype; name=\"$download_name.zip\"");
header("Content-disposition: attachment; filename=$download_name.zip");
- $fp = @fopen("{$phpbb_root_path}store/$filename.zip", 'rb');
+ $fp = @fopen(PHPBB_ROOT_PATH . "store/$filename.zip", 'rb');
if ($fp)
{
while ($buffer = fread($fp, 1024))
@@ -649,8 +645,6 @@ class compress_tar extends compress
*/
public function download($filename, $download_name = false)
{
- global $phpbb_root_path;
-
if ($download_name === false)
{
$download_name = $filename;
@@ -679,7 +673,7 @@ class compress_tar extends compress
header("Content-Type: $mimetype; name=\"$download_name$this->type\"");
header("Content-disposition: attachment; filename=$download_name$this->type");
- $fp = @fopen("{$phpbb_root_path}store/$filename$this->type", 'rb');
+ $fp = @fopen(PHPBB_ROOT_PATH . "store/$filename$this->type", 'rb');
if ($fp)
{
while ($buffer = fread($fp, 1024))
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index ee6c8ea4b1..73ab553cf0 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -406,8 +406,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
{
if (!class_exists('bbcode'))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
}
if (empty($bbcode))
@@ -435,8 +434,6 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
*/
function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false)
{
- global $phpbb_root_path, $phpEx;
-
$uid = $bitfield = '';
if (!$text)
@@ -446,7 +443,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
if (!class_exists('parse_message'))
{
- include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
}
$message_parser = new parse_message($text);
@@ -473,8 +470,6 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
*/
function generate_text_for_edit($text, $uid, $flags)
{
- global $phpbb_root_path, $phpEx;
-
decode_message($text, $uid);
return array(
@@ -699,7 +694,7 @@ function bbcode_nl2br($text)
*/
function smiley_text($text, $force_option = false)
{
- global $config, $user, $phpbb_root_path;
+ global $config, $user;
if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies'))
{
@@ -707,7 +702,7 @@ function smiley_text($text, $force_option = false)
}
else
{
- return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . $phpbb_root_path . $config['smilies_path'] . '/\2 />', $text);
+ return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . PHPBB_ROOT_PATH . $config['smilies_path'] . '/\2 />', $text);
}
}
@@ -728,7 +723,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
}
global $template, $cache, $user;
- global $extensions, $config, $phpbb_root_path, $phpEx;
+ global $extensions, $config;
//
$compiled_attachments = array();
@@ -816,8 +811,8 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
// Some basics...
$attachment['extension'] = strtolower(trim($attachment['extension']));
- $filename = $phpbb_root_path . $config['upload_path'] . '/' . basename($attachment['physical_filename']);
- $thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . basename($attachment['physical_filename']);
+ $filename = PHPBB_ROOT_PATH . $config['upload_path'] . '/' . basename($attachment['physical_filename']);
+ $thumbnail_filename = PHPBB_ROOT_PATH . $config['upload_path'] . '/thumb_' . basename($attachment['physical_filename']);
$upload_icon = '';
@@ -829,7 +824,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
}
else if ($extensions[$attachment['extension']]['upload_icon'])
{
- $upload_icon = '<img src="' . $phpbb_root_path . $config['upload_icons_path'] . '/' . trim($extensions[$attachment['extension']]['upload_icon']) . '" alt="" />';
+ $upload_icon = '<img src="' . PHPBB_ROOT_PATH . $config['upload_icons_path'] . '/' . trim($extensions[$attachment['extension']]['upload_icon']) . '" alt="" />';
}
}
@@ -907,14 +902,14 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
$display_cat = ATTACHMENT_CATEGORY_NONE;
}
- $download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
+ $download_link = append_sid('download/file', 'id=' . $attachment['attach_id']);
switch ($display_cat)
{
// Images
case ATTACHMENT_CATEGORY_IMAGE:
$l_downloaded_viewed = 'VIEWED_COUNT';
- $inline_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
+ $inline_link = append_sid('download/file', 'id=' . $attachment['attach_id']);
$download_link .= '&amp;mode=view';
$block_array += array(
@@ -928,7 +923,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
// Images, but display Thumbnail
case ATTACHMENT_CATEGORY_THUMB:
$l_downloaded_viewed = 'VIEWED_COUNT';
- $thumbnail_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id'] . '&amp;t=1');
+ $thumbnail_link = append_sid('download/file', 'id=' . $attachment['attach_id'] . '&amp;t=1');
$download_link .= '&amp;mode=view';
$block_array += array(
@@ -1118,7 +1113,7 @@ function truncate_string($string, $max_length = 60, $allow_reply = true, $append
*/
function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false)
{
- global $phpbb_root_path, $phpEx, $user, $auth;
+ global $user, $auth;
$profile_url = '';
$username_colour = ($username_colour) ? '#' . $username_colour : '';
@@ -1143,7 +1138,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
}
else
{
- $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&amp;u=' . (int) $user_id : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . (int) $user_id);
+ $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&amp;u=' . (int) $user_id : append_sid('memberlist', 'mode=viewprofile&amp;u=' . (int) $user_id);
}
}
else
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 6fd7e5b221..592fcf13f3 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -418,7 +418,7 @@ function remote_avatar_dims()
function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false)
{
- global $config, $convert, $phpbb_root_path, $user;
+ global $config, $convert, $user;
$relative_path = empty($convert->convertor['source_path_absolute']);
@@ -486,7 +486,7 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false
function import_attachment_files($category_name = '')
{
- global $config, $convert, $phpbb_root_path, $db, $user;
+ global $config, $convert, $db, $user;
$sql = 'SELECT config_value AS upload_path
FROM ' . CONFIG_TABLE . "
@@ -550,7 +550,7 @@ function _import_check($config_var, $source, $use_target)
'relative_path' => (empty($convert->convertor['source_path_absolute'])) ? true : false,
);
- // copy file will prepend $phpBB_root_path
+ // copy file will prepend PHPBB_ROOT_PATH
$target = $config[$config_var] . '/' . basename(($use_target === false) ? $source : $use_target);
if (!empty($convert->convertor[$config_var]) && strpos($source, $convert->convertor[$config_var]) !== 0)
@@ -584,7 +584,7 @@ function import_attachment($source, $use_target = false)
return '';
}
- global $convert, $phpbb_root_path, $config, $user;
+ global $convert, $config, $user;
if (empty($convert->convertor['upload_path']))
{
@@ -625,7 +625,7 @@ function import_rank($source, $use_target = false)
return '';
}
- global $convert, $phpbb_root_path, $config, $user;
+ global $convert, $config, $user;
if (!isset($convert->convertor['ranks_path']))
{
@@ -643,7 +643,7 @@ function import_smiley($source, $use_target = false)
return '';
}
- global $convert, $phpbb_root_path, $config, $user;
+ global $convert, $config, $user;
if (!isset($convert->convertor['smilies_path']))
{
@@ -663,7 +663,7 @@ function import_avatar($source, $use_target = false, $user_id = false)
return;
}
- global $convert, $phpbb_root_path, $config, $user;
+ global $convert, $config, $user;
if (!isset($convert->convertor['avatar_path']))
{
@@ -741,7 +741,7 @@ function get_smiley_dim($source, $axis)
return $smiley_cache[$source][$axis];
}
- global $convert, $phpbb_root_path, $config, $user;
+ global $convert, $config, $user;
$orig_source = $source;
@@ -856,7 +856,7 @@ function get_upload_avatar_dim($source, $axis)
$source = substr($source, 7);
}
- global $convert, $phpbb_root_path, $config, $user;
+ global $convert, $config, $user;
if (!isset($convert->convertor['avatar_path']))
{
@@ -898,7 +898,7 @@ function get_gallery_avatar_dim($source, $axis)
return $avatar_cache[$source][$axis];
}
- global $convert, $phpbb_root_path, $config, $user;
+ global $convert, $config, $user;
$orig_source = $source;
@@ -1111,7 +1111,7 @@ function words_unique(&$words)
*/
function add_user_group($group_id, $user_id, $group_leader=false)
{
- global $convert, $phpbb_root_path, $config, $user, $db;
+ global $convert, $config, $user, $db;
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'group_id' => $group_id,
@@ -1131,7 +1131,7 @@ function add_user_group($group_id, $user_id, $group_leader=false)
*/
function user_group_auth($group, $select_query, $use_src_db)
{
- global $convert, $phpbb_root_path, $config, $user, $db, $src_db, $same_db;
+ global $convert, $config, $user, $db, $src_db, $same_db;
if (!in_array($group, array('guests', 'registered', 'registered_coppa', 'global_moderators', 'administrators', 'bots')))
{
@@ -1187,7 +1187,7 @@ function get_config()
return $convert_config;
}
- global $src_db, $same_db, $phpbb_root_path, $config;
+ global $src_db, $same_db, $config;
global $convert;
if ($convert->config_schema['table_format'] != 'file')
@@ -1354,14 +1354,14 @@ function extract_variables_from_file($_filename)
function get_path($src_path, $src_url, $test_file)
{
- global $config, $phpbb_root_path, $phpEx;
+ global $config;
$board_config = get_config();
- $test_file = preg_replace('/\.php$/i', ".$phpEx", $test_file);
+ $test_file = preg_replace('/\.php$/i', '.' . PHP_EXT, $test_file);
$src_path = path($src_path);
- if (@file_exists($phpbb_root_path . $src_path . $test_file))
+ if (@file_exists(PHPBB_ROOT_PATH . $src_path . $test_file))
{
return $src_path;
}
@@ -1421,7 +1421,7 @@ function get_path($src_path, $src_url, $test_file)
if (!empty($path))
{
- if (@file_exists($phpbb_root_path . $path . $test_file))
+ if (@file_exists(PHPBB_ROOT_PATH . $path . $test_file))
{
return $path;
}
@@ -1763,7 +1763,7 @@ function sync_post_count($offset, $limit)
*/
function add_bots()
{
- global $db, $convert, $user, $config, $phpbb_root_path, $phpEx;
+ global $db, $convert, $user, $config;
$db->sql_query($convert->truncate_statement . BOTS_TABLE);
@@ -1843,7 +1843,7 @@ function add_bots()
if (!function_exists('user_add'))
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
}
foreach ($bots as $bot_name => $bot_ary)
@@ -2112,7 +2112,7 @@ function fix_empty_primary_groups()
*/
function remove_invalid_users()
{
- global $convert, $db, $phpEx, $phpbb_root_path;
+ global $convert, $db;
// username_clean is UNIQUE
$sql = 'SELECT user_id
@@ -2126,7 +2126,7 @@ function remove_invalid_users()
{
if (!function_exists('user_delete'))
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
}
user_delete('remove', $row['user_id']);
@@ -2248,7 +2248,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals
function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $source_relative_path = true)
{
- global $convert, $phpbb_root_path, $config, $user, $db;
+ global $convert, $config, $user, $db;
if (substr($trg, -1) == '/')
{
@@ -2267,7 +2267,7 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
return;
}
- $path = $phpbb_root_path;
+ $path = PHPBB_ROOT_PATH;
$parts = explode('/', $trg);
unset($parts[sizeof($parts) - 1]);
@@ -2286,15 +2286,15 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
@chmod($path, 0777);
}
- if (!@copy($src_path, $phpbb_root_path . $trg_path))
+ if (!@copy($src_path, PHPBB_ROOT_PATH . $trg_path))
{
- $convert->p_master->error(sprintf($user->lang['COULD_NOT_COPY'], $src_path, $phpbb_root_path . $trg_path), __LINE__, __FILE__, !$die_on_failure);
+ $convert->p_master->error(sprintf($user->lang['COULD_NOT_COPY'], $src_path, PHPBB_ROOT_PATH . $trg_path), __LINE__, __FILE__, !$die_on_failure);
return;
}
if ($perm = @fileperms($src_path))
{
- @chmod($phpbb_root_path . $trg_path, $perm);
+ @chmod(PHPBB_ROOT_PATH . $trg_path, $perm);
}
return true;
@@ -2302,13 +2302,13 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_failure = true, $source_relative_path = true)
{
- global $convert, $phpbb_root_path, $config, $user, $db;
+ global $convert, $config, $user, $db;
$dirlist = $filelist = $bad_dirs = array();
$src = path($src, $source_relative_path);
$trg = path($trg);
$src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__);
- $trg_path = $phpbb_root_path . $trg;
+ $trg_path = PHPBB_ROOT_PATH . $trg;
if (!is_dir($trg_path))
{
@@ -2411,7 +2411,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
function relative_base($path, $is_relative = true, $line = false, $file = false)
{
- global $convert, $phpbb_root_path, $config, $user, $db;
+ global $convert, $config, $user, $db;
if (!$is_relative)
{
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index e7971b3398..162b935f28 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -21,8 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function display_forums($root_data = '', $display_moderators = true, $return_moderators = false)
{
- global $db, $auth, $user, $template;
- global $phpbb_root_path, $phpEx, $config;
+ global $db, $auth, $user, $template, $config;
$forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array();
$parent_id = $visible_forums = 0;
@@ -274,9 +273,9 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
'FORUM_FOLDER_IMG' => '',
'FORUM_FOLDER_IMG_SRC' => '',
- 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '',
- 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
- 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']))
+ 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '',
+ 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
+ 'U_VIEWFORUM' => append_sid('viewforum', 'f=' . $row['forum_id']))
);
continue;
@@ -300,7 +299,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
if ($subforum_row['display'] && $subforum_row['name'])
{
$subforums_list[] = array(
- 'link' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $subforum_id),
+ 'link' => append_sid('viewforum', 'f=' . $subforum_id),
'name' => $subforum_row['name'],
'unread' => $subforum_unread,
);
@@ -350,7 +349,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
{
$last_post_subject = $row['forum_last_post_subject'];
$last_post_time = $user->format_date($row['forum_last_post_time']);
- $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&amp;p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
+ $last_post_url = append_sid('viewtopic', 'f=' . $row['forum_id_last_post'] . '&amp;p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
}
else
{
@@ -378,7 +377,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
if ($row['forum_type'] != FORUM_LINK)
{
- $u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
+ $u_viewforum = append_sid('viewforum', 'f=' . $row['forum_id']);
}
else
{
@@ -386,7 +385,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
// If the forum is having a password or no read access we do not expose the link, but instead handle it in viewforum
if (($row['forum_flags'] & FORUM_FLAG_LINK_TRACK) || $row['forum_password'] || !$auth->acl_get('f_read', $forum_id))
{
- $u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
+ $u_viewforum = append_sid('viewforum', 'f=' . $row['forum_id']);
}
else
{
@@ -411,8 +410,8 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '',
- 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
- 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
+ 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
+ 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
'LAST_POST_SUBJECT' => censor_text($last_post_subject),
'LAST_POST_TIME' => $last_post_time,
'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
@@ -444,7 +443,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
}
$template->assign_vars(array(
- 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $root_data['forum_id'] . '&amp;mark=forums') : '',
+ 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid('viewforum', 'f=' . $root_data['forum_id'] . '&amp;mark=forums') : '',
'S_HAS_SUBFORUM' => ($visible_forums) ? true : false,
'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'],
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'))
@@ -468,7 +467,7 @@ function generate_forum_rules(&$forum_data)
return;
}
- global $template, $phpbb_root_path, $phpEx;
+ global $template;
if ($forum_data['forum_rules'])
{
@@ -489,7 +488,6 @@ function generate_forum_rules(&$forum_data)
function generate_forum_nav(&$forum_data)
{
global $db, $user, $template, $auth;
- global $phpEx, $phpbb_root_path;
if (!$auth->acl_get('f_list', $forum_data['forum_id']))
{
@@ -518,7 +516,7 @@ function generate_forum_nav(&$forum_data)
'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false,
'FORUM_NAME' => $parent_name,
'FORUM_ID' => $parent_forum_id,
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id))
+ 'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $parent_forum_id))
);
}
}
@@ -529,7 +527,7 @@ function generate_forum_nav(&$forum_data)
'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_ID' => $forum_data['forum_id'],
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id']))
+ 'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_data['forum_id']))
);
$template->assign_vars(array(
@@ -630,7 +628,7 @@ function topic_generate_pagination($replies, $url)
*/
function get_moderators(&$forum_moderators, $forum_id = false)
{
- global $config, $template, $db, $phpbb_root_path, $phpEx;
+ global $config, $template, $db;
// Have we disabled the display of moderators? If so, then return
// from whence we came ...
@@ -689,7 +687,7 @@ function get_moderators(&$forum_moderators, $forum_id = false)
}
else
{
- $forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
+ $forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid('memberlist', 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
}
}
$db->sql_freeresult($result);
@@ -874,7 +872,6 @@ function display_reasons($reason_id = 0)
function display_user_activity(&$userdata)
{
global $auth, $template, $db, $user;
- global $phpbb_root_path, $phpEx;
// Do not display user activity for users having more than 5000 posts...
if ($userdata['user_posts'] > 5000)
@@ -972,10 +969,10 @@ function display_user_activity(&$userdata)
'ACTIVE_TOPIC' => censor_text($active_t_name),
'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count),
'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct),
- 'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id),
- 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id),
- 'S_SHOW_ACTIVITY' => true)
- );
+ 'U_ACTIVE_FORUM' => append_sid('viewforum', 'f=' . $active_f_id),
+ 'U_ACTIVE_TOPIC' => append_sid('viewtopic', 't=' . $active_t_id),
+ 'S_SHOW_ACTIVITY' => true,
+ ));
}
/**
@@ -983,7 +980,7 @@ function display_user_activity(&$userdata)
*/
function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0)
{
- global $template, $db, $user, $phpEx, $start, $phpbb_root_path;
+ global $template, $db, $user, $start;
$table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;
$where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id';
@@ -1022,7 +1019,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$db->sql_query($sql);
}
- $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
+ $redirect_url = append_sid("view$mode", "$u_url=$match_id&amp;start=$start");
meta_refresh(3, $redirect_url);
@@ -1056,7 +1053,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$db->sql_query($sql);
}
- $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
+ $redirect_url = append_sid("view$mode", "$u_url=$match_id&amp;start=$start");
meta_refresh(3, $redirect_url);
$message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
@@ -1083,7 +1080,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
if ($can_watch)
{
- $s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&amp;start=$start");
+ $s_watching['link'] = append_sid("view$mode", "$u_url=$match_id&amp;" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&amp;start=$start");
$s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
$s_watching['is_watching'] = $is_watching;
}
@@ -1103,7 +1100,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
*/
function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
{
- global $ranks, $config, $phpbb_root_path;
+ global $ranks, $config;
if (empty($ranks))
{
@@ -1114,8 +1111,8 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
if (!empty($user_rank))
{
$rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
- $rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
- $rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
+ $rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
+ $rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
}
else
{
@@ -1126,8 +1123,8 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
if ($user_posts >= $rank['rank_min'])
{
$rank_title = $rank['rank_title'];
- $rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
- $rank_img_src = (!empty($rank['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image'] : '';
+ $rank_img = (!empty($rank['rank_image'])) ? '<img src="' . PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
+ $rank_img_src = (!empty($rank['rank_image'])) ? PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $rank['rank_image'] : '';
break;
}
}
@@ -1148,7 +1145,7 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
*/
function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
{
- global $user, $config, $phpbb_root_path, $phpEx;
+ global $user, $config;
if (empty($avatar) || !$avatar_type)
{
@@ -1160,11 +1157,11 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
switch ($avatar_type)
{
case AVATAR_UPLOAD:
- $avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
+ $avatar_img = PHPBB_ROOT_PATH . 'download/file.' . PHP_EXT . '?avatar=';
break;
case AVATAR_GALLERY:
- $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
+ $avatar_img = PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/';
break;
}
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 84b1fb66c2..2c81b73e7f 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -277,14 +277,14 @@ function get_tables($db)
*/
function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix, $dbhost, $dbuser, $dbpasswd, $dbname, $dbport, $prefix_may_exist = false, $load_dbal = true, $unicode_check = true)
{
- global $phpbb_root_path, $phpEx, $config, $lang;
+ global $config, $lang;
$dbms = $dbms_details['DRIVER'];
if ($load_dbal)
{
// Include the DB layer
- include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
}
// Instantiate it and set return on error true
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index ef896f2c89..e571df74d1 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -6,6 +6,7 @@
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
+* @todo handling email and jabber queue through the database, not relying on a single file/file transactions
*/
/**
@@ -17,10 +18,16 @@ if (!defined('IN_PHPBB'))
}
/**
+* phpbb_messenger
+* phpbb_queue
+* phpbb_smtp_mailer
+*/
+
+/**
* Messenger
* @package phpBB3
*/
-class messenger
+class phpbb_messenger
{
private $vars, $msg, $extra_headers, $replyto, $from, $subject;
private $addresses = array();
@@ -53,7 +60,7 @@ class messenger
/**
* Sets an email address to send to
*/
- function to($address, $realname = '')
+ public function to($address, $realname = '')
{
global $config;
@@ -75,7 +82,7 @@ class messenger
/**
* Sets an cc address to send to
*/
- function cc($address, $realname = '')
+ public function cc($address, $realname = '')
{
$pos = isset($this->addresses['cc']) ? sizeof($this->addresses['cc']) : 0;
$this->addresses['cc'][$pos]['email'] = trim($address);
@@ -85,7 +92,7 @@ class messenger
/**
* Sets an bcc address to send to
*/
- function bcc($address, $realname = '')
+ public function bcc($address, $realname = '')
{
$pos = isset($this->addresses['bcc']) ? sizeof($this->addresses['bcc']) : 0;
$this->addresses['bcc'][$pos]['email'] = trim($address);
@@ -95,7 +102,7 @@ class messenger
/**
* Sets a im contact to send to
*/
- function im($address, $realname = '')
+ public function im($address, $realname = '')
{
$pos = isset($this->addresses['im']) ? sizeof($this->addresses['im']) : 0;
$this->addresses['im'][$pos]['uid'] = trim($address);
@@ -105,7 +112,7 @@ class messenger
/**
* Set the reply to address
*/
- function replyto($address)
+ public function replyto($address)
{
$this->replyto = trim($address);
}
@@ -113,7 +120,7 @@ class messenger
/**
* Set the from address
*/
- function from($address)
+ public function from($address)
{
$this->from = trim($address);
}
@@ -121,7 +128,7 @@ class messenger
/**
* set up subject for mail
*/
- function subject($subject = '')
+ public function subject($subject = '')
{
$this->subject = trim($subject);
}
@@ -129,7 +136,7 @@ class messenger
/**
* set up extra mail headers
*/
- function headers($headers)
+ public function headers($headers)
{
$this->extra_headers[] = trim($headers);
}
@@ -137,7 +144,7 @@ class messenger
/**
* Set the email priority
*/
- function set_mail_priority($priority = MAIL_NORMAL_PRIORITY)
+ public function set_mail_priority($priority = MAIL_NORMAL_PRIORITY)
{
$this->mail_priority = $priority;
}
@@ -145,9 +152,9 @@ class messenger
/**
* Set email template to use
*/
- function template($template_file, $template_lang = '')
+ public function template($template_file, $template_lang = '')
{
- global $config, $phpbb_root_path;
+ global $config;
if (!trim($template_file))
{
@@ -161,7 +168,7 @@ class messenger
if (empty($this->tpl_msg[$template_lang . $template_file]))
{
- $tpl_file = "{$phpbb_root_path}language/$template_lang/email/$template_file.txt";
+ $tpl_file = PHPBB_ROOT_PATH . "language/$template_lang/email/$template_file.txt";
if (!file_exists($tpl_file))
{
@@ -184,7 +191,7 @@ class messenger
/**
* assign variables to email template
*/
- function assign_vars($vars)
+ public function assign_vars($vars)
{
$this->vars = (empty($this->vars)) ? $vars : $this->vars + $vars;
}
@@ -192,7 +199,7 @@ class messenger
/**
* Send the mail out to the recipients set previously in var $this->addresses
*/
- function send($method = NOTIFY_EMAIL, $break = false)
+ public function send($method = NOTIFY_EMAIL, $break = false)
{
global $config, $user;
@@ -256,7 +263,7 @@ class messenger
*/
public static function error($type, $msg)
{
- global $user, $phpEx, $phpbb_root_path, $config;
+ global $user, $config;
// Session doesn't exist, create it
if (!isset($user->session_id) || $user->session_id === '')
@@ -285,7 +292,7 @@ class messenger
/**
* Save to queue
*/
- function save_queue()
+ public function save_queue()
{
global $config;
@@ -436,7 +443,7 @@ class messenger
*/
private function msg_jabber()
{
- global $config, $db, $user, $phpbb_root_path, $phpEx;
+ global $config, $db, $user;
if (empty($config['jab_enable']) || empty($config['jab_host']) || empty($config['jab_username']) || empty($config['jab_password']))
{
@@ -463,7 +470,7 @@ class messenger
if (!$use_queue)
{
- include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_jabber.' . PHP_EXT);
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']);
if (!$this->jabber->connect())
@@ -499,10 +506,67 @@ class messenger
}
/**
+* Classes for handling queue objects - singletons
+*/
+class phpbb_queue_jabber
+{
+ static $queue;
+
+ public function __construct(phpbb_queue &$queue)
+ {
+ self::queue = $queue;
+ }
+
+ // singleton
+ public static function &get_instance(phpbb_queue &$queue)
+ {
+ static $self;
+
+ if (is_object($self) === true)
+ {
+ return $self;
+ }
+
+ $self = new phpbb_queue_jabber($queue);
+ return $self;
+ }
+
+ public function start()
+ {
+ echo "START";
+ print_r($queue);
+ exit;
+/* if (!$config['jab_enable'])
+ {
+ unset($this->queue_data['jabber']);
+ continue 2;
+ }
+
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_jabber.' . PHP_EXT);
+ $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']);
+
+ if (!$this->jabber->connect())
+ {
+ messenger::error('JABBER', $user->lang['ERR_JAB_CONNECT']);
+ continue 2;
+ }
+
+ if (!$this->jabber->login())
+ {
+ messenger::error('JABBER', $user->lang['ERR_JAB_AUTH']);
+ continue 2;
+ }
+*/
+ }
+}
+
+class phpbb_queue_test(
+
+/**
* handling email and jabber queue
* @package phpBB3
*/
-class queue
+class phpbb_queue
{
private $data = array();
private $queue_data = array();
@@ -514,10 +578,8 @@ class queue
*/
function __construct()
{
- global $phpEx, $phpbb_root_path;
-
$this->data = array();
- $this->cache_file = "{$phpbb_root_path}cache/queue.$phpEx";
+ $this->cache_file = PHPBB_ROOT_PATH . 'cache/queue.' . PHP_EXT;
}
/**
@@ -544,7 +606,7 @@ class queue
*/
public function process()
{
- global $db, $config, $phpEx, $phpbb_root_path, $user;
+ global $db, $config, $user;
set_config('last_queue_run', time(), true);
@@ -584,6 +646,13 @@ class queue
$num_items = sizeof($data_ary['data']);
}
+ $class = 'phpbb_queue_' . $object;
+ $queue_object &= $class->get_instance($this);
+
+ $queue_object->start();
+
+
+/*
switch ($object)
{
case 'email':
@@ -596,27 +665,7 @@ class queue
break;
case 'jabber':
- if (!$config['jab_enable'])
- {
- unset($this->queue_data['jabber']);
- continue 2;
- }
-
- include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
- $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']);
-
- if (!$this->jabber->connect())
- {
- messenger::error('JABBER', $user->lang['ERR_JAB_CONNECT']);
- continue 2;
- }
-
- if (!$this->jabber->login())
- {
- messenger::error('JABBER', $user->lang['ERR_JAB_AUTH']);
- continue 2;
- }
-
+
break;
default:
@@ -682,6 +731,7 @@ class queue
$this->jabber->disconnect();
break;
}
+ */
}
if (!sizeof($this->queue_data))
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index f4ee454033..c1d04cf245 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -44,8 +44,7 @@ class p_master
*/
function list_modules($p_class)
{
- global $auth, $db, $user, $cache;
- global $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $user, $cache, $config;
// Sanitise for future path use, it's escaped as appropriate for queries
$this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class));
@@ -393,9 +392,9 @@ class p_master
*/
function load_active($mode = false, $module_url = false, $execute_module = true)
{
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user;
+ global $user;
- $module_path = $phpbb_root_path . 'includes/' . $this->p_class;
+ $module_path = PHPBB_ROOT_PATH . 'includes/' . $this->p_class;
$icat = request_var('icat', '');
if ($this->active_module === false)
@@ -405,16 +404,16 @@ class p_master
if (!class_exists("{$this->p_class}_$this->p_name"))
{
- if (!file_exists("$module_path/{$this->p_class}_$this->p_name.$phpEx"))
+ if (!file_exists("$module_path/{$this->p_class}_$this->p_name." . PHP_EXT))
{
- trigger_error("Cannot find module $module_path/{$this->p_class}_$this->p_name.$phpEx", E_USER_ERROR);
+ trigger_error("Cannot find module $module_path/{$this->p_class}_$this->p_name." . PHP_EXT, E_USER_ERROR);
}
- include("$module_path/{$this->p_class}_$this->p_name.$phpEx");
+ include("$module_path/{$this->p_class}_$this->p_name." . PHP_EXT);
if (!class_exists("{$this->p_class}_$this->p_name"))
{
- trigger_error("Module file $module_path/{$this->p_class}_$this->p_name.$phpEx does not contain correct class [{$this->p_class}_$this->p_name]", E_USER_ERROR);
+ trigger_error("Module file $module_path/{$this->p_class}_$this->p_name." . PHP_EXT . " does not contain correct class [{$this->p_class}_$this->p_name]", E_USER_ERROR);
}
if (!empty($mode))
@@ -438,7 +437,7 @@ class p_master
}
// Not being able to overwrite ;)
- $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$this->p_name}") . (($icat) ? '&amp;icat=' . $icat : '') . "&amp;mode={$this->p_mode}";
+ $this->module->u_action = append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i={$this->p_name}") . (($icat) ? '&amp;icat=' . $icat : '') . "&amp;mode={$this->p_mode}";
}
else
{
@@ -449,7 +448,7 @@ class p_master
}
else
{
- $this->module->u_action = $phpbb_root_path . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'];
+ $this->module->u_action = PHPBB_ROOT_PATH . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'];
}
$this->module->u_action = append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&amp;icat=' . $icat : '') . "&amp;mode={$this->p_mode}";
@@ -816,7 +815,7 @@ class p_master
*/
function add_mod_info($module_class)
{
- global $user, $phpEx;
+ global $user;
if (file_exists($user->lang_path . 'mods'))
{
@@ -828,9 +827,9 @@ class p_master
{
while (($entry = readdir($dir)) !== false)
{
- if (strpos($entry, 'info_' . strtolower($module_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == $phpEx)
+ if (strpos($entry, 'info_' . strtolower($module_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == PHP_EXT)
{
- $add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen($phpEx) + 1));
+ $add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen(PHP_EXT) + 1));
}
}
closedir($dir);
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 877ba8c912..df5609edf1 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -22,7 +22,6 @@ if (!defined('IN_PHPBB'))
function generate_smilies($mode, $forum_id)
{
global $auth, $db, $user, $config, $template;
- global $phpEx, $phpbb_root_path;
if ($mode == 'window')
{
@@ -89,7 +88,7 @@ function generate_smilies($mode, $forum_id)
$template->assign_block_vars('smiley', array(
'SMILEY_CODE' => $row['code'],
'A_SMILEY_CODE' => addslashes($row['code']),
- 'SMILEY_IMG' => $phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url'],
+ 'SMILEY_IMG' => PHPBB_ROOT_PATH . $config['smilies_path'] . '/' . $row['smiley_url'],
'SMILEY_WIDTH' => $row['smiley_width'],
'SMILEY_HEIGHT' => $row['smiley_height'],
'SMILEY_DESC' => $row['emotion'])
@@ -101,7 +100,7 @@ function generate_smilies($mode, $forum_id)
{
$template->assign_vars(array(
'S_SHOW_SMILEY_LINK' => true,
- 'U_MORE_SMILIES' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id))
+ 'U_MORE_SMILIES' => append_sid('posting', 'mode=smilies&amp;f=' . $forum_id))
);
}
@@ -246,7 +245,7 @@ function update_post_information($type, $ids, $return_update_sql = false)
*/
function posting_gen_topic_icons($mode, $icon_id)
{
- global $phpbb_root_path, $config, $template, $cache;
+ global $config, $template, $cache;
// Grab icons
$icons = cache::obtain_icons();
@@ -264,7 +263,7 @@ function posting_gen_topic_icons($mode, $icon_id)
{
$template->assign_block_vars('topic_icon', array(
'ICON_ID' => $id,
- 'ICON_IMG' => $phpbb_root_path . $config['icons_path'] . '/' . $data['img'],
+ 'ICON_IMG' => PHPBB_ROOT_PATH . $config['icons_path'] . '/' . $data['img'],
'ICON_WIDTH' => $data['width'],
'ICON_HEIGHT' => $data['height'],
@@ -349,13 +348,12 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false)
{
global $auth, $user, $config, $db, $cache;
- global $phpbb_root_path, $phpEx;
$filedata = array(
'error' => array()
);
- include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_upload.' . PHP_EXT);
$upload = new fileupload();
if ($config['check_attachment_content'])
@@ -463,7 +461,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
}
// Check free disk space
- if ($free_space = @disk_free_space($phpbb_root_path . $config['upload_path']))
+ if ($free_space = @disk_free_space(PHPBB_ROOT_PATH . $config['upload_path']))
{
if ($free_space <= $file->get('filesize'))
{
@@ -763,7 +761,7 @@ function posting_gen_inline_attachments(&$attachment_data)
*/
function posting_gen_attachment_entry($attachment_data, &$filename_data)
{
- global $template, $config, $phpbb_root_path, $phpEx, $user;
+ global $template, $config, $user;
$template->assign_vars(array(
'S_SHOW_ATTACH_BOX' => true)
@@ -788,7 +786,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data)
$hidden .= '<input type="hidden" name="attachment_data[' . $count . '][' . $key . ']" value="' . $value . '" />';
}
- $download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&amp;id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $user->session_id : false);
+ $download_link = append_sid('download/file', 'mode=view&amp;id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $user->session_id : false);
$template->assign_block_vars('attach_row', array(
'FILENAME' => basename($attach_row['real_filename']),
@@ -822,7 +820,6 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data)
function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
{
global $user, $db, $template, $auth;
- global $phpbb_root_path, $phpEx;
$topic_ids = $forum_ids = $draft_rows = array();
@@ -895,24 +892,24 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
$topic_forum_id = ($topic_rows[$draft['topic_id']]['forum_id']) ? $topic_rows[$draft['topic_id']]['forum_id'] : $forum_id;
$link_topic = true;
- $view_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_forum_id . '&amp;t=' . $draft['topic_id']);
+ $view_url = append_sid('viewtopic', 'f=' . $topic_forum_id . '&amp;t=' . $draft['topic_id']);
$title = $topic_rows[$draft['topic_id']]['topic_title'];
- $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $topic_forum_id . '&amp;t=' . $draft['topic_id'] . '&amp;mode=reply&amp;d=' . $draft['draft_id']);
+ $insert_url = append_sid('posting', 'f=' . $topic_forum_id . '&amp;t=' . $draft['topic_id'] . '&amp;mode=reply&amp;d=' . $draft['draft_id']);
}
else if ($draft['forum_id'] && $auth->acl_get('f_read', $draft['forum_id']))
{
$link_forum = true;
- $view_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $draft['forum_id']);
+ $view_url = append_sid('viewforum', 'f=' . $draft['forum_id']);
$title = $draft['forum_name'];
- $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $draft['forum_id'] . '&amp;mode=post&amp;d=' . $draft['draft_id']);
+ $insert_url = append_sid('posting', 'f=' . $draft['forum_id'] . '&amp;mode=post&amp;d=' . $draft['draft_id']);
}
else
{
// Either display as PM draft if forum_id and topic_id are empty or if access to the forums has been denied afterwards...
$link_pm = true;
- $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=compose&amp;d={$draft['draft_id']}");
+ $insert_url = append_sid('ucp', "i=$id&amp;mode=compose&amp;d={$draft['draft_id']}");
}
$template->assign_block_vars('draftrow', array(
@@ -936,8 +933,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
*/
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
{
- global $user, $auth, $db, $template, $bbcode, $cache;
- global $config, $phpbb_root_path, $phpEx;
+ global $user, $auth, $db, $template, $bbcode, $cache, $config;
// Go ahead and pull all data for this topic
$sql = 'SELECT p.post_id
@@ -995,7 +991,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
// Instantiate BBCode class
if (!isset($bbcode) && $bbcode_bitfield !== '')
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
}
@@ -1075,8 +1071,8 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
'MESSAGE' => $message,
'DECODED_MESSAGE' => $decoded_message,
'POST_ID' => $row['post_id'],
- 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
- 'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=post_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
+ 'U_MINI_POST' => append_sid('viewtopic', 'p=' . $row['post_id']) . '#p' . $row['post_id'],
+ 'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid('mcp', 'i=main&amp;mode=post_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '')
);
@@ -1107,7 +1103,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
*/
function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id)
{
- global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;
+ global $db, $user, $config, $auth;
$topic_notification = ($mode == 'reply' || $mode == 'quote') ? true : false;
$forum_notification = ($mode == 'post') ? true : false;
@@ -1238,7 +1234,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
// Now, we are able to really send out notifications
if (sizeof($msg_users))
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger();
$msg_list_ary = array();
@@ -1268,11 +1264,11 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
'TOPIC_TITLE' => htmlspecialchars_decode($topic_title),
'FORUM_NAME' => htmlspecialchars_decode($forum_name),
- 'U_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id",
- 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id",
- 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id",
- 'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&unwatch=topic",
- 'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&unwatch=forum",
+ 'U_FORUM' => generate_board_url() . '/viewforum.' . PHP_EXT . "?f=$forum_id",
+ 'U_TOPIC' => generate_board_url() . '/viewtopic.' . PHP_EXT . "?f=$forum_id&t=$topic_id",
+ 'U_NEWEST_POST' => generate_board_url() . '/viewtopic.' . PHP_EXT . "?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id",
+ 'U_STOP_WATCHING_TOPIC' => generate_board_url() . '/viewtopic.' . PHP_EXT . "?f=$forum_id&t=$topic_id&unwatch=topic",
+ 'U_STOP_WATCHING_FORUM' => generate_board_url() . '/viewforum.' . PHP_EXT . "?f=$forum_id&unwatch=forum",
));
$messenger->send($addr['method']);
@@ -1333,8 +1329,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
*/
function delete_post($forum_id, $topic_id, $post_id, &$data)
{
- global $db, $user, $auth;
- global $config, $phpEx, $phpbb_root_path;
+ global $db, $user, $auth, $config;
// Specify our post mode
$post_mode = 'delete';
@@ -1353,7 +1348,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
$sql_data = array();
$next_post_id = false;
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
$db->sql_transaction('begin');
@@ -1555,7 +1550,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
*/
function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true)
{
- global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path;
+ global $db, $auth, $user, $config, $template;
// We do not handle erasing posts here
if ($mode == 'delete')
@@ -2053,7 +2048,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
else
{
// insert attachment into db
- if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
+ if (!@file_exists(PHPBB_ROOT_PATH . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
{
continue;
}
@@ -2346,14 +2341,14 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// Select the search method and do some additional checks to ensure it can actually be utilised
$search_type = basename($config['search_type']);
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
if (!class_exists($search_type))
{
- include("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+ include(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT);
}
$error = false;
@@ -2447,7 +2442,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$params .= '&amp;t=' . $data['topic_id'];
}
- $url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx";
+ $url = (!$params) ? 'viewforum' : 'viewtopic';
$url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor;
return $url;
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index d01d89a7e3..b80f55420b 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -116,7 +116,6 @@ $global_rule_conditions = array(
function get_folder($user_id, $folder_id = false)
{
global $db, $user, $template;
- global $phpbb_root_path, $phpEx;
$folder = array();
@@ -200,7 +199,7 @@ function get_folder($user_id, $folder_id = false)
'NUM_MESSAGES' => $folder_ary['num_messages'],
'UNREAD_MESSAGES' => $folder_ary['unread_messages'],
- 'U_FOLDER' => ($f_id > 0) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=' . $f_id) : append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=' . $folder_id_name),
+ 'U_FOLDER' => ($f_id > 0) ? append_sid('ucp', 'i=pm&amp;folder=' . $f_id) : append_sid('ucp', 'i=pm&amp;folder=' . $folder_id_name),
'S_CUR_FOLDER' => ($f_id === $folder_id) ? true : false,
'S_UNREAD_MESSAGES' => ($folder_ary['unread_messages']) ? true : false,
@@ -731,7 +730,6 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_folder_id)
{
global $db, $user;
- global $phpbb_root_path, $phpEx;
$num_moved = 0;
@@ -762,7 +760,7 @@ function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_fol
if ($message_limit && $row['pm_count'] + sizeof($move_msg_ids) > $message_limit)
{
$message = sprintf($user->lang['NOT_ENOUGH_SPACE_FOLDER'], $row['folder_name']) . '<br /><br />';
- $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=' . $row['folder_id']) . '">', '</a>', $row['folder_name']);
+ $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . append_sid('ucp', 'i=pm&amp;folder=' . $row['folder_id']) . '">', '</a>', $row['folder_name']);
trigger_error($message);
}
}
@@ -779,7 +777,7 @@ function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_fol
if ($message_limit && $num_messages + sizeof($move_msg_ids) > $message_limit)
{
$message = sprintf($user->lang['NOT_ENOUGH_SPACE_FOLDER'], $user->lang['PM_INBOX']) . '<br /><br />';
- $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox') . '">', '</a>', $user->lang['PM_INBOX']);
+ $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . append_sid('ucp', 'i=pm&amp;folder=inbox') . '">', '</a>', $user->lang['PM_INBOX']);
trigger_error($message);
}
}
@@ -868,7 +866,7 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
*/
function handle_mark_actions($user_id, $mark_action)
{
- global $db, $user, $phpbb_root_path, $phpEx;
+ global $db, $user;
$msg_ids = request_var('marked_msg_id', array(0));
$cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX);
@@ -899,7 +897,7 @@ function handle_mark_actions($user_id, $mark_action)
delete_pm($user_id, $msg_ids, $cur_folder_id);
$success_msg = (sizeof($msg_ids) == 1) ? 'MESSAGE_DELETED' : 'MESSAGES_DELETED';
- $redirect = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=' . $cur_folder_id);
+ $redirect = append_sid('ucp', 'i=pm&amp;folder=' . $cur_folder_id);
meta_refresh(3, $redirect);
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FOLDER'], '<a href="' . $redirect . '">', '</a>'));
@@ -1105,7 +1103,7 @@ function rebuild_header($check_ary)
*/
function write_pm_addresses($check_ary, $author_id, $plaintext = false)
{
- global $db, $user, $template, $phpbb_root_path, $phpEx;
+ global $db, $user, $template;
$addresses = array();
@@ -1228,7 +1226,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false)
else
{
$tpl_ary = array_merge($tpl_ary, array(
- 'U_VIEW' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $id),
+ 'U_VIEW' => append_sid('memberlist', 'mode=group&amp;g=' . $id),
));
}
@@ -1281,7 +1279,7 @@ function get_folder_status($folder_id, $folder)
*/
function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
{
- global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path;
+ global $db, $auth, $config, $template, $user;
// We do not handle erasing pms here
if ($mode == 'delete')
@@ -1528,7 +1526,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
else
{
// insert attachment into db
- if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
+ if (!@file_exists(PHPBB_ROOT_PATH . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
{
continue;
}
@@ -1585,7 +1583,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
*/
function pm_notification($mode, $author, $recipients, $subject, $message)
{
- global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;
+ global $db, $user, $config, $auth;
$subject = censor_text($subject);
@@ -1640,7 +1638,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
return;
}
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger();
foreach ($msg_list_ary as $pos => $addr)
@@ -1655,7 +1653,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
'AUTHOR_NAME' => htmlspecialchars_decode($author),
'USERNAME' => htmlspecialchars_decode($addr['name']),
- 'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&folder=inbox")
+ 'U_INBOX' => generate_board_url() . '/ucp.' . PHP_EXT . '?i=pm&folder=inbox')
);
$messenger->send($addr['method']);
@@ -1672,7 +1670,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
*/
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
{
- global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode;
+ global $db, $user, $config, $template, $auth, $bbcode;
// Get History Messages (could be newer)
$sql = 'SELECT t.*, p.*, u.*
@@ -1703,7 +1701,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$rowset = array();
$bbcode_bitfield = '';
- $folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&amp;folder=';
+ $folder_url = append_sid('ucp', 'i=pm') . '&amp;folder=';
do
{
@@ -1736,14 +1734,14 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
{
if (!class_exists('bbcode'))
{
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
}
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
}
$title = censor_text($title);
- $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
+ $url = append_sid('ucp', 'i=pm');
$next_history_pm = $previous_history_pm = $prev_id = 0;
foreach ($rowset as $id => $row)
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index cccd0b758f..cb53d62282 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -728,8 +728,7 @@ class custom_profile
*/
private function generate_text($profile_row, $preview = false)
{
- global $template;
- global $user, $phpEx, $phpbb_root_path;
+ global $template, $user;
$field_length = explode('|', $profile_row['field_length']);
$profile_row['field_rows'] = $field_length[0];
@@ -838,7 +837,6 @@ class custom_profile
*/
private function get_profile_field($profile_row)
{
- global $phpbb_root_path, $phpEx;
global $config;
$var_name = 'pf_' . $profile_row['field_ident'];
diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php
index 5ff04b9826..1eea6c1b85 100644
--- a/phpBB/includes/functions_template.php
+++ b/phpBB/includes/functions_template.php
@@ -735,9 +735,7 @@ class template_compile
*/
public function compile_write($handle, $data)
{
- global $phpEx;
-
- $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx;
+ $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . PHP_EXT;
if ($fp = @fopen($filename, 'wb'))
{
diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php
index 9eb32a7b45..63f8d72e9f 100644
--- a/phpBB/includes/functions_transfer.php
+++ b/phpBB/includes/functions_transfer.php
@@ -38,13 +38,11 @@ class transfer
*/
function __construct()
{
- global $phpbb_root_path;
-
$this->file_perms = 0644;
$this->dir_perms = 0777;
// We use the store directory as temporary path to circumvent open basedir restrictions
- $this->tmp_path = $phpbb_root_path . 'store/';
+ $this->tmp_path = PHPBB_ROOT_PATH . 'store/';
}
/**
@@ -52,9 +50,7 @@ class transfer
*/
public function write_file($destination_file = '', $contents = '')
{
- global $phpbb_root_path;
-
- $destination_file = $this->root_path . str_replace($phpbb_root_path, '', $destination_file);
+ $destination_file = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $destination_file);
// need to create a temp file and then move that temp file.
// ftp functions can only move files around and can't create.
@@ -104,9 +100,7 @@ class transfer
*/
public function make_dir($dir)
{
- global $phpbb_root_path;
-
- $dir = str_replace($phpbb_root_path, '', $dir);
+ $dir = str_replace(PHPBB_ROOT_PATH, '', $dir);
$dir = explode('/', $dir);
$dirs = '';
@@ -120,7 +114,7 @@ class transfer
}
$cur_dir = $dir[$i] . '/';
- if (!file_exists($phpbb_root_path . $dirs . $cur_dir))
+ if (!file_exists(PHPBB_ROOT_PATH . $dirs . $cur_dir))
{
// create the directory
$result = $this->_mkdir($dir[$i]);
@@ -144,10 +138,8 @@ class transfer
*/
public function copy_file($from_loc, $to_loc)
{
- global $phpbb_root_path;
-
- $from_loc = ((strpos($from_loc, $phpbb_root_path) !== 0) ? $phpbb_root_path : '') . $from_loc;
- $to_loc = $this->root_path . str_replace($phpbb_root_path, '', $to_loc);
+ $from_loc = ((strpos($from_loc, PHPBB_ROOT_PATH) !== 0) ? PHPBB_ROOT_PATH : '') . $from_loc;
+ $to_loc = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $to_loc);
if (!file_exists($from_loc))
{
@@ -164,9 +156,7 @@ class transfer
*/
public function delete_file($file)
{
- global $phpbb_root_path;
-
- $file = $this->root_path . str_replace($phpbb_root_path, '', $file);
+ $file = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $file);
return $this->_delete($file);
}
@@ -177,9 +167,7 @@ class transfer
*/
public function remove_dir($dir)
{
- global $phpbb_root_path;
-
- $dir = $this->root_path . str_replace($phpbb_root_path, '', $dir);
+ $dir = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $dir);
return $this->_rmdir($dir);
}
@@ -189,9 +177,7 @@ class transfer
*/
public function rename($old_handle, $new_handle)
{
- global $phpbb_root_path;
-
- $old_handle = $this->root_path . str_replace($phpbb_root_path, '', $old_handle);
+ $old_handle = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $old_handle);
return $this->_rename($old_handle, $new_handle);
}
@@ -201,9 +187,7 @@ class transfer
*/
public function file_exists($directory, $filename)
{
- global $phpbb_root_path;
-
- $directory = $this->root_path . str_replace($phpbb_root_path, '', $directory);
+ $directory = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $directory);
$this->_chdir($directory);
$result = $this->_ls('');
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 96c5562adf..4411f28e5a 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -268,7 +268,7 @@ class filespec
*/
function move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = 0666)
{
- global $user, $phpbb_root_path;
+ global $user;
if (sizeof($this->error))
{
@@ -276,7 +276,7 @@ class filespec
}
// We need to trust the admin in specifying valid upload directories and an attacker not being able to overwrite it...
- $this->destination_path = $phpbb_root_path . $destination;
+ $this->destination_path = PHPBB_ROOT_PATH . $destination;
// Check if the destination path exist...
if (!file_exists($this->destination_path))
@@ -693,7 +693,7 @@ class fileupload
*/
function remote_upload($upload_url)
{
- global $user, $phpbb_root_path;
+ global $user;
$upload_ary = array();
$upload_ary['local_mode'] = true;
@@ -783,7 +783,7 @@ class fileupload
return $file;
}
- $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $phpbb_root_path . 'cache';
+ $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : PHPBB_ROOT_PATH . 'cache';
$filename = tempnam($tmp_path, unique_id() . '-');
if (!($fp = @fopen($filename, 'wb')))
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 8519cd4fa6..e32a88f1dc 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -151,7 +151,7 @@ function user_update_name($old_name, $new_name)
*/
function user_add($user_row, $cp_data = false)
{
- global $db, $user, $auth, $config, $phpbb_root_path, $phpEx;
+ global $db, $user, $auth, $config;
if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type']))
{
@@ -256,7 +256,7 @@ function user_add($user_row, $cp_data = false)
if (!class_exists('custom_profile'))
{
- include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
}
$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' .
@@ -301,7 +301,6 @@ function user_add($user_row, $cp_data = false)
function user_delete($mode, $user_id, $post_username = false)
{
global $cache, $config, $db, $user, $auth;
- global $phpbb_root_path, $phpEx;
$sql = 'SELECT *
FROM ' . USERS_TABLE . '
@@ -438,7 +437,7 @@ function user_delete($mode, $user_id, $post_username = false)
if (!function_exists('delete_posts'))
{
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
}
$sql = 'SELECT topic_id, COUNT(post_id) AS total_posts
@@ -1769,7 +1768,7 @@ function validate_jabber($jid)
*/
function avatar_delete($mode, $row, $clean_db = false)
{
- global $phpbb_root_path, $config, $db, $user;
+ global $config, $db, $user;
// Check if the users avatar is actually *not* a group avatar
if ($mode == 'user')
@@ -1785,9 +1784,9 @@ function avatar_delete($mode, $row, $clean_db = false)
avatar_remove_db($row[$mode . '_avatar']);
}
$filename = get_avatar_filename($row[$mode . '_avatar']);
- if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . $filename))
+ if (file_exists(PHPBB_ROOT_PATH . $config['avatar_path'] . '/' . $filename))
{
- @unlink($phpbb_root_path . $config['avatar_path'] . '/' . $filename);
+ @unlink(PHPBB_ROOT_PATH . $config['avatar_path'] . '/' . $filename);
return true;
}
@@ -1799,7 +1798,7 @@ function avatar_delete($mode, $row, $clean_db = false)
*/
function avatar_remote($data, &$error)
{
- global $config, $db, $user, $phpbb_root_path, $phpEx;
+ global $config, $db, $user;
if (!preg_match('#^(http|https|ftp)://#i', $data['remotelink']))
{
@@ -1834,7 +1833,7 @@ function avatar_remote($data, &$error)
}
// Check image type
- include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_upload.' . PHP_EXT);
$types = fileupload::image_types();
$extension = strtolower(filespec::get_extension($data['remotelink']));
@@ -1877,10 +1876,10 @@ function avatar_remote($data, &$error)
*/
function avatar_upload($data, &$error)
{
- global $phpbb_root_path, $config, $db, $user, $phpEx;
+ global $config, $db, $user;
// Init upload class
- include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_upload.' . PHP_EXT);
$upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], explode('|', $config['mime_triggers']));
if (!empty($_FILES['uploadfile']['name']))
@@ -1948,12 +1947,11 @@ function get_avatar_filename($avatar_entry)
*/
function avatar_gallery($category, $avatar_select, $items_per_column, $block_var = 'avatar_row')
{
- global $user, $cache, $template;
- global $config, $phpbb_root_path;
+ global $user, $cache, $template, $config;
$avatar_list = array();
- $path = $phpbb_root_path . $config['avatar_gallery_path'];
+ $path = PHPBB_ROOT_PATH . $config['avatar_gallery_path'];
if (!file_exists($path) || !is_dir($path))
{
@@ -2032,13 +2030,13 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var
foreach ($avatar_row_ary as $avatar_col_ary)
{
$template->assign_block_vars($block_var . '.avatar_column', array(
- 'AVATAR_IMAGE' => $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
+ 'AVATAR_IMAGE' => PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
'AVATAR_NAME' => $avatar_col_ary['name'],
'AVATAR_FILE' => $avatar_col_ary['filename'])
);
$template->assign_block_vars($block_var . '.avatar_option_column', array(
- 'AVATAR_IMAGE' => $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
+ 'AVATAR_IMAGE' => PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
'S_OPTIONS_AVATAR' => $avatar_col_ary['filename'])
);
}
@@ -2053,7 +2051,7 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var
*/
function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $current_y = 0)
{
- global $config, $phpbb_root_path, $user;
+ global $config, $user;
switch ($avatar_type)
{
@@ -2061,11 +2059,11 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $
break;
case AVATAR_UPLOAD :
- $avatar = $phpbb_root_path . $config['avatar_path'] . '/' . get_avatar_filename($avatar);
+ $avatar = PHPBB_ROOT_PATH . $config['avatar_path'] . '/' . get_avatar_filename($avatar);
break;
case AVATAR_GALLERY :
- $avatar = $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar ;
+ $avatar = PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $avatar ;
break;
}
@@ -2106,7 +2104,7 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $
*/
function avatar_process_user(&$error, $custom_userdata = false)
{
- global $config, $phpbb_root_path, $auth, $user, $db;
+ global $config, $auth, $user, $db;
$data = array(
'uploadurl' => request_var('uploadurl', ''),
@@ -2143,7 +2141,7 @@ function avatar_process_user(&$error, $custom_userdata = false)
$avatar_select = basename(request_var('avatar_select', ''));
// Can we upload?
- $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ $can_upload = ($config['allow_avatar_upload'] && file_exists(PHPBB_ROOT_PATH . $config['avatar_path']) && @is_writable(PHPBB_ROOT_PATH . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload)
{
@@ -2161,14 +2159,14 @@ function avatar_process_user(&$error, $custom_userdata = false)
$sql_ary['user_avatar'] = $avatar_select;
// check avatar gallery
- if (!is_dir($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category))
+ if (!is_dir(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category))
{
$sql_ary['user_avatar'] = '';
$sql_ary['user_avatar_type'] = $sql_ary['user_avatar_width'] = $sql_ary['user_avatar_height'] = 0;
}
else
{
- list($sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $sql_ary['user_avatar']);
+ list($sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = getimagesize(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category . '/' . $sql_ary['user_avatar']);
$sql_ary['user_avatar'] = $category . '/' . $sql_ary['user_avatar'];
}
}
@@ -2260,7 +2258,7 @@ function avatar_process_user(&$error, $custom_userdata = false)
*/
function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false)
{
- global $phpbb_root_path, $config, $db, $user, $file_upload;
+ global $config, $db, $user, $file_upload;
$error = array();
$attribute_ary = array(
@@ -2420,7 +2418,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
*/
function group_correct_avatar($group_id, $old_entry)
{
- global $config, $db, $phpbb_root_path;
+ global $config, $db;
$group_id = (int)$group_id;
$ext = substr(strrchr($old_entry, '.'), 1);
@@ -2428,7 +2426,7 @@ function group_correct_avatar($group_id, $old_entry)
$new_filename = $config['avatar_salt'] . "_g$group_id.$ext";
$new_entry = 'g' . $group_id . '_' . substr(time(), -5) . ".$ext";
- $avatar_path = $phpbb_root_path . $config['avatar_path'];
+ $avatar_path = PHPBB_ROOT_PATH . $config['avatar_path'];
if (@rename($avatar_path . '/'. $old_filename, $avatar_path . '/' . $new_filename))
{
$sql = 'UPDATE ' . GROUPS_TABLE . '
@@ -2459,7 +2457,7 @@ function avatar_remove_db($avatar_name)
*/
function group_delete($group_id, $group_name = false)
{
- global $db, $phpbb_root_path, $phpEx;
+ global $db;
if (!$group_name)
{
@@ -2513,7 +2511,7 @@ function group_delete($group_id, $group_name = false)
// Re-cache moderators
if (!function_exists('cache_moderators'))
{
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
}
cache_moderators();
@@ -2833,7 +2831,7 @@ function remove_default_rank($group_id, $user_ids)
*/
function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)
{
- global $db, $auth, $phpbb_root_path, $phpEx, $config;
+ global $db, $auth, $config;
// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);
@@ -2891,7 +2889,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
$db->sql_query($sql);
// Send approved email to users...
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger();
foreach ($email_users as $row)
@@ -2904,8 +2902,8 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username']),
'GROUP_NAME' => htmlspecialchars_decode($group_name),
- 'U_GROUP' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=membership")
- );
+ 'U_GROUP' => generate_board_url() . '/ucp.' . PHP_EXT . '?i=groups&mode=membership',
+ ));
$messenger->send($row['user_notify_type']);
}
@@ -3246,8 +3244,7 @@ function group_update_listings($group_id)
{
if (!function_exists('cache_moderators'))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
}
cache_moderators();
}
@@ -3256,8 +3253,7 @@ function group_update_listings($group_id)
{
if (!function_exists('update_foes'))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
}
update_foes(array($group_id));
}
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index cb6211abda..7289644d39 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -26,12 +26,11 @@ class mcp_ban
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
// Include the admin banning interface...
- include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/acp/acp_ban.' . PHP_EXT);
$bansubmit = (isset($_POST['bansubmit'])) ? true : false;
$unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
@@ -148,7 +147,7 @@ class mcp_ban
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
'U_ACTION' => $this->u_action,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp_ban&amp;field=ban'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=mcp_ban&amp;field=ban'),
));
if ($mode != 'user')
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index eec428a70b..b0a1de8efa 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -21,12 +21,11 @@ if (!defined('IN_PHPBB'))
*/
function mcp_forum_view($id, $mode, $action, $forum_info)
{
- global $template, $db, $user, $auth, $cache, $module;
- global $phpEx, $phpbb_root_path, $config;
+ global $template, $db, $user, $auth, $cache, $module, $config;
$user->add_lang(array('viewtopic', 'viewforum'));
- include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
// merge_topic is the quickmod action, merge_topics is the mcp_forum action, and merge_select is the mcp_topic action
$merge_select = ($action == 'merge_select' || $action == 'merge_topic' || $action == 'merge_topics') ? true : false;
@@ -50,7 +49,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$url_extra .= ($GLOBALS['post_id']) ? '&amp;p=' . $GLOBALS['post_id'] : '';
$url_extra .= ($GLOBALS['user_id']) ? '&amp;u=' . $GLOBALS['user_id'] : '';
- $url = append_sid("{$phpbb_root_path}mcp.$phpEx?$url_extra");
+ $url = ($url_extra) ? append_sid('mcp', $url_extra) : append_sid('mcp');
// Resync Topics
switch ($action)
@@ -121,8 +120,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_CAN_MAKE_STICKY' => $auth->acl_get('f_sticky', $forum_id),
'S_CAN_MAKE_ANNOUNCE' => $auth->acl_get('f_announce', $forum_id),
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
- 'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id) && $module->loaded('logs')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&amp;mode=forum_logs&amp;f=' . $forum_id) : '',
+ 'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_id),
+ 'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id) && $module->loaded('logs')) ? append_sid('mcp', 'i=logs&amp;mode=forum_logs&amp;f=' . $forum_id) : '',
'S_MCP_ACTION' => $url . "&amp;i=$id&amp;forum_action=$action&amp;mode=$mode&amp;start=$start" . (($merge_select) ? $selected_ids : ''),
@@ -255,8 +254,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
if ($row['topic_status'] == ITEM_MOVED)
{
$topic_row = array_merge($topic_row, array(
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_moved_id']}"),
- 'U_DELETE_TOPIC' => ($auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;f=$forum_id&amp;topic_id_list[]={$row['topic_id']}&amp;mode=forum_view&amp;action=delete_topic") : '',
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', "t={$row['topic_moved_id']}"),
+ 'U_DELETE_TOPIC' => ($auth->acl_get('m_delete', $forum_id)) ? append_sid('mcp', "i=$id&amp;f=$forum_id&amp;topic_id_list[]={$row['topic_id']}&amp;mode=forum_view&amp;action=delete_topic") : '',
'S_MOVED_TOPIC' => true,
'TOPIC_ID' => $row['topic_moved_id'],
));
@@ -272,12 +271,12 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$u_select_topic = $url . "&amp;i=$id&amp;mode=topic_view&amp;action=merge&amp;to_topic_id=" . $row['topic_id'] . $selected_ids;
}
$topic_row = array_merge($topic_row, array(
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;f=$forum_id&amp;t={$row['topic_id']}&amp;mode=topic_view"),
+ 'U_VIEW_TOPIC' => append_sid('mcp', "i=$id&amp;f=$forum_id&amp;t={$row['topic_id']}&amp;mode=topic_view"),
'S_SELECT_TOPIC' => ($merge_select && !in_array($row['topic_id'], $source_topic_ids)) ? true : false,
'U_SELECT_TOPIC' => $u_select_topic,
'U_MCP_QUEUE' => $u_mcp_queue,
- 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=topic_view&amp;t=' . $row['topic_id'] . '&amp;action=reports') : '',
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid('mcp', 'i=main&amp;mode=topic_view&amp;t=' . $row['topic_id'] . '&amp;action=reports') : '',
'TOPIC_ID' => $row['topic_id'],
'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? true : false,
));
@@ -293,7 +292,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
*/
function mcp_resync_topics($topic_ids)
{
- global $auth, $db, $template, $phpEx, $user, $phpbb_root_path;
+ global $auth, $db, $template, $user;
if (!sizeof($topic_ids))
{
@@ -337,7 +336,7 @@ function mcp_resync_topics($topic_ids)
*/
function merge_topics($forum_id, $topic_ids, $to_topic_id)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
+ global $db, $template, $user, $auth;
if (!sizeof($topic_ids))
{
@@ -423,14 +422,14 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
// Link to the new topic
- $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
+ $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
confirm_box(false, 'MERGE_TOPICS', $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -439,7 +438,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
}
else
{
- meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
+ meta_refresh(3, append_sid('viewtopic', "f=$to_forum_id&amp;t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index 707fe22685..4905640754 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -21,8 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_front_view($id, $mode, $action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth, $module;
+ global $template, $db, $user, $auth, $module, $config;
// Latest 5 unapproved
if ($module->loaded('queue'))
@@ -98,12 +97,12 @@ function mcp_front_view($id, $mode, $action)
}
$template->assign_block_vars('unapproved', array(
- 'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']),
- 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=forum_view&amp;f=' . $row['forum_id']) : '',
- 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=topic_view&amp;f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
- 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['poster_id']),
+ 'U_POST_DETAILS' => append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']),
+ 'U_MCP_FORUM' => (!$global_topic) ? append_sid('mcp', 'i=main&amp;mode=forum_view&amp;f=' . $row['forum_id']) : '',
+ 'U_MCP_TOPIC' => append_sid('mcp', 'i=main&amp;mode=topic_view&amp;f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
+ 'U_FORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_TOPIC' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
+ 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['poster_id']),
'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
'POST_ID' => $row['post_id'],
@@ -117,7 +116,7 @@ function mcp_front_view($id, $mode, $action)
}
$template->assign_vars(array(
- 'S_MCP_QUEUE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"),
+ 'S_MCP_QUEUE_ACTION' => append_sid('mcp', 'i=queue'),
));
if ($total == 0)
@@ -198,11 +197,11 @@ function mcp_front_view($id, $mode, $action)
}
$template->assign_block_vars('report', array(
- 'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id'] . "&amp;i=reports&amp;mode=report_details"),
- 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&amp;i=$id&amp;mode=forum_view") : '',
- 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'] . "&amp;i=$id&amp;mode=topic_view"),
- 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
- 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
+ 'U_POST_DETAILS' => append_sid('mcp', 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id'] . "&amp;i=reports&amp;mode=report_details"),
+ 'U_MCP_FORUM' => (!$global_topic) ? append_sid('mcp', 'f=' . $row['forum_id'] . "&amp;i=$id&amp;mode=forum_view") : '',
+ 'U_MCP_TOPIC' => append_sid('mcp', 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'] . "&amp;i=$id&amp;mode=topic_view"),
+ 'U_FORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_TOPIC' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'REPORTER' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
@@ -273,8 +272,8 @@ function mcp_front_view($id, $mode, $action)
);
}
- $template->assign_var('S_MCP_ACTION', append_sid("{$phpbb_root_path}mcp.$phpEx"));
- make_jumpbox(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=forum_view'), 0, false, 'm_', true);
+ $template->assign_var('S_MCP_ACTION', append_sid('mcp'));
+ make_jumpbox(append_sid('mcp', 'i=main&amp;mode=forum_view'), 0, false, 'm_', true);
}
?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index 6c74e65f5b..3816d2eb17 100755
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -33,8 +33,7 @@ class mcp_logs
function main($id, $mode)
{
- global $auth, $db, $user, $template;
- global $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $user, $template, $config;
$user->add_lang('acp/common');
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index f000bcc881..470a7f1a62 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -33,8 +33,7 @@ class mcp_main
function main($id, $mode)
{
- global $auth, $db, $user, $template, $action;
- global $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $user, $template, $action, $config;
$quickmod = ($mode == 'quickmod') ? true : false;
@@ -136,7 +135,7 @@ class mcp_main
switch ($mode)
{
case 'front':
- include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_front.' . PHP_EXT);
$user->add_lang('acp/common');
@@ -147,7 +146,7 @@ class mcp_main
break;
case 'forum_view':
- include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_forum.' . PHP_EXT);
$user->add_lang('viewforum');
@@ -170,7 +169,7 @@ class mcp_main
break;
case 'topic_view':
- include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_topic.' . PHP_EXT);
mcp_topic_view($id, $mode, $action);
@@ -179,7 +178,7 @@ class mcp_main
break;
case 'post_details':
- include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_post.' . PHP_EXT);
mcp_post_details($id, $mode, $action);
@@ -199,7 +198,7 @@ class mcp_main
*/
function lock_unlock($action, $ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db;
if ($action == 'lock' || $action == 'unlock')
{
@@ -265,7 +264,7 @@ function lock_unlock($action, $ids)
confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -284,7 +283,7 @@ function lock_unlock($action, $ids)
*/
function change_topic_type($action, $topic_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db;
// For changing topic types, we only allow operations in one forum.
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('f_announce', 'f_sticky', 'm_'), true);
@@ -511,7 +510,7 @@ function change_topic_type($action, $topic_ids)
}
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -531,7 +530,6 @@ function change_topic_type($action, $topic_ids)
function mcp_move_topic($topic_ids)
{
global $auth, $user, $db, $template;
- global $phpEx, $phpbb_root_path;
// Here we limit the operation to one forum only
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true);
@@ -730,7 +728,7 @@ function mcp_move_topic($topic_ids)
confirm_box(false, 'MOVE_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -743,8 +741,8 @@ function mcp_move_topic($topic_ids)
$message = $user->lang[$success_msg];
$message .= '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>');
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id") . '">', '</a>');
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$to_forum_id") . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', "f=$forum_id") . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid('viewforum', "f=$to_forum_id") . '">', '</a>');
trigger_error($message);
}
@@ -755,7 +753,7 @@ function mcp_move_topic($topic_ids)
*/
function mcp_delete_topic($topic_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db;
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_delete')))
{
@@ -791,7 +789,7 @@ function mcp_delete_topic($topic_ids)
confirm_box(false, (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS', $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -800,7 +798,7 @@ function mcp_delete_topic($topic_ids)
}
else
{
- $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
+ $redirect_url = append_sid('viewforum', 'f=' . $forum_id);
meta_refresh(3, $redirect_url);
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>'));
}
@@ -811,7 +809,7 @@ function mcp_delete_topic($topic_ids)
*/
function mcp_delete_post($post_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db;
if (!check_ids($post_ids, POSTS_TABLE, 'post_id', array('m_delete')))
{
@@ -833,7 +831,7 @@ function mcp_delete_post($post_ids)
{
if (!function_exists('delete_posts'))
{
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
}
// Count the number of topics that are affected
@@ -877,9 +875,9 @@ function mcp_delete_post($post_ids)
$return_link = array();
if ($affected_topics == 1 && !$deleted_topics && $topic_id)
{
- $return_link[] = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id") . '">', '</a>');
+ $return_link[] = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id") . '">', '</a>');
}
- $return_link[] = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
+ $return_link[] = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . $forum_id) . '">', '</a>');
if (sizeof($post_ids) == 1)
{
@@ -912,7 +910,7 @@ function mcp_delete_post($post_ids)
confirm_box(false, (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS', $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -932,7 +930,6 @@ function mcp_delete_post($post_ids)
function mcp_fork_topic($topic_ids)
{
global $auth, $user, $db, $template, $config;
- global $phpEx, $phpbb_root_path;
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{
@@ -1202,7 +1199,7 @@ function mcp_fork_topic($topic_ids)
confirm_box(false, 'FORK_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -1211,13 +1208,13 @@ function mcp_fork_topic($topic_ids)
}
else
{
- $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
+ $redirect_url = append_sid('viewforum', 'f=' . $forum_id);
meta_refresh(3, $redirect_url);
$return_link = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>');
if ($forum_id != $to_forum_id)
{
- $return_link .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $to_forum_id) . '">', '</a>');
+ $return_link .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . $to_forum_id) . '">', '</a>');
}
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index b4804d56ea..5ca3d8f606 100755
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -33,8 +33,7 @@ class mcp_notes
function main($id, $mode)
{
- global $auth, $db, $user, $template;
- global $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $user, $template, $config;
$action = request_var('action', array('' => ''));
@@ -49,8 +48,8 @@ class mcp_notes
{
case 'front':
$template->assign_vars(array(
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
- 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
+ 'U_POST_ACTION' => append_sid('mcp', 'i=notes&amp;mode=user_notes'),
'L_TITLE' => $user->lang['MCP_NOTES'],
));
@@ -72,8 +71,7 @@ class mcp_notes
*/
function mcp_notes_user_view($action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $config;
$user_id = request_var('u', 0);
$username = request_var('username', '', true);
@@ -176,7 +174,7 @@ class mcp_notes
// Generate the appropriate user information for the user we are looking at
if (!function_exists('get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
}
$rank_title = $rank_img = '';
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index 8d4ea46e31..e73c2d30ec 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -21,8 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_post_details($id, $mode, $action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth, $cache;
+ global $template, $db, $user, $auth, $cache, $config;
$user->add_lang('posting');
@@ -40,7 +39,8 @@ function mcp_post_details($id, $mode, $action)
}
$post_info = $post_info[$post_id];
- $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
+ $extra_url = extra_url();
+ $url = ($extra_url) ? append_sid('mcp', extra_url()) : append_sid('mcp') . '?';
switch ($action)
{
@@ -49,11 +49,11 @@ function mcp_post_details($id, $mode, $action)
if ($auth->acl_get('m_info', $post_info['forum_id']))
{
$ip = request_var('ip', '');
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$template->assign_vars(array(
- 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;p=$post_id") . '">', '</a>'),
- 'U_RETURN_POST' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;p=$post_id"),
+ 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid('mcp', "i=$id&amp;mode=$mode&amp;p=$post_id") . '">', '</a>'),
+ 'U_RETURN_POST' => append_sid('mcp', "i=$id&amp;mode=$mode&amp;p=$post_id"),
'L_RETURN_POST' => sprintf($user->lang['RETURN_POST'], '', ''),
'WHOIS' => user_ipwhois($ip),
));
@@ -130,7 +130,7 @@ function mcp_post_details($id, $mode, $action)
if ($post_info['bbcode_bitfield'])
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode($post_info['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
}
@@ -178,7 +178,7 @@ function mcp_post_details($id, $mode, $action)
$template->assign_vars(array(
'U_MCP_ACTION' => "$url&amp;i=main&amp;quickmod=1", // Use this for mode paramaters
'U_POST_ACTION' => "$url&amp;i=$id&amp;mode=post_details", // Use this for action parameters
- 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f={$post_info['forum_id']}"),
+ 'U_APPROVE_ACTION' => append_sid('mcp', "i=queue&amp;p=$post_id&amp;f={$post_info['forum_id']}"),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']),
@@ -191,19 +191,19 @@ function mcp_post_details($id, $mode, $action)
'S_USER_NOTES' => true,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
- 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp_chgposter&amp;field=username&amp;select_single=true'),
- 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
- 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
- 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
+ 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid('posting', "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=mcp_chgposter&amp;field=username&amp;select_single=true'),
+ 'U_MCP_APPROVE' => append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_USER_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
+ 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
+ 'U_VIEW_POST' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
- 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_info['forum_id']}&amp;p=$post_id") . "#p$post_id\">", '</a>'),
- 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'),
+ 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', "f={$post_info['forum_id']}&amp;p=$post_id") . "#p$post_id\">", '</a>'),
+ 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
@@ -222,7 +222,7 @@ function mcp_post_details($id, $mode, $action)
'POST_ID' => $post_info['post_id'],
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&amp;i=$id&amp;mode=$mode&amp;lookup={$post_info['poster_ip']}#ip" : '',
- 'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$post_info['poster_ip']}") : '',
+ 'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid('mcp', "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$post_info['poster_ip']}") : '',
));
// Get User Notes
@@ -274,7 +274,7 @@ function mcp_post_details($id, $mode, $action)
'REASON_TITLE' => $row['reason_title'],
'REASON_DESC' => $row['reason_description'],
'REPORTER' => ($row['user_id'] != ANONYMOUS) ? $row['username'] : $user->lang['GUEST'],
- 'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']) : '',
+ 'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']) : '',
'USER_NOTIFY' => ($row['user_notify']) ? true : false,
'REPORT_TIME' => $user->format_date($row['report_time']),
'REPORT_TEXT' => bbcode_nl2br(trim($row['report_text'])),
@@ -337,8 +337,8 @@ function mcp_post_details($id, $mode, $action)
'NUM_POSTS' => $user_row['postings'],
'L_POST_S' => ($user_row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
- 'U_PROFILE' => ($user_id == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_id),
- 'U_SEARCHPOSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user_id . '&amp;sr=topics'))
+ 'U_PROFILE' => ($user_id == ANONYMOUS) ? '' : append_sid('memberlist', 'mode=viewprofile&amp;u=' . $user_id),
+ 'U_SEARCHPOSTS' => append_sid('search', 'author_id=' . $user_id . '&amp;sr=topics'))
);
}
}
@@ -367,7 +367,7 @@ function mcp_post_details($id, $mode, $action)
'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
'U_LOOKUP_IP' => ($rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? '' : "$url&amp;i=$id&amp;mode=post_details&amp;rdns={$row['poster_ip']}#ip",
- 'U_WHOIS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$row['poster_ip']}"))
+ 'U_WHOIS' => append_sid('mcp', "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$row['poster_ip']}"))
);
}
$db->sql_freeresult($result);
@@ -394,7 +394,7 @@ function mcp_post_details($id, $mode, $action)
*/
function change_poster(&$post_info, $userdata)
{
- global $auth, $db, $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $config;
if (empty($userdata) || $userdata['user_id'] == $post_info['user_id'])
{
@@ -467,9 +467,9 @@ function change_poster(&$post_info, $userdata)
// refresh search cache of this post
$search_type = basename($config['search_type']);
- if (file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
{
- require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+ require(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT);
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 36e937897e..eea00e5660 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -34,9 +34,9 @@ class mcp_queue
function main($id, $mode)
{
global $auth, $db, $user, $template, $cache;
- global $config, $phpbb_root_path, $phpEx, $action;
+ global $config, $action;
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$forum_id = request_var('f', 0);
$start = request_var('start', 0);
@@ -47,7 +47,7 @@ class mcp_queue
{
case 'approve':
case 'disapprove':
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$post_id_list = request_var('post_id_list', array(0));
@@ -130,7 +130,7 @@ class mcp_queue
if ($post_info['bbcode_bitfield'])
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode($post_info['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
}
@@ -175,29 +175,29 @@ class mcp_queue
}
}
- $post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']);
- $topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']);
+ $post_url = append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']);
+ $topic_url = append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']);
$template->assign_vars(array(
'S_MCP_QUEUE' => true,
- 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f=$forum_id"),
+ 'U_APPROVE_ACTION' => append_sid('mcp', "i=queue&amp;p=$post_id&amp;f=$forum_id"),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => !$post_info['post_approved'],
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => true,
- 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
- 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
- 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
+ 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid('posting', "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
+ 'U_MCP_APPROVE' => append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_USER_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
+ 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_POST' => $post_url,
'U_VIEW_TOPIC' => $topic_url,
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
- 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . "&amp;start=$start\">", '</a>'),
+ 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid('mcp', 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . "&amp;start=$start\">", '</a>'),
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>'),
'RETURN_TOPIC_SIMPLE' => sprintf($user->lang['RETURN_TOPIC_SIMPLE'], '<a href="' . $topic_url . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
@@ -216,7 +216,7 @@ class mcp_queue
'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
'POST_ID' => $post_info['post_id'],
- 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id . '&amp;lookup=' . $post_info['poster_ip']) . '#ip' : '',
+ 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id . '&amp;lookup=' . $post_info['poster_ip']) . '#ip' : '',
));
break;
@@ -404,10 +404,10 @@ class mcp_queue
}
$template->assign_block_vars('postrow', array(
- 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
- 'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
- 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;start=$start&amp;mode=approve_details&amp;f={$row['forum_id']}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '')),
+ 'U_TOPIC' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
+ 'U_VIEWFORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_VIEWPOST' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
+ 'U_VIEW_DETAILS' => append_sid('mcp', "i=queue&amp;start=$start&amp;mode=approve_details&amp;f={$row['forum_id']}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '')),
'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
@@ -452,7 +452,6 @@ class mcp_queue
function approve_post($post_id_list, $id, $mode)
{
global $db, $template, $user, $config;
- global $phpEx, $phpbb_root_path;
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
@@ -655,8 +654,8 @@ function approve_post($post_id_list, $id, $mode)
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])),
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])),
- 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&e=0",
- 'U_VIEW_POST' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&p=$post_id&e=$post_id")
+ 'U_VIEW_TOPIC' => generate_board_url() . '/viewtopic.' . PHP_EXT . "?f={$post_data['forum_id']}&t={$post_data['topic_id']}&e=0",
+ 'U_VIEW_POST' => generate_board_url() . '/viewtopic.' . PHP_EXT . "?f={$post_data['forum_id']}&t={$post_data['topic_id']}&p=$post_id&e=$post_id")
);
$messenger->send($post_data['user_notify_type']);
@@ -685,7 +684,7 @@ function approve_post($post_id_list, $id, $mode)
if (sizeof($post_id_list) == 1)
{
$post_data = $post_info[$post_id_list[0]];
- $post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_data['forum_id']}&amp;t={$post_data['topic_id']}&amp;p={$post_data['post_id']}") . '#p' . $post_data['post_id'];
+ $post_url = append_sid('viewtopic', "f={$post_data['forum_id']}&amp;t={$post_data['topic_id']}&amp;p={$post_data['post_id']}") . '#p' . $post_data['post_id'];
}
unset($post_info);
@@ -723,7 +722,7 @@ function approve_post($post_id_list, $id, $mode)
confirm_box(false, 'APPROVE_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -751,7 +750,6 @@ function approve_post($post_id_list, $id, $mode)
function disapprove_post($post_id_list, $id, $mode)
{
global $db, $template, $user, $config;
- global $phpEx, $phpbb_root_path;
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
@@ -886,7 +884,7 @@ function disapprove_post($post_id_list, $id, $mode)
{
if (!function_exists('delete_posts'))
{
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
}
// We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts
@@ -951,7 +949,7 @@ function disapprove_post($post_id_list, $id, $mode)
}
else
{
- include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
display_reasons($reason_id);
@@ -980,7 +978,7 @@ function disapprove_post($post_id_list, $id, $mode)
confirm_box(false, 'DISAPPROVE_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index c837ff0e67..98d66aedff 100755
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -34,9 +34,9 @@ class mcp_reports
function main($id, $mode)
{
global $auth, $db, $user, $template, $cache;
- global $config, $phpbb_root_path, $phpEx, $action;
+ global $config, $action;
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$forum_id = request_var('f', 0);
$start = request_var('start', 0);
@@ -47,7 +47,7 @@ class mcp_reports
{
case 'close':
case 'delete':
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$report_id_list = request_var('report_id_list', array(0));
@@ -139,7 +139,7 @@ class mcp_reports
if ($post_info['bbcode_bitfield'])
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode($post_info['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
}
@@ -186,28 +186,28 @@ class mcp_reports
$template->assign_vars(array(
'S_MCP_REPORT' => true,
- 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'S_CLOSE_ACTION' => append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => !$post_info['post_approved'],
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => true,
- 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
- 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']),
- 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
- 'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
- 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
- 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
+ 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid('posting', "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
+ 'U_MCP_APPROVE' => append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_REPORTER_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']),
+ 'U_MCP_USER_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
+ 'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
+ 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
+ 'U_VIEW_POST' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
- 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports' . (($post_info['post_reported']) ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start . '&amp;f=' . $post_info['forum_id']) . '">', '</a>'),
+ 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid('mcp', 'i=reports' . (($post_info['post_reported']) ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start . '&amp;f=' . $post_info['forum_id']) . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
'REPORT_DATE' => $user->format_date($report['report_time']),
'REPORT_ID' => $report_id,
@@ -372,9 +372,9 @@ class mcp_reports
}
$template->assign_block_vars('postrow', array(
- 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
- 'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . '#p' . $row['post_id'],
- 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&amp;start=$start&amp;mode=report_details&amp;f={$row['forum_id']}&amp;r={$row['report_id']}"),
+ 'U_VIEWFORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_VIEWPOST' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . '#p' . $row['post_id'],
+ 'U_VIEW_DETAILS' => append_sid('mcp', "i=reports&amp;start=$start&amp;mode=report_details&amp;f={$row['forum_id']}&amp;r={$row['report_id']}"),
'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
@@ -429,7 +429,6 @@ class mcp_reports
function close_report($report_id_list, $mode, $action)
{
global $db, $template, $user, $config;
- global $phpEx, $phpbb_root_path;
$sql = 'SELECT r.post_id
FROM ' . REPORTS_TABLE . ' r
@@ -616,7 +615,7 @@ function close_report($report_id_list, $mode, $action)
confirm_box(false, $user->lang[strtoupper($action) . '_REPORT' . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -629,12 +628,12 @@ function close_report($report_id_list, $mode, $action)
$return_forum = '';
if (sizeof($forum_ids == 1))
{
- $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
+ $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
}
$return_topic = '';
if (sizeof($topic_ids == 1))
{
- $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
+ $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 't=' . current($topic_ids) . 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
}
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 2e7f60825d..5c4c1feaad 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -21,10 +21,9 @@ if (!defined('IN_PHPBB'))
*/
function mcp_topic_view($id, $mode, $action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth, $cache;
+ global $template, $db, $user, $auth, $cache, $config;
- $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
+ $url = append_sid(PHPBB_ROOT_PATH. 'mcp.' . PHP_EXT . '?' . extra_url());
$user->add_lang('viewtopic');
@@ -77,9 +76,9 @@ function mcp_topic_view($id, $mode, $action)
// Approve posts?
if ($action == 'approve' && $auth->acl_get('m_approve', $topic_info['forum_id']))
{
- include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx);
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_queue.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
if (!sizeof($post_id_list))
{
@@ -140,7 +139,7 @@ function mcp_topic_view($id, $mode, $action)
if ($bbcode_bitfield !== '')
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
}
@@ -220,7 +219,7 @@ function mcp_topic_view($id, $mode, $action)
'POST_SUBJECT' => $post_subject,
'MESSAGE' => $message,
'POST_ID' => $row['post_id'],
- 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) . '">', '</a>'),
+ 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 't=' . $topic_id) . '">', '</a>'),
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
@@ -230,8 +229,8 @@ function mcp_topic_view($id, $mode, $action)
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
'U_POST_DETAILS' => "$url&amp;i=$id&amp;p={$row['post_id']}&amp;mode=post_details" . (($forum_id) ? "&amp;f=$forum_id" : ''),
- 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '',
- 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '')
+ 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '',
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '')
);
// Display not already displayed Attachments for this post, we already parsed them. ;)
@@ -253,7 +252,7 @@ function mcp_topic_view($id, $mode, $action)
if ($auth->acl_get('m_split', $topic_info['forum_id']))
{
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$s_topic_icons = posting_gen_topic_icons('', $icon_id);
// Has the user selected a topic for merge?
@@ -283,10 +282,10 @@ function mcp_topic_view($id, $mode, $action)
$template->assign_vars(array(
'TOPIC_TITLE' => $topic_info['topic_title'],
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id']),
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', 'f=' . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id']),
'TO_TOPIC_ID' => $to_topic_id,
- 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id) . '">' . $to_topic_info['topic_title'] . '</a>') : '',
+ 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid('viewtopic', 'f=' . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id) . '">' . $to_topic_info['topic_title'] . '</a>') : '',
'SPLIT_SUBJECT' => $subject,
'POSTS_PER_PAGE' => $posts_per_page,
@@ -314,11 +313,11 @@ function mcp_topic_view($id, $mode, $action)
'U_SELECT_TOPIC' => "$url&amp;i=$id&amp;mode=forum_view&amp;action=merge_select" . (($forum_id) ? "&amp;f=$forum_id" : ''),
- 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start=$start") . '">', '</a>'),
- 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$topic_info['forum_id']}&amp;start=$start") . '">', '</a>'),
+ 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', "f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start=$start") . '">', '</a>'),
+ 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', "f={$topic_info['forum_id']}&amp;start=$start") . '">', '</a>'),
'PAGE_NUMBER' => on_page($total, $posts_per_page, $start),
- 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;t={$topic_info['topic_id']}&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir"), $total, $posts_per_page, $start),
+ 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid('mcp', "i=$id&amp;t={$topic_info['topic_id']}&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir"), $total, $posts_per_page, $start),
'TOTAL_POSTS' => ($total == 1) ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total),
));
}
@@ -328,7 +327,7 @@ function mcp_topic_view($id, $mode, $action)
*/
function split_topic($action, $topic_id, $to_forum_id, $subject)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
+ global $db, $template, $user, $auth;
$post_id_list = request_var('post_id_list', array(0));
$forum_id = request_var('forum_id', 0);
@@ -492,14 +491,14 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$success_msg = 'TOPIC_SPLIT_SUCCESS';
// Link back to both topics
- $return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
+ $return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
confirm_box(false, ($action == 'split_all') ? 'SPLIT_TOPIC_ALL' : 'SPLIT_TOPIC_BEYOND', $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -508,7 +507,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
}
else
{
- meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
+ meta_refresh(3, append_sid('viewtopic', "f=$to_forum_id&amp;t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
@@ -518,7 +517,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
*/
function merge_posts($topic_id, $to_topic_id)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
+ global $db, $template, $user, $auth;
if (!$to_topic_id)
{
@@ -584,7 +583,7 @@ function merge_posts($topic_id, $to_topic_id)
if ($row)
{
- $return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id) . '">', '</a>');
+ $return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id) . '">', '</a>');
}
else
{
@@ -598,14 +597,14 @@ function merge_posts($topic_id, $to_topic_id)
}
// Link to the new topic
- $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
+ $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
confirm_box(false, 'MERGE_POSTS', $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -614,7 +613,7 @@ function merge_posts($topic_id, $to_topic_id)
}
else
{
- meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
+ meta_refresh(3, append_sid('viewtopic', "f=$to_forum_id&amp;t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index 6751ef41bf..1ca40cb841 100755
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -33,8 +33,7 @@ class mcp_warn
function main($id, $mode)
{
- global $auth, $db, $user, $template;
- global $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $user, $template, $config;
$action = request_var('action', array('' => ''));
@@ -76,12 +75,11 @@ class mcp_warn
*/
function mcp_warn_front_view()
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $config;
$template->assign_vars(array(
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
- 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
+ 'U_POST_ACTION' => append_sid('mcp', 'i=warn&amp;mode=warn_user'),
));
// Obtain a list of the 5 naughtiest users....
@@ -94,12 +92,12 @@ class mcp_warn
foreach ($highest as $row)
{
$template->assign_block_vars('highest', array(
- 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
+ 'U_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
- 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
+ 'U_USER' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']),
'WARNING_TIME' => $user->format_date($row['user_last_warning']),
'WARNINGS' => $row['user_warnings'],
@@ -116,12 +114,12 @@ class mcp_warn
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('latest', array(
- 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
+ 'U_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
- 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
+ 'U_USER' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']),
'WARNING_TIME' => $user->format_date($row['warning_time']),
'WARNINGS' => $row['user_warnings'],
@@ -135,8 +133,7 @@ class mcp_warn
*/
function mcp_warn_list_view($action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $config;
$user->add_lang('memberlist');
@@ -164,12 +161,12 @@ class mcp_warn
foreach ($users as $row)
{
$template->assign_block_vars('user', array(
- 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
+ 'U_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
- 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
+ 'U_USER' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']),
'WARNING_TIME' => $user->format_date($row['user_last_warning']),
'WARNINGS' => $row['user_warnings'],
@@ -184,7 +181,7 @@ class mcp_warn
'S_SELECT_SORT_DAYS' => $s_limit_days,
'PAGE_NUMBER' => on_page($user_count, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, $config['topics_per_page'], $start),
+ 'PAGINATION' => generate_pagination(append_sid('mcp', "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, $config['topics_per_page'], $start),
'TOTAL_USERS' => ($user_count == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $user_count),
));
}
@@ -194,8 +191,7 @@ class mcp_warn
*/
function mcp_warn_post_view($action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $config;
$post_id = request_var('p', 0);
$forum_id = request_var('f', 0);
@@ -260,7 +256,7 @@ class mcp_warn
{
$msg = $user->lang['FORM_INVALID'];
}
- $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
+ $redirect = append_sid('mcp', "i=notes&amp;mode=user_notes&amp;u=$user_id");
meta_refresh(2, $redirect);
trigger_error($user->lang['USER_WARNING_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
@@ -274,7 +270,7 @@ class mcp_warn
// Second parse bbcode here
if ($user_row['bbcode_bitfield'])
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode($user_row['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $user_row['bbcode_uid'], $user_row['bbcode_bitfield']);
@@ -286,7 +282,7 @@ class mcp_warn
// Generate the appropriate user information for the user we are looking at
if (!function_exists('get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
}
$rank_title = $rank_img = '';
@@ -306,7 +302,7 @@ class mcp_warn
'AVATAR_IMG' => $avatar_img,
'RANK_IMG' => $rank_img,
- 'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&amp;p=$post_id#p$post_id"),
+ 'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . '/viewtopic.' . PHP_EXT . "?f=$forum_id&amp;p=$post_id#p$post_id"),
));
}
@@ -315,7 +311,7 @@ class mcp_warn
*/
function mcp_warn_user_view($action)
{
- global $phpEx, $phpbb_root_path, $config, $module;
+ global $config, $module;
global $template, $db, $user, $auth;
$user_id = request_var('u', 0);
@@ -362,7 +358,7 @@ class mcp_warn
{
$msg = $user->lang['FORM_INVALID'];
}
- $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
+ $redirect = append_sid('mcp', "i=notes&amp;mode=user_notes&amp;u=$user_id");
meta_refresh(2, $redirect);
trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
@@ -370,7 +366,7 @@ class mcp_warn
// Generate the appropriate user information for the user we are looking at
if (!function_exists('get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
}
$rank_title = $rank_img = '';
@@ -400,16 +396,15 @@ class mcp_warn
*/
function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $config;
if ($send_pm)
{
- include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
- include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_privmsgs.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
- $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . $user_row['user_lang'] . "/mcp.$phpEx")) ? $user_row['user_lang'] : $config['default_lang'];
- include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp.$phpEx");
+ $user_row['user_lang'] = (file_exists(PHPBB_ROOT_PATH . 'language/' . $user_row['user_lang'] . '/mcp.' . PHP_EXT)) ? $user_row['user_lang'] : $config['default_lang'];
+ include(PHPBB_ROOT_PATH . 'language/' . basename($user_row['user_lang']) . '/mcp.' . PHP_EXT);
$message_parser = new parse_message();
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 7d3977c507..286ccd8152 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -18,7 +18,7 @@ if (!defined('IN_PHPBB'))
if (!class_exists('bbcode'))
{
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
}
/**
@@ -970,7 +970,7 @@ class bbcode_firstpass extends bbcode
*/
function path_in_domain($url)
{
- global $config, $phpEx, $user;
+ global $config, $user;
if ($config['force_server_vars'])
{
@@ -982,7 +982,7 @@ class bbcode_firstpass extends bbcode
}
// Is the user trying to link to a php file in this domain and script path?
- if (strpos($url, ".{$phpEx}") !== false && strpos($url, $check_path) !== false)
+ if (strpos($url, '.' . PHP_EXT) !== false && strpos($url, $check_path) !== false)
{
$server_name = $user->host;
@@ -993,14 +993,14 @@ class bbcode_firstpass extends bbcode
}
// Check again in correct order...
- $pos_ext = strpos($url, ".{$phpEx}");
+ $pos_ext = strpos($url, '.' . PHP_EXT);
$pos_path = strpos($url, $check_path);
$pos_domain = strpos($url, $server_name);
if ($pos_domain !== false && $pos_path >= $pos_domain && $pos_ext >= $pos_path)
{
// Ok, actually we allow linking to some files (this may be able to be extended in some way later...)
- if (strpos($url, '/' . $check_path . '/download/file.' . $phpEx) !== 0)
+ if (strpos($url, '/' . $check_path . '/download/file.' . PHP_EXT) !== 0)
{
return false;
}
@@ -1300,7 +1300,7 @@ class parse_message extends bbcode_firstpass
*/
function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false)
{
- global $config, $auth, $user, $phpbb_root_path, $phpEx, $db;
+ global $config, $auth, $user, $db;
$error = array();
@@ -1390,7 +1390,7 @@ class parse_message extends bbcode_firstpass
// Perform actions on temporary attachments
if ($delete_file)
{
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
$index = array_keys(request_var('delete_file', array(0 => 0)));
$index = (!empty($index)) ? $index[0] : false;
@@ -1488,7 +1488,7 @@ class parse_message extends bbcode_firstpass
*/
function get_submitted_attachment_data($check_user_id = false)
{
- global $user, $db, $phpbb_root_path, $phpEx, $config;
+ global $user, $db, $config;
$this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
$attachment_data = (isset($_POST['attachment_data'])) ? $_POST['attachment_data'] : array();
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index a119f866c4..17cc6782c5 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
/**
* @ignore
*/
-include_once($phpbb_root_path . 'includes/search/search.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/search/search.' . PHP_EXT);
/**
* fulltext_mysql
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index e38f095f6d..48a29e4f31 100755
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
/**
* @ignore
*/
-include_once($phpbb_root_path . 'includes/search/search.' . $phpEx);
+include_once(PHPBB_ROOT_PATH . 'includes/search/search.' . PHP_EXT);
/**
* fulltext_native
@@ -46,7 +46,7 @@ class fulltext_native extends search_backend
*/
function __construct(&$error)
{
- global $phpbb_root_path, $phpEx, $config;
+ global $config;
$this->word_length = array('min' => $config['fulltext_native_min_chars'], 'max' => $config['fulltext_native_max_chars']);
@@ -55,7 +55,7 @@ class fulltext_native extends search_backend
*/
if (!class_exists('utf_normalizer'))
{
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
}
@@ -966,7 +966,7 @@ class fulltext_native extends search_backend
*/
private function split_message($text)
{
- global $phpbb_root_path, $phpEx, $user;
+ global $user;
$match = $words = array();
@@ -1408,7 +1408,6 @@ class fulltext_native extends search_backend
*/
private function cleanup($text, $allowed_chars = null)
{
- global $phpbb_root_path, $phpEx;
static $conv = array(), $conv_loaded = array();
$words = $allow = array();
@@ -1598,7 +1597,7 @@ class fulltext_native extends search_backend
if (!isset($conv_loaded[$idx]))
{
$conv_loaded[$idx] = 1;
- $file = $phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $phpEx;
+ $file = PHPBB_ROOT_PATH . 'includes/utf/data/search_indexer_' . $idx . '.' . PHP_EXT;
if (file_exists($file))
{
diff --git a/phpBB/includes/search/search.php b/phpBB/includes/search/search.php
index e13a59caed..ab04463527 100755
--- a/phpBB/includes/search/search.php
+++ b/phpBB/includes/search/search.php
@@ -45,14 +45,14 @@ class search_backend
{
if (!sizeof($this->ignore_words))
{
- global $user, $phpEx;
+ global $user;
$words = array();
- if (file_exists("{$user->lang_path}/search_ignore_words.$phpEx"))
+ if (file_exists("{$user->lang_path}/search_ignore_words." . PHP_EXT))
{
// include the file containing ignore words
- include("{$user->lang_path}/search_ignore_words.$phpEx");
+ include("{$user->lang_path}/search_ignore_words." . PHP_EXT);
}
$this->ignore_words = $words;
@@ -67,14 +67,14 @@ class search_backend
{
if (!sizeof($this->match_synonym))
{
- global $user, $phpEx;
+ global $user;
$synonyms = array();
- if (file_exists("{$user->lang_path}/search_synonyms.$phpEx"))
+ if (file_exists("{$user->lang_path}/search_synonyms." . PHP_EXT))
{
// include the file containing synonyms
- include("{$user->lang_path}/search_synonyms.$phpEx");
+ include("{$user->lang_path}/search_synonyms." . PHP_EXT);
}
$this->match_synonym = array_keys($synonyms);
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 6db65509ec..29d3ba584e 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -150,7 +150,7 @@ class session
*/
function session_begin($update_session_page = true)
{
- global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $config, $phpbb_root_path;
+ global $SID, $_SID, $_EXTRA_URL, $db, $config;
// Give us some basic information
$this->time_now = time();
@@ -160,7 +160,7 @@ class session
$this->referer = (!empty($_SERVER['HTTP_REFERER'])) ? htmlspecialchars((string) $_SERVER['HTTP_REFERER']) : '';
$this->forwarded_for = (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? (string) $_SERVER['HTTP_X_FORWARDED_FOR'] : '';
$this->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
- $this->page = $this->extract_current_page($phpbb_root_path);
+ $this->page = $this->extract_current_page(PHPBB_ROOT_PATH);
// if the forwarded for header shall be checked we have to validate its contents
if ($config['forwarded_for_check'])
@@ -283,7 +283,7 @@ class session
// Check whether the session is still valid if we have one
$method = basename(trim($config['auth_method']));
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
$method = 'validate_session_' . $method;
if (function_exists($method))
@@ -383,7 +383,7 @@ class session
*/
function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true)
{
- global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx;
+ global $SID, $_SID, $db, $config, $cache;
$this->data = array();
@@ -440,7 +440,7 @@ class session
}
$method = basename(trim($config['auth_method']));
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
$method = 'autologin_' . $method;
if (function_exists($method))
@@ -732,7 +732,7 @@ class session
*/
function session_kill($new_session = true)
{
- global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx;
+ global $SID, $_SID, $db, $config;
$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
WHERE session_id = '" . $db->sql_escape($this->session_id) . "'
@@ -741,7 +741,7 @@ class session
// Allow connecting logout with external auth method logout
$method = basename(trim($config['auth_method']));
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
$method = 'logout_' . $method;
if (function_exists($method))
@@ -1075,15 +1075,13 @@ class session
// We show a login box here to allow founders accessing the board if banned by IP
if (defined('IN_LOGIN') && $this->data['user_id'] == ANONYMOUS)
{
- global $phpEx;
-
$this->setup('ucp');
$this->data['is_registered'] = $this->data['is_bot'] = false;
// Set as a precaution to allow login_box() handling this case correctly as well as this function not being executed again.
define('IN_CHECK_BAN', 1);
- login_box("index.$phpEx");
+ login_box('index.' . PHP_EXT);
// The false here is needed, else the user is able to circumvent the ban.
$this->session_kill(false);
@@ -1358,12 +1356,12 @@ class user extends session
*/
function setup($lang_set = false, $style = false)
{
- global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
+ global $db, $template, $config, $auth, $cache;
if ($this->data['user_id'] != ANONYMOUS)
{
- $this->lang_name = (file_exists($phpbb_root_path . 'language/' . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
- $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';
+ $this->lang_name = (file_exists(PHPBB_ROOT_PATH . 'language/' . $this->data['user_lang'] . '/common.' . PHP_EXT)) ? $this->data['user_lang'] : basename($config['default_lang']);
+ $this->lang_path = PHPBB_ROOT_PATH . 'language/' . $this->lang_name . '/';
$this->date_format = $this->data['user_dateformat'];
$this->timezone = $this->data['user_timezone'] * 3600;
@@ -1372,7 +1370,7 @@ class user extends session
else
{
$this->lang_name = basename($config['default_lang']);
- $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';
+ $this->lang_path = PHPBB_ROOT_PATH . 'language/' . $this->lang_name . '/';
$this->date_format = $config['default_dateformat'];
$this->timezone = $config['board_timezone'] * 3600;
$this->dst = $config['board_dst'] * 3600;
@@ -1392,10 +1390,10 @@ class user extends session
$accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2));
$accept_lang = basename($accept_lang);
- if (file_exists($phpbb_root_path . 'language/' . $accept_lang . "/common.$phpEx"))
+ if (file_exists(PHPBB_ROOT_PATH . 'language/' . $accept_lang . "/common." . PHP_EXT))
{
$this->lang_name = $config['default_lang'] = $accept_lang;
- $this->lang_path = $phpbb_root_path . 'language/' . $accept_lang . '/';
+ $this->lang_path = PHPBB_ROOT_PATH . 'language/' . $accept_lang . '/';
break;
}
else
@@ -1404,10 +1402,10 @@ class user extends session
$accept_lang = substr($accept_lang, 0, 2);
$accept_lang = basename($accept_lang);
- if (file_exists($phpbb_root_path . 'language/' . $accept_lang . "/common.$phpEx"))
+ if (file_exists(PHPBB_ROOT_PATH . 'language/' . $accept_lang . "/common." . PHP_EXT))
{
$this->lang_name = $config['default_lang'] = $accept_lang;
- $this->lang_path = $phpbb_root_path . 'language/' . $accept_lang . '/';
+ $this->lang_path = PHPBB_ROOT_PATH . 'language/' . $accept_lang . '/';
break;
}
}
@@ -1419,9 +1417,9 @@ class user extends session
// We include common language file here to not load it every time a custom language file is included
$lang = &$this->lang;
- if ((@include $this->lang_path . "common.$phpEx") === false)
+ if ((@include $this->lang_path . 'common.' . PHP_EXT) === false)
{
- die('Language file ' . $this->lang_name . "/common.$phpEx" . " couldn't be opened.");
+ die('Language file ' . $this->lang_name . '/common.' . PHP_EXT . " couldn't be opened.");
}
$this->add_lang($lang_set);
@@ -1504,7 +1502,7 @@ class user extends session
{
$this->theme['theme_storedb'] = 1;
- $stylesheet = file_get_contents("{$phpbb_root_path}styles/{$this->theme['theme_path']}/theme/stylesheet.css");
+ $stylesheet = file_get_contents(PHPBB_ROOT_PATH . "styles/{$this->theme['theme_path']}/theme/stylesheet.css");
// Match CSS imports
$matches = array();
preg_match_all('/@import url\(["\'](.*)["\']\);/i', $stylesheet, $matches);
@@ -1514,7 +1512,7 @@ class user extends session
$content = '';
foreach ($matches[0] as $idx => $match)
{
- if ($content = @file_get_contents("{$phpbb_root_path}styles/{$this->theme['theme_path']}/theme/" . $matches[1][$idx]))
+ if ($content = @file_get_contents(PHPBB_ROOT_PATH . "styles/{$this->theme['theme_path']}/theme/" . $matches[1][$idx]))
{
$content = trim($content);
}
@@ -1545,7 +1543,7 @@ class user extends session
$template->set_template();
- $this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang'];
+ $this->img_lang = (file_exists(PHPBB_ROOT_PATH . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang'];
$sql = 'SELECT image_name, image_filename, image_lang, image_height, image_width
FROM ' . STYLES_IMAGESET_DATA_TABLE . '
@@ -1580,9 +1578,9 @@ class user extends session
AND image_lang = \'' . $db->sql_escape($this->img_lang) . '\'';
$result = $db->sql_query($sql);
- if (@file_exists("{$phpbb_root_path}styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg"))
+ if (@file_exists(PHPBB_ROOT_PATH . "styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg"))
{
- $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg");
+ $cfg_data_imageset_data = parse_cfg_file(PHPBB_ROOT_PATH . "styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg");
foreach ($cfg_data_imageset_data as $image_name => $value)
{
if (strpos($value, '*') !== false)
@@ -1645,7 +1643,7 @@ class user extends session
// Disable board if the install/ directory is still present
// For the brave development army we do not care about this, else we need to comment out this everytime we develop locally
- if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install'))
+ if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists(PHPBB_ROOT_PATH . 'install'))
{
// Adjust the message slightly according to the permissions
if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))
@@ -1718,9 +1716,9 @@ class user extends session
// ucp profile reg_details page ... of course do not redirect if we're already in the ucp
if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && $this->data['is_registered'] && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
{
- if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx")
+ if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != 'ucp.' . PHP_EXT)
{
- redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=reg_details'));
+ redirect(append_sid('ucp', 'i=profile&amp;mode=reg_details'));
}
}
@@ -1745,8 +1743,6 @@ class user extends session
*/
function add_lang($lang_set, $use_db = false, $use_help = false)
{
- global $phpEx;
-
if (is_array($lang_set))
{
foreach ($lang_set as $key => $lang_file)
@@ -1786,14 +1782,12 @@ class user extends session
*/
function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false)
{
- global $phpEx;
-
// Make sure the language path is set (if the user setup did not happen it is not set)
if (!$this->lang_path)
{
- global $phpbb_root_path, $config;
+ global $config;
- $this->lang_path = $phpbb_root_path . 'language/' . basename($config['default_lang']) . '/';
+ $this->lang_path = PHPBB_ROOT_PATH . 'language/' . basename($config['default_lang']) . '/';
}
// $lang == $this->lang
@@ -1803,11 +1797,11 @@ class user extends session
{
if ($use_help && strpos($lang_file, '/') !== false)
{
- $language_filename = $this->lang_path . substr($lang_file, 0, stripos($lang_file, '/') + 1) . 'help_' . substr($lang_file, stripos($lang_file, '/') + 1) . '.' . $phpEx;
+ $language_filename = $this->lang_path . substr($lang_file, 0, stripos($lang_file, '/') + 1) . 'help_' . substr($lang_file, stripos($lang_file, '/') + 1) . '.' . PHP_EXT;
}
else
{
- $language_filename = $this->lang_path . (($use_help) ? 'help_' : '') . $lang_file . '.' . $phpEx;
+ $language_filename = $this->lang_path . (($use_help) ? 'help_' : '') . $lang_file . '.' . PHP_EXT;
}
if ((@include $language_filename) === false)
@@ -1924,7 +1918,6 @@ class user extends session
function img($img, $alt = '', $width = false, $suffix = '', $type = 'full_tag')
{
static $imgs;
- global $phpbb_root_path;
$img_data = &$imgs[$img];
@@ -1937,7 +1930,7 @@ class user extends session
return $img_data;
}
- $img_data['src'] = $phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename'];
+ $img_data['src'] = PHPBB_ROOT_PATH . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename'];
$img_data['width'] = $this->img_array[$img]['image_width'];
$img_data['height'] = $this->img_array[$img]['image_height'];
}
diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php
index e5f57cfdc2..bcaa0eb5f4 100644
--- a/phpBB/includes/template.php
+++ b/phpBB/includes/template.php
@@ -46,12 +46,12 @@ class template
*/
public function set_template()
{
- global $phpbb_root_path, $user;
+ global $user;
- if (file_exists($phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template'))
+ if (file_exists(PHPBB_ROOT_PATH . 'styles/' . $user->theme['template_path'] . '/template'))
{
- $this->root = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template';
- $this->cachepath = $phpbb_root_path . 'cache/tpl_' . $user->theme['template_path'] . '_';
+ $this->root = PHPBB_ROOT_PATH . 'styles/' . $user->theme['template_path'] . '/template';
+ $this->cachepath = PHPBB_ROOT_PATH . 'cache/tpl_' . $user->theme['template_path'] . '_';
}
else
{
@@ -69,10 +69,8 @@ class template
*/
public function set_custom_template($template_path, $template_name)
{
- global $phpbb_root_path;
-
$this->root = $template_path;
- $this->cachepath = $phpbb_root_path . 'cache/ctpl_' . $template_name . '_';
+ $this->cachepath = PHPBB_ROOT_PATH . 'cache/ctpl_' . $template_name . '_';
return true;
}
@@ -199,9 +197,9 @@ class template
*/
private function _tpl_load(&$handle)
{
- global $user, $phpEx, $config;
+ global $user, $config;
- $filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . $phpEx;
+ $filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . PHP_EXT;
$recompile = (($config['load_tplcompile'] && @filemtime($filename) < filemtime($this->files[$handle])) || !file_exists($filename) || @filesize($filename) === 0) ? true : false;
@@ -211,11 +209,11 @@ class template
return $filename;
}
- global $db, $phpbb_root_path;
+ global $db;
if (!class_exists('template_compile'))
{
- include($phpbb_root_path . 'includes/functions_template.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_template.' . PHP_EXT);
}
$compile = new template_compile($this);
@@ -247,7 +245,7 @@ class template
{
do
{
- if ($row['template_mtime'] < filemtime($phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/' . $row['template_filename']))
+ if ($row['template_mtime'] < filemtime(PHPBB_ROOT_PATH . 'styles/' . $user->theme['template_path'] . '/template/' . $row['template_filename']))
{
if ($row['template_filename'] == $this->filename[$handle])
{
@@ -271,7 +269,7 @@ class template
else
{
// Only bother compiling if it doesn't already exist
- if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . '.' . $phpEx))
+ if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . '.' . PHP_EXT))
{
$this->filename[$row['template_filename']] = $row['template_filename'];
$compile->compile_write($row['template_filename'], $compile->compile(trim($row['template_data'])));
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index 355c9898c2..9589b6928b 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -27,8 +27,7 @@ class ucp_activate
function main($id, $mode)
{
- global $config, $phpbb_root_path, $phpEx;
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $config;
$user_id = request_var('u', 0);
$key = request_var('k', '');
@@ -47,7 +46,7 @@ class ucp_activate
if ($user_row['user_type'] <> USER_INACTIVE && !$user_row['user_newpasswd'])
{
- meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
+ meta_refresh(3, append_sid('index'));
trigger_error('ALREADY_ACTIVATED');
}
@@ -75,7 +74,7 @@ class ucp_activate
if (!$update_password)
{
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
user_active_flip('activate', $user_row['user_id']);
@@ -87,7 +86,7 @@ class ucp_activate
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger(false);
@@ -120,7 +119,7 @@ class ucp_activate
}
}
- meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
+ meta_refresh(3, append_sid('index'));
trigger_error($user->lang[$message]);
}
}
diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php
index 5685702de2..f70c772d9b 100644
--- a/phpBB/includes/ucp/ucp_attachments.php
+++ b/phpBB/includes/ucp/ucp_attachments.php
@@ -27,7 +27,7 @@ class ucp_attachments
function main($id, $mode)
{
- global $template, $user, $db, $config, $phpEx, $phpbb_root_path;
+ global $template, $user, $db, $config;
$start = request_var('start', 0);
$sort_key = request_var('sk', 'a');
@@ -70,7 +70,7 @@ class ucp_attachments
{
if (!function_exists('delete_attachments'))
{
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
}
delete_attachments('attach', $delete_ids);
@@ -138,11 +138,11 @@ class ucp_attachments
{
if ($row['in_message'])
{
- $view_topic = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;p={$row['post_msg_id']}");
+ $view_topic = append_sid('ucp', "i=pm&amp;p={$row['post_msg_id']}");
}
else
{
- $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&amp;p={$row['post_msg_id']}") . "#p{$row['post_msg_id']}";
+ $view_topic = append_sid('viewtopic', "t={$row['topic_id']}&amp;p={$row['post_msg_id']}") . "#p{$row['post_msg_id']}";
}
$template->assign_block_vars('attachrow', array(
@@ -161,7 +161,7 @@ class ucp_attachments
'S_IN_MESSAGE' => $row['in_message'],
- 'U_VIEW_ATTACHMENT' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $row['attach_id']),
+ 'U_VIEW_ATTACHMENT' => append_sid('download/file', 'id=' . $row['attach_id']),
'U_VIEW_TOPIC' => $view_topic)
);
diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php
index e416ff4b88..55d27e3c2e 100644
--- a/phpBB/includes/ucp/ucp_confirm.php
+++ b/phpBB/includes/ucp/ucp_confirm.php
@@ -35,7 +35,7 @@ class ucp_confirm
function main($id, $mode)
{
- global $db, $user, $phpbb_root_path, $config, $phpEx;
+ global $db, $user, $config;
// Do we have an id? No, then just exit
$confirm_id = request_var('id', '');
@@ -64,11 +64,11 @@ class ucp_confirm
if ($config['captcha_gd'])
{
- include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/captcha/captcha_gd.' . PHP_EXT);
}
else
{
- include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/captcha/captcha_non_gd.' . PHP_EXT);
}
captcha::execute($row['code'], $row['seed']);
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index d884e0d571..d7cbd29dbe 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -26,8 +26,7 @@ class ucp_groups
function main($id, $mode)
{
- global $config, $phpbb_root_path, $phpEx;
- global $db, $user, $auth, $cache, $template;
+ global $db, $user, $auth, $cache, $template, $config;
$user->add_lang('groups');
@@ -203,7 +202,7 @@ class ucp_groups
$email_template = 'group_request';
}
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger();
$sql = 'SELECT u.username, u.username_clean, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang
@@ -224,8 +223,8 @@ class ucp_groups
'USERNAME' => htmlspecialchars_decode($row['username']),
'GROUP_NAME' => htmlspecialchars_decode($group_row[$group_id]['group_name']),
- 'U_PENDING' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=manage&action=list&g=$group_id",
- 'U_GROUP' => generate_board_url() . "/memberlist.$phpEx?mode=group&g=$group_id")
+ 'U_PENDING' => generate_board_url() . '/ucp.' . PHP_EXT . "?i=groups&mode=manage&action=list&g=$group_id",
+ 'U_GROUP' => generate_board_url() . '/memberlist.' . PHP_EXT . "?mode=group&g=$group_id")
);
$messenger->send($row['user_notify_type']);
@@ -333,7 +332,7 @@ class ucp_groups
'GROUP_STATUS' => $user->lang['GROUP_IS_' . $group_status],
'GROUP_COLOUR' => $row['group_colour'],
- 'U_VIEW_GROUP' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']),
+ 'U_VIEW_GROUP' => append_sid('memberlist', 'mode=group&amp;g=' . $row['group_id']),
'S_GROUP_DEFAULT' => ($row['group_id'] == $user->data['group_id']) ? true : false,
'S_ROW_COUNT' => ${$block . '_count'}++)
@@ -389,7 +388,7 @@ class ucp_groups
'S_CAN_JOIN' => ($row['group_type'] == GROUP_OPEN || $row['group_type'] == GROUP_FREE) ? true : false,
'GROUP_COLOUR' => $row['group_colour'],
- 'U_VIEW_GROUP' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']),
+ 'U_VIEW_GROUP' => append_sid('memberlist', 'mode=group&amp;g=' . $row['group_id']),
'S_ROW_COUNT' => $nonmember_count++)
);
@@ -440,7 +439,7 @@ class ucp_groups
{
case 'edit':
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
if (!$group_id)
{
@@ -470,7 +469,7 @@ class ucp_groups
$avatar_select = basename(request_var('avatar_select', ''));
$category = basename(request_var('category', ''));
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
+ $can_upload = (file_exists(PHPBB_ROOT_PATH . $config['avatar_path']) && @is_writable(PHPBB_ROOT_PATH . $config['avatar_path']) && $file_uploads) ? true : false;
// Did we submit?
if ($update)
@@ -523,11 +522,11 @@ class ucp_groups
else if ($avatar_select && $config['allow_avatar_local'])
{
// check avatar gallery
- if (is_dir($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category))
+ if (is_dir(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category))
{
$submit_ary['avatar_type'] = AVATAR_GALLERY;
- list($submit_ary['avatar_width'], $submit_ary['avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_select);
+ list($submit_ary['avatar_width'], $submit_ary['avatar_height']) = getimagesize(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_select);
$submit_ary['avatar'] = $category . '/' . $avatar_select;
}
}
@@ -654,7 +653,7 @@ class ucp_groups
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
- $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_root_path . 'adm/images/no_avatar.gif" alt="" />';
+ $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . PHPBB_ROOT_PATH . 'adm/images/no_avatar.gif" alt="" />';
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
@@ -707,7 +706,7 @@ class ucp_groups
'GROUP_CLOSED' => $type_closed,
'GROUP_HIDDEN' => $type_hidden,
- 'U_SWATCH' => append_sid("{$phpbb_root_path}adm/swatch.$phpEx", 'form=ucp&amp;name=group_colour'),
+ 'U_SWATCH' => append_sid(CONFIG_ADM_FOLDER . '/swatch', 'form=ucp&amp;name=group_colour'),
'S_UCP_ACTION' => $this->u_action . "&amp;action=$action&amp;g=$group_id",
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),
));
@@ -818,7 +817,7 @@ class ucp_groups
'PAGINATION' => generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start),
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=ucp&amp;field=usernames'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=ucp&amp;field=usernames'),
));
break;
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index 59d7431113..2549e07024 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -33,7 +33,7 @@ class ucp_main
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $config, $db, $user, $auth, $template;
switch ($mode)
{
@@ -156,10 +156,10 @@ class ucp_main
'S_UNREAD' => $unread_topic,
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
- 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&amp;t=$topic_id&amp;p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
+ 'U_LAST_POST' => append_sid('viewtopic', "f=$g_forum_id&amp;t=$topic_id&amp;p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
- 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&amp;t=$topic_id"))
+ 'U_NEWEST_POST' => append_sid('viewtopic', "f=$g_forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', "f=$g_forum_id&amp;t=$topic_id"))
);
}
@@ -167,7 +167,7 @@ class ucp_main
{
if (!function_exists('display_user_activity'))
{
- include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
}
display_user_activity($user->data);
}
@@ -191,14 +191,14 @@ class ucp_main
// 'S_GROUP_OPTIONS' => $group_options,
- 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user->data['user_id'] . '&amp;sr=posts') : '',
+ 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid('search', 'author_id=' . $user->data['user_id'] . '&amp;sr=posts') : '',
));
break;
case 'subscribed':
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
$user->add_lang('viewforum');
@@ -244,8 +244,8 @@ class ucp_main
{
$msg = $user->lang['FORM_INVALID'];
}
- $message = $msg . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=subscribed") . '">', '</a>');
- meta_refresh(3, append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=subscribed"));
+ $message = $msg . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . append_sid('ucp', "i=$id&amp;mode=subscribed") . '">', '</a>');
+ meta_refresh(3, append_sid('ucp', "i=$id&amp;mode=subscribed"));
trigger_error($message);
}
@@ -322,7 +322,7 @@ class ucp_main
if ($row['forum_last_post_id'])
{
$last_post_time = $user->format_date($row['forum_last_post_time']);
- $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;p=" . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
+ $last_post_url = append_sid('viewtopic', "f=$forum_id&amp;p=" . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
}
else
{
@@ -333,8 +333,8 @@ class ucp_main
'FORUM_ID' => $forum_id,
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
- 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
- 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
+ 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
+ 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
'FORUM_NAME' => $row['forum_name'],
'LAST_POST_SUBJECT' => $row['forum_last_post_subject'],
'LAST_POST_TIME' => $last_post_time,
@@ -345,7 +345,7 @@ class ucp_main
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'U_LAST_POST' => $last_post_url,
- 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']))
+ 'U_VIEWFORUM' => append_sid('viewforum', 'f=' . $row['forum_id']))
);
}
$db->sql_freeresult($result);
@@ -379,7 +379,7 @@ class ucp_main
break;
}
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
$user->add_lang('viewforum');
@@ -556,23 +556,23 @@ class ucp_main
if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id']))
{
$link_topic = true;
- $view_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&amp;t=' . $draft['topic_id']);
+ $view_url = append_sid('viewtopic', 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&amp;t=' . $draft['topic_id']);
$title = $topic_rows[$draft['topic_id']]['topic_title'];
- $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&amp;t=' . $draft['topic_id'] . '&amp;mode=reply&amp;d=' . $draft['draft_id']);
+ $insert_url = append_sid('posting', 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&amp;t=' . $draft['topic_id'] . '&amp;mode=reply&amp;d=' . $draft['draft_id']);
}
else if ($auth->acl_get('f_read', $draft['forum_id']))
{
$link_forum = true;
- $view_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $draft['forum_id']);
+ $view_url = append_sid('viewforum', 'f=' . $draft['forum_id']);
$title = $draft['forum_name'];
- $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $draft['forum_id'] . '&amp;mode=post&amp;d=' . $draft['draft_id']);
+ $insert_url = append_sid('posting', 'f=' . $draft['forum_id'] . '&amp;mode=post&amp;d=' . $draft['draft_id']);
}
else if ($pm_drafts)
{
$link_pm = true;
- $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=compose&amp;d=" . $draft['draft_id']);
+ $insert_url = append_sid('ucp', "i=$id&amp;mode=compose&amp;d=" . $draft['draft_id']);
}
$template_row = array(
@@ -629,7 +629,7 @@ class ucp_main
*/
function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array())
{
- global $user, $db, $template, $config, $auth, $phpbb_root_path, $phpEx;
+ global $user, $db, $template, $config, $auth;
$table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE;
$start = request_var('start', 0);
@@ -772,7 +772,7 @@ class ucp_main
$folder_img = $folder_alt = $topic_type = '';
topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
- $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id");
+ $view_topic_url = append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id");
// Send vars to template
$template->assign_block_vars('topicrow', array(
@@ -796,7 +796,7 @@ class ucp_main
'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false,
'S_GLOBAL_TOPIC' => (!$forum_id) ? true : false,
- 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id")),
+ 'PAGINATION' => topic_generate_pagination($replies, append_sid('viewtopic', 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id")),
'REPLIES' => $replies,
'VIEWS' => $row['topic_views'],
'TOPIC_TITLE' => censor_text($row['topic_title']),
@@ -814,10 +814,10 @@ class ucp_main
'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
- 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
+ 'U_NEWEST_POST' => append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
'U_LAST_POST' => $view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
'U_VIEW_TOPIC' => $view_topic_url,
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
+ 'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_id),
));
}
}
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index b4ac0c11da..e4371602cb 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -43,7 +43,7 @@ class ucp_pm
function main($id, $mode)
{
- global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config;
+ global $user, $template, $auth, $db, $config;
if (!$user->data['is_registered'])
{
@@ -80,7 +80,7 @@ class ucp_pm
$mode = 'view';
}
- include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_privmsgs.' . PHP_EXT);
switch ($mode)
{
@@ -103,9 +103,9 @@ class ucp_pm
$template->assign_vars(array(
'MESSAGE' => $l_new_message,
'S_NOT_LOGGED_IN' => ($user->data['user_id'] == ANONYMOUS) ? true : false,
- 'CLICK_TO_VIEW' => sprintf($user->lang['CLICK_VIEW_PRIVMSG'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox') . '" onclick="jump_to_inbox(this.href); return false;">', '</a>'),
- 'U_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
- 'UA_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox', false))
+ 'CLICK_TO_VIEW' => sprintf($user->lang['CLICK_VIEW_PRIVMSG'], '<a href="' . append_sid('ucp', 'i=pm&amp;folder=inbox') . '" onclick="jump_to_inbox(this.href); return false;">', '</a>'),
+ 'U_INBOX' => append_sid('ucp', 'i=pm&amp;folder=inbox'),
+ 'UA_INBOX' => append_sid('ucp', 'i=pm&folder=inbox', false))
);
$tpl_file = 'ucp_pm_popup';
@@ -122,7 +122,7 @@ class ucp_pm
trigger_error('NO_AUTH_SEND_MESSAGE');
}
- include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/ucp/ucp_pm_compose.' . PHP_EXT);
compose_pm($id, $mode, $action);
$tpl_file = 'posting_body';
@@ -132,7 +132,7 @@ class ucp_pm
set_user_message_limit();
get_folder($user->data['user_id']);
- include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/ucp/ucp_pm_options.' . PHP_EXT);
message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions);
$tpl_file = 'ucp_pm_options';
@@ -144,7 +144,7 @@ class ucp_pm
$this->p_name = 'pm';
// Call another module... please do not try this at home... Hoochie Coochie Man
- include($phpbb_root_path . 'includes/ucp/ucp_main.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/ucp/ucp_main.' . PHP_EXT);
$module = new ucp_main($this);
$module->u_action = $this->u_action;
@@ -365,7 +365,7 @@ class ucp_pm
if ($action == 'view_folder')
{
- include($phpbb_root_path . 'includes/ucp/ucp_pm_viewfolder.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/ucp/ucp_pm_viewfolder.' . PHP_EXT);
view_folder($id, $mode, $folder_id, $folder);
$tpl_file = 'ucp_pm_viewfolder';
@@ -382,7 +382,7 @@ class ucp_pm
trigger_error('NO_MESSAGE');
}
- include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/ucp/ucp_pm_viewmessage.' . PHP_EXT);
view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row);
$tpl_file = ($view == 'print') ? 'ucp_pm_viewmessage_print' : 'ucp_pm_viewmessage';
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index af592e3612..298fd6ef18 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -22,12 +22,11 @@ if (!defined('IN_PHPBB'))
*/
function compose_pm($id, $mode, $action)
{
- global $template, $db, $auth, $user;
- global $phpbb_root_path, $phpEx, $config;
+ global $template, $db, $auth, $user, $config;
- include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
- include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
if (!$action)
{
@@ -71,9 +70,9 @@ function compose_pm($id, $mode, $action)
{
if ($msg_id)
{
- redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=view&amp;action=view_message&amp;p=' . $msg_id));
+ redirect(append_sid('ucp', 'i=pm&amp;mode=view&amp;action=view_message&amp;p=' . $msg_id));
}
- redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'));
+ redirect(append_sid('ucp', 'i=pm'));
}
// Output PM_TO box if message composing
@@ -113,7 +112,7 @@ function compose_pm($id, $mode, $action)
'S_SHOW_PM_BOX' => true,
'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false,
'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? $group_options : '',
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&amp;form=postform&amp;field=username_list&amp;select_single=$select_single"),
+ 'U_FIND_USERNAME' => append_sid('memberlist', "mode=searchuser&amp;form=postform&amp;field=username_list&amp;select_single=$select_single"),
));
}
@@ -343,7 +342,7 @@ function compose_pm($id, $mode, $action)
$message_parser->message = ($action == 'reply') ? '' : $message_text;
unset($message_text);
- $s_action = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=$mode&amp;action=$action", true, $user->session_id);
+ $s_action = append_sid('ucp', "i=$id&amp;mode=$mode&amp;action=$action", true, $user->session_id);
$s_action .= ($msg_id) ? "&amp;p=$msg_id" : '';
// Delete triggered ?
@@ -358,7 +357,7 @@ function compose_pm($id, $mode, $action)
delete_pm($user->data['user_id'], $msg_id, $folder_id);
// jump to next message in "history"? nope, not for the moment. But able to be included later.
- $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;folder=$folder_id");
+ $meta_info = append_sid('ucp', "i=pm&amp;folder=$folder_id");
$message = $user->lang['MESSAGE_DELETED'];
meta_refresh(3, $meta_info);
@@ -373,11 +372,11 @@ function compose_pm($id, $mode, $action)
'action' => 'delete'
);
- // "{$phpbb_root_path}ucp.$phpEx?i=pm&amp;mode=compose"
+ // "ucp.php?i=pm&amp;mode=compose"
confirm_box(false, 'DELETE_MESSAGE', build_hidden_fields($s_hidden_fields));
}
- redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=view&amp;action=view_message&amp;p=' . $msg_id));
+ redirect(append_sid('ucp', 'i=pm&amp;mode=view&amp;action=view_message&amp;p=' . $msg_id));
}
// Handle User/Group adding/removing
@@ -470,7 +469,7 @@ function compose_pm($id, $mode, $action)
);
$db->sql_query($sql);
- $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=$mode");
+ $redirect_url = append_sid('ucp', "i=pm&amp;mode=$mode");
meta_refresh(3, $redirect_url);
$message = $user->lang['DRAFT_SAVED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $redirect_url . '">', '</a>');
@@ -641,8 +640,8 @@ function compose_pm($id, $mode, $action)
// ((!$message_subject) ? $subject : $message_subject)
$msg_id = submit_pm($action, $subject, $pm_data);
- $return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=view&amp;p=' . $msg_id);
- $return_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=outbox');
+ $return_message_url = append_sid('ucp', 'i=pm&amp;mode=view&amp;p=' . $msg_id);
+ $return_folder_url = append_sid('ucp', 'i=pm&amp;folder=outbox');
meta_refresh(3, $return_message_url);
$message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>') . '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $return_folder_url . '">', '</a>', $user->lang['PM_OUTBOX']);
@@ -724,11 +723,11 @@ function compose_pm($id, $mode, $action)
$post_id = request_var('p', 0);
if ($config['allow_post_links'])
{
- $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}: {$message_subject}[/url]\n\n";
+ $message_link = "[url=" . generate_board_url() . '/viewtopic.' . PHP_EXT . "?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}: {$message_subject}[/url]\n\n";
}
else
{
- $message_link = $user->lang['SUBJECT'] . ': ' . $message_subject . " (" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id})\n\n";
+ $message_link = $user->lang['SUBJECT'] . ': ' . $message_subject . " (" . generate_board_url() . '/viewtopic.' . PHP_EXT . "?p={$post_id}#p{$post_id})\n\n";
}
}
else
@@ -749,11 +748,11 @@ function compose_pm($id, $mode, $action)
if ($config['allow_post_links'])
{
- $quote_username_text = '[url=' . generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&amp;u={$post['author_id']}]{$quote_username}[/url]";
+ $quote_username_text = '[url=' . generate_board_url() . '/memberlist.' . PHP_EXT . "?mode=viewprofile&amp;u={$post['author_id']}]{$quote_username}[/url]";
}
else
{
- $quote_username_text = $quote_username . ' (' . generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&amp;u={$post['author_id']})";
+ $quote_username_text = $quote_username . ' (' . generate_board_url() . '/memberlist.' . PHP_EXT . "?mode=viewprofile&amp;u={$post['author_id']})";
}
$forward_text = array();
@@ -881,7 +880,7 @@ function compose_pm($id, $mode, $action)
else
{
$tpl_ary = array_merge($tpl_ary, array(
- 'U_VIEW' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $id),
+ 'U_VIEW' => append_sid('memberlist', 'mode=group&amp;g=' . $id),
));
}
@@ -944,7 +943,7 @@ function compose_pm($id, $mode, $action)
'SUBJECT' => (isset($message_subject)) ? $message_subject : '',
'MESSAGE' => $message_text,
- 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid('faq', 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid('faq', 'mode=bbcode') . '">', '</a>'),
'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
@@ -977,8 +976,8 @@ function compose_pm($id, $mode, $action)
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']),
- 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&amp;mode=popup'),
- 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&amp;mode=popup')),
+ 'U_PROGRESS_BAR' => append_sid('posting', 'f=0&amp;mode=popup'),
+ 'UA_PROGRESS_BAR' => addslashes(append_sid('posting', 'f=0&amp;mode=popup')),
));
// Build custom bbcodes array
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index 2d2ff23cab..46f5740c46 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -21,9 +21,9 @@ if (!defined('IN_PHPBB'))
*/
function message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions)
{
- global $phpbb_root_path, $phpEx, $user, $template, $auth, $config, $db;
+ global $user, $template, $auth, $config, $db;
- $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=options");
+ $redirect_url = append_sid('ucp', "i=pm&amp;mode=options");
add_form_key('ucp_pm_options');
// Change "full folder" setting - what to do if folder is full
@@ -262,7 +262,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$db->sql_query($sql);
- $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=$mode");
+ $meta_info = append_sid('ucp', "i=pm&amp;mode=$mode");
$message = $user->lang['FOLDER_REMOVED'];
meta_refresh(3, $meta_info);
@@ -352,7 +352,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
if (!$delete_id)
{
- redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=' . $mode));
+ redirect(append_sid('ucp', 'i=pm&amp;mode=' . $mode));
}
// Do we need to confirm?
@@ -363,7 +363,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
AND rule_id = $delete_id";
$db->sql_query($sql);
- $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=' . $mode);
+ $meta_info = append_sid('ucp', 'i=pm&amp;mode=' . $mode);
$message = $user->lang['RULE_DELETED'];
// Reset user_message_rules if no more assigned
@@ -477,7 +477,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
'DEFAULT_ACTION' => ($config['full_folder_action'] == 1) ? $user->lang['DELETE_OLDEST_MESSAGES'] : $user->lang['HOLD_NEW_MESSAGES'],
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=ucp&amp;field=rule_string&amp;select_single=true'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=ucp&amp;field=rule_string&amp;select_single=true'),
));
$rule_lang = $action_lang = $check_lang = array();
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php
index 0137531154..25e1497ca6 100644
--- a/phpBB/includes/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php
@@ -22,8 +22,7 @@ if (!defined('IN_PHPBB'))
*/
function view_folder($id, $mode, $folder_id, $folder)
{
- global $user, $template, $auth, $db, $cache;
- global $phpbb_root_path, $config, $phpEx;
+ global $user, $template, $auth, $db, $cache, $config;
$submit_export = (isset($_POST['submit_export'])) ? true : false;
@@ -180,7 +179,7 @@ function view_folder($id, $mode, $folder_id, $folder)
else
{
$user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : '';
- $link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $ug_id) . '"' . $user_colour . '>';
+ $link = '<a href="' . append_sid('memberlist', 'mode=group&amp;g=' . $ug_id) . '"' . $user_colour . '>';
$address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : '');
}
}
@@ -199,8 +198,8 @@ function view_folder($id, $mode, $folder_id, $folder)
$folder_alt = ($row['pm_unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES';
// Generate all URIs ...
- $view_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=view&amp;f=$folder_id&amp;p=$message_id");
- $remove_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=compose&amp;action=delete&amp;p=$message_id");
+ $view_message_url = append_sid('ucp', "i=$id&amp;mode=view&amp;f=$folder_id&amp;p=$message_id");
+ $remove_message_url = append_sid('ucp', "i=$id&amp;mode=compose&amp;action=delete&amp;p=$message_id");
$row_indicator = '';
foreach ($color_rows as $var)
@@ -228,7 +227,7 @@ function view_folder($id, $mode, $folder_id, $folder)
'SENT_TIME' => $user->format_date($row['message_time']),
'SUBJECT' => censor_text($row['message_subject']),
'FOLDER' => (isset($folder[$row['folder_id']])) ? $folder[$row['folder_id']]['folder_name'] : '',
- 'U_FOLDER' => (isset($folder[$row['folder_id']])) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'folder=' . $row['folder_id']) : '',
+ 'U_FOLDER' => (isset($folder[$row['folder_id']])) ? append_sid('ucp', 'folder=' . $row['folder_id']) : '',
'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '',
'PM_ICON_URL' => (!empty($icons[$row['icon_id']])) ? $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] : '',
'FOLDER_IMG' => $user->img($folder_img, $folder_alt),
@@ -280,7 +279,7 @@ function view_folder($id, $mode, $folder_id, $folder)
{
$row = &$folder_info['rowset'][$message_id];
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$sql = 'SELECT p.message_text, p.bbcode_uid
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u
@@ -439,7 +438,7 @@ function view_folder($id, $mode, $folder_id, $folder)
*/
function get_pm_from($folder_id, $folder, $user_id)
{
- global $user, $db, $template, $config, $auth, $phpbb_root_path, $phpEx;
+ global $user, $db, $template, $config, $auth;
$start = request_var('start', 0);
@@ -498,7 +497,7 @@ function get_pm_from($folder_id, $folder, $user_id)
}
$template->assign_vars(array(
- 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param"), $pm_count, $config['topics_per_page'], $start),
+ 'PAGINATION' => generate_pagination(append_sid('ucp', "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param"), $pm_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start),
'TOTAL_MESSAGES' => (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)),
@@ -511,8 +510,8 @@ function get_pm_from($folder_id, $folder, $user_id)
'S_SELECT_SORT_DAYS' => $s_limit_days,
'S_TOPIC_ICONS' => ($config['enable_pm_icons']) ? true : false,
- 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose') : '',
- 'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id"))
+ 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid('ucp', 'i=pm&amp;mode=compose') : '',
+ 'S_PM_ACTION' => append_sid('ucp', "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id"))
);
// Grab all pm data
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index 31208d9b01..62932d013a 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -21,8 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
{
- global $user, $template, $auth, $db, $cache;
- global $phpbb_root_path, $phpEx, $config;
+ global $user, $template, $auth, $db, $cache, $config;
$user->add_lang(array('viewtopic', 'memberlist'));
@@ -33,7 +32,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// Not able to view message, it was deleted by the sender
if ($message_row['pm_deleted'])
{
- $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;folder=$folder_id");
+ $meta_info = append_sid('ucp', "i=pm&amp;folder=$folder_id");
$message = $user->lang['NO_AUTH_READ_REMOVED_MESSAGE'];
$message .= '<br /><br />' . sprintf($user->lang['RETURN_FOLDER'], '<a href="' . $meta_info . '">', '</a>');
@@ -54,7 +53,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// Instantiate BBCode if need be
if ($message_row['bbcode_bitfield'])
{
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode($message_row['bbcode_bitfield']);
}
@@ -155,7 +154,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
{
if ($bbcode === false)
{
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode($user_info['user_sig_bbcode_bitfield']);
}
@@ -166,7 +165,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
$signature = smiley_text($signature);
}
- $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
+ $url = append_sid('ucp', 'i=pm');
$template->assign_vars(array(
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
@@ -199,13 +198,13 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'EDITED_MESSAGE' => $l_edited_by,
'MESSAGE_ID' => $message_row['msg_id'],
- 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_info['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $author_id) : '',
+ 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_info['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid('ucp', 'i=pm&amp;mode=compose&amp;u=' . $author_id) : '',
'U_WWW' => (!empty($user_info['user_website'])) ? $user_info['user_website'] : '',
'U_ICQ' => ($user_info['user_icq']) ? 'http://www.icq.com/people/webmsg.php?to=' . urlencode($user_info['user_icq']) : '',
- 'U_AIM' => ($user_info['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=aim&amp;u=' . $author_id) : '',
+ 'U_AIM' => ($user_info['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&amp;action=aim&amp;u=' . $author_id) : '',
'U_YIM' => ($user_info['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($user_info['user_yim']) . '&amp;.src=pg' : '',
- 'U_MSN' => ($user_info['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=msnm&amp;u=' . $author_id) : '',
- 'U_JABBER' => ($user_info['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=jabber&amp;u=' . $author_id) : '',
+ 'U_MSN' => ($user_info['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&amp;action=msnm&amp;u=' . $author_id) : '',
+ 'U_JABBER' => ($user_info['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&amp;action=jabber&amp;u=' . $author_id) : '',
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&amp;mode=compose&amp;action=delete&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
'U_EMAIL' => $user_info['email'],
@@ -250,8 +249,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
*/
function get_user_information($user_id, $user_row)
{
- global $db, $auth, $user, $cache;
- global $phpbb_root_path, $phpEx, $config;
+ global $db, $auth, $user, $cache, $config;
if (!$user_id)
{
@@ -292,7 +290,7 @@ function get_user_information($user_id, $user_row)
if (!function_exists('get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
}
$user_row['avatar'] = ($user->optionget('viewavatars')) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '';
@@ -301,7 +299,7 @@ function get_user_information($user_id, $user_row)
if (!empty($user_row['user_allow_viewemail']) || $auth->acl_get('a_email'))
{
- $user_row['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&amp;u=$user_id") : ((($config['board_hide_emails'] && !$auth->acl_get('a_email')) || empty($user_row['user_email'])) ? '' : 'mailto:' . $user_row['user_email']);
+ $user_row['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid('memberlist', "mode=email&amp;u=$user_id") : ((($config['board_hide_emails'] && !$auth->acl_get('a_email')) || empty($user_row['user_email'])) ? '' : 'mailto:' . $user_row['user_email']);
}
return $user_row;
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 3762cf25f6..6648661560 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -27,7 +27,7 @@ class ucp_prefs
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $config, $db, $user, $auth, $template;
$submit = (isset($_POST['submit'])) ? true : false;
$error = $data = array();
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 65fef2d267..fae48b84fa 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -29,7 +29,7 @@ class ucp_profile
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $config, $db, $user, $auth, $template;
$user->add_lang('posting');
@@ -137,7 +137,7 @@ class ucp_profile
{
$message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN';
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$server_url = generate_board_url();
@@ -160,7 +160,7 @@ class ucp_profile
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($data['username']),
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
+ 'U_ACTIVATE' => "$server_url/ucp." . PHP_EXT . "?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
);
$messenger->send(NOTIFY_EMAIL);
@@ -192,8 +192,8 @@ class ucp_profile
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($data['username']),
- 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}",
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
+ 'U_USER_DETAILS' => "$server_url/memberlist." . PHP_EXT . "?mode=viewprofile&u={$user->data['user_id']}",
+ 'U_ACTIVATE' => "$server_url/ucp." . PHP_EXT . "?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
);
$messenger->send($row['user_notify_type']);
@@ -225,8 +225,8 @@ class ucp_profile
// Now, we can remove the user completely (kill the session) - NOT BEFORE!!!
if (!empty($sql_ary['user_actkey']))
{
- meta_refresh(5, append_sid($phpbb_root_path . 'index.' . $phpEx));
- $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid($phpbb_root_path . 'index.' . $phpEx) . '">', '</a>');
+ meta_refresh(5, append_sid('index'));
+ $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid('index') . '">', '</a>');
// Because the user gets deactivated we log him out too, killing his session
$user->session_kill();
@@ -265,7 +265,7 @@ class ucp_profile
case 'profile_info':
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
$cp = new custom_profile();
@@ -461,8 +461,8 @@ class ucp_profile
trigger_error('NO_AUTH_SIGNATURE');
}
- include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
$enable_bbcode = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false;
$enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false;
@@ -474,7 +474,7 @@ class ucp_profile
if ($submit || $preview)
{
- include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
if (!sizeof($error))
{
@@ -534,7 +534,7 @@ class ucp_profile
'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '',
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' checked="checked"' : '',
- 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid('faq', 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid('faq', 'mode=bbcode') . '">', '</a>'),
'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
@@ -556,13 +556,13 @@ class ucp_profile
case 'avatar':
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
$display_gallery = request_var('display_gallery', '0');
$avatar_select = basename(request_var('avatar_select', ''));
$category = basename(request_var('category', ''));
- $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ $can_upload = ($config['allow_avatar_upload'] && file_exists(PHPBB_ROOT_PATH . $config['avatar_path']) && @is_writable(PHPBB_ROOT_PATH . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
add_form_key('ucp_avatar');
@@ -590,7 +590,7 @@ class ucp_profile
'AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
'AVATAR_SIZE' => $config['avatar_filesize'],
- 'U_GALLERY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=avatar&amp;display_gallery=1'),
+ 'U_GALLERY' => append_sid('ucp', 'i=profile&amp;mode=avatar&amp;display_gallery=1'),
'S_FORM_ENCTYPE' => ($can_upload) ? ' enctype="multipart/form-data"' : '',
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 4e94501d39..1b75494e4e 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -27,7 +27,7 @@ class ucp_register
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $config, $db, $user, $auth, $template;
//
if ($config['require_activation'] == USER_ACTIVATION_DISABLE)
@@ -35,7 +35,7 @@ class ucp_register
trigger_error('UCP_REGISTER_DISABLE');
}
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
$confirm_id = request_var('confirm_id', '');
$coppa = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
@@ -58,7 +58,7 @@ class ucp_register
{
$use_lang = ($change_lang) ? basename($change_lang) : basename($user_lang);
- if (file_exists($phpbb_root_path . 'language/' . $use_lang . '/'))
+ if (file_exists(PHPBB_ROOT_PATH . 'language/' . $use_lang . '/'))
{
if ($change_lang)
{
@@ -69,7 +69,7 @@ class ucp_register
}
$user->lang_name = $lang = $use_lang;
- $user->lang_path = $phpbb_root_path . 'language/' . $lang . '/';
+ $user->lang_path = PHPBB_ROOT_PATH . 'language/' . $lang . '/';
$user->lang = array();
$user->add_lang(array('common', 'ucp'));
}
@@ -117,12 +117,12 @@ class ucp_register
'L_COPPA_NO' => sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday),
'L_COPPA_YES' => sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday),
- 'U_COPPA_NO' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&amp;coppa=0' . $add_lang),
- 'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&amp;coppa=1' . $add_lang),
+ 'U_COPPA_NO' => append_sid('ucp', 'mode=register&amp;coppa=0' . $add_lang),
+ 'U_COPPA_YES' => append_sid('ucp', 'mode=register&amp;coppa=1' . $add_lang),
'S_SHOW_COPPA' => true,
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),
- 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang),
+ 'S_UCP_ACTION' => append_sid('ucp', 'mode=register' . $add_lang),
));
}
else
@@ -133,7 +133,7 @@ class ucp_register
'S_SHOW_COPPA' => false,
'S_REGISTRATION' => true,
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),
- 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang . $add_coppa),
+ 'S_UCP_ACTION' => append_sid('ucp', 'mode=register' . $add_lang . $add_coppa),
)
);
}
@@ -359,7 +359,7 @@ class ucp_register
if ($config['email_enable'])
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger(false);
@@ -376,7 +376,7 @@ class ucp_register
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
'USERNAME' => htmlspecialchars_decode($data['username']),
'PASSWORD' => htmlspecialchars_decode($data['new_password']),
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
+ 'U_ACTIVATE' => "$server_url/ucp." . PHP_EXT . "?mode=activate&u=$user_id&k=$user_actkey")
);
if ($coppa)
@@ -417,8 +417,8 @@ class ucp_register
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($data['username']),
- 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u=$user_id",
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
+ 'U_USER_DETAILS' => "$server_url/memberlist." . PHP_EXT . "?mode=viewprofile&u=$user_id",
+ 'U_ACTIVATE' => "$server_url/ucp." . PHP_EXT . "?mode=activate&u=$user_id&k=$user_actkey")
);
$messenger->send($row['user_notify_type']);
@@ -427,7 +427,7 @@ class ucp_register
}
}
- $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
+ $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid('index') . '">', '</a>');
trigger_error($message);
}
}
@@ -501,7 +501,7 @@ class ucp_register
);
$db->sql_query($sql);
}
- $confirm_image = '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_REG . $str) . '" alt="" title="" />';
+ $confirm_image = '<img src="' . append_sid('ucp', 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_REG . $str) . '" alt="" title="" />';
$s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';
}
@@ -537,7 +537,7 @@ class ucp_register
'S_CONFIRM_CODE' => ($config['enable_confirm']) ? true : false,
'S_COPPA' => $coppa,
'S_HIDDEN_FIELDS' => $s_hidden_fields,
- 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
+ 'S_UCP_ACTION' => append_sid('ucp', 'mode=register'),
)
);
diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php
index 12de817099..05dfe5d74d 100644
--- a/phpBB/includes/ucp/ucp_remind.php
+++ b/phpBB/includes/ucp/ucp_remind.php
@@ -27,8 +27,7 @@ class ucp_remind
function main($id, $mode)
{
- global $config, $phpbb_root_path, $phpEx;
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $config;
$username = request_var('username', '', true);
$email = strtolower(request_var('email', ''));
@@ -79,7 +78,7 @@ class ucp_remind
WHERE user_id = " . $user_row['user_id'];
$db->sql_query($sql);
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger(false);
@@ -91,22 +90,22 @@ class ucp_remind
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']),
'PASSWORD' => htmlspecialchars_decode($user_password),
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
+ 'U_ACTIVATE' => "$server_url/ucp." . PHP_EXT . "?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
);
$messenger->send($user_row['user_notify_type']);
- meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
+ meta_refresh(3, append_sid('index'));
- $message = $user->lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
+ $message = $user->lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid('index') . '">', '</a>');
trigger_error($message);
}
$template->assign_vars(array(
'USERNAME' => $username,
'EMAIL' => $email,
- 'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=sendpassword'))
- );
+ 'S_PROFILE_ACTION' => append_sid('ucp', 'mode=sendpassword'),
+ ));
$this->tpl_name = 'ucp_remind';
$this->page_title = 'UCP_REMIND';
diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php
index 48176a3989..92445868e4 100644
--- a/phpBB/includes/ucp/ucp_resend.php
+++ b/phpBB/includes/ucp/ucp_resend.php
@@ -27,8 +27,7 @@ class ucp_resend
function main($id, $mode)
{
- global $config, $phpbb_root_path, $phpEx;
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $config;
$username = request_var('username', '', true);
$email = strtolower(request_var('email', ''));
@@ -86,7 +85,7 @@ class ucp_resend
$coppa = ($row['group_name'] == 'REGISTERED_COPPA' && $row['group_type'] == GROUP_SPECIAL) ? true : false;
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger(false);
if ($config['require_activation'] == USER_ACTIVATION_SELF || $coppa)
@@ -102,7 +101,7 @@ class ucp_resend
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
'USERNAME' => htmlspecialchars_decode($user_row['username']),
- 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
+ 'U_ACTIVATE' => generate_board_url() . '/ucp.' . PHP_EXT . "?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);
if ($coppa)
@@ -135,27 +134,27 @@ class ucp_resend
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']),
- 'U_USER_DETAILS' => generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$user_row['user_id']}",
- 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
- );
+ 'U_USER_DETAILS' => generate_board_url() . '/memberlist.' . PHP_EXT . "?mode=viewprofile&u={$user_row['user_id']}",
+ 'U_ACTIVATE' => generate_board_url() . '/ucp.' . PHP_EXT . "?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}",
+ ));
$messenger->send($row['user_notify_type']);
}
$db->sql_freeresult($result);
}
- meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
+ meta_refresh(3, append_sid('index'));
$message = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? $user->lang['ACIVATION_EMAIL_SENT_ADMIN'] : $user->lang['ACTIVATION_EMAIL_SENT'];
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid('index') . '">', '</a>');
trigger_error($message);
}
$template->assign_vars(array(
'USERNAME' => $username,
'EMAIL' => $email,
- 'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=resend_act'))
- );
+ 'S_PROFILE_ACTION' => append_sid('ucp', 'mode=resend_act'),
+ ));
$this->tpl_name = 'ucp_resend';
$this->page_title = 'UCP_RESEND';
diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php
index fb5df9394b..f0a0b1b63d 100644
--- a/phpBB/includes/ucp/ucp_zebra.php
+++ b/phpBB/includes/ucp/ucp_zebra.php
@@ -26,7 +26,7 @@ class ucp_zebra
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $config, $db, $user, $auth, $template;
$submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
$s_hidden_fields = '';
@@ -238,12 +238,12 @@ class ucp_zebra
$template->assign_vars(array(
'L_TITLE' => $user->lang['UCP_ZEBRA_' . $l_mode],
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=ucp&amp;field=add'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=ucp&amp;field=add'),
'S_USERNAME_OPTIONS' => $s_username_options,
'S_HIDDEN_FIELDS' => $s_hidden_fields,
- 'S_UCP_ACTION' => $this->u_action)
- );
+ 'S_UCP_ACTION' => $this->u_action,
+ ));
$this->tpl_name = 'ucp_zebra_' . $mode;
$this->page_title = 'UCP_ZEBRA_' . $l_mode;
diff --git a/phpBB/includes/utf/utf_normalizer.php b/phpBB/includes/utf/utf_normalizer.php
index 9048a71e51..5f88adaa4c 100644
--- a/phpBB/includes/utf/utf_normalizer.php
+++ b/phpBB/includes/utf/utf_normalizer.php
@@ -93,14 +93,12 @@ class utf_normalizer
// Note: we do not check for $GLOBALS['utf_canonical_decomp']. It is assumed they are always loaded together
if (!isset($GLOBALS['utf_nfc_qc']))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_nfc_qc.' . PHP_EXT);
}
if (!isset($GLOBALS['utf_canonical_decomp']))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_canonical_decomp.' . PHP_EXT);
}
// Replace any byte in the range 0x00..0x1F, except for \r, \n and \t
@@ -133,14 +131,12 @@ class utf_normalizer
if (!isset($GLOBALS['utf_nfc_qc']))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_nfc_qc.' . PHP_EXT);
}
if (!isset($GLOBALS['utf_canonical_decomp']))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_canonical_decomp.' . PHP_EXT);
}
$str = self::recompose($str, $pos, $len, $GLOBALS['utf_nfc_qc'], $GLOBALS['utf_canonical_decomp']);
@@ -165,14 +161,12 @@ class utf_normalizer
if (!isset($GLOBALS['utf_nfkc_qc']))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfkc_qc.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_nfkc_qc.' . PHP_EXT);
}
if (!isset($GLOBALS['utf_compatibility_decomp']))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_compatibility_decomp.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_compatibility_decomp.' . PHP_EXT);
}
$str = self::recompose($str, $pos, $len, $GLOBALS['utf_nfkc_qc'], $GLOBALS['utf_compatibility_decomp']);
@@ -197,8 +191,7 @@ class utf_normalizer
if (!isset($GLOBALS['utf_canonical_decomp']))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_canonical_decomp.' . PHP_EXT);
}
$str = self::decompose($str, $pos, $len, $GLOBALS['utf_canonical_decomp']);
@@ -223,8 +216,7 @@ class utf_normalizer
if (!isset($GLOBALS['utf_compatibility_decomp']))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_compatibility_decomp.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_compatibility_decomp.' . PHP_EXT);
}
$str = self::decompose($str, $pos, $len, $GLOBALS['utf_compatibility_decomp']);
@@ -250,15 +242,13 @@ class utf_normalizer
// Load some commonly-used tables
if (!isset($utf_jamo_index, $utf_jamo_type, $utf_combining_class))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_normalizer_common.' . PHP_EXT);
}
// Load the canonical composition table
if (!isset($utf_canonical_comp))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_comp.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_canonical_comp.' . PHP_EXT);
}
// Buffer the last ASCII char before the UTF-8 stuff if applicable
@@ -951,8 +941,7 @@ class utf_normalizer
// Load some commonly-used tables
if (!isset($utf_combining_class))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/data/utf_normalizer_common.' . PHP_EXT);
}
// UTF char length array
diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php
index 5345cc746d..8dbb236a1c 100644
--- a/phpBB/includes/utf/utf_tools.php
+++ b/phpBB/includes/utf/utf_tools.php
@@ -634,24 +634,23 @@ function utf8_decode_ncr_callback($m)
function utf8_case_fold($text, $option = 'full')
{
static $uniarray = array();
- global $phpbb_root_path, $phpEx;
// common is always set
if (!isset($uniarray['c']))
{
- $uniarray['c'] = include($phpbb_root_path . 'includes/utf/data/case_fold_c.' . $phpEx);
+ $uniarray['c'] = include(PHPBB_ROOT_PATH . 'includes/utf/data/case_fold_c.' . PHP_EXT);
}
// only set full if we need to
if ($option === 'full' && !isset($uniarray['f']))
{
- $uniarray['f'] = include($phpbb_root_path . 'includes/utf/data/case_fold_f.' . $phpEx);
+ $uniarray['f'] = include(PHPBB_ROOT_PATH . 'includes/utf/data/case_fold_f.' . PHP_EXT);
}
// only set simple if we need to
if ($option !== 'full' && !isset($uniarray['s']))
{
- $uniarray['s'] = include($phpbb_root_path . 'includes/utf/data/case_fold_s.' . $phpEx);
+ $uniarray['s'] = include(PHPBB_ROOT_PATH . 'includes/utf/data/case_fold_s.' . PHP_EXT);
}
// common is always replaced
@@ -1248,15 +1247,13 @@ function utf8_case_fold_nfkc($text, $option = 'full')
"\xF0\x9D\x9E\xBB" => "\xCF\x83",
"\xF0\x9D\x9F\x8A" => "\xCF\x9D",
);
- global $phpbb_root_path, $phpEx;
// do the case fold
$text = utf8_case_fold($text, $option);
if (!class_exists('utf_normalizer'))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
}
// convert to NFKC
@@ -1345,7 +1342,6 @@ function utf8_case_fold_nfc($text, $option = 'full')
"\xE1\xBF\xB7" => "\xE1\xBF\xB6\xCD\x85",
"\xE1\xBF\xBC" => "\xCE\xA9\xCD\x85",
);
- global $phpbb_root_path, $phpEx;
// perform a small trick, avoid further normalization on composed points that contain U+0345 in their decomposition
$text = strtr($text, $ypogegrammeni);
@@ -1372,8 +1368,7 @@ function utf8_normalize_nfc($strings)
if (!class_exists('utf_normalizer'))
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
}
if (!is_array($strings))
@@ -1416,12 +1411,11 @@ function utf8_normalize_nfc($strings)
*/
function utf8_clean_string($text)
{
- global $phpbb_root_path, $phpEx;
-
static $homographs = array();
+
if (empty($homographs))
{
- $homographs = include($phpbb_root_path . 'includes/utf/data/confusables.' . $phpEx);
+ $homographs = include(PHPBB_ROOT_PATH . 'includes/utf/data/confusables.' . PHP_EXT);
}
$text = utf8_case_fold_nfkc($text);
diff --git a/phpBB/index.php b/phpBB/index.php
index e1727c2f0a..a9032f5e5d 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -15,10 +15,10 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -71,7 +71,7 @@ while ($row = $db->sql_fetchrow($result))
}
else
{
- $legend .= (($legend != '') ? ', ' : '') . '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
+ $legend .= (($legend != '') ? ', ' : '') . '<a' . $colour_text . ' href="' . append_sid('memberlist', 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
}
}
$db->sql_freeresult($result);
@@ -114,11 +114,11 @@ $template->assign_vars(array(
'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
'FORUM_NEW_LOCKED_IMG' => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),
- 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
+ 'S_LOGIN_ACTION' => append_sid('ucp', 'mode=login'),
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
- 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums') : '',
- 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=front', true, $user->session_id) : '')
+ 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid('index', 'mark=forums') : '',
+ 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid('mcp', 'i=main&amp;mode=front', true, $user->session_id) : '')
);
// Output page
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index 518de114b8..eb71667435 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -22,7 +22,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-include($phpbb_root_path . 'config.' . $phpEx);
+include(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
unset($dbpasswd);
/**
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index b9d3677e34..05cda4d6b9 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -314,7 +314,7 @@ function phpbb_insert_forums()
function phpbb_set_encoding($text, $grab_user_lang = true)
{
global $lang_enc_array, $convert_row;
- global $convert, $phpEx;
+ global $convert;
/*static $lang_enc_array = array(
'korean' => 'euc-kr',
@@ -395,7 +395,7 @@ function phpbb_set_encoding($text, $grab_user_lang = true)
if (!isset($lang_enc_array[$get_lang]))
{
- $filename = $convert->options['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx;
+ $filename = $convert->options['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . PHP_EXT;
if (!file_exists($filename))
{
@@ -404,7 +404,7 @@ function phpbb_set_encoding($text, $grab_user_lang = true)
if (!isset($lang_enc_array[$get_lang]))
{
- include($convert->options['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx);
+ include($convert->options['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . PHP_EXT);
$lang_enc_array[$get_lang] = $lang['ENCODING'];
unset($lang);
}
@@ -1223,7 +1223,7 @@ function phpbb_replace_size($matches)
*/
function phpbb_prepare_message($message)
{
- global $phpbb_root_path, $phpEx, $db, $convert, $user, $config, $cache, $convert_row, $message_parser;
+ global $db, $convert, $user, $config, $cache, $convert_row, $message_parser;
if (!$message)
{
@@ -1367,7 +1367,7 @@ function phpbb_get_files_dir()
*/
function phpbb_copy_thumbnails()
{
- global $db, $convert, $user, $config, $cache, $phpbb_root_path;
+ global $db, $convert, $user, $config, $cache;
$src_path = $convert->options['forum_path'] . '/' . phpbb_get_files_dir() . '/thumbs/';
@@ -1387,7 +1387,7 @@ function phpbb_copy_thumbnails()
else
{
copy_file($src_path . $entry, $config['upload_path'] . '/' . preg_replace('/^t_/', 'thumb_', $entry));
- @unlink($phpbb_root_path . $config['upload_path'] . '/thumbs/' . $entry);
+ @unlink(PHPBB_ROOT_PATH . $config['upload_path'] . '/thumbs/' . $entry);
}
}
closedir($handle);
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 277fc055df..627049f941 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -21,8 +21,8 @@ if (defined('IN_PHPBB') && defined('IN_INSTALL'))
define('IN_PHPBB', true);
define('IN_INSTALL', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
// Report all errors, except notices
//error_reporting(E_ALL ^ E_NOTICE);
@@ -31,7 +31,7 @@ error_reporting(E_ALL);
@set_time_limit(0);
// Include essential scripts
-include($phpbb_root_path . 'config.' . $phpEx);
+include(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
if (!isset($dbms))
{
@@ -50,23 +50,23 @@ if (!empty($load_extensions))
}
// Include files
-require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
-require($phpbb_root_path . 'includes/cache.' . $phpEx);
-require($phpbb_root_path . 'includes/template.' . $phpEx);
-require($phpbb_root_path . 'includes/session.' . $phpEx);
-require($phpbb_root_path . 'includes/auth.' . $phpEx);
+require(PHPBB_ROOT_PATH . 'includes/acm/acm_' . $acm_type . '.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/cache.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/template.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/session.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/auth.' . PHP_EXT);
-require($phpbb_root_path . 'includes/functions.' . $phpEx);
+require(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
-if (file_exists($phpbb_root_path . 'includes/functions_content.' . $phpEx))
+if (file_exists(PHPBB_ROOT_PATH . 'includes/functions_content.' . PHP_EXT))
{
- require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'includes/functions_content.' . PHP_EXT);
}
-require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-require($phpbb_root_path . 'includes/constants.' . $phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
-require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+require(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/utf/utf_tools.' . PHP_EXT);
// If we are on PHP >= 6.0.0 we do not need some code
if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
@@ -87,14 +87,14 @@ $cache = new acm();
$db = new $sql_db();
// Add own hook handler, if present. :o
-if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
+if (file_exists(PHPBB_ROOT_PATH . 'includes/hooks/index.' . PHP_EXT))
{
- require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'includes/hooks/index.' . PHP_EXT);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
foreach (cache::obtain_hooks() as $hook)
{
- @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
+ @include(PHPBB_ROOT_PATH . 'includes/hooks/' . $hook . '.' . PHP_EXT);
}
}
else
@@ -124,15 +124,15 @@ if (!$language)
$language = $row['config_value'];
}
-if (!file_exists($phpbb_root_path . 'language/' . $language))
+if (!file_exists(PHPBB_ROOT_PATH . 'language/' . $language))
{
die('No language found!');
}
// And finally, load the relevant language files
-include($phpbb_root_path . 'language/' . $language . '/common.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/acp/common.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/install.' . $phpEx);
+include(PHPBB_ROOT_PATH . 'language/' . $language . '/common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'language/' . $language . '/acp/common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'language/' . $language . '/install.' . PHP_EXT);
// Set PHP error handler to ours
//set_error_handler('msg_handler');
@@ -589,7 +589,6 @@ flush();
$no_updates = true;
$versions = array(
- '3.0.RC2', '3.0.RC3', '3.0.RC4', '3.0.RC5', '3.0.0'
);
// some code magic
@@ -681,7 +680,7 @@ else
<p><?php echo ((isset($lang['INLINE_UPDATE_SUCCESSFUL'])) ? $lang['INLINE_UPDATE_SUCCESSFUL'] : 'The database update was successful. Now you need to continue the update process.'); ?></p>
- <p><a href="<?php echo append_sid("{$phpbb_root_path}install/index.{$phpEx}", "mode=update&amp;sub=file_check&amp;lang=$language"); ?>" class="button1"><?php echo (isset($lang['CONTINUE_UPDATE_NOW'])) ? $lang['CONTINUE_UPDATE_NOW'] : 'Continue the update process now'; ?></a></p>
+ <p><a href="<?php echo append_sid('install/index', "mode=update&amp;sub=file_check&amp;lang=$language"); ?>" class="button1"><?php echo (isset($lang['CONTINUE_UPDATE_NOW'])) ? $lang['CONTINUE_UPDATE_NOW'] : 'Continue the update process now'; ?></a></p>
<?php
}
@@ -723,404 +722,12 @@ if (function_exists('exit_handler'))
*/
function change_database_data($version)
{
- global $db, $map_dbms, $errored, $error_ary, $config, $phpbb_root_path;
+ global $db, $map_dbms, $errored, $error_ary, $config;
switch ($version)
{
- case '3.0.RC2':
-
- $smileys = array();
-
- $sql = 'SELECT smiley_id, code
- FROM ' . SMILIES_TABLE;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $smileys[$row['smiley_id']] = $row['code'];
- }
- $db->sql_freeresult($result);
-
- foreach ($smileys as $id => $code)
- {
- // 2.0 only entitized lt and gt; We need to do something about double quotes.
- if (strchr($code, '"') === false)
- {
- continue;
- }
-
- $new_code = str_replace('&amp;', '&', $code);
- $new_code = str_replace('&lt;', '<', $new_code);
- $new_code = str_replace('&gt;', '>', $new_code);
- $new_code = utf8_htmlspecialchars($new_code);
-
- $sql = 'UPDATE ' . SMILIES_TABLE . '
- SET code = \'' . $db->sql_escape($new_code) . '\'
- WHERE smiley_id = ' . (int) $id;
- $db->sql_query($sql);
- }
-
- $index_list = sql_list_index($map_dbms, ACL_ROLES_DATA_TABLE);
-
- if (in_array('ath_opt_id', $index_list))
- {
- sql_index_drop($map_dbms, 'ath_opt_id', ACL_ROLES_DATA_TABLE);
- sql_create_index($map_dbms, 'ath_op_id', ACL_ROLES_DATA_TABLE, array('auth_option_id'));
- }
-
- break;
-
- case '3.0.RC3':
-
- if ($map_dbms === 'postgres')
- {
- $sql = "SELECT SETVAL('" . FORUMS_TABLE . "_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from " . FORUMS_TABLE . '));';
- _sql($sql, $errored, $error_ary);
- }
-
- // we check for:
- // ath_opt_id
- // ath_op_id
- // ACL_ROLES_DATA_TABLE_ath_opt_id
- // we want ACL_ROLES_DATA_TABLE_ath_op_id
-
- $table_index_fix = array(
- ACL_ROLES_DATA_TABLE => array(
- 'ath_opt_id' => 'ath_op_id',
- 'ath_op_id' => 'ath_op_id',
- ACL_ROLES_DATA_TABLE . '_ath_opt_id' => 'ath_op_id'
- ),
- STYLES_IMAGESET_DATA_TABLE => array(
- 'i_id' => 'i_d',
- 'i_d' => 'i_d',
- STYLES_IMAGESET_DATA_TABLE . '_i_id' => 'i_d'
- )
- );
-
- // we need to create some indicies...
- $needed_creation = array();
-
- foreach ($table_index_fix as $table_name => $index_info)
- {
- $index_list = sql_list_fake($map_dbms, $table_name);
- foreach ($index_info as $bad_index => $good_index)
- {
- if (in_array($bad_index, $index_list))
- {
- // mysql is actually OK, it won't get a hand in this crud
- switch ($map_dbms)
- {
- // last version, mssql had issues with index removal
- case 'mssql':
- $sql = 'DROP INDEX ' . $table_name . '.' . $bad_index;
- _sql($sql, $errored, $error_ary);
- break;
-
- // last version, firebird, oracle, postgresql and sqlite all got bad index names
- // we got kinda lucky, tho: they all support the same syntax
- case 'firebird':
- case 'oracle':
- case 'postgres':
- case 'sqlite':
- $sql = 'DROP INDEX ' . $bad_index;
- _sql($sql, $errored, $error_ary);
- break;
- }
-
- // If the good index already exist we do not need to create it again...
- if (($map_dbms == 'mysql_40' || $map_dbms == 'mysql_41') && $bad_index == $good_index)
- {
- }
- else
- {
- $needed_creation[$table_name][$good_index] = 1;
- }
- }
- }
- }
-
- $new_index_defs = array('ath_op_id' => array('auth_option_id'), 'i_d' => array('imageset_id'));
-
- foreach ($needed_creation as $bad_table => $index_repair_list)
- {
- foreach ($index_repair_list as $new_index => $garbage)
- {
- sql_create_index($map_dbms, $new_index, $bad_table, $new_index_defs[$new_index]);
- }
- }
-
- // Make sure empty smiley codes do not exist
- $sql = 'DELETE FROM ' . SMILIES_TABLE . "
- WHERE code = ''";
- _sql($sql, $errored, $error_ary);
-
- set_config('allow_birthdays', '1');
- set_config('cron_lock', '0', true);
-
- break;
-
- case '3.0.RC4':
-
- $update_auto_increment = array(
- STYLES_TABLE => 'style_id',
- STYLES_TEMPLATE_TABLE => 'template_id',
- STYLES_THEME_TABLE => 'theme_id',
- STYLES_IMAGESET_TABLE => 'imageset_id'
- );
-
- $sql = 'SELECT *
- FROM ' . STYLES_TABLE . '
- WHERE style_id = 0';
- $result = _sql($sql, $errored, $error_ary);
- $bad_style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($bad_style_row)
- {
- $sql = 'SELECT MAX(style_id) as max_id
- FROM ' . STYLES_TABLE;
- $result = _sql($sql, $errored, $error_ary);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $proper_id = $row['max_id'] + 1;
-
- _sql('UPDATE ' . STYLES_TABLE . " SET style_id = $proper_id WHERE style_id = 0", $errored, $error_ary);
- _sql('UPDATE ' . FORUMS_TABLE . " SET forum_style = $proper_id WHERE forum_style = 0", $errored, $error_ary);
- _sql('UPDATE ' . USERS_TABLE . " SET user_style = $proper_id WHERE user_style = 0", $errored, $error_ary);
-
- $sql = 'SELECT config_value
- FROM ' . CONFIG_TABLE . "
- WHERE config_name = 'default_style'";
- $result = _sql($sql, $errored, $error_ary);
- $style_config = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($style_config['config_value'] === '0')
- {
- set_config('default_style', (string) $proper_id);
- }
- }
-
- $sql = 'SELECT *
- FROM ' . STYLES_TEMPLATE_TABLE . '
- WHERE template_id = 0';
- $result = _sql($sql, $errored, $error_ary);
- $bad_style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($bad_style_row)
- {
- $sql = 'SELECT MAX(template_id) as max_id
- FROM ' . STYLES_TEMPLATE_TABLE;
- $result = _sql($sql, $errored, $error_ary);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $proper_id = $row['max_id'] + 1;
-
- _sql('UPDATE ' . STYLES_TABLE . " SET template_id = $proper_id WHERE template_id = 0", $errored, $error_ary);
- }
-
- $sql = 'SELECT *
- FROM ' . STYLES_THEME_TABLE . '
- WHERE theme_id = 0';
- $result = _sql($sql, $errored, $error_ary);
- $bad_style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($bad_style_row)
- {
- $sql = 'SELECT MAX(theme_id) as max_id
- FROM ' . STYLES_THEME_TABLE;
- $result = _sql($sql, $errored, $error_ary);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $proper_id = $row['max_id'] + 1;
-
- _sql('UPDATE ' . STYLES_TABLE . " SET theme_id = $proper_id WHERE theme_id = 0", $errored, $error_ary);
- }
-
- $sql = 'SELECT *
- FROM ' . STYLES_IMAGESET_TABLE . '
- WHERE imageset_id = 0';
- $result = _sql($sql, $errored, $error_ary);
- $bad_style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($bad_style_row)
- {
- $sql = 'SELECT MAX(imageset_id) as max_id
- FROM ' . STYLES_IMAGESET_TABLE;
- $result = _sql($sql, $errored, $error_ary);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $proper_id = $row['max_id'] + 1;
-
- _sql('UPDATE ' . STYLES_TABLE . " SET imageset_id = $proper_id WHERE imageset_id = 0", $errored, $error_ary);
- _sql('UPDATE ' . STYLES_IMAGESET_DATA_TABLE . " SET imageset_id = $proper_id WHERE imageset_id = 0", $errored, $error_ary);
- }
-
- if ($map_dbms == 'mysql_40' || $map_dbms == 'mysql_41')
- {
- foreach ($update_auto_increment as $auto_table_name => $auto_column_name)
- {
- $sql = "SELECT MAX({$auto_column_name}) as max_id
- FROM {$auto_table_name}";
- $result = _sql($sql, $errored, $error_ary);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $max_id = ((int) $row['max_id']) + 1;
- _sql("ALTER TABLE {$auto_table_name} AUTO_INCREMENT = {$max_id}", $errored, $error_ary);
- }
- }
- else if ($map_dbms == 'postgres')
- {
- foreach ($update_auto_increment as $auto_table_name => $auto_column_name)
- {
- $sql = "SELECT SETVAL('" . $auto_table_name . "_seq',(select case when max({$auto_column_name})>0 then max({$auto_column_name})+1 else 1 end from " . $auto_table_name . '));';
- _sql($sql, $errored, $error_ary);
- }
-
- $sql = 'DROP SEQUENCE ' . STYLES_TEMPLATE_DATA_TABLE . '_seq';
- _sql($sql, $errored, $error_ary);
- }
- else if ($map_dbms == 'firebird')
- {
- $sql = 'DROP TRIGGER t_' . STYLES_TEMPLATE_DATA_TABLE;
- _sql($sql, $errored, $error_ary);
-
- $sql = 'DROP GENERATOR ' . STYLES_TEMPLATE_DATA_TABLE . '_gen';
- _sql($sql, $errored, $error_ary);
- }
- else if ($map_dbms == 'oracle')
- {
- $sql = 'DROP TRIGGER t_' . STYLES_TEMPLATE_DATA_TABLE;
- _sql($sql, $errored, $error_ary);
-
- $sql = 'DROP SEQUENCE ' . STYLES_TEMPLATE_DATA_TABLE . '_seq';
- _sql($sql, $errored, $error_ary);
- }
- else if ($map_dbms == 'mssql')
- {
- // we use transactions because we need to have a working DB at the end of all of this
- $db->sql_transaction('begin');
-
- $sql = 'SELECT *
- FROM ' . STYLES_TEMPLATE_DATA_TABLE;
- $result = _sql($sql, $errored, $error_ary);
- $old_style_rows = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $old_style_rows[] = $row;
- }
- $db->sql_freeresult($result);
-
- // death to the table, it is evil!
- $sql = 'DROP TABLE ' . STYLES_TEMPLATE_DATA_TABLE;
- _sql($sql, $errored, $error_ary);
-
- // the table of awesomeness, praise be to it (or something)
- $sql = 'CREATE TABLE [' . STYLES_TEMPLATE_DATA_TABLE . "] (
- [template_id] [int] DEFAULT (0) NOT NULL ,
- [template_filename] [varchar] (100) DEFAULT ('') NOT NULL ,
- [template_included] [varchar] (8000) DEFAULT ('') NOT NULL ,
- [template_mtime] [int] DEFAULT (0) NOT NULL ,
- [template_data] [text] DEFAULT ('') NOT NULL
- ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]";
- _sql($sql, $errored, $error_ary);
-
- // index? index
- $sql = 'CREATE INDEX [tid] ON [' . STYLES_TEMPLATE_DATA_TABLE . ']([template_id]) ON [PRIMARY]';
- _sql($sql, $errored, $error_ary);
-
- // yet another index
- $sql = 'CREATE INDEX [tfn] ON [' . STYLES_TEMPLATE_DATA_TABLE . ']([template_filename]) ON [PRIMARY]';
- _sql($sql, $errored, $error_ary);
-
- foreach ($old_style_rows as $return_row)
- {
- _sql('INSERT INTO ' . STYLES_TEMPLATE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $return_row), $errored, $error_ary);
- }
-
- $db->sql_transaction('commit');
- }
-
- // Setting this here again because new installations may not have it...
- set_config('cron_lock', '0', true);
- set_config('ldap_port', '');
- set_config('ldap_user_filter', '');
-
- break;
-
- case '3.0.RC5':
-
- // In case the user is having the bot mediapartner google "as is", adjust it.
- $sql = 'UPDATE ' . BOTS_TABLE . "
- SET bot_agent = '" . $db->sql_escape('Mediapartners-Google') . "'
- WHERE bot_agent = '" . $db->sql_escape('Mediapartners-Google/') . "'";
- _sql($sql, $errored, $error_ary);
-
- set_config('form_token_lifetime', '7200');
- set_config('form_token_mintime', '0');
- set_config('min_time_reg', '5');
- set_config('min_time_terms', '2');
- set_config('form_token_sid_guests', '1');
-
- $db->sql_transaction('begin');
-
- $sql = 'SELECT forum_id, forum_password
- FROM ' . FORUMS_TABLE;
- $result = _sql($sql, $errored, $error_ary);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!empty($row['forum_password']))
- {
- _sql('UPDATE ' . FORUMS_TABLE . " SET forum_password = '" . md5($row['forum_password']) . "' WHERE forum_id = {$row['forum_id']}", $errored, $error_ary);
- }
- }
- $db->sql_freeresult($result);
-
- $db->sql_transaction('commit');
-
- break;
-
- case '3.0.0':
-
- $sql = 'UPDATE ' . TOPICS_TABLE . "
- SET topic_last_view_time = topic_last_post_time
- WHERE topic_last_view_time = 0";
- _sql($sql, $errored, $error_ary);
-
- // Update smiley sizes
- $smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
-
- foreach ($smileys as $smiley)
- {
- if (file_exists($phpbb_root_path . 'images/smilies/' . $smiley))
- {
- list($width, $height) = getimagesize($phpbb_root_path . 'images/smilies/' . $smiley);
-
- $sql = 'UPDATE ' . SMILIES_TABLE . '
- SET smiley_width = ' . $width . ', smiley_height = ' . $height . "
- WHERE smiley_url = '" . $db->sql_escape($smiley) . "'";
-
- _sql($sql, $errored, $error_ary);
- }
- }
-
+ default:
break;
-
- case '3.0.1':
-
- set_config('referer_validation', '1');
- set_config('check_attachment_content', '1');
- set_config('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title');
-
}
}
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 02d379a50f..7aceaa0aa0 100755
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -15,8 +15,8 @@ define('IN_PHPBB', true);
define('IN_INSTALL', true);
/**#@-*/
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
// Report all errors, except notices
error_reporting(E_ALL ^ E_NOTICE);
@@ -148,21 +148,21 @@ else
@ini_set('memory_limit', $mem_limit);
// Include essential scripts
-require($phpbb_root_path . 'includes/functions.' . $phpEx);
+require(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
-if (file_exists($phpbb_root_path . 'includes/functions_content.' . $phpEx))
+if (file_exists(PHPBB_ROOT_PATH . 'includes/functions_content.' . PHP_EXT))
{
- require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'includes/functions_content.' . PHP_EXT);
}
-include($phpbb_root_path . 'includes/auth.' . $phpEx);
-include($phpbb_root_path . 'includes/session.' . $phpEx);
-include($phpbb_root_path . 'includes/template.' . $phpEx);
-include($phpbb_root_path . 'includes/acm/acm_file.' . $phpEx);
-include($phpbb_root_path . 'includes/cache.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
+include(PHPBB_ROOT_PATH . 'includes/auth.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/session.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/template.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/acm/acm_file.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/cache.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/utf/utf_tools.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/functions_install.' . PHP_EXT);
// Try and load an appropriate language if required
$language = basename(request_var('language', ''));
@@ -175,7 +175,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
// Set correct format ... guess full xx_yy form
$accept_lang = substr($accept_lang, 0, 2) . '_' . substr($accept_lang, 3, 2);
- if (file_exists($phpbb_root_path . 'language/' . $accept_lang))
+ if (file_exists(PHPBB_ROOT_PATH . 'language/' . $accept_lang))
{
$language = $accept_lang;
break;
@@ -184,7 +184,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
{
// No match on xx_yy so try xx
$accept_lang = substr($accept_lang, 0, 2);
- if (file_exists($phpbb_root_path . 'language/' . $accept_lang))
+ if (file_exists(PHPBB_ROOT_PATH . 'language/' . $accept_lang))
{
$language = $accept_lang;
break;
@@ -197,7 +197,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
// dir, this may or may not be English
if (!$language)
{
- $dir = @opendir($phpbb_root_path . 'language');
+ $dir = @opendir(PHPBB_ROOT_PATH . 'language');
if (!$dir)
{
@@ -207,7 +207,7 @@ if (!$language)
while (($file = readdir($dir)) !== false)
{
- $path = $phpbb_root_path . 'language/' . $file;
+ $path = PHPBB_ROOT_PATH . 'language/' . $file;
if (!is_file($path) && !is_link($path) && file_exists($path . '/iso.txt'))
{
@@ -218,17 +218,17 @@ if (!$language)
closedir($dir);
}
-if (!file_exists($phpbb_root_path . 'language/' . $language))
+if (!file_exists(PHPBB_ROOT_PATH . 'language/' . $language))
{
die('No language found!');
}
// And finally, load the relevant language files
-include($phpbb_root_path . 'language/' . $language . '/common.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/acp/common.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/acp/board.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/install.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/posting.' . $phpEx);
+include(PHPBB_ROOT_PATH . 'language/' . $language . '/common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'language/' . $language . '/acp/common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'language/' . $language . '/acp/board.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'language/' . $language . '/install.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'language/' . $language . '/posting.' . PHP_EXT);
$mode = request_var('mode', 'overview');
$sub = request_var('sub', '');
@@ -242,14 +242,14 @@ $cache = new acm();
$template = new template();
// Add own hook handler, if present. :o
-if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
+if (file_exists(PHPBB_ROOT_PATH . 'includes/hooks/index.' . PHP_EXT))
{
- require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'includes/hooks/index.' . PHP_EXT);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
foreach (cache::obtain_hooks() as $hook)
{
- @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
+ @include(PHPBB_ROOT_PATH . 'includes/hooks/' . $hook . '.' . PHP_EXT);
}
}
else
@@ -270,7 +270,7 @@ $user->theme['template_storedb'] = false;
$install = new module();
-$install->create('install', "index.$phpEx", $mode, $sub);
+$install->create('install', 'index.' . PHP_EXT, $mode, $sub);
$install->load();
// Generate the page
@@ -302,7 +302,7 @@ class module
*/
function create($module_type, $module_url, $selected_mod = false, $selected_submod = false)
{
- global $db, $config, $phpEx, $phpbb_root_path;
+ global $db, $config;
$module = array();
@@ -317,7 +317,7 @@ class module
$setmodules = 1;
while (($file = readdir($dir)) !== false)
{
- if (preg_match('#^install_(.*?)\.' . $phpEx . '$#', $file))
+ if (preg_match('#^install_(.*?)\.' . PHP_EXT . '$#', $file))
{
include($file);
}
@@ -381,8 +381,6 @@ class module
*/
function load($mode = false, $run = true)
{
- global $phpbb_root_path, $phpEx;
-
if ($run)
{
if (!empty($mode))
@@ -415,7 +413,7 @@ class module
}
define('HEADER_INC', true);
- global $template, $lang, $stage, $phpbb_root_path;
+ global $template, $lang, $stage;
$template->assign_vars(array(
'L_CHANGE' => $lang['CHANGE'],
@@ -423,7 +421,7 @@ class module
'L_SELECT_LANG' => $lang['SELECT_LANG'],
'L_SKIP' => $lang['SKIP'],
'PAGE_TITLE' => $this->get_page_title(),
- 'T_IMAGE_PATH' => $phpbb_root_path . 'adm/images/',
+ 'T_IMAGE_PATH' => PHPBB_ROOT_PATH . 'adm/images/',
'S_CONTENT_DIRECTION' => $lang['DIRECTION'],
'S_CONTENT_FLOW_BEGIN' => ($lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
@@ -529,7 +527,7 @@ class module
*/
function generate_navigation()
{
- global $lang, $template, $phpEx, $language;
+ global $lang, $template, $language;
if (is_array($this->module_ary))
{
@@ -762,9 +760,7 @@ class module
*/
function inst_language_select($default = '')
{
- global $phpbb_root_path, $phpEx;
-
- $dir = @opendir($phpbb_root_path . 'language');
+ $dir = @opendir(PHPBB_ROOT_PATH . 'language');
if (!$dir)
{
@@ -773,7 +769,7 @@ class module
while ($file = readdir($dir))
{
- $path = $phpbb_root_path . 'language/' . $file;
+ $path = PHPBB_ROOT_PATH . 'language/' . $file;
if ($file == '.' || $file == '..' || is_link($path) || is_file($path) || $file == 'CVS')
{
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 105266f5ed..f222dd7fa6 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -22,7 +22,7 @@ if (!empty($setmodules))
$module[] = array(
'module_type' => 'install',
'module_title' => 'CONVERT',
- 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
+ 'module_filename' => substr(basename(__FILE__), 0, -strlen(PHP_EXT)-1),
'module_order' => 20,
'module_subs' => '',
'module_stages' => array('INTRO', 'SETTINGS', 'IN_PROGRESS', 'FINAL'),
@@ -90,7 +90,7 @@ class install_convert extends module
function main($mode, $sub)
{
- global $lang, $template, $phpbb_root_path, $phpEx, $cache, $config, $language, $table_prefix;
+ global $lang, $template, $cache, $config, $language, $table_prefix;
global $convert;
$this->tpl_name = 'install_convert';
@@ -104,9 +104,9 @@ class install_convert extends module
// Try opening config file
// @todo If phpBB is not installed, we need to do a cut-down installation here
// For now, we redirect to the installation script instead
- if (@file_exists($phpbb_root_path . 'config.' . $phpEx))
+ if (@file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT))
{
- include($phpbb_root_path . 'config.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
}
if (!defined('PHPBB_INSTALLED'))
@@ -114,16 +114,16 @@ class install_convert extends module
$template->assign_vars(array(
'S_NOT_INSTALLED' => true,
'TITLE' => $lang['BOARD_NOT_INSTALLED'],
- 'BODY' => sprintf($lang['BOARD_NOT_INSTALLED_EXPLAIN'], append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=install&amp;language=' . $language)),
+ 'BODY' => sprintf($lang['BOARD_NOT_INSTALLED_EXPLAIN'], append_sid('install/index', 'mode=install&amp;language=' . $language)),
));
return;
}
- require($phpbb_root_path . 'config.' . $phpEx);
- require($phpbb_root_path . 'includes/constants.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/functions_convert.' . PHP_EXT);
$db = new $sql_db();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
@@ -215,10 +215,10 @@ class install_convert extends module
// This is for making sure the session get not screwed due to the 3.0.x users table being completely new.
$cache->purge();
- require($phpbb_root_path . 'config.' . $phpEx);
- require($phpbb_root_path . 'includes/constants.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/functions_convert.' . PHP_EXT);
$db = new $sql_db();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
@@ -258,7 +258,7 @@ class install_convert extends module
*/
function list_convertors($sub)
{
- global $lang, $language, $template, $phpbb_root_path, $phpEx;
+ global $lang, $language, $template;
$this->page_title = $lang['SUB_INTRO'];
@@ -289,7 +289,7 @@ class install_convert extends module
while ($entry = readdir($handle))
{
- if (preg_match('/^convert_([a-z0-9_]+).' . $phpEx . '$/i', $entry, $m))
+ if (preg_match('/^convert_([a-z0-9_]+).' . PHP_EXT . '$/i', $entry, $m))
{
include('./convertors/' . $entry);
if (isset($convertor_data))
@@ -333,12 +333,12 @@ class install_convert extends module
*/
function get_convert_settings($sub)
{
- global $lang, $language, $template, $db, $phpbb_root_path, $phpEx, $config, $cache;
+ global $lang, $language, $template, $db, $config, $cache;
- require($phpbb_root_path . 'config.' . $phpEx);
- require($phpbb_root_path . 'includes/constants.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/functions_convert.' . PHP_EXT);
$db = new $sql_db();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
@@ -368,12 +368,12 @@ class install_convert extends module
// check security implications of direct inclusion
$convertor_tag = basename($convertor_tag);
- if (!file_exists('./convertors/convert_' . $convertor_tag . '.' . $phpEx))
+ if (!file_exists('./convertors/convert_' . $convertor_tag . '.' . PHP_EXT))
{
$this->p_master->error($lang['CONVERT_NOT_EXIST'], __LINE__, __FILE__);
}
- include('./convertors/convert_' . $convertor_tag . '.' . $phpEx);
+ include('./convertors/convert_' . $convertor_tag . '.' . PHP_EXT);
// The test_file is a file that should be present in the location of the old board.
if (!isset($test_file))
@@ -581,13 +581,13 @@ class install_convert extends module
*/
function convert_data($sub)
{
- global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache;
+ global $template, $user, $db, $lang, $config, $cache;
global $convert, $convert_row, $message_parser, $skip_rows;
- require($phpbb_root_path . 'config.' . $phpEx);
- require($phpbb_root_path . 'includes/constants.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/functions_convert.' . PHP_EXT);
$db = new $sql_db();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
@@ -613,7 +613,7 @@ class install_convert extends module
// Set up a user as well. We _should_ have enough of a database here at this point to do this
// and it helps for any core code we call
$user->session_begin();
- $user->page = $user->extract_current_page($phpbb_root_path);
+ $user->page = $user->extract_current_page(PHPBB_ROOT_PATH);
// This is a little bit of a fudge, but it allows the language entries to be available to the
// core code without us loading them again
@@ -658,7 +658,7 @@ class install_convert extends module
{
if ($convert->src_dbms != $dbms)
{
- require($phpbb_root_path . 'includes/db/' . $convert->src_dbms . '.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'includes/db/' . $convert->src_dbms . '.' . PHP_EXT);
}
$sql_db = 'dbal_' . $convert->src_dbms;
$src_db = new $sql_db();
@@ -715,18 +715,18 @@ class install_convert extends module
$get_info = false;
// check security implications of direct inclusion
- if (!file_exists('./convertors/convert_' . $convert->convertor_tag . '.' . $phpEx))
+ if (!file_exists('./convertors/convert_' . $convert->convertor_tag . '.' . PHP_EXT))
{
$this->p_master->error($user->lang['CONVERT_NOT_EXIST'], __LINE__, __FILE__);
}
- if (file_exists('./convertors/functions_' . $convert->convertor_tag . '.' . $phpEx))
+ if (file_exists('./convertors/functions_' . $convert->convertor_tag . '.' . PHP_EXT))
{
- include('./convertors/functions_' . $convert->convertor_tag . '.' . $phpEx);
+ include('./convertors/functions_' . $convert->convertor_tag . '.' . PHP_EXT);
}
$get_info = true;
- include('./convertors/convert_' . $convert->convertor_tag . '.' . $phpEx);
+ include('./convertors/convert_' . $convert->convertor_tag . '.' . PHP_EXT);
// Map some variables...
$convert->convertor_data = $convertor_data;
@@ -735,7 +735,7 @@ class install_convert extends module
// Now include the real data
$get_info = false;
- include('./convertors/convert_' . $convert->convertor_tag . '.' . $phpEx);
+ include('./convertors/convert_' . $convert->convertor_tag . '.' . PHP_EXT);
$convert->convertor_data = $convertor_data;
$convert->tables = $tables;
@@ -751,18 +751,18 @@ class install_convert extends module
$search_type = basename(trim($config['search_type']));
// For conversions we are a bit less strict and set to a search backend we know exist...
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
{
$search_type = 'fulltext_native';
set_config('search_type', $search_type);
}
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
- require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT);
$error = false;
$convert->fulltext_search = new $search_type($error);
@@ -772,7 +772,7 @@ class install_convert extends module
trigger_error($error);
}
- include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
$message_parser = new parse_message();
$jump = request_var('jump', 0);
@@ -828,7 +828,7 @@ class install_convert extends module
$this->p_master->error($user->lang['DEV_NO_TEST_FILE'], __LINE__, __FILE__);
}
- if (!$local_path || !@is_writable($phpbb_root_path . $local_path))
+ if (!$local_path || !@is_writable(PHPBB_ROOT_PATH . $local_path))
{
if (!$local_path)
{
@@ -1438,7 +1438,7 @@ class install_convert extends module
*/
function sync_forums($sync_batch)
{
- global $template, $user, $db, $phpbb_root_path, $phpEx, $config, $cache;
+ global $template, $user, $db, $config, $cache;
global $convert;
$template->assign_block_vars('checks', array(
@@ -1547,7 +1547,7 @@ class install_convert extends module
*/
function finish_conversion()
{
- global $db, $phpbb_root_path, $convert, $config, $language, $user, $template;
+ global $db, $convert, $config, $language, $user, $template;
$db->sql_query('DELETE FROM ' . CONFIG_TABLE . "
WHERE config_name = 'convert_progress'
@@ -1556,7 +1556,7 @@ class install_convert extends module
OR config_name = 'convert_db_user'");
$db->sql_query('DELETE FROM ' . SESSIONS_TABLE);
- @unlink($phpbb_root_path . 'cache/data_global.php');
+ @unlink(PHPBB_ROOT_PATH . 'cache/data_global.php');
cache_moderators();
// And finally, add a note to the log
@@ -1578,7 +1578,7 @@ class install_convert extends module
*/
function final_jump($final_jump)
{
- global $template, $user, $src_db, $same_db, $db, $phpbb_root_path, $phpEx, $config, $cache;
+ global $template, $user, $src_db, $same_db, $db, $config, $cache;
global $convert;
$template->assign_block_vars('checks', array(
@@ -1617,7 +1617,7 @@ class install_convert extends module
*/
function jump($jump, $last_statement)
{
- global $template, $user, $src_db, $same_db, $db, $phpbb_root_path, $phpEx, $config, $cache;
+ global $template, $user, $src_db, $same_db, $db, $config, $cache;
global $convert;
$template->assign_block_vars('checks', array(
@@ -1920,7 +1920,7 @@ class install_convert extends module
*/
function process_row(&$schema, &$sql_data, &$insert_values)
{
- global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache;
+ global $template, $user, $db, $lang, $config, $cache;
global $convert, $convert_row;
$sql_flag = false;
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 194d5ca705..5f2161a1ce 100755
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -19,9 +19,9 @@ if (!defined('IN_INSTALL'))
if (!empty($setmodules))
{
// If phpBB is already installed we do not include this module
- if (@file_exists($phpbb_root_path . 'config.' . $phpEx) && !file_exists($phpbb_root_path . 'cache/install_lock'))
+ if (@file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) && !file_exists(PHPBB_ROOT_PATH . 'cache/install_lock'))
{
- include_once($phpbb_root_path . 'config.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
if (defined('PHPBB_INSTALLED'))
{
@@ -32,7 +32,7 @@ if (!empty($setmodules))
$module[] = array(
'module_type' => 'install',
'module_title' => 'INSTALL',
- 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
+ 'module_filename' => substr(basename(__FILE__), 0, -strlen(PHP_EXT)-1),
'module_order' => 10,
'module_subs' => '',
'module_stages' => array('INTRO', 'REQUIREMENTS', 'DATABASE', 'ADMINISTRATOR', 'CONFIG_FILE', 'ADVANCED', 'CREATE_TABLE', 'FINAL'),
@@ -53,7 +53,7 @@ class install_install extends module
function main($mode, $sub)
{
- global $lang, $template, $language, $phpbb_root_path;
+ global $lang, $template, $language;
switch ($sub)
{
@@ -107,7 +107,7 @@ class install_install extends module
$this->email_admin($mode, $sub);
// Remove the lock file
- @unlink($phpbb_root_path . 'cache/install_lock');
+ @unlink(PHPBB_ROOT_PATH . 'cache/install_lock');
break;
}
@@ -120,7 +120,7 @@ class install_install extends module
*/
function check_server_requirements($mode, $sub)
{
- global $lang, $template, $phpbb_root_path, $phpEx, $language;
+ global $lang, $template, $language;
$this->page_title = $lang['STAGE_REQUIREMENTS'];
@@ -455,31 +455,31 @@ class install_install extends module
$exists = $write = false;
// Try to create the directory if it does not exist
- if (!file_exists($phpbb_root_path . $dir))
+ if (!file_exists(PHPBB_ROOT_PATH . $dir))
{
- @mkdir($phpbb_root_path . $dir, 0777);
- @chmod($phpbb_root_path . $dir, 0777);
+ @mkdir(PHPBB_ROOT_PATH . $dir, 0777);
+ @chmod(PHPBB_ROOT_PATH . $dir, 0777);
}
// Now really check
- if (file_exists($phpbb_root_path . $dir) && is_dir($phpbb_root_path . $dir))
+ if (file_exists(PHPBB_ROOT_PATH . $dir) && is_dir(PHPBB_ROOT_PATH . $dir))
{
- if (!@is_writable($phpbb_root_path . $dir))
+ if (!@is_writable(PHPBB_ROOT_PATH . $dir))
{
- @chmod($phpbb_root_path . $dir, 0777);
+ @chmod(PHPBB_ROOT_PATH . $dir, 0777);
}
$exists = true;
}
// Now check if it is writable by storing a simple file
- $fp = @fopen($phpbb_root_path . $dir . 'test_lock', 'wb');
+ $fp = @fopen(PHPBB_ROOT_PATH . $dir . 'test_lock', 'wb');
if ($fp !== false)
{
$write = true;
}
@fclose($fp);
- @unlink($phpbb_root_path . $dir . 'test_lock');
+ @unlink(PHPBB_ROOT_PATH . $dir . 'test_lock');
$passed['files'] = ($exists && $write && $passed['files']) ? true : false;
@@ -502,14 +502,14 @@ class install_install extends module
'LEGEND_EXPLAIN' => $lang['FILES_OPTIONAL_EXPLAIN'],
));
- $directories = array('config.' . $phpEx, 'images/avatars/upload/');
+ $directories = array('config.' . PHP_EXT, 'images/avatars/upload/');
foreach ($directories as $dir)
{
$write = $exists = true;
- if (file_exists($phpbb_root_path . $dir))
+ if (file_exists(PHPBB_ROOT_PATH . $dir))
{
- if (!@is_writable($phpbb_root_path . $dir))
+ if (!@is_writable(PHPBB_ROOT_PATH . $dir))
{
$write = false;
}
@@ -550,7 +550,7 @@ class install_install extends module
*/
function obtain_database_settings($mode, $sub)
{
- global $lang, $template, $phpEx;
+ global $lang, $template;
$this->page_title = $lang['STAGE_DATABASE'];
@@ -684,7 +684,7 @@ class install_install extends module
*/
function obtain_admin_settings($mode, $sub)
{
- global $lang, $template, $phpEx;
+ global $lang, $template;
$this->page_title = $lang['STAGE_ADMINISTRATOR'];
@@ -695,7 +695,7 @@ class install_install extends module
{
// Someone's been silly and tried calling this page direct
// So we send them back to the start to do it again properly
- $this->p_master->redirect("index.$phpEx?mode=install");
+ $this->p_master->redirect('index.' . PHP_EXT . '?mode=install');
}
$s_hidden_fields = ($data['img_imagick']) ? '<input type="hidden" name="img_imagick" value="' . addslashes($data['img_imagick']) . '" />' : '';
@@ -852,7 +852,7 @@ class install_install extends module
*/
function create_config_file($mode, $sub)
{
- global $lang, $template, $phpbb_root_path, $phpEx;
+ global $lang, $template;
$this->page_title = $lang['STAGE_CONFIG_FILE'];
@@ -863,7 +863,7 @@ class install_install extends module
{
// Someone's been silly and tried calling this page direct
// So we send them back to the start to do it again properly
- $this->p_master->redirect("index.$phpEx?mode=install");
+ $this->p_master->redirect('index.' . PHP_EXT . '?mode=install');
}
$s_hidden_fields = ($data['img_imagick']) ? '<input type="hidden" name="img_imagick" value="' . addslashes($data['img_imagick']) . '" />' : '';
@@ -889,7 +889,7 @@ class install_install extends module
}
// Create a lock file to indicate that there is an install in progress
- $fp = @fopen($phpbb_root_path . 'cache/install_lock', 'wb');
+ $fp = @fopen(PHPBB_ROOT_PATH . 'cache/install_lock', 'wb');
if ($fp === false)
{
// We were unable to create the lock file - abort
@@ -897,7 +897,7 @@ class install_install extends module
}
@fclose($fp);
- @chmod($phpbb_root_path . 'cache/install_lock', 0666);
+ @chmod(PHPBB_ROOT_PATH . 'cache/install_lock', 0666);
$load_extensions = implode(',', $load_extensions);
@@ -929,12 +929,12 @@ class install_install extends module
$config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused!
// Attempt to write out the config file directly. If it works, this is the easiest way to do it ...
- if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx)) || is_writable($phpbb_root_path))
+ if ((file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) && is_writable(PHPBB_ROOT_PATH . 'config.' . PHP_EXT)) || is_writable(PHPBB_ROOT_PATH))
{
// Assume it will work ... if nothing goes wrong below
$written = true;
- if (!($fp = @fopen($phpbb_root_path . 'config.' . $phpEx, 'w')))
+ if (!($fp = @fopen(PHPBB_ROOT_PATH . 'config.' . PHP_EXT, 'w')))
{
// Something went wrong ... so let's try another method
$written = false;
@@ -950,7 +950,7 @@ class install_install extends module
if ($written)
{
- @chmod($phpbb_root_path . 'config.' . $phpEx, 0644);
+ @chmod(PHPBB_ROOT_PATH . 'config.' . PHP_EXT, 0644);
}
}
@@ -960,7 +960,7 @@ class install_install extends module
// Note that all we check is that the file has _something_ in it
// We don't compare the contents exactly - if they can't upload
// a single file correctly, it's likely they will have other problems....
- if (filesize($phpbb_root_path . 'config.' . $phpEx) > 10)
+ if (filesize(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) > 10)
{
$written = true;
}
@@ -984,8 +984,8 @@ class install_install extends module
if (isset($_POST['dlconfig']))
{
// They want a copy of the file to download, so send the relevant headers and dump out the data
- header("Content-Type: text/x-delimtext; name=\"config.$phpEx\"");
- header("Content-disposition: attachment; filename=config.$phpEx");
+ header('Content-Type: text/x-delimtext; name="config.' . PHP_EXT . '"');
+ header('Content-disposition: attachment; filename=config.' . PHP_EXT);
echo $config_data;
exit;
}
@@ -1021,7 +1021,7 @@ class install_install extends module
*/
function obtain_advanced_settings($mode, $sub)
{
- global $lang, $template, $phpEx;
+ global $lang, $template;
$this->page_title = $lang['STAGE_ADVANCED'];
@@ -1032,7 +1032,7 @@ class install_install extends module
{
// Someone's been silly and tried calling this page direct
// So we send them back to the start to do it again properly
- $this->p_master->redirect("index.$phpEx?mode=install");
+ $this->p_master->redirect('index.' . PHP_EXT . '?mode=install');
}
$s_hidden_fields = ($data['img_imagick']) ? '<input type="hidden" name="img_imagick" value="' . addslashes($data['img_imagick']) . '" />' : '';
@@ -1117,7 +1117,7 @@ class install_install extends module
*/
function load_schema($mode, $sub)
{
- global $db, $lang, $template, $phpbb_root_path, $phpEx;
+ global $db, $lang, $template;
$this->page_title = $lang['STAGE_CREATE_TABLE'];
$s_hidden_fields = '';
@@ -1129,7 +1129,7 @@ class install_install extends module
{
// Someone's been silly and tried calling this page direct
// So we send them back to the start to do it again properly
- $this->p_master->redirect("index.$phpEx?mode=install");
+ $this->p_master->redirect('index.' . PHP_EXT . '?mode=install');
}
// HTTP_HOST is having the correct browser url in most cases...
@@ -1148,13 +1148,13 @@ class install_install extends module
if (!isset($available_dbms[$data['dbms']]))
{
// Someone's been silly and tried providing a non-existant dbms
- $this->p_master->redirect("index.$phpEx?mode=install");
+ $this->p_master->redirect('index.' . PHP_EXT . '?mode=install');
}
$dbms = $available_dbms[$data['dbms']]['DRIVER'];
// Load the appropriate database class if not already loaded
- include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
// Instantiate the database
$db = new $sql_db();
@@ -1172,8 +1172,8 @@ class install_install extends module
$delimiter = $available_dbms[$data['dbms']]['DELIM'];
- include($phpbb_root_path . 'includes/db/db_tools.php');
- include($phpbb_root_path . 'install/schemas/schema_data.php');
+ include(PHPBB_ROOT_PATH . 'includes/db/db_tools.php');
+ include(PHPBB_ROOT_PATH . 'install/schemas/schema_data.php');
// we must do this so that we can handle the errors
phpbb_db_tools::$return_statements = true;
@@ -1413,7 +1413,7 @@ class install_install extends module
*/
function build_search_index($mode, $sub)
{
- global $db, $lang, $phpbb_root_path, $phpEx, $config;
+ global $db, $lang, $config;
// Obtain any submitted data
$data = $this->get_submitted_data();
@@ -1425,13 +1425,13 @@ class install_install extends module
if (!isset($available_dbms[$data['dbms']]))
{
// Someone's been silly and tried providing a non-existant dbms
- $this->p_master->redirect("index.$phpEx?mode=install");
+ $this->p_master->redirect('index.' . PHP_EXT . '?mode=install');
}
$dbms = $available_dbms[$data['dbms']]['DRIVER'];
// Load the appropriate database class if not already loaded
- include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
// Instantiate the database
$db = new $sql_db();
@@ -1440,8 +1440,8 @@ class install_install extends module
// NOTE: trigger_error does not work here.
$db->sql_return_on_error(true);
- include_once($phpbb_root_path . 'includes/constants.' . $phpEx);
- include_once($phpbb_root_path . 'includes/search/fulltext_native.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/search/fulltext_native.' . PHP_EXT);
// Fill the config array - it is needed by those functions we call
$sql = 'SELECT *
@@ -1474,9 +1474,9 @@ class install_install extends module
*/
function add_modules($mode, $sub)
{
- global $db, $lang, $phpbb_root_path, $phpEx;
+ global $db, $lang;
- include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/acp/acp_modules.' . PHP_EXT);
$_module = &new acp_modules();
$module_classes = array('acp', 'mcp', 'ucp');
@@ -1695,9 +1695,9 @@ class install_install extends module
*/
function add_language($mode, $sub)
{
- global $db, $lang, $phpbb_root_path, $phpEx;
+ global $db, $lang;
- $dir = @opendir($phpbb_root_path . 'language');
+ $dir = @opendir(PHPBB_ROOT_PATH . 'language');
if (!$dir)
{
@@ -1706,7 +1706,7 @@ class install_install extends module
while (($file = readdir($dir)) !== false)
{
- $path = $phpbb_root_path . 'language/' . $file;
+ $path = PHPBB_ROOT_PATH . 'language/' . $file;
if ($file == '.' || $file == '..' || is_link($path) || is_file($path) || $file == 'CVS')
{
@@ -1745,9 +1745,9 @@ class install_install extends module
while ($imageset_row = $db->sql_fetchrow($result))
{
- if (@file_exists("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['lang_iso']}/imageset.cfg"))
+ if (@file_exists(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['lang_iso']}/imageset.cfg"))
{
- $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['lang_iso']}/imageset.cfg");
+ $cfg_data_imageset_data = parse_cfg_file(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['lang_iso']}/imageset.cfg");
foreach ($cfg_data_imageset_data as $image_name => $value)
{
if (strpos($value, '*') !== false)
@@ -1808,7 +1808,7 @@ class install_install extends module
*/
function add_bots($mode, $sub)
{
- global $db, $lang, $phpbb_root_path, $phpEx, $config;
+ global $db, $lang, $config;
// Obtain any submitted data
$data = $this->get_submitted_data();
@@ -1840,7 +1840,7 @@ class install_install extends module
if (!function_exists('user_add'))
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
}
foreach ($this->bot_list as $bot_name => $bot_ary)
@@ -1886,7 +1886,7 @@ class install_install extends module
*/
function email_admin($mode, $sub)
{
- global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpEx;
+ global $auth, $config, $db, $lang, $template, $user;
$this->page_title = $lang['STAGE_FINAL'];
@@ -1914,7 +1914,7 @@ class install_install extends module
if ($config['email_enable'])
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger(false);
@@ -1940,9 +1940,9 @@ class install_install extends module
$template->assign_vars(array(
'TITLE' => $lang['INSTALL_CONGRATS'],
- 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], $config['version'], append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=convert&amp;language=' . $data['language']), '../docs/README.html'),
+ 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], $config['version'], append_sid('install/index', 'mode=convert&amp;language=' . $data['language']), '../docs/README.html'),
'L_SUBMIT' => $lang['INSTALL_LOGIN'],
- 'U_ACTION' => append_sid($phpbb_root_path . 'adm/index.' . $phpEx),
+ 'U_ACTION' => append_sid(CONFIG_ADM_FOLDER . '/index.' . PHP_EXT),
));
}
diff --git a/phpBB/install/install_main.php b/phpBB/install/install_main.php
index e9f35efa1d..565b06b0b3 100755
--- a/phpBB/install/install_main.php
+++ b/phpBB/install/install_main.php
@@ -22,7 +22,7 @@ if (!empty($setmodules))
$module[] = array(
'module_type' => 'install',
'module_title' => 'OVERVIEW',
- 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
+ 'module_filename' => substr(basename(__FILE__), 0, -strlen(PHP_EXT)-1),
'module_order' => 0,
'module_subs' => array('INTRO', 'LICENSE', 'SUPPORT'),
'module_stages' => '',
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index d494007f3d..8bad2f7560 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -20,9 +20,9 @@ if (!defined('IN_INSTALL'))
if (!empty($setmodules))
{
// If phpBB is not installed we do not include this module
- if (@file_exists($phpbb_root_path . 'config.' . $phpEx) && !@file_exists($phpbb_root_path . 'cache/install_lock'))
+ if (@file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) && !@file_exists(PHPBB_ROOT_PATH . 'cache/install_lock'))
{
- include_once($phpbb_root_path . 'config.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
if (!defined('PHPBB_INSTALLED'))
{
@@ -37,7 +37,7 @@ if (!empty($setmodules))
$module[] = array(
'module_type' => 'update',
'module_title' => 'UPDATE',
- 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
+ 'module_filename' => substr(basename(__FILE__), 0, -strlen(PHP_EXT)-1),
'module_order' => 30,
'module_subs' => '',
'module_stages' => array('INTRO', 'VERSION_CHECK', 'UPDATE_DB', 'FILE_CHECK', 'UPDATE_FILES'),
@@ -70,19 +70,19 @@ class install_update extends module
function main($mode, $sub)
{
- global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth;
+ global $template, $user, $db, $config, $cache, $auth;
$this->tpl_name = 'install_update';
$this->page_title = 'UPDATE_INSTALLATION';
$this->unequal_version = false;
- $this->old_location = $phpbb_root_path . 'install/update/old/';
- $this->new_location = $phpbb_root_path . 'install/update/new/';
+ $this->old_location = PHPBB_ROOT_PATH . 'install/update/old/';
+ $this->new_location = PHPBB_ROOT_PATH . 'install/update/new/';
// Init DB
- require($phpbb_root_path . 'config.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- require($phpbb_root_path . 'includes/constants.' . $phpEx);
+ require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
+ require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT);
// Special options for conflicts/modified files
define('MERGE_NO_MERGE_NEW', 1);
@@ -148,7 +148,7 @@ class install_update extends module
$up_to_date = (version_compare(str_replace('rc', 'RC', strtolower($this->current_version)), str_replace('rc', 'RC', strtolower($this->latest_version)), '<')) ? false : true;
// Check for a valid update directory, else point the user to the phpbb.com website
- if (!file_exists($phpbb_root_path . 'install/update') || !file_exists($phpbb_root_path . 'install/update/index.' . $phpEx) || !file_exists($this->old_location) || !file_exists($this->new_location))
+ if (!file_exists(PHPBB_ROOT_PATH . 'install/update') || !file_exists(PHPBB_ROOT_PATH . 'install/update/index.php') || !file_exists($this->old_location) || !file_exists($this->new_location))
{
$template->assign_vars(array(
'S_ERROR' => true,
@@ -206,9 +206,9 @@ class install_update extends module
}
// Include renderer and engine
- $this->include_file('includes/diff/diff.' . $phpEx);
- $this->include_file('includes/diff/engine.' . $phpEx);
- $this->include_file('includes/diff/renderer.' . $phpEx);
+ $this->include_file('includes/diff/diff.' . PHP_EXT);
+ $this->include_file('includes/diff/engine.' . PHP_EXT);
+ $this->include_file('includes/diff/renderer.' . PHP_EXT);
// Make sure we stay at the file check if checking the files again
if (!empty($_POST['check_again']))
@@ -259,9 +259,9 @@ class install_update extends module
$valid = false;
$updates_to_version = '';
- if (file_exists($phpbb_root_path . 'install/database_update.' . $phpEx))
+ if (file_exists(PHPBB_ROOT_PATH . 'install/database_update.' . PHP_EXT))
{
- include_once($phpbb_root_path . 'install/database_update.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'install/database_update.' . PHP_EXT);
if ($updates_to_version === $this->update_info['version']['to'])
{
@@ -282,7 +282,7 @@ class install_update extends module
$template->assign_vars(array(
'S_DB_UPDATE' => true,
'S_DB_UPDATE_FINISHED' => ($config['version'] == $this->update_info['version']['to']) ? true : false,
- 'U_DB_UPDATE' => append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=1&amp;language=' . $user->data['user_lang']),
+ 'U_DB_UPDATE' => append_sid('install/database_update', 'type=1&amp;language=' . $user->data['user_lang']),
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&amp;sub=update_db"),
'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&amp;sub=file_check"),
));
@@ -301,7 +301,7 @@ class install_update extends module
// We are directly within an update. To make sure our update list is correct we check its status.
$update_list = (!empty($_POST['check_again'])) ? false : $cache->get('_update_list');
- $modified = ($update_list !== false) ? @filemtime($cache->cache_dir . 'data_update_list.' . $phpEx) : 0;
+ $modified = ($update_list !== false) ? @filemtime($cache->cache_dir . 'data_update_list.' . PHP_EXT) : 0;
// Make sure the list is up-to-date
if ($update_list !== false)
@@ -309,7 +309,7 @@ class install_update extends module
$get_new_list = false;
foreach ($this->update_info['files'] as $file)
{
- if (file_exists($phpbb_root_path . $file) && filemtime($phpbb_root_path . $file) > $modified)
+ if (file_exists(PHPBB_ROOT_PATH . $file) && filemtime(PHPBB_ROOT_PATH . $file) > $modified)
{
$get_new_list = true;
break;
@@ -459,21 +459,21 @@ class install_update extends module
$update_time = time();
// We test for stylesheet.css because it is faster and most likely the only file changed on common themes
- if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
+ if (!$recache && $theme['theme_mtime'] < @filemtime(PHPBB_ROOT_PATH . 'styles/' . $theme['theme_path'] . '/theme/stylesheet.css'))
{
$recache = true;
- $update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css');
+ $update_time = @filemtime(PHPBB_ROOT_PATH . 'styles/' . $theme['theme_path'] . '/theme/stylesheet.css');
}
else if (!$recache)
{
$last_change = $theme['theme_mtime'];
- $dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme");
+ $dir = @opendir(PHPBB_ROOT_PATH . "styles/{$theme['theme_path']}/theme");
if ($dir)
{
while (($entry = readdir($dir)) !== false)
{
- if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}"))
+ if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime(PHPBB_ROOT_PATH . "styles/{$theme['theme_path']}/theme/{$entry}"))
{
$recache = true;
break;
@@ -485,7 +485,7 @@ class install_update extends module
if ($recache)
{
- include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/acp/acp_styles.' . PHP_EXT);
$theme['theme_data'] = acp_styles::db_theme_data($theme);
$theme['theme_mtime'] = $update_time;
@@ -679,11 +679,11 @@ class install_update extends module
break;
case MERGE_NO_MERGE_MOD:
- $contents = file_get_contents($phpbb_root_path . $file_struct['filename']);
+ $contents = file_get_contents(PHPBB_ROOT_PATH . $file_struct['filename']);
break;
default:
- $diff = $this->return_diff($this->old_location . $original_filename, $phpbb_root_path . $file_struct['filename'], $this->new_location . $original_filename);
+ $diff = $this->return_diff($this->old_location . $original_filename, PHPBB_ROOT_PATH . $file_struct['filename'], $this->new_location . $original_filename);
$contents = implode("\n", $diff->merged_output());
unset($diff);
@@ -710,12 +710,12 @@ class install_update extends module
break;
case MERGE_NO_MERGE_MOD:
- $contents = file_get_contents($phpbb_root_path . $file_struct['filename']);
+ $contents = file_get_contents(PHPBB_ROOT_PATH . $file_struct['filename']);
break;
default:
- $diff = $this->return_diff($this->old_location . $original_filename, $phpbb_root_path . $file_struct['filename'], $this->new_location . $original_filename);
+ $diff = $this->return_diff($this->old_location . $original_filename, PHPBB_ROOT_PATH . $file_struct['filename'], $this->new_location . $original_filename);
if ($option == MERGE_NEW_FILE)
{
@@ -752,7 +752,7 @@ class install_update extends module
if (!empty($_REQUEST['download']))
{
- $this->include_file('includes/functions_compress.' . $phpEx);
+ $this->include_file('includes/functions_compress.' . PHP_EXT);
$use_method = request_var('use_method', '');
$methods = array('.tar');
@@ -822,7 +822,7 @@ class install_update extends module
}
else
{
- $this->include_file('includes/functions_transfer.' . $phpEx);
+ $this->include_file('includes/functions_transfer.' . PHP_EXT);
// Choose FTP, if not available use fsock...
$method = basename(request_var('method', ''));
@@ -850,7 +850,7 @@ class install_update extends module
if ($test_connection === true)
{
// Check for common.php file
- if (!$transfer->file_exists($phpbb_root_path, 'common.' . $phpEx))
+ if (!$transfer->file_exists(PHPBB_ROOT_PATH, 'common.' . PHP_EXT))
{
$test_connection = 'ERR_WRONG_PATH_TO_PHPBB';
}
@@ -914,11 +914,11 @@ class install_update extends module
{
if ($use_method == '.zip')
{
- $compress = new compress_zip('w', $phpbb_root_path . 'store/' . $archive_filename . $use_method);
+ $compress = new compress_zip('w', PHPBB_ROOT_PATH . 'store/' . $archive_filename . $use_method);
}
else
{
- $compress = new compress_tar('w', $phpbb_root_path . 'store/' . $archive_filename . $use_method, $use_method);
+ $compress = new compress_tar('w', PHPBB_ROOT_PATH . 'store/' . $archive_filename . $use_method, $use_method);
}
}
else
@@ -965,7 +965,7 @@ class install_update extends module
// New directory too?
$dirname = dirname($file_struct['filename']);
- if ($dirname && !file_exists($phpbb_root_path . $dirname))
+ if ($dirname && !file_exists(PHPBB_ROOT_PATH . $dirname))
{
$transfer->make_dir($dirname);
}
@@ -1013,7 +1013,7 @@ class install_update extends module
$compress->close();
$compress->download($archive_filename, $download_filename);
- @unlink($phpbb_root_path . 'store/' . $archive_filename . $use_method);
+ @unlink(PHPBB_ROOT_PATH . 'store/' . $archive_filename . $use_method);
exit;
}
@@ -1038,7 +1038,7 @@ class install_update extends module
*/
function show_diff(&$update_list)
{
- global $phpbb_root_path, $template, $user;
+ global $template, $user;
$this->tpl_name = 'install_update_diff';
@@ -1088,7 +1088,7 @@ class install_update extends module
case MERGE_NO_MERGE_NEW:
case MERGE_NO_MERGE_MOD:
- $diff = $this->return_diff(array(), ($option == MERGE_NO_MERGE_NEW) ? $this->new_location . $original_file : $phpbb_root_path . $file);
+ $diff = $this->return_diff(array(), ($option == MERGE_NO_MERGE_NEW) ? $this->new_location . $original_file : PHPBB_ROOT_PATH . $file);
$template->assign_var('S_DIFF_NEW_FILE', true);
$diff_mode = 'inline';
@@ -1099,7 +1099,7 @@ class install_update extends module
case MERGE_NEW_FILE:
case MERGE_MOD_FILE:
- $diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $file, $this->new_location . $original_file);
+ $diff = $this->return_diff($this->old_location . $original_file, PHPBB_ROOT_PATH . $file, $this->new_location . $original_file);
$tmp = array(
'file1' => array(),
@@ -1118,14 +1118,14 @@ class install_update extends module
default:
- $diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $file, $this->new_location . $original_file);
+ $diff = $this->return_diff($this->old_location . $original_file, PHPBB_ROOT_PATH . $file, $this->new_location . $original_file);
$template->assign_vars(array(
'S_DIFF_CONFLICT_FILE' => true,
'NUM_CONFLICTS' => $diff->merged_output(false, false, false, true))
);
- $diff = $this->return_diff($phpbb_root_path . $file, $diff->merged_output());
+ $diff = $this->return_diff(PHPBB_ROOT_PATH . $file, $diff->merged_output());
break;
}
@@ -1139,7 +1139,7 @@ class install_update extends module
case MERGE_NO_MERGE_NEW:
case MERGE_NO_MERGE_MOD:
- $diff = $this->return_diff(array(), ($option == MERGE_NO_MERGE_NEW) ? $this->new_location . $original_file : $phpbb_root_path . $file);
+ $diff = $this->return_diff(array(), ($option == MERGE_NO_MERGE_NEW) ? $this->new_location . $original_file : PHPBB_ROOT_PATH . $file);
$template->assign_var('S_DIFF_NEW_FILE', true);
$diff_mode = 'inline';
@@ -1148,14 +1148,14 @@ class install_update extends module
break;
default:
- $diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $original_file, $this->new_location . $file);
+ $diff = $this->return_diff($this->old_location . $original_file, PHPBB_ROOT_PATH . $original_file, $this->new_location . $file);
break;
}
break;
case 'not_modified':
case 'new_conflict':
- $diff = $this->return_diff($phpbb_root_path . $file, $this->new_location . $original_file);
+ $diff = $this->return_diff(PHPBB_ROOT_PATH . $file, $this->new_location . $original_file);
break;
case 'new':
@@ -1200,7 +1200,7 @@ class install_update extends module
*/
function get_update_structure(&$update_list)
{
- global $phpbb_root_path, $phpEx, $user;
+ global $user;
if ($update_list === false)
{
@@ -1242,7 +1242,7 @@ class install_update extends module
return;
}
- if (!file_exists($phpbb_root_path . $file))
+ if (!file_exists(PHPBB_ROOT_PATH . $file))
{
// Make sure the update files are consistent by checking if the file is in new_files...
if (!file_exists($this->new_location . $file))
@@ -1259,7 +1259,7 @@ class install_update extends module
/* Only include a new file as new if the underlying path exist
// The path normally do not exist if the original style or language has been removed
- if (file_exists($phpbb_root_path . dirname($file)))
+ if (file_exists(PHPBB_ROOT_PATH . dirname($file)))
{
$this->get_custom_info($update_list['new'], $file);
$update_list['new'][] = array('filename' => $file, 'custom' => false);
@@ -1273,7 +1273,7 @@ class install_update extends module
}
}*/
- if (file_exists($phpbb_root_path . dirname($file)) || (strpos($file, 'styles/') !== 0 && strpos($file, 'language/') !== 0))
+ if (file_exists(PHPBB_ROOT_PATH . dirname($file)) || (strpos($file, 'styles/') !== 0 && strpos($file, 'language/') !== 0))
{
$this->get_custom_info($update_list['new'], $file);
$update_list['new'][] = array('filename' => $file, 'custom' => false);
@@ -1327,7 +1327,7 @@ class install_update extends module
*/
function make_update_diff(&$update_list, $original_file, $file, $custom = false)
{
- global $phpbb_root_path, $user;
+ global $user;
$update_ary = array('filename' => $file, 'custom' => $custom);
@@ -1338,11 +1338,11 @@ class install_update extends module
// On a successfull update the new location file exists but the old one does not exist.
// Check for this circumstance, the new file need to be up-to-date with the current file then...
- if (!file_exists($this->old_location . $original_file) && file_exists($this->new_location . $original_file) && file_exists($phpbb_root_path . $file))
+ if (!file_exists($this->old_location . $original_file) && file_exists($this->new_location . $original_file) && file_exists(PHPBB_ROOT_PATH . $file))
{
$tmp = array(
'file1' => file_get_contents($this->new_location . $original_file),
- 'file2' => file_get_contents($phpbb_root_path . $file),
+ 'file2' => file_get_contents(PHPBB_ROOT_PATH . $file),
);
// We need to diff the contents here to make sure the file is really the one we expect
@@ -1377,7 +1377,7 @@ class install_update extends module
$tmp = array(
'file1' => file_get_contents($this->old_location . $original_file),
- 'file2' => file_get_contents($phpbb_root_path . $file),
+ 'file2' => file_get_contents(PHPBB_ROOT_PATH . $file),
);
// We need to diff the contents here to make sure the file is really the one we expect
@@ -1388,7 +1388,7 @@ class install_update extends module
$tmp = array(
'file1' => file_get_contents($this->new_location . $original_file),
- 'file2' => file_get_contents($phpbb_root_path . $file),
+ 'file2' => file_get_contents(PHPBB_ROOT_PATH . $file),
);
// We need to diff the contents here to make sure the file is really the one we expect
@@ -1424,7 +1424,7 @@ class install_update extends module
// if the file is modified we try to make sure a merge succeed
$tmp = array(
'file1' => file_get_contents($this->old_location . $original_file),
- 'file2' => file_get_contents($phpbb_root_path . $file),
+ 'file2' => file_get_contents(PHPBB_ROOT_PATH . $file),
'file3' => file_get_contents($this->new_location . $original_file),
);
@@ -1438,7 +1438,7 @@ class install_update extends module
// There is one special case... users having merged with a conflicting file... we need to check this
$tmp = array(
- 'file1' => file_get_contents($phpbb_root_path . $file),
+ 'file1' => file_get_contents(PHPBB_ROOT_PATH . $file),
'file2' => implode("\n", $diff->merged_orig_output()),
);
@@ -1460,7 +1460,7 @@ class install_update extends module
}
$tmp = array(
- 'file1' => file_get_contents($phpbb_root_path . $file),
+ 'file1' => file_get_contents(PHPBB_ROOT_PATH . $file),
'file2' => implode("\n", $diff->merged_output()),
);
@@ -1512,7 +1512,6 @@ class install_update extends module
switch ($mode)
{
case 'version_info':
- global $phpbb_root_path, $phpEx;
$info = get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
if ($info !== false)
@@ -1530,7 +1529,7 @@ class install_update extends module
if ($info === false)
{
$update_info = array();
- include($phpbb_root_path . 'install/update/index.php');
+ include(PHPBB_ROOT_PATH . 'install/update/index.php');
$info = (empty($update_info) || !is_array($update_info)) ? false : $update_info;
if ($info !== false)
@@ -1541,10 +1540,8 @@ class install_update extends module
break;
case 'update_info':
- global $phpbb_root_path, $phpEx;
-
$update_info = array();
- include($phpbb_root_path . 'install/update/index.php');
+ include(PHPBB_ROOT_PATH . 'install/update/index.php');
$info = (empty($update_info) || !is_array($update_info)) ? false : $update_info;
$errstr = ($info === false) ? $user->lang['WRONG_INFO_FILE_FORMAT'] : '';
@@ -1603,15 +1600,13 @@ class install_update extends module
*/
function include_file($filename)
{
- global $phpbb_root_path, $phpEx;
-
if (!empty($this->update_info['files']) && in_array($filename, $this->update_info['files']))
{
include_once($this->new_location . $filename);
}
else
{
- include_once($phpbb_root_path . $filename);
+ include_once(PHPBB_ROOT_PATH . $filename);
}
}
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index cd6d20b19c..bedfcbf1ea 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -12,11 +12,11 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/functions_module.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -46,7 +46,7 @@ if (!$user->data['is_registered'])
{
if ($user->data['is_bot'])
{
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid(PHPBB_ROOT_PATH . 'index.' . PHP_EXT));
}
login_box('', $user->lang['LOGIN_EXPLAIN_MCP']);
@@ -231,14 +231,14 @@ if (!$user_id && $username == '')
$module->load_active();
// Assign data to the template engine for the list of modules
-$module->assign_tpl_vars(append_sid("{$phpbb_root_path}mcp.$phpEx"));
+$module->assign_tpl_vars(append_sid(PHPBB_ROOT_PATH . 'mcp.' . PHP_EXT));
// Generate urls for letting the moderation control panel being accessed in different modes
$template->assign_vars(array(
- 'U_MCP' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main'),
- 'U_MCP_FORUM' => ($forum_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=forum_view&amp;f=$forum_id") : '',
- 'U_MCP_TOPIC' => ($forum_id && $topic_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=topic_view&amp;t=$topic_id") : '',
- 'U_MCP_POST' => ($forum_id && $topic_id && $post_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=post_details&amp;t=$topic_id&amp;p=$post_id") : '',
+ 'U_MCP' => append_sid('mcp', 'i=main'),
+ 'U_MCP_FORUM' => ($forum_id) ? append_sid('mcp', "i=main&amp;mode=forum_view&amp;f=$forum_id") : '',
+ 'U_MCP_TOPIC' => ($forum_id && $topic_id) ? append_sid('mcp', "i=main&amp;mode=topic_view&amp;t=$topic_id") : '',
+ 'U_MCP_POST' => ($forum_id && $topic_id && $post_id) ? append_sid('mcp', "i=main&amp;mode=post_details&amp;t=$topic_id&amp;p=$post_id") : '',
));
// Generate the page, do not display/query online list
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index bfa4e6eceb..3477e5ae4e 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -12,10 +12,10 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -72,7 +72,7 @@ switch ($mode)
{
case 'leaders':
// Display a listing of board admins, moderators
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$page_title = $user->lang['THE_TEAM'];
$template_html = 'memberlist_leaders.html';
@@ -234,7 +234,7 @@ switch ($mode)
else
{
$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
- $u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']);
+ $u_group = append_sid('memberlist', 'mode=group&amp;g=' . $row['group_id']);
}
$rank_title = $rank_img = '';
@@ -251,7 +251,7 @@ switch ($mode)
'RANK_IMG_SRC' => $rank_img_src,
'U_GROUP' => $u_group,
- 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $row['user_id']) : '',
+ 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid('ucp', 'i=pm&amp;mode=compose&amp;u=' . $row['user_id']) : '',
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
@@ -297,7 +297,7 @@ switch ($mode)
$lang = 'JABBER';
$sql_field = 'user_jabber';
$s_select = (@extension_loaded('xml') && $config['jab_enable']) ? 'S_SEND_JABBER' : 'S_NO_SEND_JABBER';
- $s_action = append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=$action&amp;u=$user_id");
+ $s_action = append_sid('memberlist', "mode=contact&amp;action=$action&amp;u=$user_id");
break;
default:
@@ -334,7 +334,7 @@ switch ($mode)
if (check_form_key('memberlist_messaging'))
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']);
$message = utf8_normalize_nfc(request_var('message', '', true));
@@ -489,7 +489,7 @@ switch ($mode)
if ($member['user_sig_bbcode_bitfield'])
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode();
$bbcode->bbcode_second_pass($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield']);
}
@@ -506,7 +506,7 @@ switch ($mode)
$profile_fields = array();
if ($config['load_cpf_viewprofile'])
{
- include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
$cp = new custom_profile();
$profile_fields = $cp->generate_profile_fields_template('grab', $user_id);
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array();
@@ -517,7 +517,7 @@ switch ($mode)
if ($user->data['user_id'] != $user_id && $user->data['is_registered'])
{
- include_once($phpbb_root_path . 'includes/functions_module.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_module.' . PHP_EXT);
$module = new p_master();
$module->list_modules('ucp');
$module->set_active('zebra');
@@ -546,18 +546,18 @@ switch ($mode)
'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']),
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
- 'S_PROFILE_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group'),
+ 'S_PROFILE_ACTION' => append_sid('memberlist', 'mode=group'),
'S_GROUP_OPTIONS' => $group_options,
'S_CUSTOM_FIELDS' => (isset($profile_fields['row']) && sizeof($profile_fields['row'])) ? true : false,
- 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=users&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : '',
- 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_id}") : '',
+ 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid(CONFIG_ADM_FOLDER . '/index', 'i=users&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : '',
+ 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid('ucp', "mode=switch_perm&amp;u={$user_id}") : '',
'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false,
- 'U_ADD_FRIEND' => (!$friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
- 'U_ADD_FOE' => (!$foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
- 'U_REMOVE_FRIEND' => ($friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;usernames[]=' . $user_id) : '',
- 'U_REMOVE_FOE' => ($foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;mode=foes&amp;usernames[]=' . $user_id) : '',
+ 'U_ADD_FRIEND' => (!$friend) ? append_sid('ucp', 'i=zebra&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
+ 'U_ADD_FOE' => (!$foe) ? append_sid('ucp', 'i=zebra&amp;mode=foes&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
+ 'U_REMOVE_FRIEND' => ($friend) ? append_sid('ucp', 'i=zebra&amp;remove=1&amp;usernames[]=' . $user_id) : '',
+ 'U_REMOVE_FOE' => ($foe) ? append_sid('ucp', 'i=zebra&amp;remove=1&amp;mode=foes&amp;usernames[]=' . $user_id) : '',
));
if (!empty($profile_fields['row']))
@@ -765,7 +765,7 @@ switch ($mode)
WHERE user_id = ' . $user->data['user_id'];
$result = $db->sql_query($sql);
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger(false);
$email_tpl = ($user_id) ? 'profile_send_email' : 'email_notify';
@@ -832,15 +832,15 @@ switch ($mode)
{
$messenger->assign_vars(array(
'TOPIC_NAME' => htmlspecialchars_decode($row['topic_title']),
- 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=" . $row['forum_id'] . "&t=$topic_id")
+ 'U_TOPIC' => generate_board_url() . '/viewtopic.' . PHP_EXT . '?f=' . $row['forum_id'] . "&t=$topic_id")
);
}
$messenger->send($notify_type);
}
- meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
- $message = ($user_id) ? sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>') : sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$row['forum_id']}&amp;t=$topic_id") . '">', '</a>');
+ meta_refresh(3, append_sid('index'));
+ $message = ($user_id) ? sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid('index') . '">', '</a>') : sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', "f={$row['forum_id']}&amp;t=$topic_id") . '">', '</a>');
trigger_error($user->lang['EMAIL_SENT'] . '<br /><br />' . $message);
}
}
@@ -852,7 +852,7 @@ switch ($mode)
'USERNAME' => $row['username'],
'L_EMAIL_BODY_EXPLAIN' => $user->lang['EMAIL_BODY_EXPLAIN'],
- 'S_POST_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&amp;u=' . $user_id))
+ 'S_POST_ACTION' => append_sid('memberlist', 'mode=email&amp;u=' . $user_id))
);
}
else
@@ -863,7 +863,7 @@ switch ($mode)
'S_LANG_OPTIONS' => language_select($email_lang),
'L_EMAIL_BODY_EXPLAIN' => $user->lang['EMAIL_TOPIC_EXPLAIN'],
- 'S_POST_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&amp;t=' . $topic_id))
+ 'S_POST_ACTION' => append_sid('memberlist', 'mode=email&amp;t=' . $topic_id))
);
}
@@ -1135,7 +1135,7 @@ switch ($mode)
'RANK_IMG' => $rank_img,
'RANK_IMG_SRC' => $rank_img_src,
- 'U_PM' => ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;g=' . $group_id) : '',)
+ 'U_PM' => ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid('ucp', 'i=pm&amp;mode=compose&amp;g=' . $group_id) : '',)
);
$sql_select = ', ug.group_leader';
@@ -1229,12 +1229,12 @@ switch ($mode)
}
}
- $u_hide_find_member = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&amp;', $params));
+ $u_hide_find_member = append_sid('memberlist', implode('&amp;', $params));
$params[] = "mode=$mode";
$sort_params[] = "mode=$mode";
- $pagination_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&amp;', $params));
- $sort_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&amp;', $sort_params));
+ $pagination_url = append_sid('memberlist', implode('&amp;', $params));
+ $sort_url = append_sid('memberlist', implode('&amp;', $sort_params));
unset($params, $sort_params);
@@ -1302,7 +1302,7 @@ switch ($mode)
'S_JOINED_TIME_OPTIONS' => $s_find_join_time,
'S_ACTIVE_TIME_OPTIONS' => $s_find_active_time,
'S_GROUP_SELECT' => $s_group_select,
- 'S_USER_SEARCH_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&amp;form=$form&amp;field=$field"))
+ 'S_USER_SEARCH_ACTION' => append_sid('memberlist', "mode=searchuser&amp;form=$form&amp;field=$field"))
);
}
@@ -1371,7 +1371,7 @@ switch ($mode)
// Load custom profile fields
if ($config['load_cpf_memberlist'])
{
- include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
$cp = new custom_profile();
// Grab all profile fields from users in id cache for later use - similar to the poster cache
@@ -1403,7 +1403,7 @@ switch ($mode)
'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
'S_GROUP_LEADER' => (isset($row['group_leader']) && $row['group_leader']) ? true : false,
- 'U_VIEW_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_id))
+ 'U_VIEW_PROFILE' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $user_id))
);
if (isset($cp_row['row']) && sizeof($cp_row['row']))
@@ -1442,7 +1442,7 @@ switch ($mode)
'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']),
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
- 'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser') : '',
+ 'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? append_sid('memberlist', 'mode=searchuser') : '',
'U_HIDE_FIND_MEMBER' => ($mode == 'searchuser') ? $u_hide_find_member : '',
'U_SORT_USERNAME' => $sort_url . '&amp;sk=a&amp;sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),
'U_SORT_FROM' => $sort_url . '&amp;sk=b&amp;sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'),
@@ -1474,7 +1474,7 @@ page_header($page_title);
$template->set_filenames(array(
'body' => $template_html)
);
-make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
+make_jumpbox(append_sid('viewforum'));
page_footer();
@@ -1483,7 +1483,7 @@ page_footer();
*/
function show_profile($data)
{
- global $config, $auth, $template, $user, $phpEx, $phpbb_root_path;
+ global $config, $auth, $template, $user;
$username = $data['username'];
$user_id = $data['user_id'];
@@ -1493,7 +1493,7 @@ function show_profile($data)
if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_email'))
{
- $email = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&amp;u=' . $user_id) : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $data['user_email']);
+ $email = ($config['board_email_form'] && $config['email_enable']) ? append_sid('memberlist', 'mode=email&amp;u=' . $user_id) : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $data['user_email']);
}
else
{
@@ -1566,17 +1566,17 @@ function show_profile($data)
'ICQ_STATUS_IMG' => (!empty($data['user_icq'])) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&amp;img=5" width="18" height="18" />' : '',
'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false,
- 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&amp;sr=posts") : '',
- 'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $user_id, true, $user->session_id) : '',
- 'U_WARN' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $user_id, true, $user->session_id) : '',
- 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($data['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $user_id) : '',
+ 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid('search', "author_id=$user_id&amp;sr=posts") : '',
+ 'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $user_id, true, $user->session_id) : '',
+ 'U_WARN' => $auth->acl_get('m_warn') ? append_sid('mcp', 'i=warn&amp;mode=warn_user&amp;u=' . $user_id, true, $user->session_id) : '',
+ 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($data['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid('ucp', 'i=pm&amp;mode=compose&amp;u=' . $user_id) : '',
'U_EMAIL' => $email,
'U_WWW' => (!empty($data['user_website'])) ? $data['user_website'] : '',
'U_ICQ' => ($data['user_icq']) ? 'http://www.icq.com/people/webmsg.php?to=' . urlencode($data['user_icq']) : '',
- 'U_AIM' => ($data['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=aim&amp;u=' . $user_id) : '',
+ 'U_AIM' => ($data['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&amp;action=aim&amp;u=' . $user_id) : '',
'U_YIM' => ($data['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($data['user_yim']) . '&amp;.src=pg' : '',
- 'U_MSN' => ($data['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=msnm&amp;u=' . $user_id) : '',
- 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=jabber&amp;u=' . $user_id) : '',
+ 'U_MSN' => ($data['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&amp;action=msnm&amp;u=' . $user_id) : '',
+ 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&amp;action=jabber&amp;u=' . $user_id) : '',
'LOCATION' => ($data['user_from']) ? $data['user_from'] : '',
'USER_ICQ' => $data['user_icq'],
diff --git a/phpBB/posting.php b/phpBB/posting.php
index dfe7b348a7..af7e26d0db 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -12,12 +12,12 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
-include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
// Start session management
@@ -49,7 +49,7 @@ $current_time = time();
// Was cancel pressed? If so then redirect to the appropriate page
if ($cancel || ($current_time - $lastclick < 2 && $submit))
{
- $redirect = ($post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) : (($forum_id) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}index.$phpEx")));
+ $redirect = ($post_id) ? append_sid('viewtopic', 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid('viewtopic', 't=' . $topic_id) : (($forum_id) ? append_sid('viewforum', 'f=' . $forum_id) : append_sid('index')));
redirect($redirect);
}
@@ -168,7 +168,7 @@ if ($post_data['forum_password'])
// Check permissions
if ($user->data['is_bot'])
{
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid('index'));
}
// Is the user able to read within this forum?
@@ -313,11 +313,11 @@ if ($mode == 'bump')
add_log('mod', $forum_id, $topic_id, 'LOG_BUMP_TOPIC', $post_data['topic_title']);
- $meta_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}";
+ $meta_url = append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}";
meta_refresh(3, $meta_url);
$message = $user->lang['TOPIC_BUMPED'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $meta_url . '">', '</a>');
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . $forum_id) . '">', '</a>');
trigger_error($message);
}
@@ -493,13 +493,13 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && (
);
$db->sql_query($sql);
- $meta_info = ($mode == 'post') ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id");
+ $meta_info = ($mode == 'post') ? append_sid('viewforum', 'f=' . $forum_id) : append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id");
meta_refresh(3, $meta_info);
$message = $user->lang['DRAFT_SAVED'] . '<br /><br />';
$message .= ($mode != 'post') ? sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $meta_info . '">', '</a>') . '<br /><br />' : '';
- $message .= sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
+ $message .= sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . $forum_id) . '">', '</a>');
trigger_error($message);
}
@@ -730,7 +730,7 @@ if ($submit || $preview || $refresh)
// Validate username
if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username']))
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
if (($result = validate_username($post_data['username'], (!empty($post_data['post_username'])) ? $post_data['post_username'] : '')) !== false)
{
@@ -894,7 +894,7 @@ if ($submit || $preview || $refresh)
if (!$to_forum_id)
{
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
$template->assign_vars(array(
'S_FORUM_SELECT' => make_forum_select(false, false, false, true, true, true),
@@ -994,8 +994,8 @@ if ($submit || $preview || $refresh)
if ($mode == 'edit')
{
- $data['topic_replies_real'] = $post_data['topic_replies_real'];
- $data['topic_replies'] = $post_data['topic_replies'];
+ $data['topic_replies_real'] = (int) $post_data['topic_replies_real'];
+ $data['topic_replies'] = (int) $post_data['topic_replies'];
}
unset($message_parser);
@@ -1018,7 +1018,7 @@ if ($submit || $preview || $refresh)
$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>');
}
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . $data['forum_id']) . '">', '</a>');
trigger_error($message);
}
}
@@ -1195,7 +1195,7 @@ $notify_set = ($mode != 'edit' && $config['allow_topic_notify'] && $user->data
$notify_checked = (isset($notify)) ? $notify : (($mode == 'post') ? $user->data['user_notify'] : $notify_set);
// Page title & action URL, include session_id for security purpose
-$s_action = append_sid("{$phpbb_root_path}posting.$phpEx", "mode=$mode&amp;f=$forum_id", true, $user->session_id);
+$s_action = append_sid('posting', "mode=$mode&amp;f=$forum_id", true, $user->session_id);
$s_action .= ($topic_id) ? "&amp;t=$topic_id" : '';
$s_action .= ($post_id) ? "&amp;p=$post_id" : '';
@@ -1250,7 +1250,7 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_c
$template->assign_vars(array(
'S_CONFIRM_CODE' => true,
'CONFIRM_ID' => $confirm_id,
- 'CONFIRM_IMAGE' => '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_POST) . '" alt="" title="" />',
+ 'CONFIRM_IMAGE' => '<img src="' . append_sid('ucp', 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_POST) . '" alt="" title="" />',
'L_POST_CONFIRM_EXPLAIN' => sprintf($user->lang['POST_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
));
}
@@ -1285,7 +1285,7 @@ $template->assign_vars(array(
'USERNAME' => ((!$preview && $mode != 'quote') || $preview) ? $post_data['username'] : '',
'SUBJECT' => $post_data['post_subject'],
'MESSAGE' => $post_data['post_text'],
- 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid('faq', 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid('faq', 'mode=bbcode') . '">', '</a>'),
'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
@@ -1295,10 +1295,10 @@ $template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'TOPIC_TIME_LIMIT' => (int) $post_data['topic_time_limit'],
'EDIT_REASON' => $post_data['post_edit_reason'],
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"),
- 'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id") : '',
- 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&amp;mode=popup"),
- 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&amp;mode=popup")),
+ 'U_VIEW_FORUM' => append_sid('viewforum', "f=$forum_id"),
+ 'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id") : '',
+ 'U_PROGRESS_BAR' => append_sid('posting', "f=$forum_id&amp;mode=popup"),
+ 'UA_PROGRESS_BAR' => addslashes(append_sid('posting', "f=$forum_id&amp;mode=popup")),
'S_PRIVMSGS' => false,
'S_CLOSE_PROGRESS_WINDOW' => (isset($_POST['add_file'])) ? true : false,
@@ -1372,7 +1372,7 @@ $template->set_filenames(array(
'body' => 'posting_body.html')
);
-make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
+make_jumpbox(append_sid('viewforum'));
// Topic review
if ($mode == 'reply' || $mode == 'quote')
@@ -1413,7 +1413,6 @@ function upload_popup($forum_style = 0)
function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data)
{
global $user, $db, $auth;
- global $phpbb_root_path, $phpEx;
// If moderator removing post or user itself removing post, present a confirmation screen
if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id']))
@@ -1445,19 +1444,19 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data)
{
add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_TOPIC', $post_data['topic_title']);
- $meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
+ $meta_info = append_sid('viewforum', "f=$forum_id");
$message = $user->lang['POST_DELETED'];
}
else
{
add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_POST', $post_data['post_subject']);
- $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p=$next_post_id") . "#p$next_post_id";
+ $meta_info = append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;p=$next_post_id") . "#p$next_post_id";
$message = $user->lang['POST_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $meta_info . '">', '</a>');
}
meta_refresh(3, $meta_info);
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . $forum_id) . '">', '</a>');
trigger_error($message);
}
else
diff --git a/phpBB/report.php b/phpBB/report.php
index 03df91135d..9e816b9a66 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -12,10 +12,10 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -35,7 +35,7 @@ if (!$post_id)
trigger_error('NO_POST_SELECTED');
}
-$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;p=$post_id") . "#p$post_id";
+$redirect_url = append_sid('viewtopic', "f=$forum_id&amp;p=$post_id") . "#p$post_id";
// Has the report been cancelled?
if (isset($_POST['cancel']))
@@ -148,7 +148,7 @@ display_reasons($reason_id);
$template->assign_vars(array(
'REPORT_TEXT' => $report_text,
- 'S_REPORT_ACTION' => append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $post_id),
+ 'S_REPORT_ACTION' => append_sid('report', 'f=' . $forum_id . '&amp;p=' . $post_id),
'S_NOTIFY' => $user_notify,
'S_CAN_NOTIFY' => ($user->data['is_registered']) ? true : false)
diff --git a/phpBB/search.php b/phpBB/search.php
index c67581490b..825beac483 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -12,9 +12,9 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -221,12 +221,12 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// Select which method we'll use to obtain the post_id or topic_id information
$search_type = basename($config['search_type']);
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
- require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+ require(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT);
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;
@@ -440,11 +440,11 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($show_results == 'posts')
{
- include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
}
else
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
}
$user->add_lang('viewtopic');
@@ -470,7 +470,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$u_show_results = ($show_results != 'posts') ? '&amp;sr=' . $show_results : '';
$u_search_forum = implode('&amp;fid%5B%5D=', $search_forum);
- $u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results);
+ $u_search = append_sid('search', $u_sort_param . $u_show_results);
$u_search .= ($search_id) ? '&amp;search_id=' . $search_id : '';
$u_search .= ($u_hilit) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($search->search_query)) : '';
$u_search .= ($topic_id) ? '&amp;t=' . $topic_id : '';
@@ -681,7 +681,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// Instantiate BBCode if needed
if ($bbcode_bitfield !== '')
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
}
@@ -763,7 +763,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$u_forum_id = $forum_id;
}
- $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$u_forum_id&amp;t=$result_topic_id" . (($u_hilit) ? "&amp;hilit=$u_hilit" : ''));
+ $view_topic_url = append_sid('viewtopic', "f=$u_forum_id&amp;t=$result_topic_id" . (($u_hilit) ? "&amp;hilit=$u_hilit" : ''));
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
@@ -776,7 +776,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
$posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
- $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$result_topic_id", true, $user->session_id) : '';
+ $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid('mcp', 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$result_topic_id", true, $user->session_id) : '';
$row['topic_title'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['topic_title']);
@@ -816,7 +816,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'U_NEWEST_POST' => $view_topic_url . '&amp;view=unread#unread',
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=reports&amp;t=' . $result_topic_id, true, $user->session_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&amp;mode=reports&amp;t=' . $result_topic_id, true, $user->session_id),
'U_MCP_QUEUE' => $u_mcp_queue,
);
}
@@ -892,8 +892,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'TOPIC_VIEWS' => $row['topic_views'],
'U_VIEW_TOPIC' => $view_topic_url,
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
- 'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=" . $row['topic_id'] . '&amp;p=' . $row['post_id'] . (($u_hilit) ? '&amp;hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '')
+ 'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_id),
+ 'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid('viewtopic', "f=$forum_id&amp;t=" . $row['topic_id'] . '&amp;p=' . $row['post_id'] . (($u_hilit) ? '&amp;hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '')
));
}
@@ -912,7 +912,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$template->set_filenames(array(
'body' => 'search_results.html')
);
- make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
+ make_jumpbox(append_sid('viewforum'));
page_footer();
}
@@ -1034,7 +1034,7 @@ if (!empty($_EXTRA_URL))
}
$template->assign_vars(array(
- 'S_SEARCH_ACTION' => "{$phpbb_root_path}search.$phpEx",
+ 'S_SEARCH_ACTION' => append_sid('search'),
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),
'S_CHARACTER_OPTIONS' => $s_characters,
'S_FORUM_OPTIONS' => $s_forums,
@@ -1061,7 +1061,7 @@ if ($auth->acl_get('a_search'))
'KEYWORDS' => $keywords,
'TIME' => $user->format_date($row['search_time']),
- 'U_KEYWORDS' => append_sid("{$phpbb_root_path}search.$phpEx", 'keywords=' . urlencode(htmlspecialchars_decode($keywords)))
+ 'U_KEYWORDS' => append_sid('search', 'keywords=' . urlencode(htmlspecialchars_decode($keywords)))
));
}
$db->sql_freeresult($result);
@@ -1073,7 +1073,7 @@ page_header($user->lang['SEARCH']);
$template->set_filenames(array(
'body' => 'search_body.html')
);
-make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
+make_jumpbox(append_sid('viewforum'));
page_footer();
diff --git a/phpBB/style.php b/phpBB/style.php
index cd9f8bd9d7..3ee1726554 100644
--- a/phpBB/style.php
+++ b/phpBB/style.php
@@ -12,36 +12,8 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-
-// Report all errors, except notices
-error_reporting(E_ALL ^ E_NOTICE);
-date_default_timezone_set('UTC');
-
-require($phpbb_root_path . 'config.' . $phpEx);
-
-if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
-{
- exit;
-}
-
-if (version_compare(PHP_VERSION, '6.0.0-dev', '<'))
-{
- set_magic_quotes_runtime(0);
-}
-
-// Load Extensions
-if (!empty($load_extensions))
-{
- $load_extensions = explode(',', $load_extensions);
-
- foreach ($load_extensions as $extension)
- {
- @dl(trim($extension));
- }
-}
-
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
$sid = (isset($_GET['sid']) && !is_array($_GET['sid'])) ? htmlspecialchars($_GET['sid']) : '';
$id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
@@ -56,240 +28,223 @@ if (strspn($sid, 'abcdefABCDEF0123456789') !== strlen($sid))
// happen to have a current session it will output nothing. We will also cache the
// resulting CSS data for five minutes ... anything to reduce the load on the SQL
// server a little
-if ($id)
+if (!$id)
{
- // Include files
- require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
- require($phpbb_root_path . 'includes/cache.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- require($phpbb_root_path . 'includes/constants.' . $phpEx);
+ exit;
+}
- $db = new $sql_db();
- $cache = new acm();
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
- // Connect to DB
- if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
- {
- exit;
- }
- unset($dbpasswd);
+$user = false;
- $config = cache::obtain_config();
- $user = false;
+if ($sid)
+{
+ $sql = 'SELECT u.user_id, u.user_lang
+ FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u
+ WHERE s.session_id = '" . $db->sql_escape($sid) . "'
+ AND s.session_user_id = u.user_id";
+ $result = $db->sql_query($sql);
+ $user = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+}
- if ($sid)
- {
- $sql = 'SELECT u.user_id, u.user_lang
- FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u
- WHERE s.session_id = '" . $db->sql_escape($sid) . "'
- AND s.session_user_id = u.user_id";
- $result = $db->sql_query($sql);
- $user = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- }
+$recompile = $config['load_tplcompile'];
+if (!$user)
+{
+ $id = $config['default_style'];
+ $recompile = false;
+ $user = array('user_id' => ANONYMOUS);
+}
- $recompile = $config['load_tplcompile'];
- if (!$user)
- {
- $id = $config['default_style'];
- $recompile = false;
- $user = array('user_id' => ANONYMOUS);
- }
+$sql = 'SELECT s.style_id, c.theme_id, c.theme_data, c.theme_path, c.theme_name, c.theme_mtime, i.*, t.template_path
+ FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . ' i
+ WHERE s.style_id = ' . $id . '
+ AND t.template_id = s.template_id
+ AND c.theme_id = s.theme_id
+ AND i.imageset_id = s.imageset_id';
+$result = $db->sql_query($sql, 300);
+$theme = $db->sql_fetchrow($result);
+$db->sql_freeresult($result);
+
+if (!$theme)
+{
+ garbage_collection();
+ exit_handler();
+}
- $sql = 'SELECT s.style_id, c.theme_id, c.theme_data, c.theme_path, c.theme_name, c.theme_mtime, i.*, t.template_path
- FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . ' i
- WHERE s.style_id = ' . $id . '
- AND t.template_id = s.template_id
- AND c.theme_id = s.theme_id
- AND i.imageset_id = s.imageset_id';
- $result = $db->sql_query($sql, 300);
- $theme = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+if ($user['user_id'] == ANONYMOUS)
+{
+ $user['user_lang'] = $config['default_lang'];
+}
- if (!$theme)
- {
- exit;
- }
+$user_image_lang = (file_exists(PHPBB_ROOT_PATH . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $user['user_lang'] : $config['default_lang'];
- if ($user['user_id'] == ANONYMOUS)
- {
- $user['user_lang'] = $config['default_lang'];
- }
+$sql = 'SELECT *
+ FROM ' . STYLES_IMAGESET_DATA_TABLE . '
+ WHERE imageset_id = ' . $theme['imageset_id'] . "
+ AND image_filename <> ''
+ AND image_lang IN ('" . $db->sql_escape($user_image_lang) . "', '')";
+$result = $db->sql_query($sql, 3600);
- $user_image_lang = (file_exists($phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $user['user_lang'] : $config['default_lang'];
+$img_array = array();
+while ($row = $db->sql_fetchrow($result))
+{
+ $img_array[$row['image_name']] = $row;
+}
+$db->sql_freeresult($result);
- $sql = 'SELECT *
- FROM ' . STYLES_IMAGESET_DATA_TABLE . '
- WHERE imageset_id = ' . $theme['imageset_id'] . "
- AND image_filename <> ''
- AND image_lang IN ('" . $db->sql_escape($user_image_lang) . "', '')";
- $result = $db->sql_query($sql, 3600);
+// gzip_compression
+if ($config['gzip_compress'])
+{
+ // IE6 is not able to compress the style (do not ask us why!)
+ $browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? strtolower(htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT'])) : '';
- $img_array = array();
- while ($row = $db->sql_fetchrow($result))
+ if ($browser && strpos($browser, 'msie 6.0') === false && @extension_loaded('zlib') && !headers_sent())
{
- $img_array[$row['image_name']] = $row;
+ ob_start('ob_gzhandler');
}
- $db->sql_freeresult($result);
-
- // gzip_compression
- if ($config['gzip_compress'])
- {
- // IE6 is not able to compress the style (do not ask us why!)
- $browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? strtolower(htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT'])) : '';
+}
- if ($browser && strpos($browser, 'msie 6.0') === false && @extension_loaded('zlib') && !headers_sent())
- {
- ob_start('ob_gzhandler');
- }
- }
+// Expire time of seven days if not recached
+$expire_time = 7 * 86400;
+$recache = false;
- // Expire time of seven days if not recached
- $expire_time = 7 * 86400;
- $recache = false;
+// Re-cache stylesheet data if necessary
+if ($recompile || empty($theme['theme_data']))
+{
+ $recache = (empty($theme['theme_data'])) ? true : false;
+ $update_time = time();
- // Re-cache stylesheet data if necessary
- if ($recompile || empty($theme['theme_data']))
+ // We test for stylesheet.css because it is faster and most likely the only file changed on common themes
+ if (!$recache && $theme['theme_mtime'] < @filemtime(PHPBB_ROOT_PATH . 'styles/' . $theme['theme_path'] . '/theme/stylesheet.css'))
{
- $recache = (empty($theme['theme_data'])) ? true : false;
- $update_time = time();
+ $recache = true;
+ $update_time = @filemtime(PHPBB_ROOT_PATH . 'styles/' . $theme['theme_path'] . '/theme/stylesheet.css');
+ }
+ else if (!$recache)
+ {
+ $last_change = $theme['theme_mtime'];
+ $dir = @opendir(PHPBB_ROOT_PATH . "styles/{$theme['theme_path']}/theme");
- // We test for stylesheet.css because it is faster and most likely the only file changed on common themes
- if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
- {
- $recache = true;
- $update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css');
- }
- else if (!$recache)
+ if ($dir)
{
- $last_change = $theme['theme_mtime'];
- $dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme");
-
- if ($dir)
+ while (($entry = readdir($dir)) !== false)
{
- while (($entry = readdir($dir)) !== false)
+ if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime(PHPBB_ROOT_PATH . "styles/{$theme['theme_path']}/theme/{$entry}"))
{
- if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}"))
- {
- $recache = true;
- break;
- }
+ $recache = true;
+ break;
}
- closedir($dir);
}
+ closedir($dir);
}
}
+}
- if ($recache)
+if ($recache)
+{
+ if (!class_exists('acp_styles'))
{
- if (!class_exists('acp_styles'))
- {
- include($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx);
- }
+ include(PHPBB_ROOT_PATH . 'includes/acp/acp_styles.' . PHP_EXT);
+ }
- $theme['theme_data'] = acp_styles::db_theme_data($theme);
- $theme['theme_mtime'] = $update_time;
+ $theme['theme_data'] = acp_styles::db_theme_data($theme);
+ $theme['theme_mtime'] = $update_time;
- // Save CSS contents
- $sql_ary = array(
- 'theme_mtime' => $theme['theme_mtime'],
- 'theme_data' => $theme['theme_data']
- );
+ // Save CSS contents
+ $sql_ary = array(
+ 'theme_mtime' => $theme['theme_mtime'],
+ 'theme_data' => $theme['theme_data']
+ );
- // @TODO: rewrite with the new param db functions
- $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE theme_id = {$theme['theme_id']}";
- $db->sql_query($sql);
+ // @TODO: rewrite with the new param db functions
+ $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
+ WHERE theme_id = {$theme['theme_id']}";
+ $db->sql_query($sql);
- $cache->destroy('sql', STYLES_THEME_TABLE);
- }
+ $cache->destroy('sql', STYLES_THEME_TABLE);
+}
- // Only set the expire time if the theme changed data is older than 30 minutes - to cope with changes from the ACP
- if ($recache || $theme['theme_mtime'] > (time() - 1800))
- {
- header('Expires: 0');
- }
- else
- {
- header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + $expire_time));
- }
+// Only set the expire time if the theme changed data is older than 30 minutes - to cope with changes from the ACP
+if ($recache || $theme['theme_mtime'] > (time() - 1800))
+{
+ header('Expires: 0');
+}
+else
+{
+ header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + $expire_time));
+}
- header('Content-type: text/css; charset=UTF-8');
+header('Content-type: text/css; charset=UTF-8');
- // Parse Theme Data
- $replace = array(
- '{T_THEME_PATH}' => "{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme',
- '{T_TEMPLATE_PATH}' => "{$phpbb_root_path}styles/" . $theme['template_path'] . '/template',
- '{T_IMAGESET_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset',
- '{T_IMAGESET_LANG_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset/' . $user_image_lang,
- '{T_STYLESHEET_NAME}' => $theme['theme_name'],
- '{S_USER_LANG}' => $user['user_lang']
- );
+// Parse Theme Data
+$replace = array(
+ '{T_THEME_PATH}' => PHPBB_ROOT_PATH . 'styles/' . $theme['theme_path'] . '/theme',
+ '{T_TEMPLATE_PATH}' => PHPBB_ROOT_PATH . 'styles/' . $theme['template_path'] . '/template',
+ '{T_IMAGESET_PATH}' => PHPBB_ROOT_PATH . 'styles/' . $theme['imageset_path'] . '/imageset',
+ '{T_IMAGESET_LANG_PATH}' => PHPBB_ROOT_PATH . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user_image_lang,
+ '{T_STYLESHEET_NAME}' => $theme['theme_name'],
+ '{S_USER_LANG}' => $user['user_lang']
+);
- $theme['theme_data'] = str_replace(array_keys($replace), array_values($replace), $theme['theme_data']);
+$theme['theme_data'] = str_replace(array_keys($replace), array_values($replace), $theme['theme_data']);
- $matches = array();
- preg_match_all('#\{IMG_([A-Za-z0-9_]*?)_(WIDTH|HEIGHT|SRC)\}#', $theme['theme_data'], $matches);
+$matches = array();
+preg_match_all('#\{IMG_([A-Za-z0-9_]*?)_(WIDTH|HEIGHT|SRC)\}#', $theme['theme_data'], $matches);
- $imgs = $find = $replace = array();
- if (isset($matches[0]) && sizeof($matches[0]))
+$imgs = $find = $replace = array();
+if (isset($matches[0]) && sizeof($matches[0]))
+{
+ foreach ($matches[1] as $i => $img)
{
- foreach ($matches[1] as $i => $img)
- {
- $img = strtolower($img);
- $find[] = $matches[0][$i];
-
- if (!isset($img_array[$img]))
- {
- $replace[] = '';
- continue;
- }
+ $img = strtolower($img);
+ $find[] = $matches[0][$i];
- if (!isset($imgs[$img]))
- {
- $img_data = &$img_array[$img];
- $imgsrc = ($img_data['image_lang'] ? $img_data['image_lang'] . '/' : '') . $img_data['image_filename'];
- $imgs[$img] = array(
- 'src' => $phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $imgsrc,
- 'width' => $img_data['image_width'],
- 'height' => $img_data['image_height'],
- );
- }
+ if (!isset($img_array[$img]))
+ {
+ $replace[] = '';
+ continue;
+ }
- switch ($matches[2][$i])
- {
- case 'SRC':
- $replace[] = $imgs[$img]['src'];
- break;
-
- case 'WIDTH':
- $replace[] = $imgs[$img]['width'];
- break;
-
- case 'HEIGHT':
- $replace[] = $imgs[$img]['height'];
- break;
-
- default:
- continue;
- }
+ if (!isset($imgs[$img]))
+ {
+ $img_data = &$img_array[$img];
+ $imgsrc = ($img_data['image_lang'] ? $img_data['image_lang'] . '/' : '') . $img_data['image_filename'];
+ $imgs[$img] = array(
+ 'src' => PHPBB_ROOT_PATH . 'styles/' . $theme['imageset_path'] . '/imageset/' . $imgsrc,
+ 'width' => $img_data['image_width'],
+ 'height' => $img_data['image_height'],
+ );
}
- if (sizeof($find))
+ switch ($matches[2][$i])
{
- $theme['theme_data'] = str_replace($find, $replace, $theme['theme_data']);
+ case 'SRC':
+ $replace[] = $imgs[$img]['src'];
+ break;
+
+ case 'WIDTH':
+ $replace[] = $imgs[$img]['width'];
+ break;
+
+ case 'HEIGHT':
+ $replace[] = $imgs[$img]['height'];
+ break;
+
+ default:
+ continue;
}
}
- echo $theme['theme_data'];
-
- if (!empty($cache))
+ if (sizeof($find))
{
- $cache->unload();
+ $theme['theme_data'] = str_replace($find, $replace, $theme['theme_data']);
}
- $db->sql_close();
}
-exit;
+echo $theme['theme_data'];
+
+garbage_collection();
+exit_handler();
?> \ No newline at end of file
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index 1d182a713a..88feeeac2f 100755
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -12,11 +12,11 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-require($phpbb_root_path . 'common.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
+require(PHPBB_ROOT_PATH . 'includes/functions_module.' . PHP_EXT);
// Basic parameter data
$id = request_var('i', '');
@@ -44,7 +44,7 @@ switch ($mode)
$module->load('ucp', 'activate');
$module->display($user->lang['UCP_ACTIVATE']);
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid('index'));
break;
case 'resend_act':
@@ -60,7 +60,7 @@ switch ($mode)
case 'register':
if ($user->data['is_registered'] || isset($_REQUEST['not_agreed']))
{
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid('index'));
}
$module->load('ucp', 'register');
@@ -75,10 +75,10 @@ switch ($mode)
case 'login':
if ($user->data['is_registered'])
{
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid('index'));
}
- login_box(request_var('redirect', "index.$phpEx"));
+ login_box(request_var('redirect', 'index' . PHP_EXT));
break;
case 'logout':
@@ -92,9 +92,9 @@ switch ($mode)
{
$message = ($user->data['user_id'] == ANONYMOUS) ? $user->lang['LOGOUT_REDIRECT'] : $user->lang['LOGOUT_FAILED'];
}
- meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
+ meta_refresh(3, append_sid('index'));
- $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> ');
+ $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid('index') . '">', '</a> ');
trigger_error($message);
break;
@@ -109,7 +109,7 @@ switch ($mode)
{
if ($user->data['is_registered'])
{
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid('index'));
}
login_box();
@@ -126,7 +126,7 @@ switch ($mode)
'S_AGREEMENT' => true,
'AGREEMENT_TITLE' => $user->lang[$title],
'AGREEMENT_TEXT' => sprintf($user->lang[$message], $config['sitename'], generate_board_url()),
- 'U_BACK' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
+ 'U_BACK' => append_sid('ucp', 'mode=login'),
'L_BACK' => $user->lang['BACK_TO_LOGIN'])
);
@@ -161,9 +161,9 @@ switch ($mode)
$user->session_kill();
$user->session_begin();
- meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
+ meta_refresh(3, append_sid('index'));
- $message = $user->lang['COOKIES_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
+ $message = $user->lang['COOKIES_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid('index') . '">', '</a>');
trigger_error($message);
}
else
@@ -171,7 +171,7 @@ switch ($mode)
confirm_box(false, 'DELETE_COOKIES', '');
}
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid('index'));
break;
@@ -188,20 +188,20 @@ switch ($mode)
if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'])
{
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid('index'));
}
- include($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
$auth_admin = new auth_admin();
if (!$auth_admin->ghost_permissions($user_id, $user->data['user_id']))
{
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid('index'));
}
add_log('admin', 'LOG_ACL_TRANSFER_PERMISSIONS', $user_row['username']);
- $message = sprintf($user->lang['PERMISSIONS_TRANSFERRED'], $user_row['username']) . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
+ $message = sprintf($user->lang['PERMISSIONS_TRANSFERRED'], $user_row['username']) . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid('index') . '">', '</a>');
trigger_error($message);
break;
@@ -210,7 +210,7 @@ switch ($mode)
if (!$user->data['user_perm_from'] || !$auth->acl_get('a_switchperm'))
{
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid('index'));
}
$auth->acl_cache($user->data);
@@ -229,7 +229,7 @@ switch ($mode)
add_log('admin', 'LOG_ACL_RESTORE_PERMISSIONS', $username);
- $message = $user->lang['PERMISSIONS_RESTORED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
+ $message = $user->lang['PERMISSIONS_RESTORED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid('index') . '">', '</a>');
trigger_error($message);
break;
@@ -240,7 +240,7 @@ if (!$user->data['is_registered'])
{
if ($user->data['is_bot'])
{
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ redirect(append_sid('index'));
}
login_box('', $user->lang['LOGIN_EXPLAIN_UCP']);
@@ -310,7 +310,7 @@ $module->set_active($id, $mode);
$module->load_active();
// Assign data to the template engine for the list of modules
-$module->assign_tpl_vars(append_sid("{$phpbb_root_path}ucp.$phpEx"));
+$module->assign_tpl_vars(append_sid('ucp'));
// Generate the page, do not display/query online list
$module->display($module->get_page_title(), false);
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index f41879da78..61408b06d9 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -12,10 +12,10 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
// Start session
$user->session_begin();
@@ -139,10 +139,10 @@ $template->set_filenames(array(
'body' => 'viewforum_body.html')
);
-make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id);
+make_jumpbox(append_sid('viewforum'), $forum_id);
$template->assign_vars(array(
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&amp;start=$start"),
+ 'U_VIEW_FORUM' => append_sid('viewforum', "f=$forum_id&amp;start=$start"),
));
// Not postable forum or showing active topics?
@@ -158,7 +158,7 @@ if (!$auth->acl_get('f_read', $forum_id))
$template->assign_vars(array(
'S_NO_READ_ACCESS' => true,
'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false,
- 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') . '&amp;redirect=' . urlencode(str_replace('&amp;', '&', build_url(array('_f_')))),
+ 'S_LOGIN_ACTION' => append_sid('ucp', 'mode=login') . '&amp;redirect=' . urlencode(str_replace('&amp;', '&', build_url(array('_f_')))),
));
page_footer();
@@ -169,7 +169,7 @@ if ($mark_read == 'topics')
{
markread('topics', $forum_id);
- $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
+ $redirect_url = append_sid('viewforum', 'f=' . $forum_id);
meta_refresh(3, $redirect_url);
trigger_error($user->lang['TOPICS_MARKED'] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>'));
@@ -184,7 +184,7 @@ if ($forum_data['forum_topics_per_page'])
// Do the forum Prune thang - cron type job ...
if ($forum_data['prune_next'] < time() && $forum_data['enable_prune'])
{
- $template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=prune_forum&amp;f=' . $forum_id) . '" alt="cron" width="1" height="1" />');
+ $template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid('cron', 'cron_type=prune_forum&amp;f=' . $forum_id) . '" alt="cron" width="1" height="1" />');
}
// Forum rules and subscription info
@@ -291,17 +291,17 @@ $template->assign_vars(array(
'S_WATCH_FORUM_LINK' => $s_watching_forum['link'],
'S_WATCH_FORUM_TITLE' => $s_watching_forum['title'],
'S_WATCHING_FORUM' => $s_watching_forum['is_watching'],
- 'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&amp;start=$start"),
+ 'S_FORUM_ACTION' => append_sid('viewforum', "f=$forum_id&amp;start=$start"),
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false,
- 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'fid[]=' . $forum_id),
+ 'S_SEARCHBOX_ACTION' => append_sid('search', 'fid[]=' . $forum_id),
'S_SINGLE_MODERATOR' => (!empty($moderators[$forum_id]) && sizeof($moderators[$forum_id]) > 1) ? false : true,
'S_IS_LOCKED' => ($forum_data['forum_status'] == ITEM_LOCKED) ? true : false,
'S_VIEWFORUM' => true,
- 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&amp;i=main&amp;mode=forum_view", true, $user->session_id) : '',
- 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&amp;f=' . $forum_id) : '',
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&amp;$u_sort_param&amp;start=$start"),
- 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&amp;mark=topics") : '',
+ 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid('mcp', "f=$forum_id&amp;i=main&amp;mode=forum_view", true, $user->session_id) : '',
+ 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid('posting', 'mode=post&amp;f=' . $forum_id) : '',
+ 'U_VIEW_FORUM' => append_sid('viewforum', "f=$forum_id&amp;$u_sort_param&amp;start=$start"),
+ 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid('viewforum', "f=$forum_id&amp;mark=topics") : '',
));
// Grab icons
@@ -512,7 +512,7 @@ if ($s_display_active)
}
$template->assign_vars(array(
- 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&amp;$u_sort_param"), $topics_count, $config['topics_per_page'], $start),
+ 'PAGINATION' => generate_pagination(append_sid('viewforum', "f=$forum_id&amp;$u_sort_param"), $topics_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
'TOTAL_TOPICS' => ($s_display_active) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)))
);
@@ -600,11 +600,11 @@ if (sizeof($topic_list))
topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
// Generate all the URIs ...
- $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&amp;t=' . $topic_id);
+ $view_topic_url = append_sid('viewtopic', 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&amp;t=' . $topic_id);
$topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
$posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
- $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$topic_id", true, $user->session_id) : '';
+ $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid('mcp', 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$topic_id", true, $user->session_id) : '';
// Send vars to template
$template->assign_block_vars('topicrow', array(
@@ -654,7 +654,7 @@ if (sizeof($topic_list))
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'U_VIEW_TOPIC' => $view_topic_url,
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=reports&amp;f=' . $forum_id . '&amp;t=' . $topic_id, true, $user->session_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&amp;mode=reports&amp;f=' . $forum_id . '&amp;t=' . $topic_id, true, $user->session_id),
'U_MCP_QUEUE' => $u_mcp_queue,
'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index c7cfe64f4c..ea9bd3c463 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -12,9 +12,9 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -54,7 +54,7 @@ $order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC
// Whois requested
if ($mode == 'whois' && $auth->acl_get('a_') && $session_id)
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$sql = 'SELECT u.user_id, u.username, u.user_type, s.session_ip
FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . " s
@@ -74,7 +74,7 @@ if ($mode == 'whois' && $auth->acl_get('a_') && $session_id)
$template->set_filenames(array(
'body' => 'viewonline_whois.html')
);
- make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
+ make_jumpbox(append_sid('viewforum'));
page_footer();
}
@@ -196,12 +196,12 @@ while ($row = $db->sql_fetchrow($result))
{
case 'index':
$location = $user->lang['INDEX'];
- $location_url = append_sid("{$phpbb_root_path}index.$phpEx");
+ $location_url = append_sid('index');
break;
case 'adm/index':
$location = $user->lang['ACP'];
- $location_url = append_sid("{$phpbb_root_path}index.$phpEx");
+ $location_url = append_sid('index');
break;
case 'posting':
@@ -213,7 +213,7 @@ while ($row = $db->sql_fetchrow($result))
if ($forum_id && $auth->acl_get('f_list', $forum_id))
{
$location = '';
- $location_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
+ $location_url = append_sid('viewforum', 'f=' . $forum_id);
if ($forum_data[$forum_id]['forum_type'] == FORUM_LINK)
{
@@ -251,33 +251,33 @@ while ($row = $db->sql_fetchrow($result))
else
{
$location = $user->lang['INDEX'];
- $location_url = append_sid("{$phpbb_root_path}index.$phpEx");
+ $location_url = append_sid('index');
}
break;
case 'search':
$location = $user->lang['SEARCHING_FORUMS'];
- $location_url = append_sid("{$phpbb_root_path}search.$phpEx");
+ $location_url = append_sid('search');
break;
case 'faq':
$location = $user->lang['VIEWING_FAQ'];
- $location_url = append_sid("{$phpbb_root_path}faq.$phpEx");
+ $location_url = append_sid('faq');
break;
case 'viewonline':
$location = $user->lang['VIEWING_ONLINE'];
- $location_url = append_sid("{$phpbb_root_path}viewonline.$phpEx");
+ $location_url = append_sid('viewonline');
break;
case 'memberlist':
$location = (strpos($row['session_page'], 'mode=viewprofile') !== false) ? $user->lang['VIEWING_MEMBER_PROFILE'] : $user->lang['VIEWING_MEMBERS'];
- $location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx");
+ $location_url = append_sid('memberlist');
break;
case 'mcp':
$location = $user->lang['VIEWING_MCP'];
- $location_url = append_sid("{$phpbb_root_path}index.$phpEx");
+ $location_url = append_sid('index');
break;
case 'ucp':
@@ -301,22 +301,22 @@ while ($row = $db->sql_fetchrow($result))
}
}
- $location_url = append_sid("{$phpbb_root_path}index.$phpEx");
+ $location_url = append_sid('index');
break;
case 'download':
$location = $user->lang['DOWNLOADING_FILE'];
- $location_url = append_sid("{$phpbb_root_path}index.$phpEx");
+ $location_url = append_sid('index');
break;
case 'report':
$location = $user->lang['REPORTING_POST'];
- $location_url = append_sid("{$phpbb_root_path}index.$phpEx");
+ $location_url = append_sid('index');
break;
default:
$location = $user->lang['INDEX'];
- $location_url = append_sid("{$phpbb_root_path}index.$phpEx");
+ $location_url = append_sid('index');
break;
}
@@ -330,8 +330,8 @@ while ($row = $db->sql_fetchrow($result))
'USER_BROWSER' => ($auth->acl_get('a_user')) ? $row['session_browser'] : '',
'U_USER_PROFILE' => ($row['user_type'] != USER_IGNORE) ? get_username_string('profile', $row['user_id'], '') : '',
- 'U_USER_IP' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=lookup' . (($mode != 'lookup' || $row['session_id'] != $session_id) ? '&amp;s=' . $row['session_id'] : '') . "&amp;sg=$show_guests&amp;start=$start&amp;sk=$sort_key&amp;sd=$sort_dir"),
- 'U_WHOIS' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=whois&amp;s=' . $row['session_id']),
+ 'U_USER_IP' => append_sid('viewonline', 'mode=lookup' . (($mode != 'lookup' || $row['session_id'] != $session_id) ? '&amp;s=' . $row['session_id'] : '') . "&amp;sg=$show_guests&amp;start=$start&amp;sk=$sort_key&amp;sd=$sort_dir"),
+ 'U_WHOIS' => append_sid('viewonline', 'mode=whois&amp;s=' . $row['session_id']),
'U_FORUM_LOCATION' => $location_url,
'S_USER_HIDDEN' => $s_user_hidden,
@@ -368,7 +368,7 @@ foreach ($vars_online as $l_prefix => $var_ary)
}
unset($vars_online);
-$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&amp;sk=$sort_key&amp;sd=$sort_dir"), $counter, $config['topics_per_page'], $start);
+$pagination = generate_pagination(append_sid('viewonline', "sg=$show_guests&amp;sk=$sort_key&amp;sd=$sort_dir"), $counter, $config['topics_per_page'], $start);
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
@@ -403,13 +403,13 @@ while ($row = $db->sql_fetchrow($result))
}
else
{
- $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
+ $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid('memberlist', 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
}
}
$db->sql_freeresult($result);
// Refreshing the page every 60 seconds...
-meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&amp;sk=$sort_key&amp;sd=$sort_dir&amp;start=$start"));
+meta_refresh(60, append_sid('viewonline', "sg=$show_guests&amp;sk=$sort_key&amp;sd=$sort_dir&amp;start=$start"));
// Send data to template
$template->assign_vars(array(
@@ -419,11 +419,11 @@ $template->assign_vars(array(
'PAGINATION' => $pagination,
'PAGE_NUMBER' => on_page($counter, $config['topics_per_page'], $start),
- 'U_SORT_USERNAME' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=a&amp;sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a') . '&amp;sg=' . ((int) $show_guests)),
- 'U_SORT_UPDATED' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=b&amp;sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a') . '&amp;sg=' . ((int) $show_guests)),
- 'U_SORT_LOCATION' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=c&amp;sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a') . '&amp;sg=' . ((int) $show_guests)),
+ 'U_SORT_USERNAME' => append_sid('viewonline', 'sk=a&amp;sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a') . '&amp;sg=' . ((int) $show_guests)),
+ 'U_SORT_UPDATED' => append_sid('viewonline', 'sk=b&amp;sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a') . '&amp;sg=' . ((int) $show_guests)),
+ 'U_SORT_LOCATION' => append_sid('viewonline', 'sk=c&amp;sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a') . '&amp;sg=' . ((int) $show_guests)),
- 'U_SWITCH_GUEST_DISPLAY' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sg=' . ((int) !$show_guests)),
+ 'U_SWITCH_GUEST_DISPLAY' => append_sid('viewonline', 'sg=' . ((int) !$show_guests)),
'L_SWITCH_GUEST_DISPLAY' => ($show_guests) ? $user->lang['HIDE_GUESTS'] : $user->lang['DISPLAY_GUESTS'],
'S_SWITCH_GUEST_DISPLAY' => ($config['load_online_guests']) ? true : false)
);
@@ -437,7 +437,7 @@ page_header($user->lang['WHO_IS_ONLINE']);
$template->set_filenames(array(
'body' => 'viewonline_body.html')
);
-make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
+make_jumpbox(append_sid('viewforum'));
page_footer();
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 357d49e91f..4ad1d05caf 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -12,11 +12,11 @@
* @ignore
*/
define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
-include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
+if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
+include(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
// Start session management
$user->session_begin();
@@ -255,7 +255,7 @@ if (!$topic_data)
// If post_id was submitted, we try at least to display the topic as a last resort...
if ($post_id && $forum_id && $topic_id)
{
- redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id"));
+ redirect(append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id"));
}
trigger_error('NO_TOPIC');
@@ -343,7 +343,7 @@ if (isset($_GET['e']))
{
$jump_to = request_var('e', 0);
- $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id");
+ $redirect_url = append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id");
if ($user->data['user_id'] == ANONYMOUS)
{
@@ -442,7 +442,7 @@ if ($start < 0 || $start > $total_posts)
}
// General Viewtopic URL for return links
-$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start&amp;$u_sort_param" . (($highlight_match) ? "&amp;hilit=$highlight" : ''));
+$viewtopic_url = append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;start=$start&amp;$u_sort_param" . (($highlight_match) ? "&amp;hilit=$highlight" : ''));
// Are we watching this topic?
$s_watching_topic = array(
@@ -516,7 +516,7 @@ $topic_mod .= ($allow_change_type && $auth->acl_get('f_announce', $forum_id) &&
$topic_mod .= ($auth->acl_get('m_', $forum_id)) ? '<option value="topic_logs">' . $user->lang['VIEW_TOPIC_LOGS'] . '</option>' : '';
// If we've got a hightlight set pass it on to pagination.
-$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;$u_sort_param" . (($highlight_match) ? "&amp;hilit=$highlight" : '')), $total_posts, $config['posts_per_page'], $start);
+$pagination = generate_pagination(append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;$u_sort_param" . (($highlight_match) ? "&amp;hilit=$highlight" : '')), $total_posts, $config['posts_per_page'], $start);
// Navigation links
generate_forum_nav($topic_data);
@@ -529,7 +529,7 @@ $forum_moderators = array();
get_moderators($forum_moderators, $forum_id);
// This is only used for print view so ...
-$server_path = (!$view) ? $phpbb_root_path : generate_board_url() . '/';
+$server_path = (!$view) ? PHPBB_ROOT_PATH : generate_board_url() . '/';
// Replace naughty words in title
$topic_data['topic_title'] = censor_text($topic_data['topic_title']);
@@ -550,7 +550,7 @@ $template->assign_vars(array(
'PAGINATION' => $pagination,
'PAGE_NUMBER' => on_page($total_posts, $config['posts_per_page'], $start),
'TOTAL_POSTS' => ($total_posts == 1) ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total_posts),
- 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=topic_view&amp;f=$forum_id&amp;t=$topic_id&amp;start=$start&amp;$u_sort_param", true, $user->session_id) : '',
+ 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid('mcp', "i=main&amp;mode=topic_view&amp;f=$forum_id&amp;t=$topic_id&amp;start=$start&amp;$u_sort_param", true, $user->session_id) : '',
'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : '',
'POST_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'FORUM_LOCKED') : $user->img('button_topic_new', 'POST_NEW_TOPIC'),
@@ -579,25 +579,25 @@ $template->assign_vars(array(
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true,
- 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start"),
+ 'S_TOPIC_ACTION' => append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;start=$start"),
'S_TOPIC_MOD' => ($topic_mod != '') ? '<select name="action" id="quick-mod-select">' . $topic_mod . '</select>' : '',
- 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;quickmod=1&amp;redirect=" . urlencode(str_replace('&amp;', '&', $viewtopic_url)), true, $user->session_id),
+ 'S_MOD_ACTION' => append_sid('mcp', "f=$forum_id&amp;t=$topic_id&amp;quickmod=1&amp;redirect=" . urlencode(str_replace('&amp;', '&', $viewtopic_url)), true, $user->session_id),
'S_VIEWTOPIC' => true,
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false,
- 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 't=' . $topic_id),
+ 'S_SEARCHBOX_ACTION' => append_sid('search', 't=' . $topic_id),
'S_DISPLAY_POST_INFO' => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
'S_DISPLAY_REPLY_INFO' => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
- 'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&amp;t=$topic_id",
+ 'U_TOPIC' => "{$server_path}viewtopic." . PHP_EXT . "?f=$forum_id&amp;t=$topic_id",
'U_FORUM' => $server_path,
'U_VIEW_TOPIC' => $viewtopic_url,
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
- 'U_VIEW_OLDER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=previous"),
- 'U_VIEW_NEWER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=next"),
+ 'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_id),
+ 'U_VIEW_OLDER_TOPIC' => append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;view=previous"),
+ 'U_VIEW_NEWER_TOPIC' => append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;view=next"),
'U_PRINT_TOPIC' => ($auth->acl_get('f_print', $forum_id)) ? $viewtopic_url . '&amp;view=print' : '',
- 'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&amp;t=$topic_id") : '',
+ 'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? append_sid('memberlist', "mode=email&amp;t=$topic_id") : '',
'U_WATCH_TOPIC' => $s_watching_topic['link'],
'L_WATCH_TOPIC' => $s_watching_topic['title'],
@@ -606,9 +606,9 @@ $template->assign_vars(array(
'U_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks']) ? $viewtopic_url . '&amp;bookmark=1' : '',
'L_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'],
- 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=post&amp;f=$forum_id") : '',
- 'U_POST_REPLY_TOPIC' => ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&amp;f=$forum_id&amp;t=$topic_id") : '',
- 'U_BUMP_TOPIC' => (bump_topic_allowed($forum_id, $topic_data['topic_bumped'], $topic_data['topic_last_post_time'], $topic_data['topic_poster'], $topic_data['topic_last_poster_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=bump&amp;f=$forum_id&amp;t=$topic_id") : '')
+ 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid('posting', "mode=post&amp;f=$forum_id") : '',
+ 'U_POST_REPLY_TOPIC' => ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid('posting', "mode=reply&amp;f=$forum_id&amp;t=$topic_id") : '',
+ 'U_BUMP_TOPIC' => (bump_topic_allowed($forum_id, $topic_data['topic_bumped'], $topic_data['topic_last_post_time'], $topic_data['topic_poster'], $topic_data['topic_last_poster_id'])) ? append_sid('posting', "mode=bump&amp;f=$forum_id&amp;t=$topic_id") : '')
);
// Does this topic contain a poll?
@@ -668,7 +668,7 @@ if (!empty($topic_data['poll_start']))
if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id))
{
- $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start");
+ $redirect_url = append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;start=$start");
meta_refresh(5, $redirect_url);
if (!sizeof($voted_id))
@@ -747,7 +747,7 @@ if (!empty($topic_data['poll_start']))
//, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now
$db->sql_query($sql);
- $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start");
+ $redirect_url = append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;start=$start");
meta_refresh(5, $redirect_url);
trigger_error($user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>'));
@@ -1059,20 +1059,20 @@ while ($row = $db->sql_fetchrow($result))
'user_colour' => $row['user_colour'],
'online' => false,
- 'profile' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&amp;u=$poster_id"),
+ 'profile' => append_sid('memberlist', "mode=viewprofile&amp;u=$poster_id"),
'www' => $row['user_website'],
- 'aim' => ($row['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=aim&amp;u=$poster_id") : '',
- 'msn' => ($row['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=msnm&amp;u=$poster_id") : '',
+ 'aim' => ($row['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', "mode=contact&amp;action=aim&amp;u=$poster_id") : '',
+ 'msn' => ($row['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', "mode=contact&amp;action=msnm&amp;u=$poster_id") : '',
'yim' => ($row['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($row['user_yim']) . '&amp;.src=pg' : '',
- 'jabber' => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=jabber&amp;u=$poster_id") : '',
- 'search' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'search_author=' . urlencode($row['username']) .'&amp;showresults=posts') : '',
+ 'jabber' => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', "mode=contact&amp;action=jabber&amp;u=$poster_id") : '',
+ 'search' => ($auth->acl_get('u_search')) ? append_sid('search', 'search_author=' . urlencode($row['username']) .'&amp;showresults=posts') : '',
);
get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email'))
{
- $user_cache[$poster_id]['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&amp;u=$poster_id") : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']);
+ $user_cache[$poster_id]['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid('memberlist', "mode=email&amp;u=$poster_id") : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']);
}
else
{
@@ -1117,7 +1117,7 @@ $db->sql_freeresult($result);
// Load custom profile fields
if ($config['load_cpf_viewtopic'])
{
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
$cp = new custom_profile();
// Grab all profile fields from users in id cache for later use - similar to the poster cache
@@ -1411,14 +1411,14 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
- 'U_EDIT' => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
- 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
- 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=post_details&amp;f=$forum_id&amp;p=" . $row['post_id'], true, $user->session_id) : '',
- 'U_DELETE' => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
+ 'U_EDIT' => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid('posting', "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
+ 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid('posting', "mode=quote&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
+ 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid('mcp', "i=main&amp;mode=post_details&amp;f=$forum_id&amp;p=" . $row['post_id'], true, $user->session_id) : '',
+ 'U_DELETE' => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? append_sid('posting', "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
'U_PROFILE' => $user_cache[$poster_id]['profile'],
'U_SEARCH' => $user_cache[$poster_id]['search'],
- 'U_PM' => ($poster_id != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_cache[$poster_id]['allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;action=quotepost&amp;p=' . $row['post_id']) : '',
+ 'U_PM' => ($poster_id != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_cache[$poster_id]['allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid('ucp', 'i=pm&amp;mode=compose&amp;action=quotepost&amp;p=' . $row['post_id']) : '',
'U_EMAIL' => $user_cache[$poster_id]['email'],
'U_WWW' => $user_cache[$poster_id]['www'],
'U_ICQ' => $user_cache[$poster_id]['icq'],
@@ -1427,14 +1427,14 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'U_YIM' => $user_cache[$poster_id]['yim'],
'U_JABBER' => $user_cache[$poster_id]['jabber'],
- 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $row['post_id']) : '',
- 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
- 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
- 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . (($topic_data['topic_type'] == POST_GLOBAL) ? '&amp;f=' . $forum_id : '') . '#p' . $row['post_id'],
+ 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? append_sid('report', 'f=' . $forum_id . '&amp;p=' . $row['post_id']) : '',
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
+ 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
+ 'U_MINI_POST' => append_sid('viewtopic', 'p=' . $row['post_id']) . (($topic_data['topic_type'] == POST_GLOBAL) ? '&amp;f=' . $forum_id : '') . '#p' . $row['post_id'],
'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$post_list[$i + 1]])) ? $rowset[$post_list[$i + 1]]['post_id'] : '',
'U_PREV_POST_ID' => $prev_post_id,
- 'U_NOTES' => ($auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $poster_id, true, $user->session_id) : '',
- 'U_WARN' => ($auth->acl_get('m_warn') && $poster_id != $user->data['user_id'] && $poster_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_post&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
+ 'U_NOTES' => ($auth->acl_getf_global('m_')) ? append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $poster_id, true, $user->session_id) : '',
+ 'U_WARN' => ($auth->acl_get('m_warn') && $poster_id != $user->data['user_id'] && $poster_id != ANONYMOUS) ? append_sid('mcp', 'i=warn&amp;mode=warn_post&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
'POST_ID' => $row['post_id'],
'POSTER_ID' => $poster_id,
@@ -1530,7 +1530,7 @@ if ($all_marked_read)
else if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id])
{
$template->assign_vars(array(
- 'U_VIEW_UNREAD_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
+ 'U_VIEW_UNREAD_POST' => append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
));
}
}
@@ -1548,7 +1548,7 @@ else if (!$all_marked_read)
else if (!$last_page)
{
$template->assign_vars(array(
- 'U_VIEW_UNREAD_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
+ 'U_VIEW_UNREAD_POST' => append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
));
}
}
@@ -1567,7 +1567,7 @@ page_header($user->lang['VIEW_TOPIC'] .' - ' . $topic_data['topic_title']);
$template->set_filenames(array(
'body' => ($view == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html')
);
-make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id);
+make_jumpbox(append_sid('viewforum'), $forum_id);
page_footer();