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:
*
*
*/
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('&', '&', $redirect);
+ return PHPBB_ROOT_PATH . str_replace('&', '&', $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 & for user->page (user->page is always using &)
- $use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&', $user->page['page']);
+ $use_page = ($u_action) ? PHPBB_ROOT_PATH . $u_action : PHPBB_ROOT_PATH . str_replace('&', '&', $user->page['page']);
$u_action = reapply_sid($use_page);
$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&') . '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' => '
',
'L_LOGIN_CONFIRM_EXPLAIN' => sprintf($user->lang['LOGIN_CONFIRM_EXPLAIN'], '
'),
));
@@ -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']) ? '
' : ''
@@ -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 = '
';
$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 '
[phpBB Debug] PHP Notice : in file
' . $errfile . ' on line
' . $errline . ' :
' . $msg_text . ' ' . "\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'], '
', ' ');
+ $l_return_index = sprintf($user->lang['RETURN_INDEX'], '
', ' ');
$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 = '
Return to index page ';
+ $l_return_index = '
Return to index page ';
$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&folder=inbox'),
- 'U_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'),
- 'U_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup'),
- 'UA_POPUP_PM' => addslashes(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&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&folder=inbox'),
+ 'U_RETURN_INBOX' => append_sid('ucp', 'i=pm&folder=inbox'),
+ 'U_POPUP_PM' => append_sid('ucp', 'i=pm&mode=popup'),
+ 'UA_POPUP_PM' => addslashes(append_sid('ucp', 'i=pm&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&id=" . $user->theme['style_id'] . '&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&id=" . $user->theme['style_id'] . '&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', '
');
+ $template->assign_var('RUN_CRON_TASK', '
');
}
}
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&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&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']] . '&t=' . $row['topic_id']) : false;
- $log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&mode=topic_logs&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']] . '&t=' . $row['topic_id']) : false;
+ $log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid('mcp', 'i=logs&mode=topic_logs&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('#
', $text);
+ return preg_replace('#
', $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 = '
';
+ $upload_icon = '
';
}
}
@@ -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 .= '&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'] . '&t=1');
+ $thumbnail_link = append_sid('download/file', 'id=' . $attachment['attach_id'] . '&t=1');
$download_link .= '&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 . '&u=' . (int) $user_id : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id);
+ $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : append_sid('memberlist', 'mode=viewprofile&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']) ? '
' : '',
- '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']) ? '
' : '',
+ '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'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
+ $last_post_url = append_sid('viewtopic', 'f=' . $row['forum_id_last_post'] . '&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']) ? '
' : '',
- 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
+ 'FORUM_IMAGE' => ($row['forum_image']) ? '
' : '',
+ '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'] . '&mark=forums') : '',
+ 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid('viewforum', 'f=' . $root_data['forum_id'] . '&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']][] = '
' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ' ';
+ $forum_moderators[$row['forum_id']][] = '
' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ' ';
}
}
$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&start=$start");
+ $redirect_url = append_sid("view$mode", "$u_url=$match_id&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&start=$start");
+ $redirect_url = append_sid("view$mode", "$u_url=$match_id&start=$start");
meta_refresh(3, $redirect_url);
$message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '
' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '
', ' ');
@@ -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&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start");
+ $s_watching['link'] = append_sid("view$mode", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&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'])) ? '
' : '';
- $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'])) ? '
' : '';
+ $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'])) ? '
' : '';
- $rank_img_src = (!empty($rank['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image'] : '';
+ $rank_img = (!empty($rank['rank_image'])) ? '
' : '';
+ $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
*/
/**
@@ -16,11 +17,17 @@ if (!defined('IN_PHPBB'))
exit;
}
+/**
+* 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())
@@ -498,11 +505,68 @@ 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) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
+ $this->module->u_action = append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&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) ? '&icat=' . $icat : '') . "&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&f=' . $forum_id))
+ 'U_MORE_SMILIES' => append_sid('posting', 'mode=smilies&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 .= '
';
}
- $download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $user->session_id : false);
+ $download_link = append_sid('download/file', 'mode=view&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 . '&t=' . $draft['topic_id']);
+ $view_url = append_sid('viewtopic', 'f=' . $topic_forum_id . '&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 . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']);
+ $insert_url = append_sid('posting', 'f=' . $topic_forum_id . '&t=' . $draft['topic_id'] . '&mode=reply&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'] . '&mode=post&d=' . $draft['draft_id']);
+ $insert_url = append_sid('posting', 'f=' . $draft['forum_id'] . '&mode=post&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&mode=compose&d={$draft['draft_id']}");
+ $insert_url = append_sid('ucp', "i=$id&mode=compose&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&mode=post_details&f=' . $forum_id . '&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&mode=post_details&f=' . $forum_id . '&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 .= '&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&folder=' . $f_id) : append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $folder_id_name),
+ 'U_FOLDER' => ($f_id > 0) ? append_sid('ucp', 'i=pm&folder=' . $f_id) : append_sid('ucp', 'i=pm&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']) . '
';
- $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '
', ' ', $row['folder_name']);
+ $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '
', ' ', $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']) . '
';
- $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '
', ' ', $user->lang['PM_INBOX']);
+ $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '
', ' ', $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&folder=' . $cur_folder_id);
+ $redirect = append_sid('ucp', 'i=pm&folder=' . $cur_folder_id);
meta_refresh(3, $redirect);
trigger_error($user->lang[$success_msg] . '
' . sprintf($user->lang['RETURN_FOLDER'], '
', ' '));
@@ -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&g=' . $id),
+ 'U_VIEW' => append_sid('memberlist', 'mode=group&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') . '&folder=';
+ $folder_url = append_sid('ucp', 'i=pm') . '&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&form=mcp_ban&field=ban'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=mcp_ban&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']) ? '&p=' . $GLOBALS['post_id'] : '';
$url_extra .= ($GLOBALS['user_id']) ? '&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&mode=forum_logs&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&mode=forum_logs&f=' . $forum_id) : '',
'S_MCP_ACTION' => $url . "&i=$id&forum_action=$action&mode=$mode&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&f=$forum_id&topic_id_list[]={$row['topic_id']}&mode=forum_view&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&f=$forum_id&topic_id_list[]={$row['topic_id']}&mode=forum_view&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 . "&i=$id&mode=topic_view&action=merge&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&f=$forum_id&t={$row['topic_id']}&mode=topic_view"),
+ 'U_VIEW_TOPIC' => append_sid('mcp', "i=$id&f=$forum_id&t={$row['topic_id']}&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&mode=topic_view&t=' . $row['topic_id'] . '&action=reports') : '',
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid('mcp', 'i=main&mode=topic_view&t=' . $row['topic_id'] . '&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) ? '
' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '
', ' ');
+ $return_link .= (($return_link) ? '
' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '
', ' ');
}
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&t=$to_topic_id"));
+ meta_refresh(3, append_sid('viewtopic', "f=$to_forum_id&t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '
' . $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&mode=approve_details&f=' . $row['forum_id'] . '&p=' . $row['post_id']),
- 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view&f=' . $row['forum_id']) : '',
- 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&f=' . $row['forum_id'] . '&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'] . '&t=' . $row['topic_id']),
- 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['poster_id']),
+ 'U_POST_DETAILS' => append_sid('mcp', 'i=queue&mode=approve_details&f=' . $row['forum_id'] . '&p=' . $row['post_id']),
+ 'U_MCP_FORUM' => (!$global_topic) ? append_sid('mcp', 'i=main&mode=forum_view&f=' . $row['forum_id']) : '',
+ 'U_MCP_TOPIC' => append_sid('mcp', 'i=main&mode=topic_view&f=' . $row['forum_id'] . '&t=' . $row['topic_id']),
+ 'U_FORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_TOPIC' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']),
+ 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid('memberlist', 'mode=viewprofile&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'] . '&p=' . $row['post_id'] . "&i=reports&mode=report_details"),
- 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&i=$id&mode=forum_view") : '',
- 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . "&i=$id&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'] . '&t=' . $row['topic_id']),
+ 'U_POST_DETAILS' => append_sid('mcp', 'f=' . $row['forum_id'] . '&p=' . $row['post_id'] . "&i=reports&mode=report_details"),
+ 'U_MCP_FORUM' => (!$global_topic) ? append_sid('mcp', 'f=' . $row['forum_id'] . "&i=$id&mode=forum_view") : '',
+ 'U_MCP_TOPIC' => append_sid('mcp', 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . "&i=$id&mode=topic_view"),
+ 'U_FORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_TOPIC' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&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&mode=forum_view'), 0, false, 'm_', true);
+ $template->assign_var('S_MCP_ACTION', append_sid('mcp'));
+ make_jumpbox(append_sid('mcp', 'i=main&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 .= '
' . sprintf($user->lang['RETURN_PAGE'], '
', ' ');
- $message .= '
' . sprintf($user->lang['RETURN_FORUM'], '
', ' ');
- $message .= '
' . sprintf($user->lang['RETURN_NEW_FORUM'], '
', ' ');
+ $message .= '
' . sprintf($user->lang['RETURN_FORUM'], '
', ' ');
+ $message .= '
' . sprintf($user->lang['RETURN_NEW_FORUM'], '
', ' ');
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] . '
' . sprintf($user->lang['RETURN_FORUM'], '
', ' '));
}
@@ -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'], '
', ' ');
+ $return_link[] = sprintf($user->lang['RETURN_TOPIC'], '
', ' ');
}
- $return_link[] = sprintf($user->lang['RETURN_FORUM'], '
', ' ');
+ $return_link[] = sprintf($user->lang['RETURN_FORUM'], '
', ' ');
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'], '
', ' ');
if ($forum_id != $to_forum_id)
{
- $return_link .= '
' . sprintf($user->lang['RETURN_NEW_FORUM'], '
', ' ');
+ $return_link .= '
' . sprintf($user->lang['RETURN_NEW_FORUM'], '
', ' ');
}
trigger_error($user->lang[$success_msg] . '
' . $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&form=mcp&field=username&select_single=true'),
- 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=mcp&field=username&select_single=true'),
+ 'U_POST_ACTION' => append_sid('mcp', 'i=notes&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'], '
', ' '),
- 'U_RETURN_POST' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&p=$post_id"),
+ 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '
', ' '),
+ 'U_RETURN_POST' => append_sid('mcp', "i=$id&mode=$mode&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&i=main&quickmod=1", // Use this for mode paramaters
'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters
- 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f={$post_info['forum_id']}"),
+ 'U_APPROVE_ACTION' => append_sid('mcp', "i=queue&p=$post_id&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&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '',
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username&select_single=true'),
- 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
- 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']),
- 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '',
- 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&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'] . '&t=' . $post_info['topic_id']),
+ 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid('posting', "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '',
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=mcp_chgposter&field=username&select_single=true'),
+ 'U_MCP_APPROVE' => append_sid('mcp', 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
+ 'U_MCP_USER_NOTES' => append_sid('mcp', 'i=notes&mode=user_notes&u=' . $post_info['user_id']),
+ 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '',
+ 'U_VIEW_POST' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&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'], '
", ' '),
- 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '
', ' '),
+ 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '
", ' '),
+ 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '
', ' '),
'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&i=$id&mode=$mode&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&mode=$mode&action=whois&p=$post_id&ip={$post_info['poster_ip']}") : '',
+ 'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid('mcp', "i=$id&mode=$mode&action=whois&p=$post_id&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&u=' . $row['user_id']) : '',
+ 'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? append_sid('memberlist', 'mode=viewprofile&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&u=' . $user_id),
- 'U_SEARCHPOSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user_id . '&sr=topics'))
+ 'U_PROFILE' => ($user_id == ANONYMOUS) ? '' : append_sid('memberlist', 'mode=viewprofile&u=' . $user_id),
+ 'U_SEARCHPOSTS' => append_sid('search', 'author_id=' . $user_id . '&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&i=$id&mode=post_details&rdns={$row['poster_ip']}#ip",
- 'U_WHOIS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&action=whois&p=$post_id&ip={$row['poster_ip']}"))
+ 'U_WHOIS' => append_sid('mcp', "i=$id&mode=$mode&action=whois&p=$post_id&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'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']);
- $topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']);
+ $post_url = append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']);
+ $topic_url = append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&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&p=$post_id&f=$forum_id"),
+ 'U_APPROVE_ACTION' => append_sid('mcp', "i=queue&p=$post_id&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&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '',
- 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
- 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']),
- 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '',
+ 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid('posting', "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '',
+ 'U_MCP_APPROVE' => append_sid('mcp', 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
+ 'U_MCP_USER_NOTES' => append_sid('mcp', 'i=notes&mode=user_notes&u=' . $post_info['user_id']),
+ 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&mode=warn_user&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'], '
", ' '),
+ 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '
", ' '),
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '
', ' '),
'RETURN_TOPIC_SIMPLE' => sprintf($user->lang['RETURN_TOPIC_SIMPLE'], '
', ' '),
'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&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id . '&lookup=' . $post_info['poster_ip']) . '#ip' : '',
+ 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid('mcp', 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id . '&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'] . '&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'] . '&p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
- 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&start=$start&mode=approve_details&f={$row['forum_id']}&p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&t={$row['topic_id']}" : '')),
+ 'U_TOPIC' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']),
+ 'U_VIEWFORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_VIEWPOST' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
+ 'U_VIEW_DETAILS' => append_sid('mcp', "i=queue&start=$start&mode=approve_details&f={$row['forum_id']}&p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&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']}&t={$post_data['topic_id']}&p={$post_data['post_id']}") . '#p' . $post_data['post_id'];
+ $post_url = append_sid('viewtopic', "f={$post_data['forum_id']}&t={$post_data['topic_id']}&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&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
+ 'S_CLOSE_ACTION' => append_sid('mcp', 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&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&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '',
- 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
- 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $report['user_id']),
- 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']),
- 'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $report['user_id']) : '',
- 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '',
- 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&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'] . '&t=' . $post_info['topic_id']),
+ 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid('posting', "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '',
+ 'U_MCP_APPROVE' => append_sid('mcp', 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id),
+ 'U_MCP_REPORTER_NOTES' => append_sid('mcp', 'i=notes&mode=user_notes&u=' . $report['user_id']),
+ 'U_MCP_USER_NOTES' => append_sid('mcp', 'i=notes&mode=user_notes&u=' . $post_info['user_id']),
+ 'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&mode=warn_user&u=' . $report['user_id']) : '',
+ 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '',
+ 'U_VIEW_POST' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&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'], '
', ' '),
+ 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '
', ' '),
'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'] . '&p=' . $row['post_id']) . '#p' . $row['post_id'],
- 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&start=$start&mode=report_details&f={$row['forum_id']}&r={$row['report_id']}"),
+ 'U_VIEWFORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_VIEWPOST' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&p=' . $row['post_id']) . '#p' . $row['post_id'],
+ 'U_VIEW_DETAILS' => append_sid('mcp', "i=reports&start=$start&mode=report_details&f={$row['forum_id']}&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'], '
', ' ') . '
';
+ $return_forum = sprintf($user->lang['RETURN_FORUM'], '
', ' ') . '
';
}
$return_topic = '';
if (sizeof($topic_ids == 1))
{
- $return_topic = sprintf($user->lang['RETURN_TOPIC'], '
', ' ') . '
';
+ $return_topic = sprintf($user->lang['RETURN_TOPIC'], '
', ' ') . '
';
}
trigger_error($user->lang[$success_msg] . '
' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "
", ' '));
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'], '
', ' '),
+ 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '
', ' '),
'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&i=$id&p={$row['post_id']}&mode=post_details" . (($forum_id) ? "&f=$forum_id" : ''),
- 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $topic_info['forum_id'] . '&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&mode=report_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id']) : '')
+ 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid('mcp', 'i=queue&mode=approve_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id']) : '',
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid('mcp', 'i=reports&mode=report_details&f=' . $topic_info['forum_id'] . '&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'] . '&t=' . $topic_info['topic_id']),
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', 'f=' . $topic_info['forum_id'] . '&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, '
' . $to_topic_info['topic_title'] . ' ') : '',
+ 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '
' . $to_topic_info['topic_title'] . ' ') : '',
'SPLIT_SUBJECT' => $subject,
'POSTS_PER_PAGE' => $posts_per_page,
@@ -314,11 +313,11 @@ function mcp_topic_view($id, $mode, $action)
'U_SELECT_TOPIC' => "$url&i=$id&mode=forum_view&action=merge_select" . (($forum_id) ? "&f=$forum_id" : ''),
- 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '
', ' '),
- 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '
', ' '),
+ 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '
', ' '),
+ 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '
', ' '),
'PAGE_NUMBER' => on_page($total, $posts_per_page, $start),
- 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&t={$topic_info['topic_id']}&mode=$mode&action=$action&to_topic_id=$to_topic_id&posts_per_page=$posts_per_page&st=$sort_days&sk=$sort_key&sd=$sort_dir"), $total, $posts_per_page, $start),
+ 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid('mcp', "i=$id&t={$topic_info['topic_id']}&mode=$mode&action=$action&to_topic_id=$to_topic_id&posts_per_page=$posts_per_page&st=$sort_days&sk=$sort_key&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'], '
', ' ') . '
' . sprintf($user->lang['RETURN_NEW_TOPIC'], '
', ' ');
+ $return_link = sprintf($user->lang['RETURN_TOPIC'], '
', ' ') . '
' . sprintf($user->lang['RETURN_NEW_TOPIC'], '
', ' ');
}
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&t=$to_topic_id"));
+ meta_refresh(3, append_sid('viewtopic', "f=$to_forum_id&t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '
' . $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'], '
', ' ');
+ $return_link .= sprintf($user->lang['RETURN_TOPIC'], '
', ' ');
}
else
{
@@ -598,14 +597,14 @@ function merge_posts($topic_id, $to_topic_id)
}
// Link to the new topic
- $return_link .= (($return_link) ? '
' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '
', ' ');
+ $return_link .= (($return_link) ? '
' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '
', ' ');
}
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&t=$to_topic_id"));
+ meta_refresh(3, append_sid('viewtopic', "f=$to_forum_id&t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '
' . $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&form=mcp&field=username&select_single=true'),
- 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=mcp&field=username&select_single=true'),
+ 'U_POST_ACTION' => append_sid('mcp', 'i=warn&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&mode=user_notes&u=' . $row['user_id']),
+ 'U_NOTES' => append_sid('mcp', 'i=notes&mode=user_notes&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&u=' . $row['user_id']),
+ 'U_USER' => append_sid('memberlist', 'mode=viewprofile&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&mode=user_notes&u=' . $row['user_id']),
+ 'U_NOTES' => append_sid('mcp', 'i=notes&mode=user_notes&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&u=' . $row['user_id']),
+ 'U_USER' => append_sid('memberlist', 'mode=viewprofile&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&mode=user_notes&u=' . $row['user_id']),
+ 'U_NOTES' => append_sid('mcp', 'i=notes&mode=user_notes&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&u=' . $row['user_id']),
+ 'U_USER' => append_sid('memberlist', 'mode=viewprofile&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&mode=list&st=$st&sk=$sk&sd=$sd"), $user_count, $config['topics_per_page'], $start),
+ 'PAGINATION' => generate_pagination(append_sid('mcp', "i=warn&mode=list&st=$st&sk=$sk&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&mode=user_notes&u=$user_id");
+ $redirect = append_sid('mcp', "i=notes&mode=user_notes&u=$user_id");
meta_refresh(2, $redirect);
trigger_error($user->lang['USER_WARNING_ADDED'] . '
' . sprintf($user->lang['RETURN_PAGE'], '
', ' '));
}
@@ -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&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&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&mode=user_notes&u=$user_id");
+ $redirect = append_sid('mcp', "i=notes&mode=user_notes&u=$user_id");
meta_refresh(2, $redirect);
trigger_error($msg . '
' . sprintf($user->lang['RETURN_PAGE'], '
', ' '));
}
@@ -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&mode=reg_details'));
+ redirect(append_sid('ucp', 'i=profile&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&p={$row['post_msg_id']}");
+ $view_topic = append_sid('ucp', "i=pm&p={$row['post_msg_id']}");
}
else
{
- $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}") . "#p{$row['post_msg_id']}";
+ $view_topic = append_sid('viewtopic', "t={$row['topic_id']}&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&g=' . $row['group_id']),
+ 'U_VIEW_GROUP' => append_sid('memberlist', 'mode=group&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&g=' . $row['group_id']),
+ 'U_VIEW_GROUP' => append_sid('memberlist', 'mode=group&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') : '
';
+ $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') : '
';
$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&name=group_colour'),
+ 'U_SWATCH' => append_sid(CONFIG_ADM_FOLDER . '/swatch', 'form=ucp&name=group_colour'),
'S_UCP_ACTION' => $this->u_action . "&action=$action&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 . "&action=$action&g=$group_id", $total_members, $config['topics_per_page'], $start),
'U_ACTION' => $this->u_action . "&g=$group_id",
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=usernames'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=ucp&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&t=$topic_id&p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
+ 'U_LAST_POST' => append_sid('viewtopic', "f=$g_forum_id&t=$topic_id&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&t=$topic_id&view=unread") . '#unread',
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&t=$topic_id"))
+ 'U_NEWEST_POST' => append_sid('viewtopic', "f=$g_forum_id&t=$topic_id&view=unread") . '#unread',
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', "f=$g_forum_id&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'] . '&sr=posts') : '',
+ 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid('search', 'author_id=' . $user->data['user_id'] . '&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 . '
' . sprintf($user->lang['RETURN_UCP'], '
', ' ');
- meta_refresh(3, append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=subscribed"));
+ $message = $msg . '
' . sprintf($user->lang['RETURN_UCP'], '
', ' ');
+ meta_refresh(3, append_sid('ucp', "i=$id&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&p=" . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
+ $last_post_url = append_sid('viewtopic', "f=$forum_id&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']) ? '
' : '',
- 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
+ 'FORUM_IMAGE' => ($row['forum_image']) ? '
' : '',
+ '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'] . '&t=' . $draft['topic_id']);
+ $view_url = append_sid('viewtopic', 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&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'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']);
+ $insert_url = append_sid('posting', 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&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'] . '&mode=post&d=' . $draft['draft_id']);
+ $insert_url = append_sid('posting', 'f=' . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']);
}
else if ($pm_drafts)
{
$link_pm = true;
- $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&d=" . $draft['draft_id']);
+ $insert_url = append_sid('ucp', "i=$id&mode=compose&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&t=$topic_id");
+ $view_topic_url = append_sid('viewtopic', "f=$forum_id&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) . "&t=$topic_id")),
+ 'PAGINATION' => topic_generate_pagination($replies, append_sid('viewtopic', 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&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&t=$topic_id&view=unread") . '#unread',
+ 'U_NEWEST_POST' => append_sid('viewtopic', "f=$forum_id&t=$topic_id&view=unread") . '#unread',
'U_LAST_POST' => $view_topic_url . '&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'], '
', ' '),
- 'U_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&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'], '
', ' '),
+ 'U_INBOX' => append_sid('ucp', 'i=pm&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&mode=view&action=view_message&p=' . $msg_id));
+ redirect(append_sid('ucp', 'i=pm&mode=view&action=view_message&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&form=postform&field=username_list&select_single=$select_single"),
+ 'U_FIND_USERNAME' => append_sid('memberlist', "mode=searchuser&form=postform&field=username_list&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&mode=$mode&action=$action", true, $user->session_id);
+ $s_action = append_sid('ucp', "i=$id&mode=$mode&action=$action", true, $user->session_id);
$s_action .= ($msg_id) ? "&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&folder=$folder_id");
+ $meta_info = append_sid('ucp', "i=pm&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&mode=compose"
+ // "ucp.php?i=pm&mode=compose"
confirm_box(false, 'DELETE_MESSAGE', build_hidden_fields($s_hidden_fields));
}
- redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=view&action=view_message&p=' . $msg_id));
+ redirect(append_sid('ucp', 'i=pm&mode=view&action=view_message&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&mode=$mode");
+ $redirect_url = append_sid('ucp', "i=pm&mode=$mode");
meta_refresh(3, $redirect_url);
$message = $user->lang['DRAFT_SAVED'] . '
' . sprintf($user->lang['RETURN_UCP'], '
', ' ');
@@ -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&mode=view&p=' . $msg_id);
- $return_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=outbox');
+ $return_message_url = append_sid('ucp', 'i=pm&mode=view&p=' . $msg_id);
+ $return_folder_url = append_sid('ucp', 'i=pm&folder=outbox');
meta_refresh(3, $return_message_url);
$message = $user->lang['MESSAGE_STORED'] . '
' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '
', ' ') . '
' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '
', ' ', $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&u={$post['author_id']}]{$quote_username}[/url]";
+ $quote_username_text = '[url=' . generate_board_url() . '/memberlist.' . PHP_EXT . "?mode=viewprofile&u={$post['author_id']}]{$quote_username}[/url]";
}
else
{
- $quote_username_text = $quote_username . ' (' . generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$post['author_id']})";
+ $quote_username_text = $quote_username . ' (' . generate_board_url() . '/memberlist.' . PHP_EXT . "?mode=viewprofile&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&g=' . $id),
+ 'U_VIEW' => append_sid('memberlist', 'mode=group&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'], '
', ' ') : sprintf($user->lang['BBCODE_IS_OFF'], '
', ' '),
+ 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '
', ' ') : sprintf($user->lang['BBCODE_IS_OFF'], '
', ' '),
'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&mode=popup'),
- 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&mode=popup')),
+ 'U_PROGRESS_BAR' => append_sid('posting', 'f=0&mode=popup'),
+ 'UA_PROGRESS_BAR' => addslashes(append_sid('posting', 'f=0&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&mode=options");
+ $redirect_url = append_sid('ucp', "i=pm&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&mode=$mode");
+ $meta_info = append_sid('ucp', "i=pm&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&mode=' . $mode));
+ redirect(append_sid('ucp', 'i=pm&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&mode=' . $mode);
+ $meta_info = append_sid('ucp', 'i=pm&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&form=ucp&field=rule_string&select_single=true'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=ucp&field=rule_string&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 = '
';
+ $link = ' ';
$address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? ' ' : '');
}
}
@@ -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&mode=view&f=$folder_id&p=$message_id");
- $remove_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&action=delete&p=$message_id");
+ $view_message_url = append_sid('ucp', "i=$id&mode=view&f=$folder_id&p=$message_id");
+ $remove_message_url = append_sid('ucp', "i=$id&mode=compose&action=delete&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']])) ? '
' : '',
'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&mode=view&action=view_folder&f=$folder_id&$u_sort_param"), $pm_count, $config['topics_per_page'], $start),
+ 'PAGINATION' => generate_pagination(append_sid('ucp', "i=pm&mode=view&action=view_folder&f=$folder_id&$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&mode=compose') : '',
- 'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id"))
+ 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid('ucp', 'i=pm&mode=compose') : '',
+ 'S_PM_ACTION' => append_sid('ucp', "i=pm&mode=view&action=view_folder&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&folder=$folder_id");
+ $meta_info = append_sid('ucp', "i=pm&folder=$folder_id");
$message = $user->lang['NO_AUTH_READ_REMOVED_MESSAGE'];
$message .= '
' . sprintf($user->lang['RETURN_FOLDER'], '
', ' ');
@@ -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&mode=compose&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&mode=compose&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&action=aim&u=' . $author_id) : '',
+ 'U_AIM' => ($user_info['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&action=aim&u=' . $author_id) : '',
'U_YIM' => ($user_info['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($user_info['user_yim']) . '&.src=pg' : '',
- 'U_MSN' => ($user_info['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=msnm&u=' . $author_id) : '',
- 'U_JABBER' => ($user_info['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $author_id) : '',
+ 'U_MSN' => ($user_info['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&action=msnm&u=' . $author_id) : '',
+ 'U_JABBER' => ($user_info['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&action=jabber&u=' . $author_id) : '',
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&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&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&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] . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
+ meta_refresh(5, append_sid('index'));
+ $message = $user->lang[$message] . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
// 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'], '
', ' ') : sprintf($user->lang['BBCODE_IS_OFF'], '
', ' '),
+ 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '
', ' ') : sprintf($user->lang['BBCODE_IS_OFF'], '
', ' '),
'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&mode=avatar&display_gallery=1'),
+ 'U_GALLERY' => append_sid('ucp', 'i=profile&mode=avatar&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&coppa=0' . $add_lang),
- 'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1' . $add_lang),
+ 'U_COPPA_NO' => append_sid('ucp', 'mode=register&coppa=0' . $add_lang),
+ 'U_COPPA_YES' => append_sid('ucp', 'mode=register&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 . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
+ $message = $message . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
trigger_error($message);
}
}
@@ -501,7 +501,7 @@ class ucp_register
);
$db->sql_query($sql);
}
- $confirm_image = '
';
+ $confirm_image = '
';
$s_hidden_fields .= '
';
}
@@ -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'] . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
+ $message = $user->lang['PASSWORD_UPDATED'] . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
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 .= '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
+ $message .= '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
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&form=ucp&field=add'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=ucp&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 != '') ? ', ' : '') . '
' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ' ';
+ $legend .= (($legend != '') ? ', ' : '') . '
' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ' ';
}
}
$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&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&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
-
" class="button1">
+
" class="button1">
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('&', '&', $code);
- $new_code = str_replace('<', '<', $new_code);
- $new_code = str_replace('>', '>', $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'));
- }
-
+ default:
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);
- }
- }
-
- 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&language=' . $language)),
+ 'BODY' => sprintf($lang['BOARD_NOT_INSTALLED_EXPLAIN'], append_sid('install/index', 'mode=install&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']) ? '
' : '';
@@ -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']) ? '
' : '';
@@ -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']) ? '
' : '';
@@ -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&language=' . $data['language']), '../docs/README.html'),
+ 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], $config['version'], append_sid('install/index', 'mode=convert&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&language=' . $user->data['user_lang']),
+ 'U_DB_UPDATE' => append_sid('install/database_update', 'type=1&language=' . $user->data['user_lang']),
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"),
'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&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&mode=forum_view&f=$forum_id") : '',
- 'U_MCP_TOPIC' => ($forum_id && $topic_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&t=$topic_id") : '',
- 'U_MCP_POST' => ($forum_id && $topic_id && $post_id) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&t=$topic_id&p=$post_id") : '',
+ 'U_MCP' => append_sid('mcp', 'i=main'),
+ 'U_MCP_FORUM' => ($forum_id) ? append_sid('mcp', "i=main&mode=forum_view&f=$forum_id") : '',
+ 'U_MCP_TOPIC' => ($forum_id && $topic_id) ? append_sid('mcp', "i=main&mode=topic_view&t=$topic_id") : '',
+ 'U_MCP_POST' => ($forum_id && $topic_id && $post_id) ? append_sid('mcp', "i=main&mode=post_details&t=$topic_id&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&g=' . $row['group_id']);
+ $u_group = append_sid('memberlist', 'mode=group&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&mode=compose&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&mode=compose&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&action=$action&u=$user_id");
+ $s_action = append_sid('memberlist', "mode=contact&action=$action&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&mode=overview&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&u={$user_id}") : '',
+ 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid(CONFIG_ADM_FOLDER . '/index', 'i=users&mode=overview&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&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&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
- 'U_ADD_FOE' => (!$foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
- 'U_REMOVE_FRIEND' => ($friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '',
- 'U_REMOVE_FOE' => ($foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&mode=foes&usernames[]=' . $user_id) : '',
+ 'U_ADD_FRIEND' => (!$friend) ? append_sid('ucp', 'i=zebra&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
+ 'U_ADD_FOE' => (!$foe) ? append_sid('ucp', 'i=zebra&mode=foes&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
+ 'U_REMOVE_FRIEND' => ($friend) ? append_sid('ucp', 'i=zebra&remove=1&usernames[]=' . $user_id) : '',
+ 'U_REMOVE_FOE' => ($foe) ? append_sid('ucp', 'i=zebra&remove=1&mode=foes&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'], '
', ' ') : sprintf($user->lang['RETURN_TOPIC'], '
', ' ');
+ meta_refresh(3, append_sid('index'));
+ $message = ($user_id) ? sprintf($user->lang['RETURN_INDEX'], '
', ' ') : sprintf($user->lang['RETURN_TOPIC'], '
', ' ');
trigger_error($user->lang['EMAIL_SENT'] . '
' . $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&u=' . $user_id))
+ 'S_POST_ACTION' => append_sid('memberlist', 'mode=email&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&t=' . $topic_id))
+ 'S_POST_ACTION' => append_sid('memberlist', 'mode=email&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&mode=compose&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&mode=compose&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('&', $params));
+ $u_hide_find_member = append_sid('memberlist', implode('&', $params));
$params[] = "mode=$mode";
$sort_params[] = "mode=$mode";
- $pagination_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&', $params));
- $sort_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&', $sort_params));
+ $pagination_url = append_sid('memberlist', implode('&', $params));
+ $sort_url = append_sid('memberlist', implode('&', $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&form=$form&field=$field"))
+ 'S_USER_SEARCH_ACTION' => append_sid('memberlist', "mode=searchuser&form=$form&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&u=' . $user_id))
+ 'U_VIEW_PROFILE' => append_sid('memberlist', 'mode=viewprofile&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 . '&sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),
'U_SORT_FROM' => $sort_url . '&sk=b&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&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&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'])) ? '
' : '',
'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&sr=posts") : '',
- 'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '',
- 'U_WARN' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&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&mode=compose&u=' . $user_id) : '',
+ 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid('search', "author_id=$user_id&sr=posts") : '',
+ 'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid('mcp', 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '',
+ 'U_WARN' => $auth->acl_get('m_warn') ? append_sid('mcp', 'i=warn&mode=warn_user&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&mode=compose&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&action=aim&u=' . $user_id) : '',
+ 'U_AIM' => ($data['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&action=aim&u=' . $user_id) : '',
'U_YIM' => ($data['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($data['user_yim']) . '&.src=pg' : '',
- 'U_MSN' => ($data['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=msnm&u=' . $user_id) : '',
- 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $user_id) : '',
+ 'U_MSN' => ($data['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&action=msnm&u=' . $user_id) : '',
+ 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', 'mode=contact&action=jabber&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&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}";
+ $meta_url = append_sid('viewtopic', "f=$forum_id&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}";
meta_refresh(3, $meta_url);
$message = $user->lang['TOPIC_BUMPED'] . '
' . sprintf($user->lang['VIEW_MESSAGE'], '
', ' ');
- $message .= '
' . sprintf($user->lang['RETURN_FORUM'], '
', ' ');
+ $message .= '
' . sprintf($user->lang['RETURN_FORUM'], '
', ' ');
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&t=$topic_id");
+ $meta_info = ($mode == 'post') ? append_sid('viewforum', 'f=' . $forum_id) : append_sid('viewtopic', "f=$forum_id&t=$topic_id");
meta_refresh(3, $meta_info);
$message = $user->lang['DRAFT_SAVED'] . '
';
$message .= ($mode != 'post') ? sprintf($user->lang['RETURN_TOPIC'], '
', ' ') . '
' : '';
- $message .= sprintf($user->lang['RETURN_FORUM'], '
', ' ');
+ $message .= sprintf($user->lang['RETURN_FORUM'], '
', ' ');
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] . '
' . sprintf($user->lang['VIEW_MESSAGE'], '
', ' ');
}
- $message .= '
' . sprintf($user->lang['RETURN_FORUM'], '
', ' ');
+ $message .= '
' . sprintf($user->lang['RETURN_FORUM'], '
', ' ');
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&f=$forum_id", true, $user->session_id);
+$s_action = append_sid('posting', "mode=$mode&f=$forum_id", true, $user->session_id);
$s_action .= ($topic_id) ? "&t=$topic_id" : '';
$s_action .= ($post_id) ? "&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' => '
',
+ 'CONFIRM_IMAGE' => '
',
'L_POST_CONFIRM_EXPLAIN' => sprintf($user->lang['POST_CONFIRM_EXPLAIN'], '
', ' '),
));
}
@@ -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'], '
', ' ') : sprintf($user->lang['BBCODE_IS_OFF'], '
', ' '),
+ 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '
', ' ') : sprintf($user->lang['BBCODE_IS_OFF'], '
', ' '),
'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('
', $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&t=$topic_id") : '',
- 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup"),
- 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup")),
+ 'U_VIEW_FORUM' => append_sid('viewforum', "f=$forum_id"),
+ 'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid('viewtopic', "f=$forum_id&t=$topic_id") : '',
+ 'U_PROGRESS_BAR' => append_sid('posting', "f=$forum_id&mode=popup"),
+ 'UA_PROGRESS_BAR' => addslashes(append_sid('posting', "f=$forum_id&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&t=$topic_id&p=$next_post_id") . "#p$next_post_id";
+ $meta_info = append_sid('viewtopic', "f=$forum_id&t=$topic_id&p=$next_post_id") . "#p$next_post_id";
$message = $user->lang['POST_DELETED'] . '
' . sprintf($user->lang['RETURN_TOPIC'], '
', ' ');
}
meta_refresh(3, $meta_info);
- $message .= '
' . sprintf($user->lang['RETURN_FORUM'], '
', ' ');
+ $message .= '
' . sprintf($user->lang['RETURN_FORUM'], '
', ' ');
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&p=$post_id") . "#p$post_id";
+$redirect_url = append_sid('viewtopic', "f=$forum_id&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 . '&p=' . $post_id),
+ 'S_REPORT_ACTION' => append_sid('report', 'f=' . $forum_id . '&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') ? '&sr=' . $show_results : '';
$u_search_forum = implode('&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) ? '&search_id=' . $search_id : '';
$u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($search->search_query)) : '';
$u_search .= ($topic_id) ? '&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&t=$result_topic_id" . (($u_hilit) ? "&hilit=$u_hilit" : ''));
+ $view_topic_url = append_sid('viewtopic', "f=$u_forum_id&t=$result_topic_id" . (($u_hilit) ? "&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&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$result_topic_id", true, $user->session_id) : '';
+ $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid('mcp', 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$result_topic_id", true, $user->session_id) : '';
$row['topic_title'] = preg_replace('#(?!<.*)(?]*(?:)#is', '
$1 ', $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 . '&view=unread#unread',
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&t=' . $result_topic_id, true, $user->session_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&mode=reports&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&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . (($u_hilit) ? '&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&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . (($u_hilit) ? '&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);
-
- $db = new $sql_db();
- $cache = new acm();
-
- // Connect to DB
- if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
- {
- exit;
- }
- unset($dbpasswd);
-
- $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);
- }
-
- $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)
- {
- exit;
- }
-
- if ($user['user_id'] == ANONYMOUS)
- {
- $user['user_lang'] = $config['default_lang'];
- }
-
- $user_image_lang = (file_exists($phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $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);
-
- $img_array = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $img_array[$row['image_name']] = $row;
- }
- $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;
-
- // Re-cache stylesheet data if necessary
- if ($recompile || empty($theme['theme_data']))
- {
- $recache = (empty($theme['theme_data'])) ? true : false;
- $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'))
- {
- $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");
-
- 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}"))
- {
- $recache = true;
- break;
- }
- }
- closedir($dir);
- }
- }
- }
-
- if ($recache)
- {
- if (!class_exists('acp_styles'))
- {
- include($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx);
- }
-
- $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']
- );
-
- // @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);
- }
-
- // 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');
-
- // 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']);
-
- $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]))
- {
- foreach ($matches[1] as $i => $img)
- {
- $img = strtolower($img);
- $find[] = $matches[0][$i];
-
- if (!isset($img_array[$img]))
- {
- $replace[] = '';
- 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'],
- );
- }
-
- 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 (sizeof($find))
- {
- $theme['theme_data'] = str_replace($find, $replace, $theme['theme_data']);
- }
- }
-
- echo $theme['theme_data'];
-
- if (!empty($cache))
- {
- $cache->unload();
- }
- $db->sql_close();
+ exit;
}
-exit;
+include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
+
+$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);
+}
+
+$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();
+}
+
+if ($user['user_id'] == ANONYMOUS)
+{
+ $user['user_lang'] = $config['default_lang'];
+}
+
+$user_image_lang = (file_exists(PHPBB_ROOT_PATH . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $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);
+
+$img_array = array();
+while ($row = $db->sql_fetchrow($result))
+{
+ $img_array[$row['image_name']] = $row;
+}
+$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;
+
+// Re-cache stylesheet data if necessary
+if ($recompile || empty($theme['theme_data']))
+{
+ $recache = (empty($theme['theme_data'])) ? true : false;
+ $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'))
+ {
+ $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");
+
+ 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}"))
+ {
+ $recache = true;
+ break;
+ }
+ }
+ closedir($dir);
+ }
+ }
+}
+
+if ($recache)
+{
+ if (!class_exists('acp_styles'))
+ {
+ include(PHPBB_ROOT_PATH . 'includes/acp/acp_styles.' . PHP_EXT);
+ }
+
+ $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']
+ );
+
+ // @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);
+}
+
+// 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');
+
+// 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']);
+
+$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]))
+{
+ foreach ($matches[1] as $i => $img)
+ {
+ $img = strtolower($img);
+ $find[] = $matches[0][$i];
+
+ if (!isset($img_array[$img]))
+ {
+ $replace[] = '';
+ 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'],
+ );
+ }
+
+ 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 (sizeof($find))
+ {
+ $theme['theme_data'] = str_replace($find, $replace, $theme['theme_data']);
+ }
+}
+
+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 . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
+ $message = $message . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
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'] . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
+ $message = $user->lang['COOKIES_DELETED'] . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
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']) . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
+ $message = sprintf($user->lang['PERMISSIONS_TRANSFERRED'], $user_row['username']) . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
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'] . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
+ $message = $user->lang['PERMISSIONS_RESTORED'] . '
' . sprintf($user->lang['RETURN_INDEX'], '
', ' ');
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&start=$start"),
+ 'U_VIEW_FORUM' => append_sid('viewforum', "f=$forum_id&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') . '&redirect=' . urlencode(str_replace('&', '&', build_url(array('_f_')))),
+ 'S_LOGIN_ACTION' => append_sid('ucp', 'mode=login') . '&redirect=' . urlencode(str_replace('&', '&', 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'] . '
' . sprintf($user->lang['RETURN_FORUM'], '
', ' '));
@@ -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', '
');
+ $template->assign_var('RUN_CRON_TASK', '
');
}
// 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&start=$start"),
+ 'S_FORUM_ACTION' => append_sid('viewforum', "f=$forum_id&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&i=main&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&f=' . $forum_id) : '',
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&$u_sort_param&start=$start"),
- 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&mark=topics") : '',
+ 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid('mcp', "f=$forum_id&i=main&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&f=' . $forum_id) : '',
+ 'U_VIEW_FORUM' => append_sid('viewforum', "f=$forum_id&$u_sort_param&start=$start"),
+ 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid('viewforum', "f=$forum_id&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&$u_sort_param"), $topics_count, $config['topics_per_page'], $start),
+ 'PAGINATION' => generate_pagination(append_sid('viewforum', "f=$forum_id&$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) . '&t=' . $topic_id);
+ $view_topic_url = append_sid('viewtopic', 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&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&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : '';
+ $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid('mcp', 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&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&mode=reports&f=' . $forum_id . '&t=' . $topic_id, true, $user->session_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&mode=reports&f=' . $forum_id . '&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) ? '&s=' . $row['session_id'] : '') . "&sg=$show_guests&start=$start&sk=$sort_key&sd=$sort_dir"),
- 'U_WHOIS' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=whois&s=' . $row['session_id']),
+ 'U_USER_IP' => append_sid('viewonline', 'mode=lookup' . (($mode != 'lookup' || $row['session_id'] != $session_id) ? '&s=' . $row['session_id'] : '') . "&sg=$show_guests&start=$start&sk=$sort_key&sd=$sort_dir"),
+ 'U_WHOIS' => append_sid('viewonline', 'mode=whois&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&sk=$sort_key&sd=$sort_dir"), $counter, $config['topics_per_page'], $start);
+$pagination = generate_pagination(append_sid('viewonline', "sg=$show_guests&sk=$sort_key&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 != '') ? ', ' : '') . '
' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ' ';
+ $legend .= (($legend != '') ? ', ' : '') . '
' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ' ';
}
}
$db->sql_freeresult($result);
// Refreshing the page every 60 seconds...
-meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir&start=$start"));
+meta_refresh(60, append_sid('viewonline', "sg=$show_guests&sk=$sort_key&sd=$sort_dir&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&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
- 'U_SORT_UPDATED' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
- 'U_SORT_LOCATION' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
+ 'U_SORT_USERNAME' => append_sid('viewonline', 'sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
+ 'U_SORT_UPDATED' => append_sid('viewonline', 'sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
+ 'U_SORT_LOCATION' => append_sid('viewonline', 'sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a') . '&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&t=$topic_id"));
+ redirect(append_sid('viewtopic', "f=$forum_id&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&t=$topic_id");
+ $redirect_url = append_sid('viewtopic', "f=$forum_id&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&t=$topic_id&start=$start&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : ''));
+$viewtopic_url = append_sid('viewtopic', "f=$forum_id&t=$topic_id&start=$start&$u_sort_param" . (($highlight_match) ? "&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)) ? '
' . $user->lang['VIEW_TOPIC_LOGS'] . ' ' : '';
// 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&t=$topic_id&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : '')), $total_posts, $config['posts_per_page'], $start);
+$pagination = generate_pagination(append_sid('viewtopic', "f=$forum_id&t=$topic_id&$u_sort_param" . (($highlight_match) ? "&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&mode=topic_view&f=$forum_id&t=$topic_id&start=$start&$u_sort_param", true, $user->session_id) : '',
+ 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid('mcp', "i=main&mode=topic_view&f=$forum_id&t=$topic_id&start=$start&$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&t=$topic_id&start=$start"),
+ 'S_TOPIC_ACTION' => append_sid('viewtopic', "f=$forum_id&t=$topic_id&start=$start"),
'S_TOPIC_MOD' => ($topic_mod != '') ? '
' . $topic_mod . ' ' : '',
- 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id),
+ 'S_MOD_ACTION' => append_sid('mcp', "f=$forum_id&t=$topic_id&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $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&t=$topic_id",
+ 'U_TOPIC' => "{$server_path}viewtopic." . PHP_EXT . "?f=$forum_id&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&t=$topic_id&view=previous"),
- 'U_VIEW_NEWER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=next"),
+ 'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_id),
+ 'U_VIEW_OLDER_TOPIC' => append_sid('viewtopic', "f=$forum_id&t=$topic_id&view=previous"),
+ 'U_VIEW_NEWER_TOPIC' => append_sid('viewtopic', "f=$forum_id&t=$topic_id&view=next"),
'U_PRINT_TOPIC' => ($auth->acl_get('f_print', $forum_id)) ? $viewtopic_url . '&view=print' : '',
- 'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&t=$topic_id") : '',
+ 'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? append_sid('memberlist', "mode=email&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 . '&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&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&f=$forum_id&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&f=$forum_id&t=$topic_id") : '')
+ 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid('posting', "mode=post&f=$forum_id") : '',
+ 'U_POST_REPLY_TOPIC' => ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid('posting', "mode=reply&f=$forum_id&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&f=$forum_id&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&t=$topic_id&start=$start");
+ $redirect_url = append_sid('viewtopic', "f=$forum_id&t=$topic_id&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&t=$topic_id&start=$start");
+ $redirect_url = append_sid('viewtopic', "f=$forum_id&t=$topic_id&start=$start");
meta_refresh(5, $redirect_url);
trigger_error($user->lang['VOTE_SUBMITTED'] . '
' . sprintf($user->lang['RETURN_TOPIC'], '
', ' '));
@@ -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&u=$poster_id"),
+ 'profile' => append_sid('memberlist', "mode=viewprofile&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&action=aim&u=$poster_id") : '',
- 'msn' => ($row['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=msnm&u=$poster_id") : '',
+ 'aim' => ($row['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', "mode=contact&action=aim&u=$poster_id") : '',
+ 'msn' => ($row['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', "mode=contact&action=msnm&u=$poster_id") : '',
'yim' => ($row['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($row['user_yim']) . '&.src=pg' : '',
- 'jabber' => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=jabber&u=$poster_id") : '',
- 'search' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'search_author=' . urlencode($row['username']) .'&showresults=posts') : '',
+ 'jabber' => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid('memberlist', "mode=contact&action=jabber&u=$poster_id") : '',
+ 'search' => ($auth->acl_get('u_search')) ? append_sid('search', 'search_author=' . urlencode($row['username']) .'&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&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&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&f=$forum_id&p={$row['post_id']}") : ''),
- 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '',
- 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&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&f=$forum_id&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&f=$forum_id&p={$row['post_id']}") : ''),
+ 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid('posting', "mode=quote&f=$forum_id&p={$row['post_id']}") : '',
+ 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid('mcp', "i=main&mode=post_details&f=$forum_id&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&f=$forum_id&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&mode=compose&action=quotepost&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&mode=compose&action=quotepost&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 . '&p=' . $row['post_id']) : '',
- 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $forum_id . '&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&mode=approve_details&f=' . $forum_id . '&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) ? '&f=' . $forum_id : '') . '#p' . $row['post_id'],
+ 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? append_sid('report', 'f=' . $forum_id . '&p=' . $row['post_id']) : '',
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid('mcp', 'i=reports&mode=report_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
+ 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid('mcp', 'i=queue&mode=approve_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
+ 'U_MINI_POST' => append_sid('viewtopic', 'p=' . $row['post_id']) . (($topic_data['topic_type'] == POST_GLOBAL) ? '&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&mode=user_notes&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&mode=warn_post&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
+ 'U_NOTES' => ($auth->acl_getf_global('m_')) ? append_sid('mcp', 'i=notes&mode=user_notes&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&mode=warn_post&f=' . $forum_id . '&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&t=$topic_id&view=unread") . '#unread',
+ 'U_VIEW_UNREAD_POST' => append_sid('viewtopic', "f=$forum_id&t=$topic_id&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&t=$topic_id&view=unread") . '#unread',
+ 'U_VIEW_UNREAD_POST' => append_sid('viewtopic', "f=$forum_id&t=$topic_id&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();