aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_attachments.php29
-rw-r--r--phpBB/includes/acp/acp_ban.php5
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php3
-rw-r--r--phpBB/includes/acp/acp_board.php25
-rw-r--r--phpBB/includes/acp/acp_bots.php3
-rw-r--r--phpBB/includes/acp/acp_captcha.php9
-rw-r--r--phpBB/includes/acp/acp_database.php12
-rw-r--r--phpBB/includes/acp/acp_disallow.php5
-rw-r--r--phpBB/includes/acp/acp_email.php14
-rw-r--r--phpBB/includes/acp/acp_forums.php17
-rw-r--r--phpBB/includes/acp/acp_groups.php25
-rw-r--r--phpBB/includes/acp/acp_icons.php23
-rwxr-xr-xphpBB/includes/acp/acp_inactive.php11
-rw-r--r--phpBB/includes/acp/acp_jabber.php5
-rw-r--r--phpBB/includes/acp/acp_language.php123
-rw-r--r--phpBB/includes/acp/acp_logs.php3
-rw-r--r--phpBB/includes/acp/acp_main.php21
-rw-r--r--phpBB/includes/acp/acp_modules.php13
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php7
-rw-r--r--phpBB/includes/acp/acp_permissions.php11
-rw-r--r--phpBB/includes/acp/acp_php_info.php3
-rw-r--r--phpBB/includes/acp/acp_profile.php7
-rw-r--r--phpBB/includes/acp/acp_prune.php16
-rw-r--r--phpBB/includes/acp/acp_ranks.php11
-rw-r--r--phpBB/includes/acp/acp_reasons.php3
-rw-r--r--phpBB/includes/acp/acp_search.php30
-rw-r--r--phpBB/includes/acp/acp_styles.php147
-rw-r--r--phpBB/includes/acp/acp_update.php3
-rw-r--r--phpBB/includes/acp/acp_users.php55
-rw-r--r--phpBB/includes/acp/acp_words.php3
-rw-r--r--phpBB/includes/acp/auth.php18
31 files changed, 305 insertions, 355 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 89769552bd..8d6e91a71c 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -26,8 +26,7 @@ class acp_attachments
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
@@ -79,7 +78,7 @@ class acp_attachments
{
case 'attach':
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$sql = 'SELECT group_name, cat_id
FROM ' . EXTENSION_GROUPS_TABLE . '
@@ -696,7 +695,7 @@ class acp_attachments
$filename_list = '';
$no_image_select = false;
- $imglist = filelist($phpbb_root_path . $img_path);
+ $imglist = filelist(PHPBB_ROOT_PATH . $img_path);
if (sizeof($imglist))
{
@@ -742,14 +741,14 @@ class acp_attachments
}
$template->assign_vars(array(
- 'PHPBB_ROOT_PATH' => $phpbb_root_path,
+ 'PHPBB_ROOT_PATH' => PHPBB_ROOT_PATH,
'IMG_PATH' => $img_path,
'ACTION' => $action,
'GROUP_ID' => $group_id,
'GROUP_NAME' => $ext_group_row['group_name'],
'ALLOW_GROUP' => $ext_group_row['allow_group'],
'ALLOW_IN_PM' => $ext_group_row['allow_in_pm'],
- 'UPLOAD_ICON_SRC' => $phpbb_root_path . $img_path . '/' . $ext_group_row['upload_icon'],
+ 'UPLOAD_ICON_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $ext_group_row['upload_icon'],
'EXTGROUP_FILESIZE' => $ext_group_row['max_filesize'],
'ASSIGNED_EXTENSIONS' => $assigned_extensions,
@@ -761,7 +760,7 @@ class acp_attachments
'S_NO_IMAGE' => $no_image_select,
'S_FORUM_IDS' => (sizeof($forum_ids)) ? true : false,
- 'U_EXTENSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=extensions"),
+ 'U_EXTENSIONS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&mode=extensions"),
'U_BACK' => $this->u_action,
'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP'])
@@ -1032,7 +1031,7 @@ class acp_attachments
'PHYSICAL_FILENAME' => basename($row['physical_filename']),
'ATTACH_ID' => $row['attach_id'],
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
- 'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&id=' . $row['attach_id']))
+ 'U_FILE' => append_sid('download/file', 'mode=view&id=' . $row['attach_id']))
);
}
$db->sql_freeresult($result);
@@ -1192,31 +1191,31 @@ class acp_attachments
*/
function test_upload(&$error, $upload_dir, $create_directory = false)
{
- global $user, $phpbb_root_path;
+ global $user;
// Does the target directory exist, is it a directory and writable.
if ($create_directory)
{
- if (!file_exists($phpbb_root_path . $upload_dir))
+ if (!file_exists(PHPBB_ROOT_PATH . $upload_dir))
{
- @mkdir($phpbb_root_path . $upload_dir, 0777);
- @chmod($phpbb_root_path . $upload_dir, 0777);
+ @mkdir(PHPBB_ROOT_PATH . $upload_dir, 0777);
+ @chmod(PHPBB_ROOT_PATH . $upload_dir, 0777);
}
}
- if (!file_exists($phpbb_root_path . $upload_dir))
+ if (!file_exists(PHPBB_ROOT_PATH . $upload_dir))
{
$error[] = sprintf($user->lang['NO_UPLOAD_DIR'], $upload_dir);
return;
}
- if (!is_dir($phpbb_root_path . $upload_dir))
+ if (!is_dir(PHPBB_ROOT_PATH . $upload_dir))
{
$error[] = sprintf($user->lang['UPLOAD_NOT_DIR'], $upload_dir);
return;
}
- if (!is_writable($phpbb_root_path . $upload_dir))
+ if (!is_writable(PHPBB_ROOT_PATH . $upload_dir))
{
$error[] = sprintf($user->lang['NO_WRITE_UPLOAD'], $upload_dir);
return;
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index 77fb44dda9..3d60ffbe09 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -26,9 +26,8 @@ class acp_ban
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$bansubmit = (isset($_POST['bansubmit'])) ? true : false;
$unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
@@ -112,7 +111,7 @@ class acp_ban
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
'U_ACTION' => $this->u_action,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_ban&field=ban'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=acp_ban&field=ban'),
));
}
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 33e8fe7ec1..e0d478689e 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -25,8 +25,7 @@ class acp_bbcodes
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('acp/posting');
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 800abd875a..6d3fd34263 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -27,8 +27,7 @@ class acp_board
function main($id, $mode)
{
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $config;
$user->add_lang('acp/board');
@@ -418,15 +417,15 @@ class acp_board
// Retrieve a list of auth plugins and check their config values
$auth_plugins = array();
- $dp = @opendir($phpbb_root_path . 'includes/auth');
+ $dp = @opendir(PHPBB_ROOT_PATH . 'includes/auth');
if ($dp)
{
while (($file = readdir($dp)) !== false)
{
- if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
+ if (preg_match('#^auth_(.*?)\.' . PHP_EXT . '$#', $file))
{
- $auth_plugins[] = basename(preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file));
+ $auth_plugins[] = basename(preg_replace('#^auth_(.*?)\.' . PHP_EXT . '$#', '\1', $file));
}
}
closedir($dp);
@@ -438,9 +437,9 @@ class acp_board
$old_auth_config = array();
foreach ($auth_plugins as $method)
{
- if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
+ if ($method && file_exists(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT))
{
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
$method = 'acp_' . $method;
if (function_exists($method))
@@ -481,7 +480,7 @@ class acp_board
$method = basename($cfg_array['auth_method']);
if ($method && in_array($method, $auth_plugins))
{
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
$method = 'init_' . $method;
if (function_exists($method))
@@ -579,7 +578,7 @@ class acp_board
foreach ($auth_plugins as $method)
{
- if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
+ if ($method && file_exists(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT))
{
$method = 'acp_' . $method;
if (function_exists($method))
@@ -604,11 +603,9 @@ class acp_board
*/
function select_auth_method($selected_method, $key = '')
{
- global $phpbb_root_path, $phpEx;
-
$auth_plugins = array();
- $dp = @opendir($phpbb_root_path . 'includes/auth');
+ $dp = @opendir(PHPBB_ROOT_PATH . 'includes/auth');
if (!$dp)
{
@@ -617,9 +614,9 @@ class acp_board
while (($file = readdir($dp)) !== false)
{
- if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
+ if (preg_match('#^auth_(.*?)\.' . PHP_EXT . '$#', $file))
{
- $auth_plugins[] = preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file);
+ $auth_plugins[] = preg_replace('#^auth_(.*?)\.' . PHP_EXT . '$#', '\1', $file);
}
}
closedir($dp);
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index 81ac239358..672fb39c1d 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -26,7 +26,6 @@ class acp_bots
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
@@ -141,7 +140,7 @@ class acp_bots
case 'edit':
case 'add':
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$bot_row = array(
'bot_name' => utf8_normalize_nfc(request_var('bot_name', '', true)),
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index 5b2b345ef8..8a93f887f1 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -24,8 +24,7 @@ class acp_captcha
function main($id, $mode)
{
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $config;
$user->add_lang('acp/board');
@@ -47,11 +46,11 @@ class acp_captcha
if ($config['captcha_gd'])
{
- include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/captcha/captcha_gd.' . PHP_EXT);
}
else
{
- include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/captcha/captcha_non_gd.' . PHP_EXT);
}
captcha::execute(gen_rand_string(mt_rand(5, 8)), time());
@@ -92,7 +91,7 @@ class acp_captcha
else
{
- $preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&demo=demo"));
+ $preview_image_src = append_sid(append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&demo=demo"));
if (@extension_loaded('gd'))
{
$template->assign_var('GD', true);
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 98c2decbf6..561e88bbbf 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -25,8 +25,7 @@ class acp_database
function main($id, $mode)
{
- global $cache, $db, $user, $auth, $template, $table_prefix;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $cache, $db, $user, $auth, $template, $table_prefix, $config;
$user->add_lang('acp/database');
@@ -171,7 +170,7 @@ class acp_database
break;
default:
- include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_install.' . PHP_EXT);
$tables = get_tables($db);
asort($tables);
foreach ($tables as $table_name)
@@ -225,7 +224,7 @@ class acp_database
trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $file_name = $phpbb_root_path . 'store/' . $matches[0];
+ $file_name = PHPBB_ROOT_PATH . 'store/' . $matches[0];
if (!file_exists($file_name) || !is_readable($file_name))
{
@@ -420,7 +419,7 @@ class acp_database
$methods[] = $type;
}
- $dir = $phpbb_root_path . 'store/';
+ $dir = PHPBB_ROOT_PATH . 'store/';
$dh = @opendir($dir);
if ($dh)
@@ -529,8 +528,7 @@ class base_extractor
if ($store == true)
{
- global $phpbb_root_path;
- $file = $phpbb_root_path . 'store/' . $filename . $ext;
+ $file = PHPBB_ROOT_PATH . 'store/' . $filename . $ext;
$this->fp = $open($file, 'w');
diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php
index 9549955cc8..abcb964906 100644
--- a/phpBB/includes/acp/acp_disallow.php
+++ b/phpBB/includes/acp/acp_disallow.php
@@ -25,10 +25,9 @@ class acp_disallow
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$user->add_lang('acp/posting');
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index c964530c32..b8672a1c03 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -26,7 +26,6 @@ class acp_email
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$user->add_lang('acp/email');
$this->tpl_name = 'acp_email';
@@ -148,8 +147,8 @@ class acp_email
$db->sql_freeresult($result);
// Send the messages
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$messenger = new messenger($use_queue);
$errored = false;
@@ -218,7 +217,7 @@ class acp_email
}
else
{
- $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=critical') . '">', '</a>');
+ $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=logs&amp;mode=critical') . '">', '</a>');
trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -250,12 +249,11 @@ class acp_email
'U_ACTION' => $this->u_action,
'S_GROUP_OPTIONS' => $select_list,
'USERNAMES' => $usernames,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_email&amp;field=usernames'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=acp_email&amp;field=usernames'),
'SUBJECT' => $subject,
'MESSAGE' => $message,
- 'S_PRIORITY_OPTIONS' => $s_priority_options)
- );
-
+ 'S_PRIORITY_OPTIONS' => $s_priority_options,
+ ));
}
}
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 6f11c88d60..4a5db8f7a0 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -26,8 +26,7 @@ class acp_forums
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('acp/forums');
$this->tpl_name = 'acp_forums';
@@ -253,13 +252,13 @@ class acp_forums
// Redirect to permissions
if ($auth->acl_get('a_fauth'))
{
- $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions' . $acl_url) . '">', '</a>');
}
// redirect directly to permission settings screen if authed
if ($action == 'add' && !$forum_perm_from && $auth->acl_get('a_fauth'))
{
- meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url));
+ meta_refresh(4, append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions' . $acl_url));
}
trigger_error($message . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
@@ -636,7 +635,7 @@ class acp_forums
'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_DATA_LINK' => $forum_data['forum_link'],
'FORUM_IMAGE' => $forum_data['forum_image'],
- 'FORUM_IMAGE_SRC' => ($forum_data['forum_image']) ? $phpbb_root_path . $forum_data['forum_image'] : '',
+ 'FORUM_IMAGE_SRC' => ($forum_data['forum_image']) ? PHPBB_ROOT_PATH . $forum_data['forum_image'] : '',
'FORUM_POST' => FORUM_POST,
'FORUM_LINK' => FORUM_LINK,
'FORUM_CAT' => FORUM_CAT,
@@ -810,8 +809,8 @@ class acp_forums
$template->assign_block_vars('forums', array(
'FOLDER_IMAGE' => $folder_image,
- 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="" />' : '',
- 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
+ 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="" />' : '',
+ 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
'FORUM_NAME' => $row['forum_name'],
'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
'FORUM_TOPICS' => $row['forum_topics'],
@@ -1620,9 +1619,9 @@ class acp_forums
*/
function delete_forum_content($forum_id)
{
- global $db, $config, $phpbb_root_path, $phpEx;
+ global $db, $config;
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$db->sql_transaction('begin');
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index eb785ced23..f43c3de484 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -25,8 +25,7 @@ class acp_groups
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
+ global $config, $db, $user, $auth, $template, $cache, $file_uploads;
$user->add_lang('acp/groups');
$this->tpl_name = 'acp_groups';
@@ -35,7 +34,7 @@ class acp_groups
$form_key = 'acp_groups';
add_form_key($form_key);
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
// Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''));
@@ -49,7 +48,7 @@ class acp_groups
// Clear some vars
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
+ $can_upload = (file_exists(PHPBB_ROOT_PATH . $config['avatar_path']) && @is_writable(PHPBB_ROOT_PATH . $config['avatar_path']) && $file_uploads) ? true : false;
$group_row = array();
// Grab basic data for group, if group_id is set and exists
@@ -247,7 +246,7 @@ class acp_groups
case 'edit':
case 'add':
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
$data = $submit_ary = array();
@@ -330,11 +329,11 @@ class acp_groups
else if ($avatar_select && $config['allow_avatar_local'])
{
// check avatar gallery
- if (is_dir($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category))
+ if (is_dir(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category))
{
$submit_ary['avatar_type'] = AVATAR_GALLERY;
- list($submit_ary['avatar_width'], $submit_ary['avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_select);
+ list($submit_ary['avatar_width'], $submit_ary['avatar_height']) = getimagesize(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_select);
$submit_ary['avatar'] = $category . '/' . $avatar_select;
}
}
@@ -505,7 +504,7 @@ class acp_groups
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
- $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
+ $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . PHPBB_ADMIN_PATH . 'images/no_avatar.gif" alt="" />';
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
@@ -519,7 +518,7 @@ class acp_groups
switch ($back_link)
{
case 'acp_users_groups':
- $u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=groups&amp;u=' . request_var('u', 0));
+ $u_back = append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&amp;mode=groups&amp;u=' . request_var('u', 0));
break;
default:
@@ -574,7 +573,7 @@ class acp_groups
'GROUP_HIDDEN' => $type_hidden,
'U_BACK' => $u_back,
- 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&amp;name=group_colour'),
+ 'U_SWATCH' => append_sid(PHPBB_ADMIN_PATH . 'swatch.' . PHP_EXT, 'form=settings&amp;name=group_colour'),
'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;g=$group_id",
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),
)
@@ -604,7 +603,7 @@ class acp_groups
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('leader', array(
- 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;action=edit&amp;u={$row['user_id']}"),
+ 'U_USER_EDIT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&amp;action=edit&amp;u={$row['user_id']}"),
'USERNAME' => $row['username'],
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
@@ -643,7 +642,7 @@ class acp_groups
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
'U_BACK' => $this->u_action,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=list&amp;field=usernames'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=list&amp;field=usernames'),
'U_DEFAULT_ALL' => "{$this->u_action}&amp;action=default&amp;g=$group_id",
));
@@ -670,7 +669,7 @@ class acp_groups
}
$template->assign_block_vars('member', array(
- 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;action=edit&amp;u={$row['user_id']}"),
+ 'U_USER_EDIT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&amp;action=edit&amp;u={$row['user_id']}"),
'USERNAME' => $row['username'],
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 4f16c0c83d..e9b24155c8 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -26,8 +26,7 @@ class acp_icons
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('acp/posting');
@@ -69,13 +68,13 @@ class acp_icons
// Grab file list of paks and images
if ($action == 'edit' || $action == 'add' || $action == 'import')
{
- $imglist = filelist($phpbb_root_path . $img_path, '');
+ $imglist = filelist(PHPBB_ROOT_PATH . $img_path, '');
foreach ($imglist as $path => $img_ary)
{
foreach ($img_ary as $img)
{
- $img_size = getimagesize($phpbb_root_path . $img_path . '/' . $path . $img);
+ $img_size = getimagesize(PHPBB_ROOT_PATH . $img_path . '/' . $path . $img);
if (!$img_size[0] || !$img_size[1] || strlen($img) > 255)
{
@@ -89,11 +88,11 @@ class acp_icons
}
unset($imglist);
- if ($dir = @opendir($phpbb_root_path . $img_path))
+ if ($dir = @opendir(PHPBB_ROOT_PATH . $img_path))
{
while (($file = readdir($dir)) !== false)
{
- if (is_file($phpbb_root_path . $img_path . '/' . $file) && preg_match('#\.pak$#i', $file))
+ if (is_file(PHPBB_ROOT_PATH . $img_path . '/' . $file) && preg_match('#\.pak$#i', $file))
{
$_paks[] = $file;
}
@@ -254,7 +253,7 @@ class acp_icons
$template->assign_block_vars('items', array(
'IMG' => $img,
'A_IMG' => addslashes($img),
- 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $img,
+ 'IMG_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $img,
'CODE' => ($mode == 'smilies' && isset($img_row['code'])) ? $img_row['code'] : '',
'EMOTION' => ($mode == 'smilies' && isset($img_row['emotion'])) ? $img_row['emotion'] : '',
@@ -278,9 +277,9 @@ class acp_icons
'S_ADD_ORDER_LIST_DISPLAY' => $add_order_list . $add_order_lists[1],
'S_ADD_ORDER_LIST_UNDISPLAY' => $add_order_list . $add_order_lists[0],
- 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'],
+ 'IMG_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $default_row['smiley_url'],
'IMG_PATH' => $img_path,
- 'PHPBB_ROOT_PATH' => $phpbb_root_path,
+ 'PHPBB_ROOT_PATH' => PHPBB_ROOT_PATH,
'CODE' => $default_row['code'],
'EMOTION' => $default_row['emotion'],
@@ -352,7 +351,7 @@ class acp_icons
{
if ($image_width[$image] == 0 || $image_height[$image] == 0)
{
- $img_size = getimagesize($phpbb_root_path . $img_path . '/' . $image);
+ $img_size = getimagesize(PHPBB_ROOT_PATH . $img_path . '/' . $image);
$image_width[$image] = $img_size[0];
$image_height[$image] = $img_size[1];
}
@@ -461,7 +460,7 @@ class acp_icons
{
$order = 0;
- if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak)))
+ if (!($pak_ary = @file(PHPBB_ROOT_PATH . $img_path . '/' . $pak)))
{
trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -833,7 +832,7 @@ class acp_icons
$template->assign_block_vars('items', array(
'S_SPACER' => (!$spacer && !$row['display_on_posting']) ? true : false,
'ALT_TEXT' => $alt_text,
- 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $row[$fields . '_url'],
+ 'IMG_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $row[$fields . '_url'],
'WIDTH' => $row[$fields . '_width'],
'HEIGHT' => $row[$fields . '_height'],
'CODE' => (isset($row['code'])) ? $row['code'] : '',
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php
index 90f326b099..1a1ff3ecf7 100755
--- a/phpBB/includes/acp/acp_inactive.php
+++ b/phpBB/includes/acp/acp_inactive.php
@@ -32,9 +32,8 @@ class acp_inactive
function main($id, $mode)
{
global $config, $db, $user, $auth, $template;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$user->add_lang('memberlist');
@@ -98,7 +97,7 @@ class acp_inactive
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !empty($inactive_users))
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger();
@@ -167,7 +166,7 @@ class acp_inactive
if ($row = $db->sql_fetchrow($result))
{
// Send the messages
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$messenger = new messenger();
$usernames = array();
@@ -182,7 +181,7 @@ class acp_inactive
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username']),
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
- 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
+ 'U_ACTIVATE' => generate_board_url() . '/ucp.' . PHP_EXT . '?mode=activate&u=' . $row['user_id'] . '&k=' . $row['user_actkey'])
);
$messenger->send($row['user_notify_type']);
@@ -228,7 +227,7 @@ class acp_inactive
'REASON' => $row['inactive_reason'],
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
- 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
+ 'U_USER_ADMIN' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
);
}
diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php
index 3862ee1ee8..a8b55ab397 100644
--- a/phpBB/includes/acp/acp_jabber.php
+++ b/phpBB/includes/acp/acp_jabber.php
@@ -26,12 +26,11 @@ class acp_jabber
function main($id, $mode)
{
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $config;
$user->add_lang('acp/board');
- include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_jabber.' . PHP_EXT);
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index fc2ae11b1e..66f201dbed 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -32,10 +32,9 @@ class acp_language
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
global $safe_mode, $file_uploads;
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$this->default_variables();
@@ -61,7 +60,7 @@ class acp_language
list($_REQUEST['language_file'], ) = array_keys($missing_file);
}
- $selected_lang_file = request_var('language_file', '|common.' . $phpEx);
+ $selected_lang_file = request_var('language_file', '|common.' . PHP_EXT);
list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file);
@@ -78,7 +77,7 @@ class acp_language
$action = 'upload_file';
$method = request_var('method', '');
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
switch ($method)
{
@@ -103,7 +102,7 @@ class acp_language
{
case 'upload_file':
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
$method = request_var('method', '');
@@ -219,7 +218,7 @@ class acp_language
{
case 'email':
// Get email templates
- $email_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt');
+ $email_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'email', 'txt');
$email_files = $email_files['email/'];
if (!in_array($this->language_file, $email_files))
@@ -230,7 +229,7 @@ class acp_language
case 'acp':
// Get acp files
- $acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx);
+ $acp_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'acp', PHP_EXT);
$acp_files = $acp_files['acp/'];
if (!in_array($this->language_file, $acp_files))
@@ -241,7 +240,7 @@ class acp_language
case 'mods':
// Get mod files
- $mods_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx);
+ $mods_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'mods', PHP_EXT);
$mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array();
if (!in_array($this->language_file, $mods_files))
@@ -269,7 +268,7 @@ class acp_language
foreach ($mkdir_ary as $dir)
{
- $dir = $phpbb_root_path . 'store/' . $dir;
+ $dir = PHPBB_ROOT_PATH . 'store/' . $dir;
if (!is_dir($dir))
{
@@ -284,7 +283,7 @@ class acp_language
// Get target filename for storage folder
$filename = $this->get_filename($row['lang_iso'], $this->language_directory, $this->language_file, true, true);
- $fp = @fopen($phpbb_root_path . $filename, 'wb');
+ $fp = @fopen(PHPBB_ROOT_PATH . $filename, 'wb');
if (!$fp)
{
@@ -354,7 +353,7 @@ class acp_language
header('Content-Type: application/octetstream; name="' . $this->language_file . '"');
header('Content-disposition: attachment; filename=' . $this->language_file);
- $fp = @fopen($phpbb_root_path . $filename, 'rb');
+ $fp = @fopen(PHPBB_ROOT_PATH . $filename, 'rb');
while ($buffer = fread($fp, 1024))
{
echo $buffer;
@@ -382,7 +381,7 @@ class acp_language
$old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true);
$lang_path = 'language/' . $row['lang_iso'] . '/' . (($dir) ? $dir . '/' : '');
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
$method = request_var('method', '');
if ($method != 'ftp' && $method != 'ftp_fsock')
@@ -412,9 +411,9 @@ class acp_language
$transfer->close_session();
// Remove from storage folder
- if (file_exists($phpbb_root_path . 'store/' . $lang_path . $file))
+ if (file_exists(PHPBB_ROOT_PATH . 'store/' . $lang_path . $file))
{
- @unlink($phpbb_root_path . 'store/' . $lang_path . $file);
+ @unlink(PHPBB_ROOT_PATH . 'store/' . $lang_path . $file);
}
add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file);
@@ -447,15 +446,15 @@ class acp_language
$missing_vars = $missing_files = array();
// Get email templates
- $email_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'email', 'txt');
+ $email_files = filelist(PHPBB_ROOT_PATH . 'language/' . $config['default_lang'], 'email', 'txt');
$email_files = $email_files['email/'];
// Get acp files
- $acp_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'acp', $phpEx);
+ $acp_files = filelist(PHPBB_ROOT_PATH . 'language/' . $config['default_lang'], 'acp', PHP_EXT);
$acp_files = $acp_files['acp/'];
// Get mod files
- $mods_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'mods', $phpEx);
+ $mods_files = filelist(PHPBB_ROOT_PATH . 'language/' . $config['default_lang'], 'mods', PHP_EXT);
$mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array();
// Check if our current filename matches the files
@@ -493,13 +492,13 @@ class acp_language
{
$store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true);
- if (file_exists($phpbb_root_path . $store_filename))
+ if (file_exists(PHPBB_ROOT_PATH . $store_filename))
{
- @unlink($phpbb_root_path . $store_filename);
+ @unlink(PHPBB_ROOT_PATH . $store_filename);
}
}
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
$methods = transfer::methods();
@@ -529,7 +528,7 @@ class acp_language
foreach ($this->main_files as $file)
{
- if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file)))
+ if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, '', $file)))
{
$missing_vars[$file] = $this->compare_language_files($config['default_lang'], $lang_iso, '', $file);
@@ -547,7 +546,7 @@ class acp_language
// Now go through acp/mods directories
foreach ($acp_files as $file)
{
- if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'acp', $file)))
+ if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'acp', $file)))
{
$missing_vars['acp/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'acp', $file);
@@ -566,7 +565,7 @@ class acp_language
{
foreach ($mods_files as $file)
{
- if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'mods', $file)))
+ if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'mods', $file)))
{
$missing_vars['mods/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'mods', $file);
@@ -585,7 +584,7 @@ class acp_language
// More missing files... for example email templates?
foreach ($email_files as $file)
{
- if (!file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'email', $file)))
+ if (!file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'email', $file)))
{
$missing_files[] = $this->get_filename($lang_iso, 'email', $file);
}
@@ -625,7 +624,7 @@ class acp_language
}
// Main language files
- $s_lang_options = '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['LANGUAGE_FILES'] . '</option>';
+ $s_lang_options = '<option value="|common.' . PHP_EXT . '" class="sep">' . $user->lang['LANGUAGE_FILES'] . '</option>';
foreach ($this->main_files as $file)
{
if (strpos($file, 'help_') === 0)
@@ -633,14 +632,14 @@ class acp_language
continue;
}
- $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
+ $prefix = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
}
// Help Files
- $s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
+ $s_lang_options .= '<option value="|common.' . PHP_EXT . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
foreach ($this->main_files as $file)
{
if (strpos($file, 'help_') !== 0)
@@ -648,7 +647,7 @@ class acp_language
continue;
}
- $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
+ $prefix = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
@@ -664,11 +663,11 @@ class acp_language
continue;
}
- $s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
+ $s_lang_options .= '<option value="|common.' . PHP_EXT . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
foreach (${$check . '_files'} as $file)
{
- $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : '';
+ $prefix = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : '';
$selected = ($this->language_directory == $check && $this->language_file == $file) ? ' selected="selected"' : '';
$s_lang_options .= '<option value="' . $check . '|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
@@ -681,10 +680,10 @@ class acp_language
$is_email_file = ($this->language_directory == 'email') ? true : false;
$is_help_file = (strpos($this->language_file, 'help_') === 0) ? true : false;
- $file_from_store = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true))) ? true : false;
+ $file_from_store = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true))) ? true : false;
$no_store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file);
- if (!$file_from_store && !file_exists($phpbb_root_path . $no_store_filename))
+ if (!$file_from_store && !file_exists(PHPBB_ROOT_PATH . $no_store_filename))
{
$print_message = sprintf($user->lang['MISSING_LANGUAGE_FILE'], $no_store_filename);
}
@@ -692,12 +691,12 @@ class acp_language
{
if ($is_email_file)
{
- $lang = file_get_contents($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
+ $lang = file_get_contents(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
}
else
{
$help = array();
- include($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
+ include(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
if ($is_help_file)
{
@@ -794,12 +793,12 @@ class acp_language
$lang_iso = request_var('iso', '');
$lang_iso = basename($lang_iso);
- if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt"))
+ if (!$lang_iso || !file_exists(PHPBB_ROOT_PATH . "language/$lang_iso/iso.txt"))
{
trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $file = file("{$phpbb_root_path}language/$lang_iso/iso.txt");
+ $file = file(PHPBB_ROOT_PATH . "language/$lang_iso/iso.txt");
$lang_pack = array(
'iso' => $lang_iso,
@@ -849,9 +848,9 @@ class acp_language
$result = $db->sql_query($sql);
while ($imageset_row = $db->sql_fetchrow($result))
{
- if (@file_exists("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg"))
+ if (@file_exists(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg"))
{
- $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg");
+ $cfg_data_imageset_data = parse_cfg_file(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg");
foreach ($cfg_data_imageset_data as $image_name => $value)
{
if (strpos($value, '*') !== false)
@@ -994,41 +993,41 @@ class acp_language
$use_method = '.tar';
}
- include_once($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_compress.' . PHP_EXT);
if ($use_method == '.zip')
{
- $compress = new compress_zip('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
+ $compress = new compress_zip('w', PHPBB_ROOT_PATH . 'store/lang_' . $row['lang_iso'] . $use_method);
}
else
{
- $compress = new compress_tar('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method, $use_method);
+ $compress = new compress_tar('w', PHPBB_ROOT_PATH . 'store/lang_' . $row['lang_iso'] . $use_method, $use_method);
}
// Get email templates
- $email_templates = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt');
+ $email_templates = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'email', 'txt');
$email_templates = $email_templates['email/'];
// Get acp files
- $acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx);
+ $acp_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'acp', PHP_EXT);
$acp_files = $acp_files['acp/'];
// Get mod files
- $mod_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx);
+ $mod_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'mods', PHP_EXT);
$mod_files = (isset($mod_files['mods/'])) ? $mod_files['mods/'] : array();
// Add main files
$this->add_to_archive($compress, $this->main_files, $row['lang_iso']);
// Add search files if they exist...
- if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_ignore_words.' . $phpEx))
+ if (file_exists(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'] . '/search_ignore_words.' . PHP_EXT))
{
- $this->add_to_archive($compress, array("search_ignore_words.$phpEx"), $row['lang_iso']);
+ $this->add_to_archive($compress, array('search_ignore_words.' . PHP_EXT), $row['lang_iso']);
}
- if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_synonyms.' . $phpEx))
+ if (file_exists(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'] . '/search_synonyms.' . PHP_EXT))
{
- $this->add_to_archive($compress, array("search_synonyms.$phpEx"), $row['lang_iso']);
+ $this->add_to_archive($compress, array('search_synonyms.' . PHP_EXT), $row['lang_iso']);
}
// Write files in folders
@@ -1055,7 +1054,7 @@ class acp_language
$compress->close();
$compress->download('lang_' . $row['lang_iso']);
- @unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
+ @unlink(PHPBB_ROOT_PATH . 'store/lang_' . $row['lang_iso'] . $use_method);
exit;
@@ -1101,17 +1100,17 @@ class acp_language
$db->sql_freeresult($result);
$new_ary = $iso = array();
- $dp = @opendir("{$phpbb_root_path}language");
+ $dp = @opendir(PHPBB_ROOT_PATH . 'language');
if ($dp)
{
while (($file = readdir($dp)) !== false)
{
- if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
+ if ($file[0] != '.' && file_exists(PHPBB_ROOT_PATH . "language/$file/iso.txt"))
{
if (!in_array($file, $installed))
{
- if ($iso = file("{$phpbb_root_path}language/$file/iso.txt"))
+ if ($iso = file(PHPBB_ROOT_PATH . "language/$file/iso.txt"))
{
if (sizeof($iso) == 3)
{
@@ -1153,8 +1152,6 @@ class acp_language
*/
function default_variables()
{
- global $phpEx;
-
$this->language_file_header = '<?php
/**
*
@@ -1199,7 +1196,7 @@ $lang = array_merge($lang, array(
';
// Language files in language root directory
- $this->main_files = array("common.$phpEx", "groups.$phpEx", "install.$phpEx", "mcp.$phpEx", "memberlist.$phpEx", "posting.$phpEx", "search.$phpEx", "ucp.$phpEx", "viewforum.$phpEx", "viewtopic.$phpEx", "help_bbcode.$phpEx", "help_faq.$phpEx");
+ $this->main_files = array('common.' . PHP_EXT, 'groups.' . PHP_EXT, 'install.' . PHP_EXT, 'mcp.' . PHP_EXT, 'memberlist.' . PHP_EXT, 'posting.' . PHP_EXT, 'search.' . PHP_EXT, 'ucp.' . PHP_EXT, 'viewforum.' . PHP_EXT, 'viewtopic.' . PHP_EXT, 'help_bbcode.' . PHP_EXT, 'help_faq.' . PHP_EXT);
}
/**
@@ -1207,7 +1204,7 @@ $lang = array_merge($lang, array(
*/
function get_filename($lang_iso, $directory, $filename, $check_store = false, $only_return_filename = false)
{
- global $phpbb_root_path, $safe_mode;
+ global $safe_mode;
$check_filename = "language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename;
@@ -1215,7 +1212,7 @@ $lang = array_merge($lang, array(
{
$check_store_filename = ($safe_mode) ? "store/langfile_{$lang_iso}" . (($directory) ? '_' . $directory : '') . "_{$filename}" : "store/language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename;
- if (!$only_return_filename && file_exists($phpbb_root_path . $check_store_filename))
+ if (!$only_return_filename && file_exists(PHPBB_ROOT_PATH . $check_store_filename))
{
return $check_store_filename;
}
@@ -1233,8 +1230,6 @@ $lang = array_merge($lang, array(
*/
function add_to_archive(&$compress, $filelist, $lang_iso, $directory = '')
{
- global $phpbb_root_path;
-
foreach ($filelist as $file)
{
// Get source filename
@@ -1242,7 +1237,7 @@ $lang = array_merge($lang, array(
$destination = 'language/' . $lang_iso . '/' . (($directory) ? $directory . '/' : '') . $file;
// Add file to archive
- $compress->add_custom_file($phpbb_root_path . $source, $destination);
+ $compress->add_custom_file(PHPBB_ROOT_PATH . $source, $destination);
}
}
@@ -1359,22 +1354,20 @@ $lang = array_merge($lang, array(
*/
function compare_language_files($source_lang, $dest_lang, $directory, $file)
{
- global $phpbb_root_path, $phpEx;
-
$return_ary = array();
$lang = array();
- include("{$phpbb_root_path}language/{$source_lang}/" . (($directory) ? $directory . '/' : '') . $file);
+ include(PHPBB_ROOT_PATH . "language/{$source_lang}/" . (($directory) ? $directory . '/' : '') . $file);
$lang_entry_src = $lang;
$lang = array();
- if (!file_exists($phpbb_root_path . $this->get_filename($dest_lang, $directory, $file, true)))
+ if (!file_exists(PHPBB_ROOT_PATH . $this->get_filename($dest_lang, $directory, $file, true)))
{
return array();
}
- include($phpbb_root_path . $this->get_filename($dest_lang, $directory, $file, true));
+ include(PHPBB_ROOT_PATH . $this->get_filename($dest_lang, $directory, $file, true));
$lang_entry_dst = $lang;
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index 12953173f1..7ad0734151 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -25,8 +25,7 @@ class acp_logs
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('mcp');
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index bf6e8a39b5..3e24898908 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -26,7 +26,6 @@ class acp_main
function main($id, $mode)
{
global $config, $db, $user, $auth, $template;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx;
// Show restore permissions notice
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
@@ -42,16 +41,16 @@ class acp_main
$db->sql_freeresult($result);
$perm_from = '<strong' . (($user_row['user_colour']) ? ' style="color: #' . $user_row['user_colour'] . '">' : '>');
- $perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_row['user_id']) . '">' : '';
+ $perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid('memberlist', 'mode=viewprofile&amp;u=' . $user_row['user_id']) . '">' : '';
$perm_from .= $user_row['username'];
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '</a>' : '';
$perm_from .= '</strong>';
$template->assign_vars(array(
'S_RESTORE_PERMISSIONS' => true,
- 'U_RESTORE_PERMISSIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm'),
+ 'U_RESTORE_PERMISSIONS' => append_sid('ucp', 'mode=restore_perm'),
'PERM_FROM' => $perm_from,
- 'L_PERMISSIONS_TRANSFERRED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERRED_EXPLAIN'], $perm_from, append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm')),
+ 'L_PERMISSIONS_TRANSFERRED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERRED_EXPLAIN'], $perm_from, append_sid('ucp', 'mode=restore_perm')),
));
return;
@@ -162,7 +161,7 @@ class acp_main
if (!function_exists('update_last_username'))
{
- include($phpbb_root_path . "includes/functions_user.$phpEx");
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
}
update_last_username();
@@ -311,13 +310,13 @@ class acp_main
$avatar_dir_size = 0;
- if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path']))
+ if ($avatar_dir = @opendir(PHPBB_ROOT_PATH . $config['avatar_path']))
{
while (($file = readdir($avatar_dir)) !== false)
{
if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false)
{
- $avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
+ $avatar_dir_size += filesize(PHPBB_ROOT_PATH . $config['avatar_path'] . '/' . $file);
}
}
closedir($avatar_dir);
@@ -387,8 +386,8 @@ class acp_main
'BOARD_VERSION' => $config['version'],
'U_ACTION' => $this->u_action,
- 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
- 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
+ 'U_ADMIN_LOG' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=logs&amp;mode=admin'),
+ 'U_INACTIVE_USERS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=inactive&amp;mode=list'),
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
@@ -429,7 +428,7 @@ class acp_main
'REASON' => $row['inactive_reason'],
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
- 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
+ 'U_USER_ADMIN' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
);
}
@@ -446,7 +445,7 @@ class acp_main
}
// Warn if install is still present
- if (file_exists($phpbb_root_path . 'install'))
+ if (file_exists(PHPBB_ROOT_PATH . 'install'))
{
$template->assign_var('S_REMOVE_INSTALL', true);
}
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index f3540941df..0ab8ac6f6b 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -37,8 +37,7 @@ class acp_modules
function main($id, $mode)
{
- global $db, $user, $auth, $template, $module;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $db, $user, $auth, $template, $module, $config;
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
define('MODULE_INCLUDE', true);
@@ -530,11 +529,9 @@ class acp_modules
*/
function get_module_infos($module = '', $module_class = false)
{
- global $phpbb_root_path, $phpEx;
-
$module_class = ($module_class === false) ? $this->module_class : $module_class;
- $directory = $phpbb_root_path . 'includes/' . $module_class . '/info/';
+ $directory = PHPBB_ROOT_PATH . 'includes/' . $module_class . '/info/';
$fileinfo = array();
if (!$module)
@@ -549,9 +546,9 @@ class acp_modules
while (($file = readdir($dh)) !== false)
{
// Is module?
- if (preg_match('/^' . $module_class . '_.+\.' . $phpEx . '$/', $file))
+ if (preg_match('/^' . $module_class . '_.+\.' . PHP_EXT . '$/', $file))
{
- $class = str_replace(".$phpEx", '', $file) . '_info';
+ $class = str_replace('.' . PHP_EXT, '', $file) . '_info';
if (!class_exists($class))
{
@@ -578,7 +575,7 @@ class acp_modules
if (!class_exists($class))
{
- include($directory . $filename . '.' . $phpEx);
+ include($directory . $filename . '.' . PHP_EXT);
}
// Get module title tag
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index 03ea5a39dd..cdc276ad01 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -25,11 +25,10 @@ class acp_permission_roles
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
$auth_admin = new auth_admin();
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 9240db271c..ed7ca5e942 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -26,11 +26,10 @@ class acp_permissions
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
$auth_admin = new auth_admin();
@@ -354,7 +353,7 @@ class acp_permissions
$template->assign_vars(array(
'S_SELECT_USER' => true,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_victim&amp;field=username&amp;select_single=true'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=select_victim&amp;field=username&amp;select_single=true'),
));
break;
@@ -416,7 +415,7 @@ class acp_permissions
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'],
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], (($user->data['user_type'] == USER_FOUNDER) ? false : 0)),
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=add_user&amp;field=username&amp;select_single=true'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=add_user&amp;field=username&amp;select_single=true'),
));
break;
diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php
index 9935c0466e..3df63edc17 100644
--- a/phpBB/includes/acp/acp_php_info.php
+++ b/phpBB/includes/acp/acp_php_info.php
@@ -25,8 +25,7 @@ class acp_php_info
function main($id, $mode)
{
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $config;
if ($mode != 'info')
{
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 253308d153..a05766f4a6 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -29,11 +29,10 @@ class acp_profile
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
- include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
$user->add_lang(array('ucp', 'acp/profile'));
$this->tpl_name = 'acp_profile';
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index a82a438db7..a1e4620377 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -25,10 +25,10 @@ class acp_prune
function main($id, $mode)
{
- global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path;
+ global $user;
$user->add_lang('acp/prune');
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
switch ($mode)
{
@@ -51,8 +51,7 @@ class acp_prune
*/
function prune_forums($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$all_forums = request_var('all_forums', 0);
$forum_id = request_var('f', array(0));
@@ -228,8 +227,7 @@ class acp_prune
*/
function prune_users($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('memberlist');
@@ -300,8 +298,8 @@ class acp_prune
{
$template->assign_block_vars('users', array(
'USERNAME' => $usernames[$user_id],
- 'U_PROFILE' => append_sid($phpbb_root_path . 'memberlist.' . $phpEx, 'mode=viewprofile&amp;u=' . $user_id),
- 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : '',
+ 'U_PROFILE' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $user_id),
+ 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : '',
));
}
@@ -358,7 +356,7 @@ class acp_prune
'S_JOINED_OPTIONS' => $s_find_join_time,
'S_ACTIVE_OPTIONS' => $s_find_active_time,
'S_COUNT_OPTIONS' => $s_find_count,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_prune&amp;field=users'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=acp_prune&amp;field=users'),
));
}
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index 41ed5b0fba..aa827d646c 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -25,8 +25,7 @@ class acp_ranks
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('acp/posting');
@@ -157,7 +156,7 @@ class acp_ranks
}
$db->sql_freeresult($result);
- $imglist = filelist($phpbb_root_path . $config['ranks_path'], '');
+ $imglist = filelist(PHPBB_ROOT_PATH . $config['ranks_path'], '');
$edit_img = $filename_list = '';
foreach ($imglist as $path => $img_ary)
@@ -196,12 +195,12 @@ class acp_ranks
$template->assign_vars(array(
'S_EDIT' => true,
'U_BACK' => $this->u_action,
- 'RANKS_PATH' => $phpbb_root_path . $config['ranks_path'],
+ 'RANKS_PATH' => PHPBB_ROOT_PATH . $config['ranks_path'],
'U_ACTION' => $this->u_action . '&amp;id=' . $rank_id,
'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '',
'S_FILENAME_LIST' => $filename_list,
- 'RANK_IMAGE' => ($edit_img) ? $phpbb_root_path . $config['ranks_path'] . '/' . $edit_img : $phpbb_admin_path . 'images/spacer.gif',
+ 'RANK_IMAGE' => ($edit_img) ? PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $edit_img : PHPBB_ADMIN_PATH . 'images/spacer.gif',
'S_SPECIAL_RANK' => (!isset($ranks['rank_special']) || $ranks['rank_special']) ? true : false,
'MIN_POSTS' => (isset($ranks['rank_min']) && !$ranks['rank_special']) ? $ranks['rank_min'] : 0)
);
@@ -227,7 +226,7 @@ class acp_ranks
'S_RANK_IMAGE' => ($row['rank_image']) ? true : false,
'S_SPECIAL_RANK' => ($row['rank_special']) ? true : false,
- 'RANK_IMAGE' => $phpbb_root_path . $config['ranks_path'] . '/' . $row['rank_image'],
+ 'RANK_IMAGE' => PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $row['rank_image'],
'RANK_TITLE' => $row['rank_title'],
'MIN_POSTS' => $row['rank_min'],
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index 7a74c29631..c7706402be 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -25,8 +25,7 @@ class acp_reasons
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang(array('mcp', 'acp/posting'));
diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php
index dc6f3d1c44..a593afc648 100644
--- a/phpBB/includes/acp/acp_search.php
+++ b/phpBB/includes/acp/acp_search.php
@@ -50,8 +50,7 @@ class acp_search
function settings($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$submit = (isset($_POST['submit'])) ? true : false;
@@ -159,7 +158,7 @@ class acp_search
{
add_log('admin', 'LOG_CONFIG_SEARCH');
}
- $extra_message = '<br />' . $user->lang['SWITCHED_SEARCH_BACKEND'] . '<br /><a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=search&amp;mode=index') . '">&raquo; ' . $user->lang['GO_TO_SEARCH_INDEX'] . '</a>';
+ $extra_message = '<br />' . $user->lang['SWITCHED_SEARCH_BACKEND'] . '<br /><a href="' . append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=search&amp;mode=index') . '">&raquo; ' . $user->lang['GO_TO_SEARCH_INDEX'] . '</a>';
}
else
{
@@ -227,8 +226,7 @@ class acp_search
function index($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
if (isset($_REQUEST['action']) && is_array($_REQUEST['action']))
{
@@ -297,7 +295,7 @@ class acp_search
if (method_exists($this->search, 'delete_index'))
{
// pass a reference to myself so the $search object can make use of save_state() and attributes
- if ($error = $this->search->delete_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=delete", false)))
+ if ($error = $this->search->delete_index($this, append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&mode=$mode&action=delete", false)))
{
$this->state = array('');
$this->save_state();
@@ -360,7 +358,7 @@ class acp_search
if (method_exists($this->search, 'create_index'))
{
// pass a reference to acp_search so the $search object can make use of save_state() and attributes
- if ($error = $this->search->create_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=create", false)))
+ if ($error = $this->search->create_index($this, append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&mode=$mode&action=create", false)))
{
$this->state = array('');
$this->save_state();
@@ -500,8 +498,8 @@ class acp_search
$template->assign_vars(array(
'S_INDEX' => true,
'U_ACTION' => $this->u_action,
- 'U_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;mode=$mode&amp;action=progress_bar"),
- 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;mode=$mode&amp;action=progress_bar")),
+ 'U_PROGRESS_BAR' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&amp;mode=$mode&amp;action=progress_bar"),
+ 'UA_PROGRESS_BAR' => addslashes(append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&amp;mode=$mode&amp;action=progress_bar")),
));
if (isset($this->state[1]))
@@ -546,19 +544,17 @@ class acp_search
function get_search_types()
{
- global $phpbb_root_path, $phpEx;
-
$search_types = array();
- $dp = @opendir($phpbb_root_path . 'includes/search');
+ $dp = @opendir(PHPBB_ROOT_PATH . 'includes/search');
if ($dp)
{
while (($file = readdir($dp)) !== false)
{
- if ((preg_match('#\.' . $phpEx . '$#', $file)) && ($file != "search.$phpEx"))
+ if ((preg_match('#\.' . PHP_EXT . '$#', $file)) && ($file != 'search.' . PHP_EXT))
{
- $search_types[] = preg_replace('#^(.*?)\.' . $phpEx . '$#', '\1', $file);
+ $search_types[] = preg_replace('#^(.*?)\.' . PHP_EXT . '$#', '\1', $file);
}
}
closedir($dp);
@@ -601,15 +597,15 @@ class acp_search
*/
function init_search($type, &$search, &$error)
{
- global $phpbb_root_path, $phpEx, $user;
+ global $user;
- if (!preg_match('#^\w+$#', $type) || !file_exists("{$phpbb_root_path}includes/search/$type.$phpEx"))
+ if (!preg_match('#^\w+$#', $type) || !file_exists(PHPBB_ROOT_PATH . "includes/search/$type." . PHP_EXT))
{
$error = $user->lang['NO_SUCH_SEARCH_MODULE'];
return $error;
}
- include_once("{$phpbb_root_path}includes/search/$type.$phpEx");
+ include_once(PHPBB_ROOT_PATH . "includes/search/$type." . PHP_EXT);
if (!class_exists($type))
{
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 538114de6a..e5002a3de6 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -31,8 +31,7 @@ class acp_styles
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
// Hardcoded template bitfield to add for new templates
$bitfield = new bitfield();
@@ -246,7 +245,7 @@ parse_css_file = {PARSE_CSS_FILE}
$template_refreshed = '';
// Only refresh database if the template is stored in the database
- if ($template_row['template_storedb'] && file_exists("{$phpbb_root_path}styles/{$template_row['template_path']}/template/"))
+ if ($template_row['template_storedb'] && file_exists(PHPBB_ROOT_PATH . "styles/{$template_row['template_path']}/template/"))
{
$filelist = array('' => array());
@@ -257,7 +256,7 @@ parse_css_file = {PARSE_CSS_FILE}
while ($row = $db->sql_fetchrow($result))
{
-// if (@filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/" . $row['template_filename']) > $row['template_mtime'])
+// if (@filemtime(PHPBB_ROOT_PATH . "styles/{$template_row['template_path']}/template/" . $row['template_filename']) > $row['template_mtime'])
// {
// get folder info from the filename
if (($slash_pos = strrpos($row['template_filename'], '/')) === false)
@@ -325,11 +324,11 @@ parse_css_file = {PARSE_CSS_FILE}
if (confirm_box(true))
{
- if ($theme_row['theme_storedb'] && file_exists("{$phpbb_root_path}styles/{$theme_row['theme_path']}/theme/stylesheet.css"))
+ if ($theme_row['theme_storedb'] && file_exists(PHPBB_ROOT_PATH . "styles/{$theme_row['theme_path']}/theme/stylesheet.css"))
{
// Save CSS contents
$sql_ary = array(
- 'theme_mtime' => (int) filemtime("{$phpbb_root_path}styles/{$theme_row['theme_path']}/theme/stylesheet.css"),
+ 'theme_mtime' => (int) filemtime(PHPBB_ROOT_PATH . "styles/{$theme_row['theme_path']}/theme/stylesheet.css"),
'theme_data' => $this->db_theme_data($theme_row)
);
@@ -386,7 +385,7 @@ parse_css_file = {PARSE_CSS_FILE}
$imageset_definitions = array_merge($imageset_definitions, $key_array);
}
- $cfg_data_imageset = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/imageset.cfg");
+ $cfg_data_imageset = parse_cfg_file(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/imageset.cfg");
$db->sql_transaction('begin');
@@ -437,9 +436,9 @@ parse_css_file = {PARSE_CSS_FILE}
while ($row = $db->sql_fetchrow($result))
{
- if (@file_exists("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$row['lang_dir']}/imageset.cfg"))
+ if (@file_exists(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$row['lang_dir']}/imageset.cfg"))
{
- $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$row['lang_dir']}/imageset.cfg");
+ $cfg_data_imageset_data = parse_cfg_file(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$row['lang_dir']}/imageset.cfg");
foreach ($cfg_data_imageset_data as $image_name => $value)
{
if (strpos($value, '*') !== false)
@@ -511,7 +510,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function frontend($mode, $options, $actions)
{
- global $user, $template, $db, $config, $phpbb_root_path, $phpEx;
+ global $user, $template, $db, $config;
$sql_from = '';
$style_count = array();
@@ -600,7 +599,7 @@ parse_css_file = {PARSE_CSS_FILE}
'L_STYLE_ACT_DEACT' => $user->lang['STYLE_' . strtoupper($stylevis)],
'S_OPTIONS' => implode(' | ', $s_options),
'S_ACTIONS' => implode(' | ', $s_actions),
- 'U_PREVIEW' => ($mode == 'style') ? append_sid("{$phpbb_root_path}index.$phpEx", "$mode=" . $row[$mode . '_id']) : '',
+ 'U_PREVIEW' => ($mode == 'style') ? append_sid('index', "style=" . $row[$mode . '_id']) : '',
'NAME' => $row[$mode . '_name'],
'STYLE_COUNT' => ($mode == 'style' && isset($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : 0,
@@ -612,16 +611,16 @@ parse_css_file = {PARSE_CSS_FILE}
// Grab uninstalled items
$new_ary = $cfg = array();
- $dp = @opendir("{$phpbb_root_path}styles");
+ $dp = @opendir(PHPBB_ROOT_PATH . 'styles');
if ($dp)
{
while (($file = readdir($dp)) !== false)
{
$subpath = ($mode != 'style') ? "$mode/" : '';
- if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
+ if ($file[0] != '.' && file_exists(PHPBB_ROOT_PATH . "styles/$file/$subpath$mode.cfg"))
{
- if ($cfg = file("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
+ if ($cfg = file(PHPBB_ROOT_PATH . "styles/$file/$subpath$mode.cfg"))
{
$items = parse_cfg_file('', $cfg);
$name = (isset($items['name'])) ? trim($items['name']) : false;
@@ -668,7 +667,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function edit_template($template_id)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template, $safe_mode;
+ global $config, $db, $cache, $user, $template, $safe_mode;
$this->page_title = 'EDIT_TEMPLATE';
@@ -709,7 +708,7 @@ parse_css_file = {PARSE_CSS_FILE}
if ($save_changes && $template_file)
{
// Get the filesystem location of the current file
- $file = "{$phpbb_root_path}styles/{$template_info['template_path']}/template/$template_file";
+ $file = PHPBB_ROOT_PATH . "styles/{$template_info['template_path']}/template/$template_file";
$additional = '';
// If the template is stored on the filesystem try to write the file else store it in the database
@@ -734,7 +733,7 @@ parse_css_file = {PARSE_CSS_FILE}
WHERE template_id = ' . $template_id;
$db->sql_query($sql);
- $filelist = filelist("{$phpbb_root_path}styles/{$template_info['template_path']}/template", '', 'html');
+ $filelist = filelist(PHPBB_ROOT_PATH . "styles/{$template_info['template_path']}/template", '', 'html');
$this->store_templates('insert', $template_id, $template_info['template_path'], $filelist);
add_log('admin', 'LOG_TEMPLATE_EDIT_DETAILS', $template_info['template_name']);
@@ -763,7 +762,7 @@ parse_css_file = {PARSE_CSS_FILE}
// Generate a category array containing template filenames
if (!$template_info['template_storedb'])
{
- $template_path = "{$phpbb_root_path}styles/{$template_info['template_path']}/template";
+ $template_path = PHPBB_ROOT_PATH . "styles/{$template_info['template_path']}/template";
$filelist = filelist($template_path, '', 'html');
$filelist[''] = array_diff($filelist[''], array('bbcode.html'));
@@ -898,7 +897,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function template_cache($template_id)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
+ global $config, $db, $cache, $user, $template;
$source = str_replace('/', '.', request_var('source', ''));
$file_ary = array_diff(request_var('delete', array('')), array(''));
@@ -928,7 +927,7 @@ parse_css_file = {PARSE_CSS_FILE}
// Someone wants to see the cached source ... so we'll highlight it,
// add line numbers and indent it appropriately. This could be nasty
// on larger source files ...
- if ($source && file_exists("{$phpbb_root_path}cache/{$cache_prefix}_$source.html.$phpEx"))
+ if ($source && file_exists(PHPBB_ROOT_PATH . "cache/{$cache_prefix}_$source.html." . PHP_EXT))
{
adm_page_header($user->lang['TEMPLATE_CACHE']);
@@ -940,7 +939,7 @@ parse_css_file = {PARSE_CSS_FILE}
'FILENAME' => str_replace('.', '/', $source) . '.html')
);
- $code = str_replace(array("\r\n", "\r"), array("\n", "\n"), file_get_contents("{$phpbb_root_path}cache/{$cache_prefix}_$source.html.$phpEx"));
+ $code = str_replace(array("\r\n", "\r"), array("\n", "\n"), file_get_contents(PHPBB_ROOT_PATH . "cache/{$cache_prefix}_$source.html." . PHP_EXT));
$conf = array('highlight.bg', 'highlight.comment', 'highlight.default', 'highlight.html', 'highlight.keyword', 'highlight.string');
foreach ($conf as $ini_var)
@@ -1000,9 +999,9 @@ parse_css_file = {PARSE_CSS_FILE}
$tpl_file = str_replace('.', '/', $file);
$tpl_file = str_replace('///', '../', $tpl_file);
- $filename = "{$cache_prefix}_$file.html.$phpEx";
+ $filename = "{$cache_prefix}_$file.html." . PHP_EXT;
- if (!file_exists("{$phpbb_root_path}cache/$filename"))
+ if (!file_exists(PHPBB_ROOT_PATH . "cache/$filename"))
{
continue;
}
@@ -1010,10 +1009,10 @@ parse_css_file = {PARSE_CSS_FILE}
$template->assign_block_vars('file', array(
'U_VIEWSOURCE' => $this->u_action . "&amp;action=cache&amp;id=$template_id&amp;source=$file",
- 'CACHED' => $user->format_date(filemtime("{$phpbb_root_path}cache/$filename")),
+ 'CACHED' => $user->format_date(filemtime(PHPBB_ROOT_PATH . "cache/$filename")),
'FILENAME' => $file,
- 'FILESIZE' => sprintf('%.1f ' . $user->lang['KIB'], filesize("{$phpbb_root_path}cache/$filename") / 1024),
- 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/$tpl_file.html") : $filemtime[$file . '.html']))
+ 'FILESIZE' => sprintf('%.1f ' . $user->lang['KIB'], filesize(PHPBB_ROOT_PATH . "cache/$filename") / 1024),
+ 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime(PHPBB_ROOT_PATH . "styles/{$template_row['template_path']}/template/$tpl_file.html") : $filemtime[$file . '.html']))
);
}
unset($filemtime);
@@ -1034,7 +1033,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function edit_theme($theme_id)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template, $safe_mode;
+ global $config, $db, $cache, $user, $template, $safe_mode;
$this->page_title = 'EDIT_THEME';
@@ -1065,7 +1064,7 @@ parse_css_file = {PARSE_CSS_FILE}
if ($save_changes)
{
// Get the filesystem location of the current file
- $file = "{$phpbb_root_path}styles/{$theme_info['theme_path']}/theme/$theme_file";
+ $file = PHPBB_ROOT_PATH . "styles/{$theme_info['theme_path']}/theme/$theme_file";
$additional = '';
$message = $user->lang['THEME_UPDATED'];
@@ -1110,7 +1109,7 @@ parse_css_file = {PARSE_CSS_FILE}
// Generate a category array containing theme filenames
if (!$theme_info['theme_storedb'])
{
- $theme_path = "{$phpbb_root_path}styles/{$theme_info['theme_path']}/theme";
+ $theme_path = PHPBB_ROOT_PATH ."styles/{$theme_info['theme_path']}/theme";
$filelist = filelist($theme_path, '', 'css');
@@ -1218,7 +1217,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function edit_imageset($imageset_id)
{
- global $db, $user, $phpbb_root_path, $cache, $template;
+ global $db, $user, $cache, $template;
$this->page_title = 'EDIT_IMAGESET';
@@ -1293,7 +1292,7 @@ parse_css_file = {PARSE_CSS_FILE}
$imgheight = request_var('imgheight', 0);
$imglang = '';
- if ($imgpath && !file_exists("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath"))
+ if ($imgpath && !file_exists(PHPBB_ROOT_PATH . "styles/$imageset_path/imageset/$imgpath"))
{
trigger_error($user->lang['NO_IMAGE_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -1302,7 +1301,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
if (!$imgwidth || !$imgheight)
{
- list($imgwidth_file, $imgheight_file) = getimagesize("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath");
+ list($imgwidth_file, $imgheight_file) = getimagesize(PHPBB_ROOT_PATH . "styles/$imageset_path/imageset/$imgpath");
$imgwidth = ($imgwidth) ? $imgwidth : $imgwidth_file;
$imgheight = ($imgheight) ? $imgheight : $imgheight_file;
}
@@ -1361,7 +1360,7 @@ parse_css_file = {PARSE_CSS_FILE}
$imagesetlist = array('nolang' => array(), 'lang' => array());
$langs = array();
- $dir = "{$phpbb_root_path}styles/$imageset_path/imageset";
+ $dir = PHPBB_ROOT_PATH . "styles/$imageset_path/imageset";
$dp = @opendir($dir);
if ($dp)
@@ -1487,7 +1486,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function remove($mode, $style_id)
{
- global $db, $template, $user, $phpbb_root_path, $cache, $config;
+ global $db, $template, $user, $cache, $config;
$new_id = request_var('new_id', 0);
$update = (isset($_POST['update'])) ? true : false;
@@ -1623,7 +1622,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function export($mode, $style_id)
{
- global $db, $template, $user, $phpbb_root_path, $cache, $phpEx, $config;
+ global $db, $template, $user, $cache, $config;
$update = (isset($_POST['update'])) ? true : false;
@@ -1866,7 +1865,7 @@ parse_css_file = {PARSE_CSS_FILE}
end($data);
- $imageset_root = "{$phpbb_root_path}styles/{$style_row['imageset_path']}/imageset/";
+ $imageset_root = PHPBB_ROOT_PATH . "styles/{$style_row['imageset_path']}/imageset/";
if ($dh = @opendir($imageset_root))
{
@@ -1946,7 +1945,7 @@ parse_css_file = {PARSE_CSS_FILE}
if (!sizeof($error))
{
- include($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_compress.' . PHP_EXT);
if ($mode == 'style')
{
@@ -1959,11 +1958,11 @@ parse_css_file = {PARSE_CSS_FILE}
if ($format == 'zip')
{
- $compress = new compress_zip('w', $phpbb_root_path . "store/$path$ext");
+ $compress = new compress_zip('w', PHPBB_ROOT_PATH . "store/$path$ext");
}
else
{
- $compress = new compress_tar('w', $phpbb_root_path . "store/$path$ext", $ext);
+ $compress = new compress_tar('w', PHPBB_ROOT_PATH . "store/$path$ext", $ext);
}
if (sizeof($files))
@@ -1989,7 +1988,7 @@ parse_css_file = {PARSE_CSS_FILE}
if (!$store)
{
$compress->download($path);
- @unlink("{$phpbb_root_path}store/$path$ext");
+ @unlink(PHPBB_ROOT_PATH . "store/$path$ext");
exit;
}
@@ -2040,7 +2039,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function details($mode, $style_id)
{
- global $template, $db, $config, $user, $safe_mode, $cache, $phpbb_root_path;
+ global $template, $db, $config, $user, $safe_mode, $cache;
$update = (isset($_POST['update'])) ? true : false;
$l_type = strtoupper($mode);
@@ -2112,7 +2111,7 @@ parse_css_file = {PARSE_CSS_FILE}
if ($mode === 'theme' || $mode === 'template')
{
// a rather elaborate check we have to do here once to avoid trouble later
- $check = "{$phpbb_root_path}styles/" . $style_row["{$mode}_path"] . (($mode === 'theme') ? '/theme/stylesheet.css' : '/template');
+ $check = PHPBB_ROOT_PATH . "styles/" . $style_row["{$mode}_path"] . (($mode === 'theme') ? '/theme/stylesheet.css' : '/template');
if (($style_row["{$mode}_storedb"] != $store_db) && !$store_db && ($safe_mode || !@is_writable($check)))
{
$error[] = $user->lang['EDIT_' . strtoupper($mode) . '_STORED_DB'];
@@ -2122,7 +2121,7 @@ parse_css_file = {PARSE_CSS_FILE}
// themes which have to be parsed have to go into db
if ($mode == 'theme')
{
- $cfg = parse_cfg_file("{$phpbb_root_path}styles/" . $style_row["{$mode}_path"] . "/theme/theme.cfg");
+ $cfg = parse_cfg_file(PHPBB_ROOT_PATH . "styles/" . $style_row["{$mode}_path"] . "/theme/theme.cfg");
if (isset($cfg['parse_css_file']) && $cfg['parse_css_file'] && !$store_db)
{
@@ -2193,12 +2192,12 @@ parse_css_file = {PARSE_CSS_FILE}
{
$theme_data = $this->db_theme_data($style_row);
}
- else if (!$store_db && !$safe_mode && @is_writable("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css"))
+ else if (!$store_db && !$safe_mode && @is_writable(PHPBB_ROOT_PATH . "styles/{$style_row['theme_path']}/theme/stylesheet.css"))
{
$store_db = 1;
$theme_data = $style_row['theme_data'];
- if ($fp = @fopen("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css", 'wb'))
+ if ($fp = @fopen(PHPBB_ROOT_PATH . "styles/{$style_row['theme_path']}/theme/stylesheet.css", 'wb'))
{
$store_db = (@fwrite($fp, str_replace("styles/{$style_row['theme_path']}/theme/", './', $theme_data))) ? 0 : 1;
}
@@ -2206,7 +2205,7 @@ parse_css_file = {PARSE_CSS_FILE}
}
$sql_ary += array(
- 'theme_mtime' => ($store_db) ? filemtime("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css") : 0,
+ 'theme_mtime' => ($store_db) ? filemtime(PHPBB_ROOT_PATH . "styles/{$style_row['theme_path']}/theme/stylesheet.css") : 0,
'theme_storedb' => $store_db,
'theme_data' => ($store_db) ? $theme_data : '',
);
@@ -2217,7 +2216,7 @@ parse_css_file = {PARSE_CSS_FILE}
if ($style_row['template_storedb'] != $store_db)
{
- if (!$store_db && !$safe_mode && @is_writable("{$phpbb_root_path}styles/{$style_row['template_path']}/template"))
+ if (!$store_db && !$safe_mode && @is_writable(PHPBB_ROOT_PATH . "styles/{$style_row['template_path']}/template"))
{
$sql = 'SELECT *
FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
@@ -2226,7 +2225,7 @@ parse_css_file = {PARSE_CSS_FILE}
while ($row = $db->sql_fetchrow($result))
{
- if (!($fp = @fopen("{$phpbb_root_path}styles/{$style_row['template_path']}/template/" . $row['template_filename'], 'wb')))
+ if (!($fp = @fopen(PHPBB_ROOT_PATH . "styles/{$style_row['template_path']}/template/" . $row['template_filename'], 'wb')))
{
$store_db = 1;
$error[] = $user->lang['EDIT_TEMPLATE_STORED_DB'];
@@ -2247,7 +2246,7 @@ parse_css_file = {PARSE_CSS_FILE}
}
else if ($store_db)
{
- $filelist = filelist("{$phpbb_root_path}styles/{$style_row['template_path']}/template", '', 'html');
+ $filelist = filelist(PHPBB_ROOT_PATH . "styles/{$style_row['template_path']}/template", '', 'html');
$this->store_templates('insert', $style_id, $style_row['template_path'], $filelist);
}
else
@@ -2350,9 +2349,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function load_css_file($path, $filename)
{
- global $phpbb_root_path;
-
- $file = "{$phpbb_root_path}styles/$path/theme/$filename";
+ $file = PHPBB_ROOT_PATH . "styles/$path/theme/$filename";
if (file_exists($file) && ($content = file_get_contents($file)))
{
@@ -2372,17 +2369,15 @@ parse_css_file = {PARSE_CSS_FILE}
*
* @param array $theme_row is an associative array containing the theme's current database entry
* @param mixed $stylesheet can either be the new content for the stylesheet or false to load from the standard file
- * @param string $root_path should only be used in case you want to use a different root path than "{$phpbb_root_path}styles/{$theme_row['theme_path']}"
+ * @param string $root_path should only be used in case you want to use a different root path than PHPBB_ROOT_PATH . "styles/{$theme_row['theme_path']}"
*
* @return string Stylesheet data for theme_data column in the theme table
*/
function db_theme_data($theme_row, $stylesheet = false, $root_path = '')
{
- global $phpbb_root_path;
-
if (!$root_path)
{
- $root_path = $phpbb_root_path . 'styles/' . $theme_row['theme_path'];
+ $root_path = PHPBB_ROOT_PATH . 'styles/' . $theme_row['theme_path'];
}
if (!$stylesheet)
@@ -2415,7 +2410,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function store_templates($mode, $style_id, $template_path, $filelist)
{
- global $phpbb_root_path, $phpEx, $db;
+ global $db;
$template_path = $template_path . '/template/';
$includes = array();
@@ -2423,11 +2418,11 @@ parse_css_file = {PARSE_CSS_FILE}
{
foreach ($file_ary as $file)
{
- if (!($fp = @fopen("{$phpbb_root_path}styles/$template_path$pathfile$file", 'r')))
+ if (!($fp = @fopen(PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file", 'r')))
{
- trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR);
+ trigger_error('Could not open ' . PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file", E_USER_ERROR);
}
- $template_data = fread($fp, filesize("{$phpbb_root_path}styles/$template_path$pathfile$file"));
+ $template_data = fread($fp, filesize(PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file"));
fclose($fp);
if (preg_match_all('#<!-- INCLUDE (.*?\.html) -->#is', $template_data, $matches))
@@ -2456,8 +2451,8 @@ parse_css_file = {PARSE_CSS_FILE}
'template_id' => (int) $style_id,
'template_filename' => "$pathfile$file",
'template_included' => (isset($includes[$file])) ? implode(':', $includes[$file]) . ':' : '',
- 'template_mtime' => (int) filemtime("{$phpbb_root_path}styles/$template_path$pathfile$file"),
- 'template_data' => (string) file_get_contents("{$phpbb_root_path}styles/$template_path$pathfile$file"),
+ 'template_mtime' => (int) filemtime(PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file"),
+ 'template_data' => (string) file_get_contents(PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file"),
);
if ($mode == 'insert')
@@ -2484,11 +2479,11 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function template_cache_filelist($template_path)
{
- global $phpbb_root_path, $phpEx, $user;
+ global $user;
$cache_prefix = 'tpl_' . $template_path;
- if (!($dp = @opendir("{$phpbb_root_path}cache")))
+ if (!($dp = @opendir(PHPBB_ROOT_PATH . 'cache')))
{
trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -2501,9 +2496,9 @@ parse_css_file = {PARSE_CSS_FILE}
continue;
}
- if (is_file($phpbb_root_path . 'cache/' . $file) && (strpos($file, $cache_prefix) === 0))
+ if (is_file(PHPBB_ROOT_PATH . 'cache/' . $file) && (strpos($file, $cache_prefix) === 0))
{
- $file_ary[] = str_replace('.', '/', preg_replace('#^' . preg_quote($cache_prefix, '#') . '_(.*?)\.html\.' . $phpEx . '$#i', '\1', $file));
+ $file_ary[] = str_replace('.', '/', preg_replace('#^' . preg_quote($cache_prefix, '#') . '_(.*?)\.html\.' . PHP_EXT . '$#i', '\1', $file));
}
}
closedir($dp);
@@ -2520,7 +2515,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function clear_template_cache($template_row, $file_ary = false)
{
- global $phpbb_root_path, $phpEx, $user;
+ global $user;
$cache_prefix = 'tpl_' . $template_row['template_path'];
@@ -2538,7 +2533,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
$file = str_replace('/', '.', $file);
- $file = "{$phpbb_root_path}cache/{$cache_prefix}_$file.html.$phpEx";
+ $file = PHPBB_ROOT_PATH . "cache/{$cache_prefix}_$file.html." . PHP_EXT;
if (file_exists($file) && is_file($file))
{
@unlink($file);
@@ -2554,7 +2549,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function install($mode)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
+ global $config, $db, $cache, $user, $template;
$l_type = strtoupper($mode);
@@ -2568,7 +2563,7 @@ parse_css_file = {PARSE_CSS_FILE}
// Installing, obtain cfg file contents
if ($install_path)
{
- $root_path = $phpbb_root_path . 'styles/' . $install_path . '/';
+ $root_path = PHPBB_ROOT_PATH . 'styles/' . $install_path . '/';
$cfg_file = ($mode == 'style') ? "$root_path$mode.cfg" : "$root_path$mode/$mode.cfg";
if (!file_exists($cfg_file))
@@ -2617,7 +2612,7 @@ parse_css_file = {PARSE_CSS_FILE}
$element . '_copyright' => '')
);
- $this->test_installed($element, $error, (${'reqd_' . $element}) ? $phpbb_root_path . 'styles/' . $reqd_template . '/' : $root_path, ${'reqd_' . $element}, $style_row[$element . '_id'], $style_row[$element . '_name'], $style_row[$element . '_copyright']);
+ $this->test_installed($element, $error, (${'reqd_' . $element}) ? PHPBB_ROOT_PATH . 'styles/' . $reqd_template . '/' : $root_path, ${'reqd_' . $element}, $style_row[$element . '_id'], $style_row[$element . '_name'], $style_row[$element . '_copyright']);
if (!$style_row[$element . '_name'])
{
@@ -2656,7 +2651,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
foreach ($element_ary as $element => $table)
{
- ${$element . '_root_path'} = (${'reqd_' . $element}) ? $phpbb_root_path . 'styles/' . ${'reqd_' . $element} . '/' : false;
+ ${$element . '_root_path'} = (${'reqd_' . $element}) ? PHPBB_ROOT_PATH . 'styles/' . ${'reqd_' . $element} . '/' : false;
${$element . '_path'} = (${'reqd_' . $element}) ? ${'reqd_' . $element} : false;
}
$this->install_style($error, 'install', $root_path, $style_row['style_id'], $style_row['style_name'], $install_path, $style_row['style_copyright'], $style_row['style_active'], $style_row['style_default'], $style_row, $template_root_path, $template_path, $theme_root_path, $theme_path, $imageset_root_path, $imageset_path);
@@ -2712,7 +2707,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function add($mode)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
+ global $config, $db, $cache, $user, $template;
$l_type = strtoupper($mode);
$element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE);
@@ -3031,7 +3026,7 @@ parse_css_file = {PARSE_CSS_FILE}
*/
function install_element($mode, &$error, $action, $root_path, &$id, $name, $path, $copyright, $store_db = 0)
{
- global $phpbb_root_path, $db, $user;
+ global $db, $user;
switch ($mode)
{
@@ -3120,7 +3115,7 @@ parse_css_file = {PARSE_CSS_FILE}
case 'theme':
// We are only interested in the theme configuration for now
- $theme_cfg = parse_cfg_file("{$phpbb_root_path}styles/$path/theme/theme.cfg");
+ $theme_cfg = parse_cfg_file(PHPBB_ROOT_PATH . "styles/$path/theme/theme.cfg");
if (isset($theme_cfg['parse_css_file']) && $theme_cfg['parse_css_file'])
{
@@ -3130,7 +3125,7 @@ parse_css_file = {PARSE_CSS_FILE}
$sql_ary += array(
'theme_storedb' => $store_db,
'theme_data' => ($store_db) ? $this->db_theme_data($sql_ary, false, $root_path) : '',
- 'theme_mtime' => (int) filemtime("{$phpbb_root_path}styles/$path/theme/stylesheet.css")
+ 'theme_mtime' => (int) filemtime(PHPBB_ROOT_PATH . "styles/$path/theme/stylesheet.css")
);
break;
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
index dbb25bdbbd..a6440c8364 100644
--- a/phpBB/includes/acp/acp_update.php
+++ b/phpBB/includes/acp/acp_update.php
@@ -26,7 +26,6 @@ class acp_update
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('install');
@@ -48,7 +47,7 @@ class acp_update
$latest_version = trim($info[0]);
$announcement_url = trim($info[1]);
- $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
+ $update_link = append_sid('install/index', 'mode=update');
// Determine automatic update...
$sql = 'SELECT config_value
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 3ad8c88fb9..667cd6a64b 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -31,8 +31,7 @@ class acp_users
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
+ global $config, $db, $user, $auth, $template, $cache, $file_uploads;
$user->add_lang(array('posting', 'ucp', 'acp/users'));
$this->tpl_name = 'acp_users';
@@ -51,7 +50,7 @@ class acp_users
// Whois (special case)
if ($action == 'whois')
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$this->page_title = 'WHOIS';
$this->tpl_name = 'simple_body';
@@ -78,7 +77,7 @@ class acp_users
'ANONYMOUS_USER_ID' => ANONYMOUS,
'S_SELECT_USER' => true,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_user&amp;field=username&amp;select_single=true'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=select_user&amp;field=username&amp;select_single=true'),
));
return;
@@ -146,7 +145,7 @@ class acp_users
$template->assign_vars(array(
'U_BACK' => $this->u_action,
- 'U_MODE_SELECT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;u=$user_id"),
+ 'U_MODE_SELECT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&amp;u=$user_id"),
'U_ACTION' => $this->u_action . '&amp;u=' . $user_id,
'S_FORM_OPTIONS' => $s_form_options,
'MANAGED_USERNAME' => $user_row['username'])
@@ -162,7 +161,7 @@ class acp_users
{
case 'overview':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$user->add_lang('acp/ban');
@@ -303,7 +302,7 @@ class acp_users
if ($config['email_enable'])
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$server_url = generate_board_url();
@@ -347,7 +346,7 @@ class acp_users
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
'USERNAME' => htmlspecialchars_decode($user_row['username']),
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
+ 'U_ACTIVATE' => "$server_url/ucp." . PHP_EXT . "?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
);
$messenger->send(NOTIFY_EMAIL);
@@ -906,7 +905,7 @@ class acp_users
'U_SHOW_IP' => $this->u_action . "&amp;u=$user_id&amp;ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
'U_WHOIS' => $this->u_action . "&amp;action=whois&amp;user_ip={$user_row['user_ip']}",
- 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_row['user_id']}") : '',
+ 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid('ucp', "mode=switch_perm&amp;u={$user_row['user_id']}") : '',
'USER' => $user_row['username'],
'USER_REGISTERED' => $user->format_date($user_row['user_regdate']),
@@ -1024,8 +1023,8 @@ class acp_users
case 'profile':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
$cp = new custom_profile();
@@ -1227,7 +1226,7 @@ class acp_users
case 'prefs':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$data = array(
'dateformat' => utf8_normalize_nfc(request_var('dateformat', $user_row['user_dateformat'], true)),
@@ -1438,10 +1437,10 @@ class acp_users
case 'avatar':
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
+ $can_upload = (file_exists(PHPBB_ROOT_PATH . $config['avatar_path']) && @is_writable(PHPBB_ROOT_PATH . $config['avatar_path']) && $file_uploads) ? true : false;
if ($submit)
{
@@ -1461,7 +1460,7 @@ class acp_users
}
// Generate users avatar
- $avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
+ $avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '<img src="' . PHPBB_ADMIN_PATH . 'images/no_avatar.gif" alt="" />';
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
$avatar_select = basename(request_var('avatar_select', ''));
@@ -1532,8 +1531,8 @@ class acp_users
case 'sig':
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
$enable_bbcode = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false;
$enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false;
@@ -1544,7 +1543,7 @@ class acp_users
if ($submit || $preview)
{
- include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
$message_parser = new parse_message($signature);
@@ -1602,7 +1601,7 @@ class acp_users
'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '',
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' checked="checked"' : '',
- 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid('faq', 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid('faq', 'mode=bbcode') . '">', '</a>'),
'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
@@ -1734,11 +1733,11 @@ class acp_users
{
if ($row['in_message'])
{
- $view_topic = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;p={$row['post_msg_id']}");
+ $view_topic = append_sid('ucp', "i=pm&amp;p={$row['post_msg_id']}");
}
else
{
- $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&amp;p={$row['post_msg_id']}") . '#p' . $row['post_msg_id'];
+ $view_topic = append_sid('viewtopic', "t={$row['topic_id']}&amp;p={$row['post_msg_id']}") . '#p' . $row['post_msg_id'];
}
$template->assign_block_vars('attach', array(
@@ -1756,7 +1755,7 @@ class acp_users
'S_IN_MESSAGE' => $row['in_message'],
- 'U_DOWNLOAD' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&amp;id=' . $row['attach_id']),
+ 'U_DOWNLOAD' => append_sid('download/file', 'mode=view&amp;id=' . $row['attach_id']),
'U_VIEW_TOPIC' => $view_topic)
);
}
@@ -1775,7 +1774,7 @@ class acp_users
case 'groups':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$user->add_lang(array('groups', 'acp/groups'));
$group_id = request_var('g', 0);
@@ -1933,7 +1932,7 @@ class acp_users
foreach ($data_ary as $data)
{
$template->assign_block_vars('group', array(
- 'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g={$data['group_id']}&amp;back_link=acp_users_groups"),
+ 'U_EDIT_GROUP' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g={$data['group_id']}&amp;back_link=acp_users_groups"),
'U_DEFAULT' => $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_DEMOTE_PROMOTE' => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id'],
@@ -1957,7 +1956,7 @@ class acp_users
case 'perm':
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
$auth_admin = new auth_admin();
@@ -2015,8 +2014,8 @@ class acp_users
'S_FORUM_OPTIONS' => $s_forum_options,
'U_ACTION' => $this->u_action . '&amp;u=' . $user_id,
- 'U_USER_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx" ,'i=permissions&amp;mode=setting_user_global&amp;user_id[]=' . $user_id),
- 'U_USER_FORUM_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions&amp;mode=setting_user_local&amp;user_id[]=' . $user_id))
+ 'U_USER_PERMISSIONS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions&amp;mode=setting_user_global&amp;user_id[]=' . $user_id),
+ 'U_USER_FORUM_PERMISSIONS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions&amp;mode=setting_user_local&amp;user_id[]=' . $user_id))
);
break;
diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php
index 596c2fc743..5db6bef3e5 100644
--- a/phpBB/includes/acp/acp_words.php
+++ b/phpBB/includes/acp/acp_words.php
@@ -26,8 +26,7 @@ class acp_words
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $config;
$user->add_lang('acp/posting');
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 5c81092a65..0fd78981a9 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -262,7 +262,7 @@ class auth_admin extends auth
*/
public function display_mask($mode, $permission_type, array $hold_ary, $user_mode = 'user', $local = false, $group_display = true)
{
- global $template, $user, $db, $phpbb_root_path, $phpEx;
+ global $template, $user, $db;
// Define names for template loops, might be able to be set
$tpl_pmask = 'p_mask';
@@ -606,7 +606,7 @@ class auth_admin extends auth
*/
public function display_role_mask(array $hold_ary)
{
- global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $template, $user;
if (!sizeof($hold_ary))
{
@@ -650,7 +650,7 @@ class auth_admin extends auth
$template->assign_block_vars('role_mask.users', array(
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
- 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&amp;u={$row['user_id']}"))
+ 'U_PROFILE' => append_sid('memberlist', "mode=viewprofile&amp;u={$row['user_id']}"))
);
}
$db->sql_freeresult($result);
@@ -669,7 +669,7 @@ class auth_admin extends auth
$template->assign_block_vars('role_mask.groups', array(
'GROUP_ID' => $row['group_id'],
'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],
- 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&amp;g={$row['group_id']}"))
+ 'U_PROFILE' => append_sid('memberlist', "mode=group&amp;g={$row['group_id']}"))
);
}
$db->sql_freeresult($result);
@@ -1076,7 +1076,7 @@ class auth_admin extends auth
*/
private static function assign_cat_array(array $category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view)
{
- global $template, $user, $phpbb_admin_path, $phpEx;
+ global $template, $user;
@reset($category_array);
while (list($cat, $cat_array) = each($category_array))
@@ -1118,8 +1118,8 @@ class auth_admin extends auth
'FIELD_NAME' => $permission,
'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
- 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
- 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
+ 'U_TRACE' => ($show_trace) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
+ 'UA_TRACE' => ($show_trace) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
);
@@ -1136,8 +1136,8 @@ class auth_admin extends auth
'FIELD_NAME' => $permission,
'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
- 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
- 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
+ 'U_TRACE' => ($show_trace) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
+ 'UA_TRACE' => ($show_trace) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
);