diff options
Diffstat (limited to 'phpBB/includes/acp/acp_attachments.php')
-rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 29 |
1 files changed, 14 insertions, 15 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; |