mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
ok... i hope i haven't messed too much with the code and everything is still working.
Changes: - Ascraeus now uses constants for the phpbb root path and the php extension. This ensures more security for external applications and modifications (no more overwriting of root path and extension possible through insecure mods and register globals enabled) as well as no more globalizing needed. - A second change implemented here is an additional short-hand-notation for append_sid(). It is allowed to omit the root path and extension now (for example calling append_sid('memberlist')) - in this case the root path and extension get added automatically. The hook is called after these are added. git-svn-id: file:///svn/phpbb/trunk@8572 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
91b4fe1868
commit
2f4a618900
154 changed files with 2044 additions and 3484 deletions
|
@ -15,11 +15,11 @@ define('ADMIN_START', true);
|
||||||
define('NEED_SID', true);
|
define('NEED_SID', true);
|
||||||
|
|
||||||
// Include files
|
// Include files
|
||||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
|
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
require($phpbb_root_path . 'common.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||||
require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/functions_module.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
@ -42,7 +42,7 @@ if (!$auth->acl_get('a_'))
|
||||||
|
|
||||||
// We define the admin variables now, because the user is now able to use the admin related features...
|
// We define the admin variables now, because the user is now able to use the admin related features...
|
||||||
define('IN_ADMIN', true);
|
define('IN_ADMIN', true);
|
||||||
$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './';
|
if (!defined('PHPBB_ADMIN_PATH')) define('PHPBB_ADMIN_PATH', './');
|
||||||
|
|
||||||
// Some oft used variables
|
// Some oft used variables
|
||||||
$safe_mode = (@ini_get('safe_mode') == '1' || @strtolower(ini_get('safe_mode')) === 'on') ? true : false;
|
$safe_mode = (@ini_get('safe_mode') == '1' || @strtolower(ini_get('safe_mode')) === 'on') ? true : false;
|
||||||
|
@ -51,8 +51,8 @@ $module_id = request_var('i', '');
|
||||||
$mode = request_var('mode', '');
|
$mode = request_var('mode', '');
|
||||||
|
|
||||||
// Set custom template for admin area
|
// Set custom template for admin area
|
||||||
$template->set_custom_template($phpbb_admin_path . 'style', 'admin');
|
$template->set_custom_template(PHPBB_ADMIN_PATH . 'style', 'admin');
|
||||||
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
|
$template->assign_var('T_TEMPLATE_PATH', PHPBB_ADMIN_PATH . 'style');
|
||||||
|
|
||||||
// the acp template is never stored in the database
|
// the acp template is never stored in the database
|
||||||
$user->theme['template_storedb'] = false;
|
$user->theme['template_storedb'] = false;
|
||||||
|
@ -68,7 +68,7 @@ $module->set_active($module_id, $mode);
|
||||||
|
|
||||||
// Assign data to the template engine for the list of modules
|
// Assign data to the template engine for the list of modules
|
||||||
// We do this before loading the active module for correct menu display in trigger_error
|
// We do this before loading the active module for correct menu display in trigger_error
|
||||||
$module->assign_tpl_vars(append_sid("{$phpbb_admin_path}index.$phpEx"));
|
$module->assign_tpl_vars(append_sid('index'));
|
||||||
|
|
||||||
// Load and execute the relevant module
|
// Load and execute the relevant module
|
||||||
$module->load_active();
|
$module->load_active();
|
||||||
|
@ -88,7 +88,7 @@ adm_page_footer();
|
||||||
function adm_page_header($page_title)
|
function adm_page_header($page_title)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $template;
|
global $config, $db, $user, $template;
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
|
global $SID, $_SID;
|
||||||
|
|
||||||
if (defined('HEADER_INC'))
|
if (defined('HEADER_INC'))
|
||||||
{
|
{
|
||||||
|
@ -113,30 +113,30 @@ function adm_page_header($page_title)
|
||||||
'SID' => $SID,
|
'SID' => $SID,
|
||||||
'_SID' => $_SID,
|
'_SID' => $_SID,
|
||||||
'SESSION_ID' => $user->session_id,
|
'SESSION_ID' => $user->session_id,
|
||||||
'ROOT_PATH' => $phpbb_admin_path,
|
'ROOT_PATH' => PHPBB_ADMIN_PATH,
|
||||||
|
|
||||||
'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'),
|
'U_LOGOUT' => append_sid('ucp', 'mode=logout'),
|
||||||
'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"),
|
'U_ADM_INDEX' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT),
|
||||||
'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
|
'U_INDEX' => append_sid('index'),
|
||||||
|
|
||||||
'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
|
'T_IMAGES_PATH' => PHPBB_ROOT_PATH . 'images/',
|
||||||
'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
|
'T_SMILIES_PATH' => PHPBB_ROOT_PATH . $config['smilies_path'] . '/',
|
||||||
'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/",
|
'T_AVATAR_PATH' => PHPBB_ROOT_PATH . $config['avatar_path'] . '/',
|
||||||
'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
|
'T_AVATAR_GALLERY_PATH' => PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/',
|
||||||
'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
|
'T_ICONS_PATH' => PHPBB_ROOT_PATH . $config['icons_path'] . '/',
|
||||||
'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
|
'T_RANKS_PATH' => PHPBB_ROOT_PATH . $config['ranks_path'] . '/',
|
||||||
'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
|
'T_UPLOAD_PATH' => PHPBB_ROOT_PATH . $config['upload_path'] . '/',
|
||||||
|
|
||||||
'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
'ICON_MOVE_UP' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||||
'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
'ICON_MOVE_UP_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||||
'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
'ICON_MOVE_DOWN' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||||
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||||
'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
'ICON_EDIT' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||||
'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
'ICON_EDIT_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||||
'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
'ICON_DELETE' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
||||||
'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
'ICON_DELETE_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
||||||
'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
|
'ICON_SYNC' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
|
||||||
'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
|
'ICON_SYNC_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
|
||||||
|
|
||||||
'S_USER_LANG' => $user->lang['USER_LANG'],
|
'S_USER_LANG' => $user->lang['USER_LANG'],
|
||||||
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
||||||
|
@ -161,7 +161,7 @@ function adm_page_header($page_title)
|
||||||
function adm_page_footer($copyright_html = true)
|
function adm_page_footer($copyright_html = true)
|
||||||
{
|
{
|
||||||
global $db, $config, $template, $user, $auth, $cache;
|
global $db, $config, $template, $user, $auth, $cache;
|
||||||
global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
global $starttime;
|
||||||
|
|
||||||
// Output page creation time
|
// Output page creation time
|
||||||
if (defined('DEBUG'))
|
if (defined('DEBUG'))
|
||||||
|
@ -372,7 +372,8 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
||||||
*/
|
*/
|
||||||
function validate_config_vars($config_vars, &$cfg_array, &$error)
|
function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $user;
|
global $user;
|
||||||
|
|
||||||
$type = 0;
|
$type = 0;
|
||||||
$min = 1;
|
$min = 1;
|
||||||
$max = 2;
|
$max = 2;
|
||||||
|
@ -465,13 +466,13 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||||
|
|
||||||
$cfg_array[$config_name] = basename($cfg_array[$config_name]);
|
$cfg_array[$config_name] = basename($cfg_array[$config_name]);
|
||||||
|
|
||||||
if (!file_exists($phpbb_root_path . 'language/' . $cfg_array[$config_name] . '/'))
|
if (!file_exists(PHPBB_ROOT_PATH . 'language/' . $cfg_array[$config_name] . '/'))
|
||||||
{
|
{
|
||||||
$error[] = $user->lang['WRONG_DATA_LANG'];
|
$error[] = $user->lang['WRONG_DATA_LANG'];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Relative path (appended $phpbb_root_path)
|
// Relative path (appended PHPBB_ROOT_PATH)
|
||||||
case 'rpath':
|
case 'rpath':
|
||||||
case 'rwpath':
|
case 'rwpath':
|
||||||
if (!$cfg_array[$config_name])
|
if (!$cfg_array[$config_name])
|
||||||
|
@ -513,12 +514,12 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists($phpbb_root_path . $cfg_array[$config_name]))
|
if (!file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
|
||||||
{
|
{
|
||||||
$error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
|
$error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name]))
|
if (file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]) && !is_dir(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
|
||||||
{
|
{
|
||||||
$error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
|
$error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
|
||||||
}
|
}
|
||||||
|
@ -526,7 +527,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||||
// Check if the path is writable
|
// Check if the path is writable
|
||||||
if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
|
if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
|
||||||
{
|
{
|
||||||
if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !@is_writable($phpbb_root_path . $cfg_array[$config_name]))
|
if (file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]) && !@is_writable(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
|
||||||
{
|
{
|
||||||
$error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
|
$error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
*/
|
*/
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
define('ADMIN_START', true);
|
define('ADMIN_START', true);
|
||||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
|
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin(false);
|
$user->session_begin(false);
|
||||||
|
@ -23,7 +23,7 @@ $auth->acl($user->data);
|
||||||
$user->setup();
|
$user->setup();
|
||||||
|
|
||||||
// Set custom template for admin area
|
// Set custom template for admin area
|
||||||
$template->set_custom_template($phpbb_root_path . 'adm/style', 'admin');
|
$template->set_custom_template(PHPBB_ROOT_PATH . CONFIG_ADM_FOLDER . '/style', 'admin');
|
||||||
|
|
||||||
$template->set_filenames(array(
|
$template->set_filenames(array(
|
||||||
'body' => 'colour_swatch.html')
|
'body' => 'colour_swatch.html')
|
||||||
|
@ -39,7 +39,7 @@ $name = (!preg_match('/^[a-z0-9_-]+$/i', $name)) ? '' : $name;
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'OPENER' => $form,
|
'OPENER' => $form,
|
||||||
'NAME' => $name,
|
'NAME' => $name,
|
||||||
'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
|
'T_IMAGES_PATH' => PHPBB_ROOT_PATH . 'images/',
|
||||||
|
|
||||||
'S_USER_LANG' => $user->lang['USER_LANG'],
|
'S_USER_LANG' => $user->lang['USER_LANG'],
|
||||||
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
||||||
|
|
|
@ -117,15 +117,15 @@ else
|
||||||
|
|
||||||
if (defined('IN_CRON'))
|
if (defined('IN_CRON'))
|
||||||
{
|
{
|
||||||
$phpbb_root_path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
|
@define('PHPBB_ROOT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists($phpbb_root_path . 'config.' . $phpEx))
|
if (!file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT))
|
||||||
{
|
{
|
||||||
die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>");
|
die('<p>The config.' . PHP_EXT . ' file could not be found.</p><p><a href="' . PHPBB_ROOT_PATH . 'install/index.' . PHP_EXT . '">Click here to install phpBB</a></p>');
|
||||||
}
|
}
|
||||||
|
|
||||||
require($phpbb_root_path . 'config.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
|
||||||
|
|
||||||
if (!defined('PHPBB_INSTALLED'))
|
if (!defined('PHPBB_INSTALLED'))
|
||||||
{
|
{
|
||||||
|
@ -144,7 +144,7 @@ if (!defined('PHPBB_INSTALLED'))
|
||||||
|
|
||||||
// Replace any number of consecutive backslashes and/or slashes with a single slash
|
// Replace any number of consecutive backslashes and/or slashes with a single slash
|
||||||
// (could happen on some proxy setups and/or Windows servers)
|
// (could happen on some proxy setups and/or Windows servers)
|
||||||
$script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx;
|
$script_path = trim(dirname($script_name)) . '/install/index.' . PHP_EXT;
|
||||||
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
|
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
|
||||||
|
|
||||||
$url = (($secure) ? 'https://' : 'http://') . $server_name;
|
$url = (($secure) ? 'https://' : 'http://') . $server_name;
|
||||||
|
@ -184,18 +184,18 @@ if (!empty($load_extensions))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include files
|
// Include files
|
||||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/acm/acm_' . $acm_type . '.' . PHP_EXT);
|
||||||
require($phpbb_root_path . 'includes/cache.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/cache.' . PHP_EXT);
|
||||||
require($phpbb_root_path . 'includes/template.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/template.' . PHP_EXT);
|
||||||
require($phpbb_root_path . 'includes/session.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/session.' . PHP_EXT);
|
||||||
require($phpbb_root_path . 'includes/auth.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/auth.' . PHP_EXT);
|
||||||
|
|
||||||
require($phpbb_root_path . 'includes/functions.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
|
||||||
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/functions_content.' . PHP_EXT);
|
||||||
|
|
||||||
require($phpbb_root_path . 'includes/constants.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT);
|
||||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
|
||||||
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/utf/utf_tools.' . PHP_EXT);
|
||||||
|
|
||||||
// Set PHP error handler to ours
|
// Set PHP error handler to ours
|
||||||
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
||||||
|
@ -217,12 +217,12 @@ unset($dbpasswd);
|
||||||
$config = cache::obtain_config();
|
$config = cache::obtain_config();
|
||||||
|
|
||||||
// Add own hook handler
|
// Add own hook handler
|
||||||
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/hooks/index.' . PHP_EXT);
|
||||||
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
|
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
|
||||||
|
|
||||||
foreach (cache::obtain_hooks() as $hook)
|
foreach (cache::obtain_hooks() as $hook)
|
||||||
{
|
{
|
||||||
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
|
@include(PHPBB_ROOT_PATH . 'includes/hooks/' . $hook . '.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -12,9 +12,9 @@
|
||||||
*/
|
*/
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
define('IN_CRON', true);
|
define('IN_CRON', true);
|
||||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
|
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
// Do not update users last page entry
|
// Do not update users last page entry
|
||||||
$user->session_begin(false);
|
$user->session_begin(false);
|
||||||
|
@ -74,7 +74,7 @@ switch ($cron_type)
|
||||||
{
|
{
|
||||||
case 'queue':
|
case 'queue':
|
||||||
|
|
||||||
if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
|
if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists(PHPBB_ROOT_PATH . 'cache/queue.' . PHP_EXT))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ switch ($cron_type)
|
||||||
$use_shutdown_function = false;
|
$use_shutdown_function = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
|
||||||
$queue = new queue();
|
$queue = new queue();
|
||||||
|
|
||||||
if ($use_shutdown_function)
|
if ($use_shutdown_function)
|
||||||
|
@ -122,12 +122,12 @@ switch ($cron_type)
|
||||||
// Select the search method
|
// Select the search method
|
||||||
$search_type = basename($config['search_type']);
|
$search_type = basename($config['search_type']);
|
||||||
|
|
||||||
if (time() - $config['search_gc'] <= $config['search_last_gc'] || !file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
|
if (time() - $config['search_gc'] <= $config['search_last_gc'] || !file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
|
include_once(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT);
|
||||||
|
|
||||||
// We do some additional checks in the module to ensure it can actually be utilised
|
// We do some additional checks in the module to ensure it can actually be utilised
|
||||||
$error = false;
|
$error = false;
|
||||||
|
@ -156,7 +156,7 @@ switch ($cron_type)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||||
|
|
||||||
if ($use_shutdown_function)
|
if ($use_shutdown_function)
|
||||||
{
|
{
|
||||||
|
@ -176,7 +176,7 @@ switch ($cron_type)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||||
|
|
||||||
if ($use_shutdown_function)
|
if ($use_shutdown_function)
|
||||||
{
|
{
|
||||||
|
@ -226,7 +226,7 @@ switch ($cron_type)
|
||||||
// Do the forum Prune thang
|
// Do the forum Prune thang
|
||||||
if ($row['prune_next'] < time() && $row['enable_prune'])
|
if ($row['prune_next'] < time() && $row['enable_prune'])
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||||
|
|
||||||
if ($row['prune_days'])
|
if ($row['prune_days'])
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,34 +20,10 @@
|
||||||
//
|
//
|
||||||
die("Please read the first lines of this script for instructions on how to enable it");
|
die("Please read the first lines of this script for instructions on how to enable it");
|
||||||
|
|
||||||
|
|
||||||
// This script adds missing permissions
|
|
||||||
$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
|
|
||||||
|
|
||||||
define('IN_PHPBB', 1);
|
define('IN_PHPBB', 1);
|
||||||
define('ANONYMOUS', 1);
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
$phpbb_root_path='./../';
|
require(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'config.'.$phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
|
|
||||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
|
||||||
|
|
||||||
define('ACL_NEVER', 0);
|
|
||||||
define('ACL_YES', 1);
|
|
||||||
define('ACL_NO', -1);
|
|
||||||
|
|
||||||
define('ACL_GROUPS_TABLE', $table_prefix.'acl_groups');
|
|
||||||
define('ACL_OPTIONS_TABLE', $table_prefix.'acl_options');
|
|
||||||
define('ACL_USERS_TABLE', $table_prefix.'acl_users');
|
|
||||||
define('GROUPS_TABLE', $table_prefix.'groups');
|
|
||||||
define('USERS_TABLE', $table_prefix.'users');
|
|
||||||
|
|
||||||
$cache = new acm();
|
|
||||||
$db = new sql_db();
|
|
||||||
|
|
||||||
// Connect to DB
|
|
||||||
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
|
|
||||||
|
|
||||||
// auth => is_local, is_global
|
// auth => is_local, is_global
|
||||||
$f_permissions = array(
|
$f_permissions = array(
|
||||||
|
@ -414,4 +390,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
garbage_collection();
|
||||||
|
exit_handler();
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -9,9 +9,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
@ -130,9 +130,9 @@ $db->sql_close();
|
||||||
|
|
||||||
function adjust_avatar($old_name, $midfix)
|
function adjust_avatar($old_name, $midfix)
|
||||||
{
|
{
|
||||||
global $config, $phpbb_root_path;
|
global $config;
|
||||||
|
|
||||||
$avatar_path = $phpbb_root_path . $config['avatar_path'];
|
$avatar_path = PHPBB_ROOT_PATH . $config['avatar_path'];
|
||||||
$extension = strtolower(substr(strrchr($old_name, '.'), 1));
|
$extension = strtolower(substr(strrchr($old_name, '.'), 1));
|
||||||
$new_name = $config['avatar_salt'] . '_' . $midfix . '.' . $extension;
|
$new_name = $config['avatar_salt'] . '_' . $midfix . '.' . $extension;
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,10 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
|
|
@ -10,9 +10,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
|
|
@ -13,9 +13,9 @@ set_time_limit(0);
|
||||||
@ini_set('memory_limit', '128M');
|
@ini_set('memory_limit', '128M');
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
|
|
@ -7,9 +7,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
|
|
@ -12,9 +12,9 @@ set_time_limit(0);
|
||||||
@ini_set('memory_limit', '512M');
|
@ini_set('memory_limit', '512M');
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
|
|
@ -9,9 +9,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
|
|
@ -1,462 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
//
|
|
||||||
// Security message:
|
|
||||||
//
|
|
||||||
// This script is potentially dangerous.
|
|
||||||
// Remove or comment the next line (die(".... ) to enable this script.
|
|
||||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
|
||||||
//
|
|
||||||
die("Please read the first lines of this script for instructions on how to enable it");
|
|
||||||
|
|
||||||
//
|
|
||||||
// Do not change anything below this line.
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
$phpbb_root_path = "../";
|
|
||||||
include($phpbb_root_path . 'extension.inc');
|
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
|
||||||
include($phpbb_root_path . 'includes/post.'.$phpEx);
|
|
||||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
|
||||||
|
|
||||||
srand ((double) microtime() * 1000000);
|
|
||||||
set_time_limit(240*60);
|
|
||||||
|
|
||||||
// Here's the text we stick in posts..
|
|
||||||
$bigass_text = '
|
|
||||||
phpBB BBCode test suite v0.0.2
|
|
||||||
auto-linkification:
|
|
||||||
http://something.com
|
|
||||||
www.something.com
|
|
||||||
nate@phpbb.com
|
|
||||||
http://something.com/foo.php?this=that&theother=some%20encoded%20string is a link.
|
|
||||||
[code]
|
|
||||||
Simple code block with some <html> <tags>.
|
|
||||||
[/code]
|
|
||||||
[b]bolded[/b], [i]italic[/i]
|
|
||||||
[email]james@totalgeek.org[/email]
|
|
||||||
[url=http://www.totalgeek.org]totalgeek.org[/url]
|
|
||||||
[url]www.totalgeek.org[/url]
|
|
||||||
[list]
|
|
||||||
[*] This is the first bulleted item.
|
|
||||||
[*] This is the second bulleted item.
|
|
||||||
[/list]
|
|
||||||
[list=A]
|
|
||||||
[*] This is the first bulleted item.
|
|
||||||
[*] This is the second bulleted item.
|
|
||||||
[/list]
|
|
||||||
[quote]
|
|
||||||
And a quote!
|
|
||||||
[/quote]
|
|
||||||
';
|
|
||||||
|
|
||||||
|
|
||||||
// The script expects the ID's in the tables to sequential (1,2,3,4,5),
|
|
||||||
// so no holes please (1,4,5,8)...
|
|
||||||
$nr_of_users = nrof(USERS_TABLE);
|
|
||||||
$nr_of_cats = nrof(CATEGORIES_TABLE);
|
|
||||||
$nr_of_forums = nrof(FORUMS_TABLE);
|
|
||||||
$nr_of_posts = nrof(POSTS_TABLE);
|
|
||||||
|
|
||||||
$u = $users;
|
|
||||||
|
|
||||||
$starttime = microtime();
|
|
||||||
|
|
||||||
$usercreationcount = 0;
|
|
||||||
while($users > 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
$name = "testuser_" . substr(md5(uniqid(rand())), 0, 10);
|
|
||||||
if (make_user($name))
|
|
||||||
{
|
|
||||||
$usercreationcount++;
|
|
||||||
$users--;
|
|
||||||
}
|
|
||||||
if (($usercreationcount % 500) == 0)
|
|
||||||
{
|
|
||||||
echo "status: $usercreationcount <br>\n";
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($posts > 0)
|
|
||||||
{
|
|
||||||
filldb($posts);
|
|
||||||
}
|
|
||||||
|
|
||||||
$endtime = microtime();
|
|
||||||
|
|
||||||
if ($submit="" || !isset($submit))
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
Hello, welcome to this little phpBB Benchmarking script :)<p>
|
|
||||||
|
|
||||||
At the moment there are:<br>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr><td align="right"><?php echo $nr_of_users?></td><td>Users</td></tr>
|
|
||||||
<tr><td align="right"><?php echo $nr_of_forums?></td><td>Forums</td></tr>
|
|
||||||
<tr><td align="right"><?php echo $nr_of_posts?></td><td>Posts</td></tr>
|
|
||||||
</table>
|
|
||||||
<p>
|
|
||||||
What do you want to create?<p>
|
|
||||||
|
|
||||||
<form method="get" action="<?php echo $PHP_SELF?>">
|
|
||||||
<input type="text" name="users" size="3"> Users<br>
|
|
||||||
<input type="text" name="posts" size="3"> Posts/topics (optional: post size in <input type="text" name="size" size="3"> bytes)<br>
|
|
||||||
<input type="submit" name="submit">
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
list ($starttime_msec,$starttime_sec) = explode(" ",$starttime);
|
|
||||||
list ($endtime_msec,$endtime_sec) = explode(" ",$endtime);
|
|
||||||
$timetaken_sec = ($endtime_sec+$endtime_msec) - ($starttime_sec+$starttime_msec);
|
|
||||||
print "<B>TIME TAKEN : ".$timetaken_sec."s</B><BR>\n";
|
|
||||||
|
|
||||||
print "<p>\n<a href=\"$PHP_SELF\">Back to the overview page</a>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function filldb($newposts)
|
|
||||||
{
|
|
||||||
global $nr_of_forums;
|
|
||||||
global $nr_of_users;
|
|
||||||
|
|
||||||
$forum_topic_counts = array();
|
|
||||||
|
|
||||||
for ($i = 1; $i <= $nr_of_forums; $i++)
|
|
||||||
{
|
|
||||||
$forum_topic_counts[$i] = get_topic_count($i);
|
|
||||||
}
|
|
||||||
|
|
||||||
for($i = 0; $i < $newposts; $i++)
|
|
||||||
{
|
|
||||||
$userid = rand(2, $nr_of_users - 1);
|
|
||||||
$forum = rand(1,$nr_of_forums);
|
|
||||||
|
|
||||||
if ((rand(0,30) < 1) || ($forum_topic_count[$forum] == 0))
|
|
||||||
{
|
|
||||||
// create a new topic 1 in 30 times (or when there are none);
|
|
||||||
$topic = make_topic($userid, "Testing topic $i", $forum);
|
|
||||||
$forum_topic_count[$forum]++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Otherwise create a reply(posting) somewhere.
|
|
||||||
$topic = get_smallest_topic($forum);
|
|
||||||
create_posting($userid, $topic, $forum, "reply");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($i % 1000) == 0)
|
|
||||||
{
|
|
||||||
echo "status: $i <br>";
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function get_smallest_topic($forum_id)
|
|
||||||
{
|
|
||||||
global $db;
|
|
||||||
|
|
||||||
$sql = "SELECT topic_id
|
|
||||||
FROM " . TOPICS_TABLE . "
|
|
||||||
WHERE (forum_id = $forum_id)
|
|
||||||
ORDER BY topic_replies ASC LIMIT 1";
|
|
||||||
if($result = $db->sql_query($sql))
|
|
||||||
{
|
|
||||||
$row = $db->sql_fetchrow($result);
|
|
||||||
$topic_id = $row['topic_id'];
|
|
||||||
|
|
||||||
unset($result);
|
|
||||||
unset($row);
|
|
||||||
return $topic_id;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Couldn't get smallest topic.", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function get_topic_count($forum_id)
|
|
||||||
{
|
|
||||||
global $db;
|
|
||||||
|
|
||||||
$sql = "SELECT forum_topics
|
|
||||||
FROM " . FORUMS_TABLE . "
|
|
||||||
WHERE (forum_id = $forum_id)";
|
|
||||||
if($result = $db->sql_query($sql))
|
|
||||||
{
|
|
||||||
$row = $db->sql_fetchrow($result);
|
|
||||||
$topic_count = $row['forum_topics'];
|
|
||||||
|
|
||||||
unset($result);
|
|
||||||
unset($row);
|
|
||||||
return $topic_count;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Couldn't get topic count.", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function make_topic($user_id, $subject, $forum_id)
|
|
||||||
{
|
|
||||||
global $db;
|
|
||||||
$topic_type = POST_NORMAL;
|
|
||||||
$topic_vote = 0;
|
|
||||||
$current_time = time();
|
|
||||||
|
|
||||||
$sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote)
|
|
||||||
VALUES ('$subject', $user_id, $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)";
|
|
||||||
|
|
||||||
if( $result = $db->sql_query($sql, BEGIN_TRANSACTION) )
|
|
||||||
{
|
|
||||||
$new_topic_id = $db->sql_nextid();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Error inserting data into topics table", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
create_posting($user_id, $new_topic_id, $forum_id);
|
|
||||||
|
|
||||||
return $new_topic_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function create_posting($userid, $topic_id, $forum, $mode='newtopic')
|
|
||||||
{
|
|
||||||
$message = generatepost();
|
|
||||||
|
|
||||||
return make_post($topic_id, $forum, $userid, "", $message, $mode);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $mode='newtopic')
|
|
||||||
{
|
|
||||||
global $db;
|
|
||||||
$current_time = time();
|
|
||||||
$user_ip = "ac100202";
|
|
||||||
$bbcode_on = 1;
|
|
||||||
$html_on = 1;
|
|
||||||
$smilies_on = 1;
|
|
||||||
$attach_sig = 1;
|
|
||||||
$bbcode_uid = make_bbcode_uid();
|
|
||||||
|
|
||||||
$post_subject = 'random subject';
|
|
||||||
|
|
||||||
$post_message = prepare_message($text, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
|
|
||||||
|
|
||||||
$sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, attach_id, icon_id, post_username, post_time, poster_ip, post_approved, bbcode_uid, enable_bbcode, enable_html, enable_smilies, enable_sig, post_subject, post_text)
|
|
||||||
VALUES ($new_topic_id, $forum_id, $user_id, 0, 0, '$post_username', $current_time, '$user_ip', 1, '$bbcode_uid', $bbcode_on, $html_on, $smilies_on, $attach_sig, '$post_subject', '$post_message')";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$new_post_id = $db->sql_nextid();
|
|
||||||
|
|
||||||
$sql = "UPDATE " . TOPICS_TABLE . "
|
|
||||||
SET topic_last_post_id = $new_post_id";
|
|
||||||
if($mode == "reply")
|
|
||||||
{
|
|
||||||
$sql .= ", topic_replies = topic_replies + 1 ";
|
|
||||||
}
|
|
||||||
$sql .= " WHERE topic_id = $new_topic_id";
|
|
||||||
|
|
||||||
if($db->sql_query($sql))
|
|
||||||
{
|
|
||||||
$sql = "UPDATE " . FORUMS_TABLE . "
|
|
||||||
SET forum_last_post_id = $new_post_id, forum_posts = forum_posts + 1";
|
|
||||||
if($mode == "newtopic")
|
|
||||||
{
|
|
||||||
$sql .= ", forum_topics = forum_topics + 1";
|
|
||||||
}
|
|
||||||
$sql .= " WHERE forum_id = $forum_id";
|
|
||||||
|
|
||||||
if($db->sql_query($sql))
|
|
||||||
{
|
|
||||||
$sql = "UPDATE " . USERS_TABLE . "
|
|
||||||
SET user_posts = user_posts + 1
|
|
||||||
WHERE user_id = " . $user_id;
|
|
||||||
|
|
||||||
if($db->sql_query($sql, END_TRANSACTION))
|
|
||||||
{
|
|
||||||
// SUCCESS.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Error updating users table", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Error updating forums table", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Rollback
|
|
||||||
if($db->sql_layer == "mysql")
|
|
||||||
{
|
|
||||||
$sql = "DELETE FROM " . POSTS_TABLE . "
|
|
||||||
WHERE post_id = $new_post_id";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
}
|
|
||||||
message_die(GENERAL_ERROR, "Error updating topics table", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Error inserting data into posts table", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function generatepost($size=850)
|
|
||||||
{
|
|
||||||
global $bigass_text;
|
|
||||||
// Returns a string with a length between $size and $size*0.2
|
|
||||||
$size = rand(0.2*$size, $size);
|
|
||||||
|
|
||||||
$textsize = strlen($bigass_text);
|
|
||||||
$currentsize = 0;
|
|
||||||
// Add whole $text multiple times
|
|
||||||
while($currentsize < $size && $size-$currentsize <= $textsize)
|
|
||||||
{
|
|
||||||
$message .= $bigass_text;
|
|
||||||
$currentsize += $textsize;
|
|
||||||
}
|
|
||||||
// Add the remainder number of chars and return it.
|
|
||||||
$message .= substr($bigass_text, 0, $size-$currentsize);
|
|
||||||
|
|
||||||
return (addslashes($message));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function nrof($table)
|
|
||||||
{
|
|
||||||
global $db;
|
|
||||||
$sql = "SELECT count(*) AS counted FROM $table";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
$topics = $db->sql_fetchrow($result);
|
|
||||||
return $topics[counted];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function make_user($username)
|
|
||||||
{
|
|
||||||
global $db, $board_config;
|
|
||||||
|
|
||||||
$password = md5("benchpass");
|
|
||||||
$email = "nobody@localhost";
|
|
||||||
$icq = "12345678";
|
|
||||||
$website = "http://www.phpbb.com";
|
|
||||||
$occupation = "phpBB tester";
|
|
||||||
$location = "phpBB world hq";
|
|
||||||
$interests = "Eating, sleeping, living, and breathing phpBB";
|
|
||||||
$signature = "$username: phpBB tester.";
|
|
||||||
$signature_bbcode_uid = "";
|
|
||||||
$avatar_filename = "";
|
|
||||||
$viewemail = 0;
|
|
||||||
$aim = 0;
|
|
||||||
$yim = 0;
|
|
||||||
$msn = 0;
|
|
||||||
$attachsig = 1;
|
|
||||||
$allowsmilies = 1;
|
|
||||||
$allowhtml = 1;
|
|
||||||
$allowbbcode = 1;
|
|
||||||
$allowviewonline = 1;
|
|
||||||
$notifyreply = 0;
|
|
||||||
$notifypm = 0;
|
|
||||||
$user_timezone = $board_config['board_timezone'];
|
|
||||||
$user_dateformat = $board_config['default_dateformat'];
|
|
||||||
$user_lang = $board_config['default_lang'];
|
|
||||||
$user_style = $board_config['default_style'];
|
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT MAX(user_id) AS total
|
|
||||||
FROM " . USERS_TABLE;
|
|
||||||
if($result = $db->sql_query($sql))
|
|
||||||
{
|
|
||||||
$row = $db->sql_fetchrow($result);
|
|
||||||
$new_user_id = $row['total'] + 1;
|
|
||||||
|
|
||||||
unset($result);
|
|
||||||
unset($row);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Couldn't obtained next user_id information.", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "SELECT MAX(group_id) AS total
|
|
||||||
FROM " . GROUPS_TABLE;
|
|
||||||
if($result = $db->sql_query($sql))
|
|
||||||
{
|
|
||||||
$row = $db->sql_fetchrow($result);
|
|
||||||
$new_group_id = $row['total'] + 1;
|
|
||||||
|
|
||||||
unset($result);
|
|
||||||
unset($row);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Couldn't obtained next user_id information.", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
|
|
||||||
VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$icq', '$website', '$occupation', '$location', '$interests', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, ";
|
|
||||||
|
|
||||||
|
|
||||||
$sql .= "1, '')";
|
|
||||||
|
|
||||||
if($result = $db->sql_query($sql, BEGIN_TRANSACTION))
|
|
||||||
{
|
|
||||||
$sql = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_name, group_description, group_single_user, group_moderator)
|
|
||||||
VALUES ($new_group_id, '', 'Personal User', 1, 0)";
|
|
||||||
if($result = $db->sql_query($sql))
|
|
||||||
{
|
|
||||||
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
|
|
||||||
VALUES ($new_user_id, $new_group_id, 0)";
|
|
||||||
if($result = $db->sql_query($sql, END_TRANSACTION))
|
|
||||||
{
|
|
||||||
|
|
||||||
// SUCCESS.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Couldn't insert data into user_group table", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Couldn't insert data into groups table", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Couldn't insert data into users table", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
|
@ -21,22 +21,10 @@
|
||||||
die("Please read the first lines of this script for instructions on how to enable it");
|
die("Please read the first lines of this script for instructions on how to enable it");
|
||||||
@set_time_limit(300);
|
@set_time_limit(300);
|
||||||
|
|
||||||
$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
|
|
||||||
|
|
||||||
define('IN_PHPBB', 1);
|
define('IN_PHPBB', 1);
|
||||||
define('ANONYMOUS', 1);
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
$phpbb_root_path='./../';
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'config.'.$phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
|
|
||||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
|
||||||
|
|
||||||
$cache = new acm();
|
|
||||||
$db = new sql_db();
|
|
||||||
|
|
||||||
// Connect to DB
|
|
||||||
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
|
|
||||||
|
|
||||||
$start = 0;
|
$start = 0;
|
||||||
do
|
do
|
||||||
|
|
|
@ -30,23 +30,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
|
|
||||||
@set_time_limit(2400);
|
@set_time_limit(2400);
|
||||||
|
|
||||||
// This script adds missing permissions
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
define('IN_PHPBB', 1);
|
|
||||||
define('ANONYMOUS', 1);
|
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
|
||||||
$phpbb_root_path='./../';
|
|
||||||
include($phpbb_root_path . 'config.'.$phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
|
|
||||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
|
||||||
|
|
||||||
$cache = new acm();
|
|
||||||
$db = new $sql_db();
|
|
||||||
|
|
||||||
// Connect to DB
|
|
||||||
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
|
|
||||||
|
|
||||||
$sql = "SELECT post_id, post_text FROM {$table_prefix}posts WHERE post_text LIKE '%{SMILE_PATH}%'";
|
$sql = "SELECT post_id, post_text FROM {$table_prefix}posts WHERE post_text LIKE '%{SMILE_PATH}%'";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
|
@ -21,10 +21,10 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
|
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||||
|
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
header('Expires: 0');
|
header('Expires: 0');
|
||||||
|
@ -117,14 +117,14 @@ switch ($mode)
|
||||||
|
|
||||||
if ($topic_id >= $num_topics)
|
if ($topic_id >= $num_topics)
|
||||||
{
|
{
|
||||||
echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?mode=sync&' . time() . '">And now for something completely different...';
|
echo '<meta http-equiv="refresh" content="10; url=fill.' . PHP_EXT . '?mode=sync&' . time() . '">And now for something completely different...';
|
||||||
|
|
||||||
$db->sql_query('ANALYZE TABLES ' . TOPICS_TABLE . ', ' . POSTS_TABLE);
|
$db->sql_query('ANALYZE TABLES ' . TOPICS_TABLE . ', ' . POSTS_TABLE);
|
||||||
flush();
|
flush();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?start=' . $topic_id . '&' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')';
|
echo '<meta http-equiv="refresh" content="10; url=fill.' . PHP_EXT . '?start=' . $topic_id . '&' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')';
|
||||||
flush();
|
flush();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -141,7 +141,7 @@ switch ($mode)
|
||||||
$e = explode(' ', microtime());
|
$e = explode(' ', microtime());
|
||||||
|
|
||||||
echo '<pre><b>' . ($e[0] + $e[1] - $s[0] - $s[1]) . '</b></pre>';
|
echo '<pre><b>' . ($e[0] + $e[1] - $s[0] - $s[1]) . '</b></pre>';
|
||||||
echo '<a href="fill.' . $phpEx . '">Here we go again</a>';
|
echo '<a href="fill.' . PHP_EXT . '">Here we go again</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -157,11 +157,11 @@ switch ($mode)
|
||||||
if ($end < $num_topics)
|
if ($end < $num_topics)
|
||||||
{
|
{
|
||||||
$start += $batch_size;
|
$start += $batch_size;
|
||||||
echo '<meta http-equiv="refresh" content="0; url=fill.' . $phpEx . "?mode=sync&start=$start&" . time() . "\">And now for something completely different... ($start/$num_topics)";
|
echo '<meta http-equiv="refresh" content="0; url=fill.' . PHP_EXT . "?mode=sync&start=$start&" . time() . "\">And now for something completely different... ($start/$num_topics)";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo '<a href="fill.' . $phpEx . '">Here we go again</a>';
|
echo '<a href="fill.' . PHP_EXT . '">Here we go again</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = '../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
|
|
||||||
echo "Checking for required files\n";
|
echo "Checking for required files\n";
|
||||||
download('http://unicode.org/Public/UNIDATA/CaseFolding.txt');
|
download('http://unicode.org/Public/UNIDATA/CaseFolding.txt');
|
||||||
|
@ -71,8 +71,8 @@ foreach ($array as $value)
|
||||||
|
|
||||||
foreach ($uniarray as $idx => $contents)
|
foreach ($uniarray as $idx => $contents)
|
||||||
{
|
{
|
||||||
echo "Writing to case_fold_$idx.$phpEx\n";
|
echo "Writing to case_fold_$idx." . PHP_EXT . "\n";
|
||||||
$fp = fopen($phpbb_root_path . 'includes/utf/data/case_fold_' . strtolower($idx) . '.' . $phpEx, 'wb');
|
$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/case_fold_' . strtolower($idx) . '.' . PHP_EXT, 'wb');
|
||||||
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
|
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
|
@ -116,9 +116,7 @@ function my_var_export($var)
|
||||||
*/
|
*/
|
||||||
function download($url)
|
function download($url)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
|
||||||
|
|
||||||
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +128,7 @@ function download($url)
|
||||||
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
|
if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
|
||||||
{
|
{
|
||||||
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,8 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = '../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
|
|
||||||
echo "Checking for required files\n";
|
echo "Checking for required files\n";
|
||||||
download('http://unicode.org/reports/tr39/data/confusables.txt');
|
download('http://unicode.org/reports/tr39/data/confusables.txt');
|
||||||
|
@ -155,9 +155,9 @@ foreach ($array as $value)
|
||||||
$uniarray[utf8_chr(hexdec((string)$value[1]))] = $temp_hold;
|
$uniarray[utf8_chr(hexdec((string)$value[1]))] = $temp_hold;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Writing to confusables.$phpEx\n";
|
echo "Writing to confusables." . PHP_EXT . "\n";
|
||||||
|
|
||||||
$fp = fopen($phpbb_root_path . 'includes/utf/data/confusables.' . $phpEx, 'wb');
|
$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/confusables.' . PHP_EXT, 'wb');
|
||||||
fwrite($fp, '<?php return ' . my_var_export($uniarray) . ';');
|
fwrite($fp, '<?php return ' . my_var_export($uniarray) . ';');
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
|
@ -200,9 +200,7 @@ function my_var_export($var)
|
||||||
*/
|
*/
|
||||||
function download($url)
|
function download($url)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
|
||||||
|
|
||||||
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -214,7 +212,7 @@ function download($url)
|
||||||
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
|
if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
|
||||||
{
|
{
|
||||||
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,8 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = '../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
|
|
||||||
echo "Checking for required files\n";
|
echo "Checking for required files\n";
|
||||||
download('http://www.unicode.org/Public/UNIDATA/CompositionExclusions.txt');
|
download('http://www.unicode.org/Public/UNIDATA/CompositionExclusions.txt');
|
||||||
|
@ -34,7 +34,7 @@ download('http://www.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt');
|
||||||
download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt');
|
download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt');
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
|
require_once(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
|
||||||
$file_contents = array();
|
$file_contents = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -172,7 +172,7 @@ fclose($fp);
|
||||||
* Do mappings
|
* Do mappings
|
||||||
*/
|
*/
|
||||||
echo "Loading Unicode decomposition mappings\n";
|
echo "Loading Unicode decomposition mappings\n";
|
||||||
$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
|
$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt');
|
||||||
|
|
||||||
$map = array();
|
$map = array();
|
||||||
while (!feof($fp))
|
while (!feof($fp))
|
||||||
|
@ -266,9 +266,9 @@ foreach ($file_contents as $file => $contents)
|
||||||
/**
|
/**
|
||||||
* Generate a new file
|
* Generate a new file
|
||||||
*/
|
*/
|
||||||
echo "Writing to $file.$phpEx\n";
|
echo "Writing to $file." . PHP_EXT . "\n";
|
||||||
|
|
||||||
if (!$fp = fopen($phpbb_root_path . 'includes/utf/data/' . $file . '.' . $phpEx, 'wb'))
|
if (!$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/' . $file . '.' . PHP_EXT, 'wb'))
|
||||||
{
|
{
|
||||||
trigger_error('Cannot open ' . $file . ' for write');
|
trigger_error('Cannot open ' . $file . ' for write');
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ echo "\n*** UTF-8 normalization tables done\n\n";
|
||||||
*/
|
*/
|
||||||
echo "Generating search indexer tables\n";
|
echo "Generating search indexer tables\n";
|
||||||
|
|
||||||
$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
|
$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt');
|
||||||
|
|
||||||
$map = array();
|
$map = array();
|
||||||
while ($line = fgets($fp, 1024))
|
while ($line = fgets($fp, 1024))
|
||||||
|
@ -406,8 +406,8 @@ unset($map);
|
||||||
|
|
||||||
foreach ($file_contents as $idx => $contents)
|
foreach ($file_contents as $idx => $contents)
|
||||||
{
|
{
|
||||||
echo "Writing to search_indexer_$idx.$phpEx\n";
|
echo "Writing to search_indexer_$idx." . PHP_EXT . "\n";
|
||||||
$fp = fopen($phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $phpEx, 'wb');
|
$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/search_indexer_' . $idx . '.' . PHP_EXT, 'wb');
|
||||||
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
|
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
|
@ -486,9 +486,7 @@ function my_var_export($var)
|
||||||
*/
|
*/
|
||||||
function download($url)
|
function download($url)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
|
||||||
|
|
||||||
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -500,7 +498,7 @@ function download($url)
|
||||||
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
|
if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
|
||||||
{
|
{
|
||||||
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,13 +24,13 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
// Thanks to arod-1
|
// Thanks to arod-1
|
||||||
|
|
||||||
define('IN_PHPBB', 1);
|
define('IN_PHPBB', 1);
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpbb_root_path='./../';
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
$mode = request_var('mode', '');
|
$mode = request_var('mode', '');
|
||||||
|
|
||||||
$modules = find_modules($phpbb_root_path . 'language/en');
|
$modules = find_modules(PHPBB_ROOT_PATH . 'language/en');
|
||||||
|
|
||||||
$kkeys = $keys = array();
|
$kkeys = $keys = array();
|
||||||
$langdir = dirname(__FILE__);
|
$langdir = dirname(__FILE__);
|
||||||
|
@ -81,7 +81,7 @@ while ($module = array_shift($keys))
|
||||||
}
|
}
|
||||||
|
|
||||||
$color = '';
|
$color = '';
|
||||||
if ((basename($module) == "common.$phpEx") || (basename($other_module) == "common.$phpEx"))
|
if ((basename($module) == "common." . PHP_EXT) || (basename($other_module) == "common." . PHP_EXT))
|
||||||
{
|
{
|
||||||
$color = ' style="color:#B00000;"';
|
$color = ' style="color:#B00000;"';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
<?php
|
|
||||||
// -------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// FILENAME : merge_attachment_tables.php
|
|
||||||
// STARTED : Tue Nov 04, 2003
|
|
||||||
// COPYRIGHT : © 2001, 2003 phpBB Group
|
|
||||||
// WWW : http://www.phpbb.com/
|
|
||||||
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
|
|
||||||
//
|
|
||||||
// -------------------------------------------------------------
|
|
||||||
|
|
||||||
//
|
|
||||||
// Security message:
|
|
||||||
//
|
|
||||||
// This script is potentially dangerous.
|
|
||||||
// Remove or comment the next line (die(".... ) to enable this script.
|
|
||||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
|
||||||
//
|
|
||||||
die("Please read the first lines of this script for instructions on how to enable it");
|
|
||||||
|
|
||||||
$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
|
|
||||||
|
|
||||||
define('IN_PHPBB', 1);
|
|
||||||
define('ANONYMOUS', 1);
|
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
|
||||||
$phpbb_root_path='./../';
|
|
||||||
include($phpbb_root_path . 'config.'.$phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
|
|
||||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
|
||||||
|
|
||||||
$cache = new acm();
|
|
||||||
$db = new sql_db();
|
|
||||||
|
|
||||||
// Connect to DB
|
|
||||||
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
|
|
||||||
|
|
||||||
// Rename the attachments table...
|
|
||||||
$sql = "RENAME TABLE {$table_prefix}attachments TO {$table_prefix}attach_temp";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
$sql = "CREATE TABLE {$table_prefix}attachments
|
|
||||||
SELECT d.*, a.post_id, a.user_id_from as poster_id, p.topic_id
|
|
||||||
FROM {$table_prefix}attach_desc d, {$table_prefix}attach_temp a, {$table_prefix}posts p
|
|
||||||
WHERE a.attach_id = d.attach_id
|
|
||||||
AND a.post_id = p.post_id";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
switch ($db->sql_layer)
|
|
||||||
{
|
|
||||||
case 'mysql':
|
|
||||||
case 'mysql4':
|
|
||||||
$sql = 'ALTER TABLE ' . $table_prefix . 'attachments
|
|
||||||
ADD PRIMARY KEY (attach_id),
|
|
||||||
ADD INDEX filetime (filetime),
|
|
||||||
ADD INDEX post_id (post_id),
|
|
||||||
ADD INDEX poster_id (poster_id),
|
|
||||||
ADD INDEX physical_filename (physical_filename(10)),
|
|
||||||
ADD INDEX filesize (filesize),
|
|
||||||
ADD INDEX topic_id (topic_id),
|
|
||||||
MODIFY COLUMN attach_id mediumint(8) UNSIGNED NOT NULL auto_increment';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'mssql':
|
|
||||||
case 'mssql-odbc':
|
|
||||||
case 'msaccess':
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'postgresql':
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
//$db->sql_query("DROP TABLE {$table_prefix}attach_temp");
|
|
||||||
|
|
||||||
echo "<p><b>Done</b></p>\n";
|
|
||||||
|
|
||||||
?>
|
|
|
@ -1,209 +0,0 @@
|
||||||
<?php
|
|
||||||
/***************************************************************************
|
|
||||||
* merge_clean_posts.php
|
|
||||||
* -------------------
|
|
||||||
* begin : Tuesday, February 25, 2003
|
|
||||||
* copyright : (C) 2003 The phpBB Group
|
|
||||||
* email : support@phpbb.com
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
//
|
|
||||||
// Security message:
|
|
||||||
//
|
|
||||||
// This script is potentially dangerous.
|
|
||||||
// Remove or comment the next line (die(".... ) to enable this script.
|
|
||||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
|
||||||
//
|
|
||||||
die("Please read the first lines of this script for instructions on how to enable it");
|
|
||||||
|
|
||||||
@set_time_limit(2400);
|
|
||||||
|
|
||||||
$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
|
|
||||||
|
|
||||||
define('IN_PHPBB', 1);
|
|
||||||
define('ANONYMOUS', 1);
|
|
||||||
$phpbb_root_path='./../';
|
|
||||||
include($phpbb_root_path . 'extension.inc');
|
|
||||||
include($phpbb_root_path . 'config.'.$phpEx);
|
|
||||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/acm/cache_' . $acm_type . '.'.$phpEx);
|
|
||||||
include($phpbb_root_path . 'db/' . $dbms . '.'.$phpEx);
|
|
||||||
|
|
||||||
$cache = new acm();
|
|
||||||
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
|
|
||||||
|
|
||||||
// Just Do it (tm)
|
|
||||||
$sql = "RENAME TABLE {$table_prefix}posts TO {$table_prefix}posts_temp";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
$sql = "CREATE TABLE {$table_prefix}posts
|
|
||||||
SELECT p.*, pt.post_subject, pt.post_text, pt.post_checksum, pt.bbcode_bitfield, pt.bbcode_uid
|
|
||||||
FROM {$table_prefix}posts_temp p, {$table_prefix}posts_text pt
|
|
||||||
WHERE pt.post_id = p.post_id";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
switch ($db->sql_layer)
|
|
||||||
{
|
|
||||||
case 'mysql':
|
|
||||||
case 'mysql4':
|
|
||||||
$sql = 'ALTER TABLE ' . $table_prefix . 'posts
|
|
||||||
ADD PRIMARY KEY (post_id),
|
|
||||||
ADD INDEX topic_id (topic_id),
|
|
||||||
ADD INDEX poster_ip (poster_ip),
|
|
||||||
ADD INDEX post_approved (post_approved),
|
|
||||||
MODIFY COLUMN post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
|
||||||
ADD COLUMN post_encoding varchar(11) DEFAULT \'iso-8859-15\' NOT NULL';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'mssql':
|
|
||||||
case 'mssql-odbc':
|
|
||||||
case 'msaccess':
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'postgresql':
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
$sql = "UPDATE {$table_prefix}topics SET topic_poster = 1 WHERE topic_poster = 0 OR topic_poster IS NULL";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
$sql = "UPDATE {$table_prefix}topics SET topic_last_poster_id = 1 WHERE topic_last_poster_id = 0 OR topic_last_poster_id IS NULL";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
$sql = "UPDATE {$table_prefix}posts SET poster_id = 1 WHERE poster_id = 0 OR poster_id IS NULL";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
$sql = "UPDATE {$table_prefix}users SET user_id = 1 WHERE user_id = 0";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
$sql = "SELECT t.topic_id
|
|
||||||
FROM {$table_prefix}topics t
|
|
||||||
LEFT JOIN {$table_prefix}posts p ON p.topic_id = t.topic_id
|
|
||||||
WHERE p.topic_id IS NULL";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$del_sql = '';
|
|
||||||
do
|
|
||||||
{
|
|
||||||
$del_sql .= (($del_sql != '') ? ', ' : '') . $row['topic_id'];
|
|
||||||
}
|
|
||||||
while ($row = $db->sql_fetchrow($result));
|
|
||||||
|
|
||||||
$sql = "DELETE FROM {$table_prefix}topics
|
|
||||||
WHERE topic_id IN ($del_sql)";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$del_sql = '';
|
|
||||||
$sql = "SELECT topic_id, MIN(post_id) AS first_post_id, MAX(post_id) AS last_post_id, COUNT(post_id) AS total_posts
|
|
||||||
FROM {$table_prefix}posts
|
|
||||||
GROUP BY topic_id";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$del_sql .= (($del_sql != '') ? ', ' : '') . $row['topic_id'];
|
|
||||||
|
|
||||||
$sql = "UPDATE {$table_prefix}topics
|
|
||||||
SET topic_first_post_id = " . $row['first_post_id'] . ", topic_last_post_id = " . $row['last_post_id'] . ", topic_replies = " . ($row['total_posts'] - 1) . "
|
|
||||||
WHERE topic_id = " . $row['topic_id'];
|
|
||||||
$db->sql_query($sql);
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$sql = "DELETE FROM {$table_prefix}topics WHERE topic_id NOT IN ($del_sql)";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
$topic_count = $post_count = array();
|
|
||||||
$sql = "SELECT forum_id, COUNT(topic_id) AS topics
|
|
||||||
FROM {$table_prefix}topics
|
|
||||||
GROUP BY forum_id";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$topic_count[$row['forum_id']] = $row['topics'];
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$sql = "SELECT forum_id, COUNT(post_id) AS posts
|
|
||||||
FROM {$table_prefix}posts
|
|
||||||
GROUP BY forum_id";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$post_count[$row['forum_id']] = $row['posts'];
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
switch ($db->sql_layer)
|
|
||||||
{
|
|
||||||
case 'oracle':
|
|
||||||
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
|
|
||||||
FROM " . $table_prefix . "forums f, " . $table_prefix . "posts p, " . $table_prefix . "users u
|
|
||||||
WHERE p.post_id = f.forum_last_post_id(+)
|
|
||||||
AND u.user_id = p.poster_id(+)";
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
$sql = "SELECT f.forum_id, p.post_time, p.post_username, u.username, u.user_id
|
|
||||||
FROM ((" . $table_prefix . "forums f
|
|
||||||
LEFT JOIN " . $table_prefix . "posts p ON p.post_id = f.forum_last_post_id)
|
|
||||||
LEFT JOIN " . $table_prefix . "users u ON u.user_id = p.poster_id)";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$sql_ary = array();
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$forum_id = $row['forum_id'];
|
|
||||||
|
|
||||||
$sql_ary[] = "UPDATE " . $table_prefix . "forums
|
|
||||||
SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
|
|
||||||
WHERE forum_id = $forum_id";
|
|
||||||
|
|
||||||
$sql = "SELECT t.topic_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
|
|
||||||
FROM " . $table_prefix . "topics t, " . $table_prefix . "users u, " . $table_prefix . "posts p, " . $table_prefix . "posts p2, " . $table_prefix . "users u2
|
|
||||||
WHERE t.forum_id = $forum_id
|
|
||||||
AND u.user_id = t.topic_poster
|
|
||||||
AND p.post_id = t.topic_first_post_id
|
|
||||||
AND p2.post_id = t.topic_last_post_id
|
|
||||||
AND u2.user_id = p2.poster_id";
|
|
||||||
$result2 = $db->sql_query($sql);
|
|
||||||
|
|
||||||
while ($row2 = $db->sql_fetchrow($result2))
|
|
||||||
{
|
|
||||||
$sql_ary[] = "UPDATE " . $table_prefix . "topics
|
|
||||||
SET topic_poster = " . $row2['user_id'] . ", topic_first_poster_name = '" . ((!empty($row2['user_id']) && $row2['user_id'] != ANONYMOUS) ? addslashes($row2['username']) : addslashes($row2['post_username'])) . "', topic_last_poster_id = " . ((!empty($row2['id2']) && $row2['id2'] != ANONYMOUS) ? $row2['id2'] : ANONYMOUS) . ", topic_last_post_time = " . $row2['post_time'] . ", topic_last_poster_name = '" . ((!empty($row2['id2']) && $row2['id2'] != ANONYMOUS) ? addslashes($row2['user2']) : addslashes($row2['post_username2'])) . "'
|
|
||||||
WHERE topic_id = " . $row2['topic_id'];
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result2);
|
|
||||||
|
|
||||||
unset($row2);
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
foreach ($sql_ary as $sql)
|
|
||||||
{
|
|
||||||
$sql . "<br />";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "<p><b>Done</b></p>\n";
|
|
||||||
|
|
||||||
?>
|
|
|
@ -21,8 +21,9 @@
|
||||||
die("Please read the first lines of this script for instructions on how to enable it");
|
die("Please read the first lines of this script for instructions on how to enable it");
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
$prefix = $table_prefix;
|
$prefix = $table_prefix;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
//$db = new dbal_mysqli();
|
//$db = new dbal_mysqli();
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,10 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
include($phpbb_root_path . '/includes/functions_user.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
|
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
|
|
|
@ -23,9 +23,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = '../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
@ -34,12 +34,12 @@ $user->setup();
|
||||||
|
|
||||||
$search_type = $config['search_type'];
|
$search_type = $config['search_type'];
|
||||||
|
|
||||||
if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
|
if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
|
||||||
{
|
{
|
||||||
trigger_error('NO_SUCH_SEARCH_MODULE');
|
trigger_error('NO_SUCH_SEARCH_MODULE');
|
||||||
}
|
}
|
||||||
|
|
||||||
require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx);
|
require(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT);
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
$search = new $search_type($error);
|
$search = new $search_type($error);
|
||||||
|
|
|
@ -98,8 +98,7 @@ function utf8_normalize_nfkc($strings)
|
||||||
|
|
||||||
if (!class_exists('utf_normalizer'))
|
if (!class_exists('utf_normalizer'))
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
include(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_array($strings))
|
if (!is_array($strings))
|
||||||
|
|
|
@ -26,8 +26,8 @@ set_time_limit(0);
|
||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = '../';
|
define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,13 +77,13 @@ $test_suite = array(
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
|
require_once(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
|
||||||
|
|
||||||
$i = $n = 0;
|
$i = $n = 0;
|
||||||
$failed = false;
|
$failed = false;
|
||||||
$tested_chars = array();
|
$tested_chars = array();
|
||||||
|
|
||||||
$fp = fopen($phpbb_root_path . 'develop/NormalizationTest.txt', 'rb');
|
$fp = fopen(PHPBB_ROOT_PATH . 'develop/NormalizationTest.txt', 'rb');
|
||||||
while (!feof($fp))
|
while (!feof($fp))
|
||||||
{
|
{
|
||||||
$line = fgets($fp);
|
$line = fgets($fp);
|
||||||
|
@ -158,7 +158,7 @@ fclose($fp);
|
||||||
*/
|
*/
|
||||||
echo "\n\nTesting for invariants...\n\n";
|
echo "\n\nTesting for invariants...\n\n";
|
||||||
|
|
||||||
$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
|
$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt');
|
||||||
|
|
||||||
$n = 0;
|
$n = 0;
|
||||||
while (!feof($fp))
|
while (!feof($fp))
|
||||||
|
@ -227,9 +227,7 @@ die("\n\nALL TESTS PASSED SUCCESSFULLY\n");
|
||||||
*/
|
*/
|
||||||
function download($url)
|
function download($url)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
|
||||||
|
|
||||||
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -241,7 +239,7 @@ function download($url)
|
||||||
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
|
if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
|
||||||
{
|
{
|
||||||
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,12 +399,12 @@ do_stuff($str);
|
||||||
|
|
||||||
<p class="bad">// Sometimes single quotes are just not right</p>
|
<p class="bad">// Sometimes single quotes are just not right</p>
|
||||||
<div class="codebox"><pre>
|
<div class="codebox"><pre>
|
||||||
$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;start=' . $start;
|
$some_string = $board_url . 'someurl.php?mode=' . $mode . '&amp;start=' . $start;
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p class="good">// Double quotes are sometimes needed to not overcroud the line with concentinations</p>
|
<p class="good">// Double quotes are sometimes needed to not overcroud the line with concentinations</p>
|
||||||
<div class="codebox"><pre>
|
<div class="codebox"><pre>
|
||||||
$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;start=$start";
|
$some_string = "{$board_url}someurl.php?mode=$mode&amp;start=$start";
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>In SQL Statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL Formatting), else it should be tryed to only use one method - mostly single quotes.</p>
|
<p>In SQL Statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL Formatting), else it should be tryed to only use one method - mostly single quotes.</p>
|
||||||
|
@ -925,12 +925,18 @@ trigger_error('NO_MODE', E_USER_ERROR);
|
||||||
|
|
||||||
<h4>Url formatting</h4>
|
<h4>Url formatting</h4>
|
||||||
|
|
||||||
<p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p>
|
<p>All urls pointing to internal files need to be prepended by the <code>PHPBB_ROOT_PATH</code> constant. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>PHPBB_ADMIN_PATH</code> constant. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p>
|
||||||
|
|
||||||
<p>The <code>append_sid()</code> function from 2.0.x is available too, though does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
|
<p>The <code>append_sid()</code> function from 2.0.x is available too, though does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
|
||||||
|
|
||||||
<div class="codebox"><pre>
|
<div class="codebox"><pre>
|
||||||
append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id'])
|
append_sid(PHPBB_ROOT_PATH . 'memberlist.' . PHP_EXT, 'mode=group&amp;g=' . $row['group_id'])
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>For shorter writing internal urls are allowed to be written in short notation, not providing the root path and the extension. The append_sid() function will prepend the root path and append the extension automatically (and before calling the hook).</p>
|
||||||
|
|
||||||
|
<div class="codebox"><pre>
|
||||||
|
append_sid('memberlist', 'mode=group&amp;g=' . $row['group_id'])
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<h4>General function usage: </h4>
|
<h4>General function usage: </h4>
|
||||||
|
|
|
@ -383,10 +383,10 @@ a:active { color: #368AD2; }
|
||||||
<p>There are also valid external constants you may want to use if you embed phpBB3 into your application:</p>
|
<p>There are also valid external constants you may want to use if you embed phpBB3 into your application:</p>
|
||||||
|
|
||||||
<div class="codebox"><pre>
|
<div class="codebox"><pre>
|
||||||
PHPBB_MSG_HANDLER (overwrite message handler)
|
PHPBB_MSG_HANDLER (define own message handler)
|
||||||
PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect)
|
PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect)
|
||||||
PHPBB_ROOT_PATH (overwrite $phpbb_root_path)
|
PHPBB_ROOT_PATH (define own PHPBB_ROOT_PATH)
|
||||||
PHPBB_ADMIN_PATH (overwrite $phpbb_admin_path)
|
PHPBB_ADMIN_PATH (define own PHPBB_ADMIN_PATH)
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,33 +12,12 @@
|
||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
|
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
if (isset($_GET['avatar']))
|
if (isset($_GET['avatar']))
|
||||||
{
|
{
|
||||||
require($phpbb_root_path . 'config.' . $phpEx);
|
|
||||||
|
|
||||||
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
|
|
||||||
{
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/cache.' . $phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
|
|
||||||
require($phpbb_root_path . 'includes/constants.' . $phpEx);
|
|
||||||
|
|
||||||
$db = new $sql_db();
|
|
||||||
$cache = new acm();
|
|
||||||
|
|
||||||
// Connect to DB
|
|
||||||
if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
|
|
||||||
{
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
unset($dbpasswd);
|
|
||||||
|
|
||||||
// worst-case default
|
// worst-case default
|
||||||
$browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0';
|
$browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0';
|
||||||
|
|
||||||
|
@ -92,43 +71,21 @@ if (isset($_GET['avatar']))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($ext, array('png', 'gif', 'jpg', 'jpeg')))
|
if (!in_array($ext, array('png', 'gif', 'jpg', 'jpeg')) || !$filename)
|
||||||
{
|
{
|
||||||
// no way such an avatar could exist. They are not following the rules, stop the show.
|
// no way such an avatar could exist. They are not following the rules, stop the show.
|
||||||
header("HTTP/1.0 403 forbidden");
|
header("HTTP/1.0 403 Forbidden");
|
||||||
if (!empty($cache))
|
garbage_collection();
|
||||||
{
|
exit_handler();
|
||||||
$cache->unload();
|
|
||||||
}
|
|
||||||
$db->sql_close();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$filename)
|
|
||||||
{
|
|
||||||
// no way such an avatar could exist. They are not following the rules, stop the show.
|
|
||||||
header("HTTP/1.0 403 forbidden");
|
|
||||||
if (!empty($cache))
|
|
||||||
{
|
|
||||||
$cache->unload();
|
|
||||||
}
|
|
||||||
$db->sql_close();
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
send_avatar_to_browser(($avatar_group ? 'g' : '') . $filename . '.' . $ext, $browser);
|
send_avatar_to_browser(($avatar_group ? 'g' : '') . $filename . '.' . $ext, $browser);
|
||||||
|
|
||||||
if (!empty($cache))
|
garbage_collection();
|
||||||
{
|
exit_handler();
|
||||||
$cache->unload();
|
|
||||||
}
|
|
||||||
$db->sql_close();
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// implicit else: we are not in avatar mode
|
// implicit else: we are not in avatar mode
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
|
||||||
|
|
||||||
$download_id = request_var('id', 0);
|
$download_id = request_var('id', 0);
|
||||||
$mode = request_var('mode', '');
|
$mode = request_var('mode', '');
|
||||||
$thumbnail = request_var('t', false);
|
$thumbnail = request_var('t', false);
|
||||||
|
@ -299,7 +256,7 @@ else if (($display_cat == ATTACHMENT_CATEGORY_NONE || $display_cat == ATTACHMENT
|
||||||
|
|
||||||
if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && strpos(strtolower($user->browser), 'msie') !== false)
|
if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && strpos(strtolower($user->browser), 'msie') !== false)
|
||||||
{
|
{
|
||||||
wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
|
wrap_img_in_html(append_sid('download/file', 'id=' . $attachment['attach_id']), $attachment['real_filename']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -307,12 +264,12 @@ else
|
||||||
if ($download_mode == PHYSICAL_LINK)
|
if ($download_mode == PHYSICAL_LINK)
|
||||||
{
|
{
|
||||||
// This presenting method should no longer be used
|
// This presenting method should no longer be used
|
||||||
if (!@is_dir($phpbb_root_path . $config['upload_path']))
|
if (!@is_dir(PHPBB_ROOT_PATH . $config['upload_path']))
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']);
|
trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']);
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']);
|
redirect(PHPBB_ROOT_PATH . $config['upload_path'] . '/' . $attachment['physical_filename']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -329,7 +286,7 @@ else
|
||||||
*/
|
*/
|
||||||
function send_avatar_to_browser($file, $browser)
|
function send_avatar_to_browser($file, $browser)
|
||||||
{
|
{
|
||||||
global $config, $phpbb_root_path;
|
global $config;
|
||||||
|
|
||||||
$prefix = $config['avatar_salt'] . '_';
|
$prefix = $config['avatar_salt'] . '_';
|
||||||
$image_dir = $config['avatar_path'];
|
$image_dir = $config['avatar_path'];
|
||||||
|
@ -345,7 +302,7 @@ function send_avatar_to_browser($file, $browser)
|
||||||
{
|
{
|
||||||
$image_dir = '';
|
$image_dir = '';
|
||||||
}
|
}
|
||||||
$file_path = $phpbb_root_path . $image_dir . '/' . $prefix . $file;
|
$file_path = PHPBB_ROOT_PATH . $image_dir . '/' . $prefix . $file;
|
||||||
|
|
||||||
if ((@file_exists($file_path) && @is_readable($file_path)) && !headers_sent())
|
if ((@file_exists($file_path) && @is_readable($file_path)) && !headers_sent())
|
||||||
{
|
{
|
||||||
|
@ -427,9 +384,9 @@ function wrap_img_in_html($src, $title)
|
||||||
*/
|
*/
|
||||||
function send_file_to_browser($attachment, $upload_dir, $category)
|
function send_file_to_browser($attachment, $upload_dir, $category)
|
||||||
{
|
{
|
||||||
global $user, $db, $config, $phpbb_root_path;
|
global $user, $db, $config;
|
||||||
|
|
||||||
$filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];
|
$filename = PHPBB_ROOT_PATH . $upload_dir . '/' . $attachment['physical_filename'];
|
||||||
|
|
||||||
if (!@file_exists($filename))
|
if (!@file_exists($filename))
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
|
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
@ -67,7 +67,7 @@ page_header($l_title);
|
||||||
$template->set_filenames(array(
|
$template->set_filenames(array(
|
||||||
'body' => 'faq_body.html')
|
'body' => 'faq_body.html')
|
||||||
);
|
);
|
||||||
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
|
make_jumpbox(append_sid('viewforum'));
|
||||||
|
|
||||||
page_footer();
|
page_footer();
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,7 @@ class acm
|
||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
|
||||||
$this->cache_dir = $phpbb_root_path . 'cache/';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,8 +41,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
private function load()
|
private function load()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// grab the global cache
|
// grab the global cache
|
||||||
if ($this->vars = apc_fetch('global'))
|
if ($this->vars = apc_fetch('global'))
|
||||||
{
|
{
|
||||||
|
@ -86,8 +83,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function tidy()
|
public function tidy()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// cache has auto GC, no need to have any code here :)
|
// cache has auto GC, no need to have any code here :)
|
||||||
|
|
||||||
set_config('cache_last_gc', time(), true);
|
set_config('cache_last_gc', time(), true);
|
||||||
|
@ -100,8 +95,6 @@ class acm
|
||||||
{
|
{
|
||||||
if ($var_name[0] === '_')
|
if ($var_name[0] === '_')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
return apc_fetch($var_name);
|
return apc_fetch($var_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -171,8 +164,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function destroy($var_name, $table = '')
|
public function destroy($var_name, $table = '')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
if ($var_name === 'sql' && !empty($table))
|
if ($var_name === 'sql' && !empty($table))
|
||||||
{
|
{
|
||||||
if (!is_array($table))
|
if (!is_array($table))
|
||||||
|
@ -221,8 +212,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function sql_load($query)
|
public function sql_load($query)
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
$query_id = sizeof($this->sql_rowset);
|
$query_id = sizeof($this->sql_rowset);
|
||||||
|
@ -244,7 +233,7 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function sql_save($query, &$query_result, $ttl)
|
public function sql_save($query, &$query_result, $ttl)
|
||||||
{
|
{
|
||||||
global $db, $phpEx;
|
global $db;
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
|
|
|
@ -33,8 +33,7 @@ class acm
|
||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
|
||||||
$this->cache_dir = $phpbb_root_path . 'cache/';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,8 +41,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
private function load()
|
private function load()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// grab the global cache
|
// grab the global cache
|
||||||
if ($this->vars = eaccelerator_get('global'))
|
if ($this->vars = eaccelerator_get('global'))
|
||||||
{
|
{
|
||||||
|
@ -86,8 +83,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function tidy()
|
public function tidy()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
eaccelerator_gc();
|
eaccelerator_gc();
|
||||||
|
|
||||||
set_config('cache_last_gc', time(), true);
|
set_config('cache_last_gc', time(), true);
|
||||||
|
@ -100,8 +95,6 @@ class acm
|
||||||
{
|
{
|
||||||
if ($var_name[0] === '_')
|
if ($var_name[0] === '_')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
$temp = eaccelerator_get($var_name);
|
$temp = eaccelerator_get($var_name);
|
||||||
|
|
||||||
if ($temp !== null)
|
if ($temp !== null)
|
||||||
|
@ -183,8 +176,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function destroy($var_name, $table = '')
|
public function destroy($var_name, $table = '')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
if ($var_name === 'sql' && !empty($table))
|
if ($var_name === 'sql' && !empty($table))
|
||||||
{
|
{
|
||||||
if (!is_array($table))
|
if (!is_array($table))
|
||||||
|
@ -237,8 +228,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function sql_load($query)
|
public function sql_load($query)
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
$query_id = sizeof($this->sql_rowset);
|
$query_id = sizeof($this->sql_rowset);
|
||||||
|
@ -260,7 +249,7 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function sql_save($query, &$query_result, $ttl)
|
public function sql_save($query, &$query_result, $ttl)
|
||||||
{
|
{
|
||||||
global $db, $phpEx;
|
global $db;
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
|
|
|
@ -34,8 +34,7 @@ class acm
|
||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
|
||||||
$this->cache_dir = $phpbb_root_path . 'cache/';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,12 +42,10 @@ class acm
|
||||||
*/
|
*/
|
||||||
private function load()
|
private function load()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// grab the global cache
|
// grab the global cache
|
||||||
if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
|
if (file_exists($this->cache_dir . 'data_global.' . PHP_EXT))
|
||||||
{
|
{
|
||||||
@include($this->cache_dir . 'data_global.' . $phpEx);
|
@include($this->cache_dir . 'data_global.' . PHP_EXT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,16 +77,14 @@ class acm
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
global $phpEx;
|
if ($fp = @fopen($this->cache_dir . 'data_global.' . PHP_EXT, 'wb'))
|
||||||
|
|
||||||
if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb'))
|
|
||||||
{
|
{
|
||||||
@flock($fp, LOCK_EX);
|
@flock($fp, LOCK_EX);
|
||||||
fwrite($fp, "<?php\n\$this->vars = unserialize('" . serialize($this->vars) . "');\n\$this->var_expires = unserialize('" . serialize($this->var_expires) . "');");
|
fwrite($fp, "<?php\n\$this->vars = unserialize('" . serialize($this->vars) . "');\n\$this->var_expires = unserialize('" . serialize($this->var_expires) . "');");
|
||||||
@flock($fp, LOCK_UN);
|
@flock($fp, LOCK_UN);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
@chmod($this->cache_dir . 'data_global.' . $phpEx, 0666);
|
@chmod($this->cache_dir . 'data_global.' . PHP_EXT, 0666);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -99,7 +94,7 @@ class acm
|
||||||
trigger_error($this->cache_dir . ' is NOT writable.', E_USER_ERROR);
|
trigger_error($this->cache_dir . ' is NOT writable.', E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx, E_USER_ERROR);
|
trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . PHP_EXT, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->is_modified = false;
|
$this->is_modified = false;
|
||||||
|
@ -110,8 +105,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function tidy()
|
public function tidy()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
$dir = @opendir($this->cache_dir);
|
$dir = @opendir($this->cache_dir);
|
||||||
|
|
||||||
if (!$dir)
|
if (!$dir)
|
||||||
|
@ -135,7 +128,7 @@ class acm
|
||||||
}
|
}
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
|
|
||||||
if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
|
if (file_exists($this->cache_dir . 'data_global.' . PHP_EXT))
|
||||||
{
|
{
|
||||||
if (!sizeof($this->vars))
|
if (!sizeof($this->vars))
|
||||||
{
|
{
|
||||||
|
@ -161,14 +154,12 @@ class acm
|
||||||
{
|
{
|
||||||
if ($var_name[0] === '_')
|
if ($var_name[0] === '_')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
if (!$this->_exists($var_name))
|
if (!$this->_exists($var_name))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include($this->cache_dir . "data{$var_name}.$phpEx");
|
@include($this->cache_dir . "data{$var_name}." . PHP_EXT);
|
||||||
return (isset($data)) ? $data : false;
|
return (isset($data)) ? $data : false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -184,16 +175,14 @@ class acm
|
||||||
{
|
{
|
||||||
if ($var_name[0] === '_')
|
if ($var_name[0] === '_')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
if ($fp = @fopen($this->cache_dir . "data{$var_name}." . PHP_EXT, 'wb'))
|
||||||
|
|
||||||
if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb'))
|
|
||||||
{
|
{
|
||||||
@flock($fp, LOCK_EX);
|
@flock($fp, LOCK_EX);
|
||||||
fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\$data = " . (sizeof($var) ? "unserialize('" . serialize($var) . "');" : 'array();'));
|
fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\$data = " . (sizeof($var) ? "unserialize('" . serialize($var) . "');" : 'array();'));
|
||||||
@flock($fp, LOCK_UN);
|
@flock($fp, LOCK_UN);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
@chmod($this->cache_dir . "data{$var_name}.$phpEx", 0666);
|
@chmod($this->cache_dir . "data{$var_name}." . PHP_EXT, 0666);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -244,8 +233,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function destroy($var_name, $table = '')
|
public function destroy($var_name, $table = '')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
if ($var_name === 'sql' && !empty($table))
|
if ($var_name === 'sql' && !empty($table))
|
||||||
{
|
{
|
||||||
if (!is_array($table))
|
if (!is_array($table))
|
||||||
|
@ -306,7 +293,7 @@ class acm
|
||||||
|
|
||||||
if ($var_name[0] === '_')
|
if ($var_name[0] === '_')
|
||||||
{
|
{
|
||||||
$this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx", true);
|
$this->remove_file($this->cache_dir . 'data' . $var_name . '.' . PHP_EXT, true);
|
||||||
}
|
}
|
||||||
else if (isset($this->vars[$var_name]))
|
else if (isset($this->vars[$var_name]))
|
||||||
{
|
{
|
||||||
|
@ -326,8 +313,7 @@ class acm
|
||||||
{
|
{
|
||||||
if ($var_name[0] === '_')
|
if ($var_name[0] === '_')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
return file_exists($this->cache_dir . 'data' . $var_name . '.' . PHP_EXT);
|
||||||
return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -350,18 +336,16 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function sql_load($query)
|
public function sql_load($query)
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
$query_id = sizeof($this->sql_rowset);
|
$query_id = sizeof($this->sql_rowset);
|
||||||
|
|
||||||
if (!file_exists($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"))
|
if (!file_exists($this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include($this->cache_dir . 'sql_' . md5($query) . ".$phpEx");
|
@include($this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT);
|
||||||
|
|
||||||
if (!isset($expired))
|
if (!isset($expired))
|
||||||
{
|
{
|
||||||
|
@ -369,7 +353,7 @@ class acm
|
||||||
}
|
}
|
||||||
else if ($expired)
|
else if ($expired)
|
||||||
{
|
{
|
||||||
$this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx", true);
|
$this->remove_file($this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT, true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,11 +366,11 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function sql_save($query, &$query_result, $ttl)
|
public function sql_save($query, &$query_result, $ttl)
|
||||||
{
|
{
|
||||||
global $db, $phpEx;
|
global $db;
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
$filename = $this->cache_dir . 'sql_' . md5($query) . '.' . $phpEx;
|
$filename = $this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT;
|
||||||
|
|
||||||
if ($fp = @fopen($filename, 'wb'))
|
if ($fp = @fopen($filename, 'wb'))
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
|
||||||
$this->memcache = memcache_connect('localhost', 11211);
|
$this->memcache = memcache_connect('localhost', 11211);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,8 +42,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
private function load()
|
private function load()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// grab the global cache
|
// grab the global cache
|
||||||
if ($this->vars = memcache_get($this->memcache, 'global'))
|
if ($this->vars = memcache_get($this->memcache, 'global'))
|
||||||
{
|
{
|
||||||
|
@ -87,8 +84,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function tidy()
|
public function tidy()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// cache has auto GC, no need to have any code here :)
|
// cache has auto GC, no need to have any code here :)
|
||||||
|
|
||||||
set_config('cache_last_gc', time(), true);
|
set_config('cache_last_gc', time(), true);
|
||||||
|
@ -101,8 +96,6 @@ class acm
|
||||||
{
|
{
|
||||||
if ($var_name[0] === '_')
|
if ($var_name[0] === '_')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
return memcache_get($this->memcache, $var_name);
|
return memcache_get($this->memcache, $var_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -172,8 +165,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function destroy($var_name, $table = '')
|
public function destroy($var_name, $table = '')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
if ($var_name === 'sql' && !empty($table))
|
if ($var_name === 'sql' && !empty($table))
|
||||||
{
|
{
|
||||||
if (!is_array($table))
|
if (!is_array($table))
|
||||||
|
@ -222,8 +213,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function sql_load($query)
|
public function sql_load($query)
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
$query_id = sizeof($this->sql_rowset);
|
$query_id = sizeof($this->sql_rowset);
|
||||||
|
@ -246,7 +235,7 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function sql_save($query, &$query_result, $ttl)
|
public function sql_save($query, &$query_result, $ttl)
|
||||||
{
|
{
|
||||||
global $db, $phpEx;
|
global $db;
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
|
|
|
@ -33,8 +33,7 @@ class acm
|
||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
|
||||||
$this->cache_dir = $phpbb_root_path . 'cache/';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,8 +41,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
private function load()
|
private function load()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// grab the global cache
|
// grab the global cache
|
||||||
if (xcache_isset('global'))
|
if (xcache_isset('global'))
|
||||||
{
|
{
|
||||||
|
@ -87,8 +84,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function tidy()
|
public function tidy()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// cache has auto GC, no need to have any code here :)
|
// cache has auto GC, no need to have any code here :)
|
||||||
|
|
||||||
set_config('cache_last_gc', time(), true);
|
set_config('cache_last_gc', time(), true);
|
||||||
|
@ -101,8 +96,6 @@ class acm
|
||||||
{
|
{
|
||||||
if ($var_name[0] === '_')
|
if ($var_name[0] === '_')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
return (xcache_isset($var_name)) ? xcache_get($var_name) : false;
|
return (xcache_isset($var_name)) ? xcache_get($var_name) : false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -176,8 +169,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function destroy($var_name, $table = '')
|
public function destroy($var_name, $table = '')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
if ($var_name === 'sql' && !empty($table))
|
if ($var_name === 'sql' && !empty($table))
|
||||||
{
|
{
|
||||||
if (!is_array($table))
|
if (!is_array($table))
|
||||||
|
@ -226,8 +217,6 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function sql_load($query)
|
public function sql_load($query)
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
$query_id = sizeof($this->sql_rowset);
|
$query_id = sizeof($this->sql_rowset);
|
||||||
|
@ -250,7 +239,7 @@ class acm
|
||||||
*/
|
*/
|
||||||
public function sql_save($query, &$query_result, $ttl)
|
public function sql_save($query, &$query_result, $ttl)
|
||||||
{
|
{
|
||||||
global $db, $phpEx;
|
global $db;
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
|
|
|
@ -26,8 +26,7 @@ class acp_attachments
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
|
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
|
||||||
|
|
||||||
|
@ -79,7 +78,7 @@ class acp_attachments
|
||||||
{
|
{
|
||||||
case 'attach':
|
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
|
$sql = 'SELECT group_name, cat_id
|
||||||
FROM ' . EXTENSION_GROUPS_TABLE . '
|
FROM ' . EXTENSION_GROUPS_TABLE . '
|
||||||
|
@ -696,7 +695,7 @@ class acp_attachments
|
||||||
$filename_list = '';
|
$filename_list = '';
|
||||||
$no_image_select = false;
|
$no_image_select = false;
|
||||||
|
|
||||||
$imglist = filelist($phpbb_root_path . $img_path);
|
$imglist = filelist(PHPBB_ROOT_PATH . $img_path);
|
||||||
|
|
||||||
if (sizeof($imglist))
|
if (sizeof($imglist))
|
||||||
{
|
{
|
||||||
|
@ -742,14 +741,14 @@ class acp_attachments
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PHPBB_ROOT_PATH' => $phpbb_root_path,
|
'PHPBB_ROOT_PATH' => PHPBB_ROOT_PATH,
|
||||||
'IMG_PATH' => $img_path,
|
'IMG_PATH' => $img_path,
|
||||||
'ACTION' => $action,
|
'ACTION' => $action,
|
||||||
'GROUP_ID' => $group_id,
|
'GROUP_ID' => $group_id,
|
||||||
'GROUP_NAME' => $ext_group_row['group_name'],
|
'GROUP_NAME' => $ext_group_row['group_name'],
|
||||||
'ALLOW_GROUP' => $ext_group_row['allow_group'],
|
'ALLOW_GROUP' => $ext_group_row['allow_group'],
|
||||||
'ALLOW_IN_PM' => $ext_group_row['allow_in_pm'],
|
'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'],
|
'EXTGROUP_FILESIZE' => $ext_group_row['max_filesize'],
|
||||||
'ASSIGNED_EXTENSIONS' => $assigned_extensions,
|
'ASSIGNED_EXTENSIONS' => $assigned_extensions,
|
||||||
|
|
||||||
|
@ -761,7 +760,7 @@ class acp_attachments
|
||||||
'S_NO_IMAGE' => $no_image_select,
|
'S_NO_IMAGE' => $no_image_select,
|
||||||
'S_FORUM_IDS' => (sizeof($forum_ids)) ? true : false,
|
'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,
|
'U_BACK' => $this->u_action,
|
||||||
|
|
||||||
'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP'])
|
'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP'])
|
||||||
|
@ -1032,7 +1031,7 @@ class acp_attachments
|
||||||
'PHYSICAL_FILENAME' => basename($row['physical_filename']),
|
'PHYSICAL_FILENAME' => basename($row['physical_filename']),
|
||||||
'ATTACH_ID' => $row['attach_id'],
|
'ATTACH_ID' => $row['attach_id'],
|
||||||
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$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);
|
$db->sql_freeresult($result);
|
||||||
|
@ -1192,31 +1191,31 @@ class acp_attachments
|
||||||
*/
|
*/
|
||||||
function test_upload(&$error, $upload_dir, $create_directory = false)
|
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.
|
// Does the target directory exist, is it a directory and writable.
|
||||||
if ($create_directory)
|
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);
|
@mkdir(PHPBB_ROOT_PATH . $upload_dir, 0777);
|
||||||
@chmod($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);
|
$error[] = sprintf($user->lang['NO_UPLOAD_DIR'], $upload_dir);
|
||||||
return;
|
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);
|
$error[] = sprintf($user->lang['UPLOAD_NOT_DIR'], $upload_dir);
|
||||||
return;
|
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);
|
$error[] = sprintf($user->lang['NO_WRITE_UPLOAD'], $upload_dir);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -26,9 +26,8 @@ class acp_ban
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
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;
|
$bansubmit = (isset($_POST['bansubmit'])) ? true : false;
|
||||||
$unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
|
$unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
|
||||||
|
@ -112,7 +111,7 @@ class acp_ban
|
||||||
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
|
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
|
||||||
|
|
||||||
'U_ACTION' => $this->u_action,
|
'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'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,7 @@ class acp_bbcodes
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('acp/posting');
|
$user->add_lang('acp/posting');
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,7 @@ class acp_board
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template;
|
global $db, $user, $auth, $template, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('acp/board');
|
$user->add_lang('acp/board');
|
||||||
|
|
||||||
|
@ -418,15 +417,15 @@ class acp_board
|
||||||
// Retrieve a list of auth plugins and check their config values
|
// Retrieve a list of auth plugins and check their config values
|
||||||
$auth_plugins = array();
|
$auth_plugins = array();
|
||||||
|
|
||||||
$dp = @opendir($phpbb_root_path . 'includes/auth');
|
$dp = @opendir(PHPBB_ROOT_PATH . 'includes/auth');
|
||||||
|
|
||||||
if ($dp)
|
if ($dp)
|
||||||
{
|
{
|
||||||
while (($file = readdir($dp)) !== false)
|
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);
|
closedir($dp);
|
||||||
|
@ -438,9 +437,9 @@ class acp_board
|
||||||
$old_auth_config = array();
|
$old_auth_config = array();
|
||||||
foreach ($auth_plugins as $method)
|
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;
|
$method = 'acp_' . $method;
|
||||||
if (function_exists($method))
|
if (function_exists($method))
|
||||||
|
@ -481,7 +480,7 @@ class acp_board
|
||||||
$method = basename($cfg_array['auth_method']);
|
$method = basename($cfg_array['auth_method']);
|
||||||
if ($method && in_array($method, $auth_plugins))
|
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;
|
$method = 'init_' . $method;
|
||||||
if (function_exists($method))
|
if (function_exists($method))
|
||||||
|
@ -579,7 +578,7 @@ class acp_board
|
||||||
|
|
||||||
foreach ($auth_plugins as $method)
|
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;
|
$method = 'acp_' . $method;
|
||||||
if (function_exists($method))
|
if (function_exists($method))
|
||||||
|
@ -604,11 +603,9 @@ class acp_board
|
||||||
*/
|
*/
|
||||||
function select_auth_method($selected_method, $key = '')
|
function select_auth_method($selected_method, $key = '')
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$auth_plugins = array();
|
$auth_plugins = array();
|
||||||
|
|
||||||
$dp = @opendir($phpbb_root_path . 'includes/auth');
|
$dp = @opendir(PHPBB_ROOT_PATH . 'includes/auth');
|
||||||
|
|
||||||
if (!$dp)
|
if (!$dp)
|
||||||
{
|
{
|
||||||
|
@ -617,9 +614,9 @@ class acp_board
|
||||||
|
|
||||||
while (($file = readdir($dp)) !== false)
|
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);
|
closedir($dp);
|
||||||
|
|
|
@ -26,7 +26,6 @@ class acp_bots
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache;
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
|
||||||
|
|
||||||
$action = request_var('action', '');
|
$action = request_var('action', '');
|
||||||
$submit = (isset($_POST['submit'])) ? true : false;
|
$submit = (isset($_POST['submit'])) ? true : false;
|
||||||
|
@ -141,7 +140,7 @@ class acp_bots
|
||||||
|
|
||||||
case 'edit':
|
case 'edit':
|
||||||
case 'add':
|
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_row = array(
|
||||||
'bot_name' => utf8_normalize_nfc(request_var('bot_name', '', true)),
|
'bot_name' => utf8_normalize_nfc(request_var('bot_name', '', true)),
|
||||||
|
|
|
@ -24,8 +24,7 @@ class acp_captcha
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template;
|
global $db, $user, $auth, $template, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('acp/board');
|
$user->add_lang('acp/board');
|
||||||
|
|
||||||
|
@ -47,11 +46,11 @@ class acp_captcha
|
||||||
|
|
||||||
if ($config['captcha_gd'])
|
if ($config['captcha_gd'])
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/captcha/captcha_gd.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
else
|
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());
|
captcha::execute(gen_rand_string(mt_rand(5, 8)), time());
|
||||||
|
@ -92,7 +91,7 @@ class acp_captcha
|
||||||
else
|
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'))
|
if (@extension_loaded('gd'))
|
||||||
{
|
{
|
||||||
$template->assign_var('GD', true);
|
$template->assign_var('GD', true);
|
||||||
|
|
|
@ -25,8 +25,7 @@ class acp_database
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $cache, $db, $user, $auth, $template, $table_prefix;
|
global $cache, $db, $user, $auth, $template, $table_prefix, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('acp/database');
|
$user->add_lang('acp/database');
|
||||||
|
|
||||||
|
@ -171,7 +170,7 @@ class acp_database
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_install.' . PHP_EXT);
|
||||||
$tables = get_tables($db);
|
$tables = get_tables($db);
|
||||||
asort($tables);
|
asort($tables);
|
||||||
foreach ($tables as $table_name)
|
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);
|
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))
|
if (!file_exists($file_name) || !is_readable($file_name))
|
||||||
{
|
{
|
||||||
|
@ -420,7 +419,7 @@ class acp_database
|
||||||
$methods[] = $type;
|
$methods[] = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir = $phpbb_root_path . 'store/';
|
$dir = PHPBB_ROOT_PATH . 'store/';
|
||||||
$dh = @opendir($dir);
|
$dh = @opendir($dir);
|
||||||
|
|
||||||
if ($dh)
|
if ($dh)
|
||||||
|
@ -529,8 +528,7 @@ class base_extractor
|
||||||
|
|
||||||
if ($store == true)
|
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');
|
$this->fp = $open($file, 'w');
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,9 @@ class acp_disallow
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
|
|
||||||
$user->add_lang('acp/posting');
|
$user->add_lang('acp/posting');
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ class acp_email
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache;
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
|
||||||
|
|
||||||
$user->add_lang('acp/email');
|
$user->add_lang('acp/email');
|
||||||
$this->tpl_name = 'acp_email';
|
$this->tpl_name = 'acp_email';
|
||||||
|
@ -148,8 +147,8 @@ class acp_email
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
// Send the messages
|
// Send the messages
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
|
||||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
$messenger = new messenger($use_queue);
|
$messenger = new messenger($use_queue);
|
||||||
|
|
||||||
$errored = false;
|
$errored = false;
|
||||||
|
@ -218,7 +217,7 @@ class acp_email
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=critical') . '">', '</a>');
|
$message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=logs&mode=critical') . '">', '</a>');
|
||||||
trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
|
trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,12 +249,11 @@ class acp_email
|
||||||
'U_ACTION' => $this->u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'S_GROUP_OPTIONS' => $select_list,
|
'S_GROUP_OPTIONS' => $select_list,
|
||||||
'USERNAMES' => $usernames,
|
'USERNAMES' => $usernames,
|
||||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_email&field=usernames'),
|
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=acp_email&field=usernames'),
|
||||||
'SUBJECT' => $subject,
|
'SUBJECT' => $subject,
|
||||||
'MESSAGE' => $message,
|
'MESSAGE' => $message,
|
||||||
'S_PRIORITY_OPTIONS' => $s_priority_options)
|
'S_PRIORITY_OPTIONS' => $s_priority_options,
|
||||||
);
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,7 @@ class acp_forums
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('acp/forums');
|
$user->add_lang('acp/forums');
|
||||||
$this->tpl_name = 'acp_forums';
|
$this->tpl_name = 'acp_forums';
|
||||||
|
@ -253,13 +252,13 @@ class acp_forums
|
||||||
// Redirect to permissions
|
// Redirect to permissions
|
||||||
if ($auth->acl_get('a_fauth'))
|
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
|
// redirect directly to permission settings screen if authed
|
||||||
if ($action == 'add' && !$forum_perm_from && $auth->acl_get('a_fauth'))
|
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 . '&parent_id=' . $this->parent_id));
|
trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||||
|
@ -636,7 +635,7 @@ class acp_forums
|
||||||
'FORUM_NAME' => $forum_data['forum_name'],
|
'FORUM_NAME' => $forum_data['forum_name'],
|
||||||
'FORUM_DATA_LINK' => $forum_data['forum_link'],
|
'FORUM_DATA_LINK' => $forum_data['forum_link'],
|
||||||
'FORUM_IMAGE' => $forum_data['forum_image'],
|
'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_POST' => FORUM_POST,
|
||||||
'FORUM_LINK' => FORUM_LINK,
|
'FORUM_LINK' => FORUM_LINK,
|
||||||
'FORUM_CAT' => FORUM_CAT,
|
'FORUM_CAT' => FORUM_CAT,
|
||||||
|
@ -810,8 +809,8 @@ class acp_forums
|
||||||
|
|
||||||
$template->assign_block_vars('forums', array(
|
$template->assign_block_vars('forums', array(
|
||||||
'FOLDER_IMAGE' => $folder_image,
|
'FOLDER_IMAGE' => $folder_image,
|
||||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="" />' : '',
|
'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_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
|
||||||
'FORUM_NAME' => $row['forum_name'],
|
'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_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'],
|
'FORUM_TOPICS' => $row['forum_topics'],
|
||||||
|
@ -1620,9 +1619,9 @@ class acp_forums
|
||||||
*/
|
*/
|
||||||
function delete_forum_content($forum_id)
|
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');
|
$db->sql_transaction('begin');
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,7 @@ class acp_groups
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache, $file_uploads;
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
|
|
||||||
|
|
||||||
$user->add_lang('acp/groups');
|
$user->add_lang('acp/groups');
|
||||||
$this->tpl_name = 'acp_groups';
|
$this->tpl_name = 'acp_groups';
|
||||||
|
@ -35,7 +34,7 @@ class acp_groups
|
||||||
$form_key = 'acp_groups';
|
$form_key = 'acp_groups';
|
||||||
add_form_key($form_key);
|
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
|
// Check and set some common vars
|
||||||
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''));
|
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''));
|
||||||
|
@ -49,7 +48,7 @@ class acp_groups
|
||||||
|
|
||||||
|
|
||||||
// Clear some vars
|
// 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();
|
$group_row = array();
|
||||||
|
|
||||||
// Grab basic data for group, if group_id is set and exists
|
// Grab basic data for group, if group_id is set and exists
|
||||||
|
@ -247,7 +246,7 @@ class acp_groups
|
||||||
case 'edit':
|
case 'edit':
|
||||||
case 'add':
|
case 'add':
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
|
||||||
|
|
||||||
$data = $submit_ary = array();
|
$data = $submit_ary = array();
|
||||||
|
|
||||||
|
@ -330,11 +329,11 @@ class acp_groups
|
||||||
else if ($avatar_select && $config['allow_avatar_local'])
|
else if ($avatar_select && $config['allow_avatar_local'])
|
||||||
{
|
{
|
||||||
// check avatar gallery
|
// 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;
|
$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;
|
$submit_ary['avatar'] = $category . '/' . $avatar_select;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -505,7 +504,7 @@ class acp_groups
|
||||||
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
|
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
|
||||||
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' 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;
|
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
|
||||||
|
|
||||||
|
@ -519,7 +518,7 @@ class acp_groups
|
||||||
switch ($back_link)
|
switch ($back_link)
|
||||||
{
|
{
|
||||||
case 'acp_users_groups':
|
case 'acp_users_groups':
|
||||||
$u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=groups&u=' . request_var('u', 0));
|
$u_back = append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&mode=groups&u=' . request_var('u', 0));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -574,7 +573,7 @@ class acp_groups
|
||||||
'GROUP_HIDDEN' => $type_hidden,
|
'GROUP_HIDDEN' => $type_hidden,
|
||||||
|
|
||||||
'U_BACK' => $u_back,
|
'U_BACK' => $u_back,
|
||||||
'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&name=group_colour'),
|
'U_SWATCH' => append_sid(PHPBB_ADMIN_PATH . 'swatch.' . PHP_EXT, 'form=settings&name=group_colour'),
|
||||||
'U_ACTION' => "{$this->u_action}&action=$action&g=$group_id",
|
'U_ACTION' => "{$this->u_action}&action=$action&g=$group_id",
|
||||||
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),
|
'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))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$template->assign_block_vars('leader', array(
|
$template->assign_block_vars('leader', array(
|
||||||
'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"),
|
'U_USER_EDIT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&action=edit&u={$row['user_id']}"),
|
||||||
|
|
||||||
'USERNAME' => $row['username'],
|
'USERNAME' => $row['username'],
|
||||||
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
|
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
|
||||||
|
@ -643,7 +642,7 @@ class acp_groups
|
||||||
|
|
||||||
'U_ACTION' => $this->u_action . "&g=$group_id",
|
'U_ACTION' => $this->u_action . "&g=$group_id",
|
||||||
'U_BACK' => $this->u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames'),
|
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=list&field=usernames'),
|
||||||
'U_DEFAULT_ALL' => "{$this->u_action}&action=default&g=$group_id",
|
'U_DEFAULT_ALL' => "{$this->u_action}&action=default&g=$group_id",
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -670,7 +669,7 @@ class acp_groups
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('member', array(
|
$template->assign_block_vars('member', array(
|
||||||
'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"),
|
'U_USER_EDIT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&action=edit&u={$row['user_id']}"),
|
||||||
|
|
||||||
'USERNAME' => $row['username'],
|
'USERNAME' => $row['username'],
|
||||||
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
|
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
|
||||||
|
|
|
@ -26,8 +26,7 @@ class acp_icons
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('acp/posting');
|
$user->add_lang('acp/posting');
|
||||||
|
|
||||||
|
@ -69,13 +68,13 @@ class acp_icons
|
||||||
// Grab file list of paks and images
|
// Grab file list of paks and images
|
||||||
if ($action == 'edit' || $action == 'add' || $action == 'import')
|
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 ($imglist as $path => $img_ary)
|
||||||
{
|
{
|
||||||
foreach ($img_ary as $img)
|
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)
|
if (!$img_size[0] || !$img_size[1] || strlen($img) > 255)
|
||||||
{
|
{
|
||||||
|
@ -89,11 +88,11 @@ class acp_icons
|
||||||
}
|
}
|
||||||
unset($imglist);
|
unset($imglist);
|
||||||
|
|
||||||
if ($dir = @opendir($phpbb_root_path . $img_path))
|
if ($dir = @opendir(PHPBB_ROOT_PATH . $img_path))
|
||||||
{
|
{
|
||||||
while (($file = readdir($dir)) !== false)
|
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;
|
$_paks[] = $file;
|
||||||
}
|
}
|
||||||
|
@ -254,7 +253,7 @@ class acp_icons
|
||||||
$template->assign_block_vars('items', array(
|
$template->assign_block_vars('items', array(
|
||||||
'IMG' => $img,
|
'IMG' => $img,
|
||||||
'A_IMG' => addslashes($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'] : '',
|
'CODE' => ($mode == 'smilies' && isset($img_row['code'])) ? $img_row['code'] : '',
|
||||||
'EMOTION' => ($mode == 'smilies' && isset($img_row['emotion'])) ? $img_row['emotion'] : '',
|
'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_DISPLAY' => $add_order_list . $add_order_lists[1],
|
||||||
'S_ADD_ORDER_LIST_UNDISPLAY' => $add_order_list . $add_order_lists[0],
|
'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,
|
'IMG_PATH' => $img_path,
|
||||||
'PHPBB_ROOT_PATH' => $phpbb_root_path,
|
'PHPBB_ROOT_PATH' => PHPBB_ROOT_PATH,
|
||||||
|
|
||||||
'CODE' => $default_row['code'],
|
'CODE' => $default_row['code'],
|
||||||
'EMOTION' => $default_row['emotion'],
|
'EMOTION' => $default_row['emotion'],
|
||||||
|
@ -352,7 +351,7 @@ class acp_icons
|
||||||
{
|
{
|
||||||
if ($image_width[$image] == 0 || $image_height[$image] == 0)
|
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_width[$image] = $img_size[0];
|
||||||
$image_height[$image] = $img_size[1];
|
$image_height[$image] = $img_size[1];
|
||||||
}
|
}
|
||||||
|
@ -461,7 +460,7 @@ class acp_icons
|
||||||
{
|
{
|
||||||
$order = 0;
|
$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);
|
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(
|
$template->assign_block_vars('items', array(
|
||||||
'S_SPACER' => (!$spacer && !$row['display_on_posting']) ? true : false,
|
'S_SPACER' => (!$spacer && !$row['display_on_posting']) ? true : false,
|
||||||
'ALT_TEXT' => $alt_text,
|
'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'],
|
'WIDTH' => $row[$fields . '_width'],
|
||||||
'HEIGHT' => $row[$fields . '_height'],
|
'HEIGHT' => $row[$fields . '_height'],
|
||||||
'CODE' => (isset($row['code'])) ? $row['code'] : '',
|
'CODE' => (isset($row['code'])) ? $row['code'] : '',
|
||||||
|
|
|
@ -32,9 +32,8 @@ class acp_inactive
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template;
|
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');
|
$user->add_lang('memberlist');
|
||||||
|
|
||||||
|
@ -98,7 +97,7 @@ class acp_inactive
|
||||||
|
|
||||||
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !empty($inactive_users))
|
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();
|
$messenger = new messenger();
|
||||||
|
|
||||||
|
@ -167,7 +166,7 @@ class acp_inactive
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
// Send the messages
|
// 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();
|
$messenger = new messenger();
|
||||||
$usernames = array();
|
$usernames = array();
|
||||||
|
@ -182,7 +181,7 @@ class acp_inactive
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'USERNAME' => htmlspecialchars_decode($row['username']),
|
'USERNAME' => htmlspecialchars_decode($row['username']),
|
||||||
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
|
'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']);
|
$messenger->send($row['user_notify_type']);
|
||||||
|
@ -228,7 +227,7 @@ class acp_inactive
|
||||||
'REASON' => $row['inactive_reason'],
|
'REASON' => $row['inactive_reason'],
|
||||||
'USER_ID' => $row['user_id'],
|
'USER_ID' => $row['user_id'],
|
||||||
'USERNAME' => $row['username'],
|
'USERNAME' => $row['username'],
|
||||||
'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}"))
|
'U_USER_ADMIN' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&mode=overview&u={$row['user_id']}"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,12 +26,11 @@ class acp_jabber
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template;
|
global $db, $user, $auth, $template, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('acp/board');
|
$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', '');
|
$action = request_var('action', '');
|
||||||
$submit = (isset($_POST['submit'])) ? true : false;
|
$submit = (isset($_POST['submit'])) ? true : false;
|
||||||
|
|
|
@ -32,10 +32,9 @@ class acp_language
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache;
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
|
||||||
global $safe_mode, $file_uploads;
|
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();
|
$this->default_variables();
|
||||||
|
|
||||||
|
@ -61,7 +60,7 @@ class acp_language
|
||||||
list($_REQUEST['language_file'], ) = array_keys($missing_file);
|
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);
|
list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file);
|
||||||
|
|
||||||
|
@ -78,7 +77,7 @@ class acp_language
|
||||||
$action = 'upload_file';
|
$action = 'upload_file';
|
||||||
$method = request_var('method', '');
|
$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)
|
switch ($method)
|
||||||
{
|
{
|
||||||
|
@ -103,7 +102,7 @@ class acp_language
|
||||||
{
|
{
|
||||||
case 'upload_file':
|
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', '');
|
$method = request_var('method', '');
|
||||||
|
|
||||||
|
@ -219,7 +218,7 @@ class acp_language
|
||||||
{
|
{
|
||||||
case 'email':
|
case 'email':
|
||||||
// Get email templates
|
// 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/'];
|
$email_files = $email_files['email/'];
|
||||||
|
|
||||||
if (!in_array($this->language_file, $email_files))
|
if (!in_array($this->language_file, $email_files))
|
||||||
|
@ -230,7 +229,7 @@ class acp_language
|
||||||
|
|
||||||
case 'acp':
|
case 'acp':
|
||||||
// Get acp files
|
// 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/'];
|
$acp_files = $acp_files['acp/'];
|
||||||
|
|
||||||
if (!in_array($this->language_file, $acp_files))
|
if (!in_array($this->language_file, $acp_files))
|
||||||
|
@ -241,7 +240,7 @@ class acp_language
|
||||||
|
|
||||||
case 'mods':
|
case 'mods':
|
||||||
// Get mod files
|
// 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();
|
$mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array();
|
||||||
|
|
||||||
if (!in_array($this->language_file, $mods_files))
|
if (!in_array($this->language_file, $mods_files))
|
||||||
|
@ -269,7 +268,7 @@ class acp_language
|
||||||
|
|
||||||
foreach ($mkdir_ary as $dir)
|
foreach ($mkdir_ary as $dir)
|
||||||
{
|
{
|
||||||
$dir = $phpbb_root_path . 'store/' . $dir;
|
$dir = PHPBB_ROOT_PATH . 'store/' . $dir;
|
||||||
|
|
||||||
if (!is_dir($dir))
|
if (!is_dir($dir))
|
||||||
{
|
{
|
||||||
|
@ -284,7 +283,7 @@ class acp_language
|
||||||
|
|
||||||
// Get target filename for storage folder
|
// Get target filename for storage folder
|
||||||
$filename = $this->get_filename($row['lang_iso'], $this->language_directory, $this->language_file, true, true);
|
$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)
|
if (!$fp)
|
||||||
{
|
{
|
||||||
|
@ -354,7 +353,7 @@ class acp_language
|
||||||
header('Content-Type: application/octetstream; name="' . $this->language_file . '"');
|
header('Content-Type: application/octetstream; name="' . $this->language_file . '"');
|
||||||
header('Content-disposition: attachment; filename=' . $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))
|
while ($buffer = fread($fp, 1024))
|
||||||
{
|
{
|
||||||
echo $buffer;
|
echo $buffer;
|
||||||
|
@ -382,7 +381,7 @@ class acp_language
|
||||||
$old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true);
|
$old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true);
|
||||||
$lang_path = 'language/' . $row['lang_iso'] . '/' . (($dir) ? $dir . '/' : '');
|
$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', '');
|
$method = request_var('method', '');
|
||||||
|
|
||||||
if ($method != 'ftp' && $method != 'ftp_fsock')
|
if ($method != 'ftp' && $method != 'ftp_fsock')
|
||||||
|
@ -412,9 +411,9 @@ class acp_language
|
||||||
$transfer->close_session();
|
$transfer->close_session();
|
||||||
|
|
||||||
// Remove from storage folder
|
// 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);
|
add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file);
|
||||||
|
@ -447,15 +446,15 @@ class acp_language
|
||||||
$missing_vars = $missing_files = array();
|
$missing_vars = $missing_files = array();
|
||||||
|
|
||||||
// Get email templates
|
// 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/'];
|
$email_files = $email_files['email/'];
|
||||||
|
|
||||||
// Get acp files
|
// 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/'];
|
$acp_files = $acp_files['acp/'];
|
||||||
|
|
||||||
// Get mod files
|
// 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();
|
$mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array();
|
||||||
|
|
||||||
// Check if our current filename matches the files
|
// 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);
|
$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();
|
$methods = transfer::methods();
|
||||||
|
|
||||||
|
@ -529,7 +528,7 @@ class acp_language
|
||||||
|
|
||||||
foreach ($this->main_files as $file)
|
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);
|
$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
|
// Now go through acp/mods directories
|
||||||
foreach ($acp_files as $file)
|
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);
|
$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)
|
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);
|
$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?
|
// More missing files... for example email templates?
|
||||||
foreach ($email_files as $file)
|
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);
|
$missing_files[] = $this->get_filename($lang_iso, 'email', $file);
|
||||||
}
|
}
|
||||||
|
@ -625,7 +624,7 @@ class acp_language
|
||||||
}
|
}
|
||||||
|
|
||||||
// Main language files
|
// 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)
|
foreach ($this->main_files as $file)
|
||||||
{
|
{
|
||||||
if (strpos($file, 'help_') === 0)
|
if (strpos($file, 'help_') === 0)
|
||||||
|
@ -633,14 +632,14 @@ class acp_language
|
||||||
continue;
|
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"' : '';
|
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
|
||||||
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
|
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Help Files
|
// 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)
|
foreach ($this->main_files as $file)
|
||||||
{
|
{
|
||||||
if (strpos($file, 'help_') !== 0)
|
if (strpos($file, 'help_') !== 0)
|
||||||
|
@ -648,7 +647,7 @@ class acp_language
|
||||||
continue;
|
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"' : '';
|
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
|
||||||
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
|
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
|
||||||
|
@ -664,11 +663,11 @@ class acp_language
|
||||||
continue;
|
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)
|
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"' : '';
|
$selected = ($this->language_directory == $check && $this->language_file == $file) ? ' selected="selected"' : '';
|
||||||
$s_lang_options .= '<option value="' . $check . '|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
|
$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_email_file = ($this->language_directory == 'email') ? true : false;
|
||||||
$is_help_file = (strpos($this->language_file, 'help_') === 0) ? 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);
|
$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);
|
$print_message = sprintf($user->lang['MISSING_LANGUAGE_FILE'], $no_store_filename);
|
||||||
}
|
}
|
||||||
|
@ -692,12 +691,12 @@ class acp_language
|
||||||
{
|
{
|
||||||
if ($is_email_file)
|
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
|
else
|
||||||
{
|
{
|
||||||
$help = array();
|
$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)
|
if ($is_help_file)
|
||||||
{
|
{
|
||||||
|
@ -794,12 +793,12 @@ class acp_language
|
||||||
$lang_iso = request_var('iso', '');
|
$lang_iso = request_var('iso', '');
|
||||||
$lang_iso = basename($lang_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);
|
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(
|
$lang_pack = array(
|
||||||
'iso' => $lang_iso,
|
'iso' => $lang_iso,
|
||||||
|
@ -849,9 +848,9 @@ class acp_language
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
while ($imageset_row = $db->sql_fetchrow($result))
|
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)
|
foreach ($cfg_data_imageset_data as $image_name => $value)
|
||||||
{
|
{
|
||||||
if (strpos($value, '*') !== false)
|
if (strpos($value, '*') !== false)
|
||||||
|
@ -994,41 +993,41 @@ class acp_language
|
||||||
$use_method = '.tar';
|
$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')
|
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
|
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
|
// 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/'];
|
$email_templates = $email_templates['email/'];
|
||||||
|
|
||||||
// Get acp files
|
// 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/'];
|
$acp_files = $acp_files['acp/'];
|
||||||
|
|
||||||
// Get mod files
|
// 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();
|
$mod_files = (isset($mod_files['mods/'])) ? $mod_files['mods/'] : array();
|
||||||
|
|
||||||
// Add main files
|
// Add main files
|
||||||
$this->add_to_archive($compress, $this->main_files, $row['lang_iso']);
|
$this->add_to_archive($compress, $this->main_files, $row['lang_iso']);
|
||||||
|
|
||||||
// Add search files if they exist...
|
// 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
|
// Write files in folders
|
||||||
|
@ -1055,7 +1054,7 @@ class acp_language
|
||||||
$compress->close();
|
$compress->close();
|
||||||
|
|
||||||
$compress->download('lang_' . $row['lang_iso']);
|
$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;
|
exit;
|
||||||
|
|
||||||
|
@ -1101,17 +1100,17 @@ class acp_language
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$new_ary = $iso = array();
|
$new_ary = $iso = array();
|
||||||
$dp = @opendir("{$phpbb_root_path}language");
|
$dp = @opendir(PHPBB_ROOT_PATH . 'language');
|
||||||
|
|
||||||
if ($dp)
|
if ($dp)
|
||||||
{
|
{
|
||||||
while (($file = readdir($dp)) !== false)
|
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 (!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)
|
if (sizeof($iso) == 3)
|
||||||
{
|
{
|
||||||
|
@ -1153,8 +1152,6 @@ class acp_language
|
||||||
*/
|
*/
|
||||||
function default_variables()
|
function default_variables()
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
$this->language_file_header = '<?php
|
$this->language_file_header = '<?php
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -1199,7 +1196,7 @@ $lang = array_merge($lang, array(
|
||||||
';
|
';
|
||||||
|
|
||||||
// Language files in language root directory
|
// 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)
|
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;
|
$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;
|
$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;
|
return $check_store_filename;
|
||||||
}
|
}
|
||||||
|
@ -1233,8 +1230,6 @@ $lang = array_merge($lang, array(
|
||||||
*/
|
*/
|
||||||
function add_to_archive(&$compress, $filelist, $lang_iso, $directory = '')
|
function add_to_archive(&$compress, $filelist, $lang_iso, $directory = '')
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
|
||||||
|
|
||||||
foreach ($filelist as $file)
|
foreach ($filelist as $file)
|
||||||
{
|
{
|
||||||
// Get source filename
|
// Get source filename
|
||||||
|
@ -1242,7 +1237,7 @@ $lang = array_merge($lang, array(
|
||||||
$destination = 'language/' . $lang_iso . '/' . (($directory) ? $directory . '/' : '') . $file;
|
$destination = 'language/' . $lang_iso . '/' . (($directory) ? $directory . '/' : '') . $file;
|
||||||
|
|
||||||
// Add file to archive
|
// 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)
|
function compare_language_files($source_lang, $dest_lang, $directory, $file)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$return_ary = array();
|
$return_ary = array();
|
||||||
|
|
||||||
$lang = 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_entry_src = $lang;
|
||||||
|
|
||||||
$lang = array();
|
$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();
|
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;
|
$lang_entry_dst = $lang;
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,7 @@ class acp_logs
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('mcp');
|
$user->add_lang('mcp');
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ class acp_main
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template;
|
global $config, $db, $user, $auth, $template;
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
// Show restore permissions notice
|
// Show restore permissions notice
|
||||||
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
|
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
|
||||||
|
@ -42,16 +41,16 @@ class acp_main
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$perm_from = '<strong' . (($user_row['user_colour']) ? ' style="color: #' . $user_row['user_colour'] . '">' : '>');
|
$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&u=' . $user_row['user_id']) . '">' : '';
|
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid('memberlist', 'mode=viewprofile&u=' . $user_row['user_id']) . '">' : '';
|
||||||
$perm_from .= $user_row['username'];
|
$perm_from .= $user_row['username'];
|
||||||
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '</a>' : '';
|
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '</a>' : '';
|
||||||
$perm_from .= '</strong>';
|
$perm_from .= '</strong>';
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_RESTORE_PERMISSIONS' => true,
|
'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,
|
'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;
|
return;
|
||||||
|
@ -162,7 +161,7 @@ class acp_main
|
||||||
|
|
||||||
if (!function_exists('update_last_username'))
|
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();
|
update_last_username();
|
||||||
|
|
||||||
|
@ -311,13 +310,13 @@ class acp_main
|
||||||
|
|
||||||
$avatar_dir_size = 0;
|
$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)
|
while (($file = readdir($avatar_dir)) !== false)
|
||||||
{
|
{
|
||||||
if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === 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);
|
closedir($avatar_dir);
|
||||||
|
@ -387,8 +386,8 @@ class acp_main
|
||||||
'BOARD_VERSION' => $config['version'],
|
'BOARD_VERSION' => $config['version'],
|
||||||
|
|
||||||
'U_ACTION' => $this->u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'),
|
'U_ADMIN_LOG' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=logs&mode=admin'),
|
||||||
'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&mode=list'),
|
'U_INACTIVE_USERS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=inactive&mode=list'),
|
||||||
|
|
||||||
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
|
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
|
||||||
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
|
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
|
||||||
|
@ -429,7 +428,7 @@ class acp_main
|
||||||
'REASON' => $row['inactive_reason'],
|
'REASON' => $row['inactive_reason'],
|
||||||
'USER_ID' => $row['user_id'],
|
'USER_ID' => $row['user_id'],
|
||||||
'USERNAME' => $row['username'],
|
'USERNAME' => $row['username'],
|
||||||
'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}"))
|
'U_USER_ADMIN' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&mode=overview&u={$row['user_id']}"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,7 +445,7 @@ class acp_main
|
||||||
}
|
}
|
||||||
|
|
||||||
// Warn if install is still present
|
// 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);
|
$template->assign_var('S_REMOVE_INSTALL', true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,7 @@ class acp_modules
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $module;
|
global $db, $user, $auth, $template, $module, $config;
|
||||||
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
|
// 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);
|
define('MODULE_INCLUDE', true);
|
||||||
|
@ -530,11 +529,9 @@ class acp_modules
|
||||||
*/
|
*/
|
||||||
function get_module_infos($module = '', $module_class = false)
|
function get_module_infos($module = '', $module_class = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$module_class = ($module_class === false) ? $this->module_class : $module_class;
|
$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();
|
$fileinfo = array();
|
||||||
|
|
||||||
if (!$module)
|
if (!$module)
|
||||||
|
@ -549,9 +546,9 @@ class acp_modules
|
||||||
while (($file = readdir($dh)) !== false)
|
while (($file = readdir($dh)) !== false)
|
||||||
{
|
{
|
||||||
// Is module?
|
// 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))
|
if (!class_exists($class))
|
||||||
{
|
{
|
||||||
|
@ -578,7 +575,7 @@ class acp_modules
|
||||||
|
|
||||||
if (!class_exists($class))
|
if (!class_exists($class))
|
||||||
{
|
{
|
||||||
include($directory . $filename . '.' . $phpEx);
|
include($directory . $filename . '.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get module title tag
|
// Get module title tag
|
||||||
|
|
|
@ -25,11 +25,10 @@ class acp_permission_roles
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
|
||||||
|
|
||||||
$auth_admin = new auth_admin();
|
$auth_admin = new auth_admin();
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,10 @@ class acp_permissions
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
|
||||||
|
|
||||||
$auth_admin = new auth_admin();
|
$auth_admin = new auth_admin();
|
||||||
|
|
||||||
|
@ -354,7 +353,7 @@ class acp_permissions
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_SELECT_USER' => true,
|
'S_SELECT_USER' => true,
|
||||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username&select_single=true'),
|
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=select_victim&field=username&select_single=true'),
|
||||||
));
|
));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -416,7 +415,7 @@ class acp_permissions
|
||||||
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
|
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
|
||||||
'S_DEFINED_GROUP_OPTIONS' => $items['group_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)),
|
'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&form=add_user&field=username&select_single=true'),
|
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=add_user&field=username&select_single=true'),
|
||||||
));
|
));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -25,8 +25,7 @@ class acp_php_info
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template;
|
global $db, $user, $auth, $template, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
if ($mode != 'info')
|
if ($mode != 'info')
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,11 +29,10 @@ class acp_profile
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
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_posting.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
|
||||||
|
|
||||||
$user->add_lang(array('ucp', 'acp/profile'));
|
$user->add_lang(array('ucp', 'acp/profile'));
|
||||||
$this->tpl_name = 'acp_profile';
|
$this->tpl_name = 'acp_profile';
|
||||||
|
|
|
@ -25,10 +25,10 @@ class acp_prune
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path;
|
global $user;
|
||||||
|
|
||||||
$user->add_lang('acp/prune');
|
$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)
|
switch ($mode)
|
||||||
{
|
{
|
||||||
|
@ -51,8 +51,7 @@ class acp_prune
|
||||||
*/
|
*/
|
||||||
function prune_forums($id, $mode)
|
function prune_forums($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$all_forums = request_var('all_forums', 0);
|
$all_forums = request_var('all_forums', 0);
|
||||||
$forum_id = request_var('f', array(0));
|
$forum_id = request_var('f', array(0));
|
||||||
|
@ -228,8 +227,7 @@ class acp_prune
|
||||||
*/
|
*/
|
||||||
function prune_users($id, $mode)
|
function prune_users($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('memberlist');
|
$user->add_lang('memberlist');
|
||||||
|
|
||||||
|
@ -300,8 +298,8 @@ class acp_prune
|
||||||
{
|
{
|
||||||
$template->assign_block_vars('users', array(
|
$template->assign_block_vars('users', array(
|
||||||
'USERNAME' => $usernames[$user_id],
|
'USERNAME' => $usernames[$user_id],
|
||||||
'U_PROFILE' => append_sid($phpbb_root_path . 'memberlist.' . $phpEx, 'mode=viewprofile&u=' . $user_id),
|
'U_PROFILE' => append_sid('memberlist', 'mode=viewprofile&u=' . $user_id),
|
||||||
'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '',
|
'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,7 +356,7 @@ class acp_prune
|
||||||
'S_JOINED_OPTIONS' => $s_find_join_time,
|
'S_JOINED_OPTIONS' => $s_find_join_time,
|
||||||
'S_ACTIVE_OPTIONS' => $s_find_active_time,
|
'S_ACTIVE_OPTIONS' => $s_find_active_time,
|
||||||
'S_COUNT_OPTIONS' => $s_find_count,
|
'S_COUNT_OPTIONS' => $s_find_count,
|
||||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_prune&field=users'),
|
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=acp_prune&field=users'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,7 @@ class acp_ranks
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('acp/posting');
|
$user->add_lang('acp/posting');
|
||||||
|
|
||||||
|
@ -157,7 +156,7 @@ class acp_ranks
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$imglist = filelist($phpbb_root_path . $config['ranks_path'], '');
|
$imglist = filelist(PHPBB_ROOT_PATH . $config['ranks_path'], '');
|
||||||
$edit_img = $filename_list = '';
|
$edit_img = $filename_list = '';
|
||||||
|
|
||||||
foreach ($imglist as $path => $img_ary)
|
foreach ($imglist as $path => $img_ary)
|
||||||
|
@ -196,12 +195,12 @@ class acp_ranks
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_EDIT' => true,
|
'S_EDIT' => true,
|
||||||
'U_BACK' => $this->u_action,
|
'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 . '&id=' . $rank_id,
|
'U_ACTION' => $this->u_action . '&id=' . $rank_id,
|
||||||
|
|
||||||
'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '',
|
'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '',
|
||||||
'S_FILENAME_LIST' => $filename_list,
|
'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,
|
'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)
|
'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_RANK_IMAGE' => ($row['rank_image']) ? true : false,
|
||||||
'S_SPECIAL_RANK' => ($row['rank_special']) ? 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'],
|
'RANK_TITLE' => $row['rank_title'],
|
||||||
'MIN_POSTS' => $row['rank_min'],
|
'MIN_POSTS' => $row['rank_min'],
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,7 @@ class acp_reasons
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang(array('mcp', 'acp/posting'));
|
$user->add_lang(array('mcp', 'acp/posting'));
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,7 @@ class acp_search
|
||||||
|
|
||||||
function settings($id, $mode)
|
function settings($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$submit = (isset($_POST['submit'])) ? true : false;
|
$submit = (isset($_POST['submit'])) ? true : false;
|
||||||
|
|
||||||
|
@ -159,7 +158,7 @@ class acp_search
|
||||||
{
|
{
|
||||||
add_log('admin', 'LOG_CONFIG_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&mode=index') . '">» ' . $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&mode=index') . '">» ' . $user->lang['GO_TO_SEARCH_INDEX'] . '</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -227,8 +226,7 @@ class acp_search
|
||||||
|
|
||||||
function index($id, $mode)
|
function index($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
if (isset($_REQUEST['action']) && is_array($_REQUEST['action']))
|
if (isset($_REQUEST['action']) && is_array($_REQUEST['action']))
|
||||||
{
|
{
|
||||||
|
@ -297,7 +295,7 @@ class acp_search
|
||||||
if (method_exists($this->search, 'delete_index'))
|
if (method_exists($this->search, 'delete_index'))
|
||||||
{
|
{
|
||||||
// pass a reference to myself so the $search object can make use of save_state() and attributes
|
// 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->state = array('');
|
||||||
$this->save_state();
|
$this->save_state();
|
||||||
|
@ -360,7 +358,7 @@ class acp_search
|
||||||
if (method_exists($this->search, 'create_index'))
|
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
|
// 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->state = array('');
|
||||||
$this->save_state();
|
$this->save_state();
|
||||||
|
@ -500,8 +498,8 @@ class acp_search
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_INDEX' => true,
|
'S_INDEX' => true,
|
||||||
'U_ACTION' => $this->u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'U_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar"),
|
'U_PROGRESS_BAR' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&mode=$mode&action=progress_bar"),
|
||||||
'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar")),
|
'UA_PROGRESS_BAR' => addslashes(append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&mode=$mode&action=progress_bar")),
|
||||||
));
|
));
|
||||||
|
|
||||||
if (isset($this->state[1]))
|
if (isset($this->state[1]))
|
||||||
|
@ -546,19 +544,17 @@ class acp_search
|
||||||
|
|
||||||
function get_search_types()
|
function get_search_types()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$search_types = array();
|
$search_types = array();
|
||||||
|
|
||||||
$dp = @opendir($phpbb_root_path . 'includes/search');
|
$dp = @opendir(PHPBB_ROOT_PATH . 'includes/search');
|
||||||
|
|
||||||
if ($dp)
|
if ($dp)
|
||||||
{
|
{
|
||||||
while (($file = readdir($dp)) !== false)
|
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);
|
closedir($dp);
|
||||||
|
@ -601,15 +597,15 @@ class acp_search
|
||||||
*/
|
*/
|
||||||
function init_search($type, &$search, &$error)
|
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'];
|
$error = $user->lang['NO_SUCH_SEARCH_MODULE'];
|
||||||
return $error;
|
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))
|
if (!class_exists($type))
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,8 +31,7 @@ class acp_styles
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
// Hardcoded template bitfield to add for new templates
|
// Hardcoded template bitfield to add for new templates
|
||||||
$bitfield = new bitfield();
|
$bitfield = new bitfield();
|
||||||
|
@ -246,7 +245,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
$template_refreshed = '';
|
$template_refreshed = '';
|
||||||
|
|
||||||
// Only refresh database if the template is stored in the database
|
// 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());
|
$filelist = array('' => array());
|
||||||
|
|
||||||
|
@ -257,7 +256,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
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
|
// get folder info from the filename
|
||||||
if (($slash_pos = strrpos($row['template_filename'], '/')) === false)
|
if (($slash_pos = strrpos($row['template_filename'], '/')) === false)
|
||||||
|
@ -325,11 +324,11 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
|
|
||||||
if (confirm_box(true))
|
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
|
// Save CSS contents
|
||||||
$sql_ary = array(
|
$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)
|
'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);
|
$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');
|
$db->sql_transaction('begin');
|
||||||
|
|
||||||
|
@ -437,9 +436,9 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
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)
|
foreach ($cfg_data_imageset_data as $image_name => $value)
|
||||||
{
|
{
|
||||||
if (strpos($value, '*') !== false)
|
if (strpos($value, '*') !== false)
|
||||||
|
@ -511,7 +510,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function frontend($mode, $options, $actions)
|
function frontend($mode, $options, $actions)
|
||||||
{
|
{
|
||||||
global $user, $template, $db, $config, $phpbb_root_path, $phpEx;
|
global $user, $template, $db, $config;
|
||||||
|
|
||||||
$sql_from = '';
|
$sql_from = '';
|
||||||
$style_count = array();
|
$style_count = array();
|
||||||
|
@ -600,7 +599,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
'L_STYLE_ACT_DEACT' => $user->lang['STYLE_' . strtoupper($stylevis)],
|
'L_STYLE_ACT_DEACT' => $user->lang['STYLE_' . strtoupper($stylevis)],
|
||||||
'S_OPTIONS' => implode(' | ', $s_options),
|
'S_OPTIONS' => implode(' | ', $s_options),
|
||||||
'S_ACTIONS' => implode(' | ', $s_actions),
|
'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'],
|
'NAME' => $row[$mode . '_name'],
|
||||||
'STYLE_COUNT' => ($mode == 'style' && isset($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : 0,
|
'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
|
// Grab uninstalled items
|
||||||
$new_ary = $cfg = array();
|
$new_ary = $cfg = array();
|
||||||
|
|
||||||
$dp = @opendir("{$phpbb_root_path}styles");
|
$dp = @opendir(PHPBB_ROOT_PATH . 'styles');
|
||||||
|
|
||||||
if ($dp)
|
if ($dp)
|
||||||
{
|
{
|
||||||
while (($file = readdir($dp)) !== false)
|
while (($file = readdir($dp)) !== false)
|
||||||
{
|
{
|
||||||
$subpath = ($mode != 'style') ? "$mode/" : '';
|
$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);
|
$items = parse_cfg_file('', $cfg);
|
||||||
$name = (isset($items['name'])) ? trim($items['name']) : false;
|
$name = (isset($items['name'])) ? trim($items['name']) : false;
|
||||||
|
@ -668,7 +667,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function edit_template($template_id)
|
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';
|
$this->page_title = 'EDIT_TEMPLATE';
|
||||||
|
|
||||||
|
@ -709,7 +708,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
if ($save_changes && $template_file)
|
if ($save_changes && $template_file)
|
||||||
{
|
{
|
||||||
// Get the filesystem location of the current 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 = '';
|
$additional = '';
|
||||||
|
|
||||||
// If the template is stored on the filesystem try to write the file else store it in the database
|
// 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;
|
WHERE template_id = ' . $template_id;
|
||||||
$db->sql_query($sql);
|
$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);
|
$this->store_templates('insert', $template_id, $template_info['template_path'], $filelist);
|
||||||
|
|
||||||
add_log('admin', 'LOG_TEMPLATE_EDIT_DETAILS', $template_info['template_name']);
|
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
|
// Generate a category array containing template filenames
|
||||||
if (!$template_info['template_storedb'])
|
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 = filelist($template_path, '', 'html');
|
||||||
$filelist[''] = array_diff($filelist[''], array('bbcode.html'));
|
$filelist[''] = array_diff($filelist[''], array('bbcode.html'));
|
||||||
|
@ -898,7 +897,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function template_cache($template_id)
|
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', ''));
|
$source = str_replace('/', '.', request_var('source', ''));
|
||||||
$file_ary = array_diff(request_var('delete', array('')), array(''));
|
$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,
|
// Someone wants to see the cached source ... so we'll highlight it,
|
||||||
// add line numbers and indent it appropriately. This could be nasty
|
// add line numbers and indent it appropriately. This could be nasty
|
||||||
// on larger source files ...
|
// 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']);
|
adm_page_header($user->lang['TEMPLATE_CACHE']);
|
||||||
|
|
||||||
|
@ -940,7 +939,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
'FILENAME' => str_replace('.', '/', $source) . '.html')
|
'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');
|
$conf = array('highlight.bg', 'highlight.comment', 'highlight.default', 'highlight.html', 'highlight.keyword', 'highlight.string');
|
||||||
foreach ($conf as $ini_var)
|
foreach ($conf as $ini_var)
|
||||||
|
@ -1000,9 +999,9 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
$tpl_file = str_replace('.', '/', $file);
|
$tpl_file = str_replace('.', '/', $file);
|
||||||
$tpl_file = str_replace('///', '../', $tpl_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;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1010,10 +1009,10 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
$template->assign_block_vars('file', array(
|
$template->assign_block_vars('file', array(
|
||||||
'U_VIEWSOURCE' => $this->u_action . "&action=cache&id=$template_id&source=$file",
|
'U_VIEWSOURCE' => $this->u_action . "&action=cache&id=$template_id&source=$file",
|
||||||
|
|
||||||
'CACHED' => $user->format_date(filemtime("{$phpbb_root_path}cache/$filename")),
|
'CACHED' => $user->format_date(filemtime(PHPBB_ROOT_PATH . "cache/$filename")),
|
||||||
'FILENAME' => $file,
|
'FILENAME' => $file,
|
||||||
'FILESIZE' => sprintf('%.1f ' . $user->lang['KIB'], filesize("{$phpbb_root_path}cache/$filename") / 1024),
|
'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']))
|
'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);
|
unset($filemtime);
|
||||||
|
@ -1034,7 +1033,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function edit_theme($theme_id)
|
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';
|
$this->page_title = 'EDIT_THEME';
|
||||||
|
|
||||||
|
@ -1065,7 +1064,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
if ($save_changes)
|
if ($save_changes)
|
||||||
{
|
{
|
||||||
// Get the filesystem location of the current file
|
// 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 = '';
|
$additional = '';
|
||||||
$message = $user->lang['THEME_UPDATED'];
|
$message = $user->lang['THEME_UPDATED'];
|
||||||
|
|
||||||
|
@ -1110,7 +1109,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
// Generate a category array containing theme filenames
|
// Generate a category array containing theme filenames
|
||||||
if (!$theme_info['theme_storedb'])
|
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');
|
$filelist = filelist($theme_path, '', 'css');
|
||||||
|
|
||||||
|
@ -1218,7 +1217,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function edit_imageset($imageset_id)
|
function edit_imageset($imageset_id)
|
||||||
{
|
{
|
||||||
global $db, $user, $phpbb_root_path, $cache, $template;
|
global $db, $user, $cache, $template;
|
||||||
|
|
||||||
$this->page_title = 'EDIT_IMAGESET';
|
$this->page_title = 'EDIT_IMAGESET';
|
||||||
|
|
||||||
|
@ -1293,7 +1292,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
$imgheight = request_var('imgheight', 0);
|
$imgheight = request_var('imgheight', 0);
|
||||||
$imglang = '';
|
$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);
|
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)
|
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;
|
$imgwidth = ($imgwidth) ? $imgwidth : $imgwidth_file;
|
||||||
$imgheight = ($imgheight) ? $imgheight : $imgheight_file;
|
$imgheight = ($imgheight) ? $imgheight : $imgheight_file;
|
||||||
}
|
}
|
||||||
|
@ -1361,7 +1360,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
$imagesetlist = array('nolang' => array(), 'lang' => array());
|
$imagesetlist = array('nolang' => array(), 'lang' => array());
|
||||||
$langs = array();
|
$langs = array();
|
||||||
|
|
||||||
$dir = "{$phpbb_root_path}styles/$imageset_path/imageset";
|
$dir = PHPBB_ROOT_PATH . "styles/$imageset_path/imageset";
|
||||||
$dp = @opendir($dir);
|
$dp = @opendir($dir);
|
||||||
|
|
||||||
if ($dp)
|
if ($dp)
|
||||||
|
@ -1487,7 +1486,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function remove($mode, $style_id)
|
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);
|
$new_id = request_var('new_id', 0);
|
||||||
$update = (isset($_POST['update'])) ? true : false;
|
$update = (isset($_POST['update'])) ? true : false;
|
||||||
|
@ -1623,7 +1622,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function export($mode, $style_id)
|
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;
|
$update = (isset($_POST['update'])) ? true : false;
|
||||||
|
|
||||||
|
@ -1866,7 +1865,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
|
|
||||||
end($data);
|
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))
|
if ($dh = @opendir($imageset_root))
|
||||||
{
|
{
|
||||||
|
@ -1946,7 +1945,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
|
|
||||||
if (!sizeof($error))
|
if (!sizeof($error))
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_compress.' . PHP_EXT);
|
||||||
|
|
||||||
if ($mode == 'style')
|
if ($mode == 'style')
|
||||||
{
|
{
|
||||||
|
@ -1959,11 +1958,11 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
|
|
||||||
if ($format == 'zip')
|
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
|
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))
|
if (sizeof($files))
|
||||||
|
@ -1989,7 +1988,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
if (!$store)
|
if (!$store)
|
||||||
{
|
{
|
||||||
$compress->download($path);
|
$compress->download($path);
|
||||||
@unlink("{$phpbb_root_path}store/$path$ext");
|
@unlink(PHPBB_ROOT_PATH . "store/$path$ext");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2040,7 +2039,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function details($mode, $style_id)
|
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;
|
$update = (isset($_POST['update'])) ? true : false;
|
||||||
$l_type = strtoupper($mode);
|
$l_type = strtoupper($mode);
|
||||||
|
@ -2112,7 +2111,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
if ($mode === 'theme' || $mode === 'template')
|
if ($mode === 'theme' || $mode === 'template')
|
||||||
{
|
{
|
||||||
// a rather elaborate check we have to do here once to avoid trouble later
|
// 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)))
|
if (($style_row["{$mode}_storedb"] != $store_db) && !$store_db && ($safe_mode || !@is_writable($check)))
|
||||||
{
|
{
|
||||||
$error[] = $user->lang['EDIT_' . strtoupper($mode) . '_STORED_DB'];
|
$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
|
// themes which have to be parsed have to go into db
|
||||||
if ($mode == 'theme')
|
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)
|
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);
|
$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;
|
$store_db = 1;
|
||||||
$theme_data = $style_row['theme_data'];
|
$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;
|
$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(
|
$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_storedb' => $store_db,
|
||||||
'theme_data' => ($store_db) ? $theme_data : '',
|
'theme_data' => ($store_db) ? $theme_data : '',
|
||||||
);
|
);
|
||||||
|
@ -2217,7 +2216,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
|
|
||||||
if ($style_row['template_storedb'] != $store_db)
|
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 *
|
$sql = 'SELECT *
|
||||||
FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
|
FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
|
||||||
|
@ -2226,7 +2225,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
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;
|
$store_db = 1;
|
||||||
$error[] = $user->lang['EDIT_TEMPLATE_STORED_DB'];
|
$error[] = $user->lang['EDIT_TEMPLATE_STORED_DB'];
|
||||||
|
@ -2247,7 +2246,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
}
|
}
|
||||||
else if ($store_db)
|
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);
|
$this->store_templates('insert', $style_id, $style_row['template_path'], $filelist);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2350,9 +2349,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function load_css_file($path, $filename)
|
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)))
|
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 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 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
|
* @return string Stylesheet data for theme_data column in the theme table
|
||||||
*/
|
*/
|
||||||
function db_theme_data($theme_row, $stylesheet = false, $root_path = '')
|
function db_theme_data($theme_row, $stylesheet = false, $root_path = '')
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
|
||||||
|
|
||||||
if (!$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)
|
if (!$stylesheet)
|
||||||
|
@ -2415,7 +2410,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function store_templates($mode, $style_id, $template_path, $filelist)
|
function store_templates($mode, $style_id, $template_path, $filelist)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $db;
|
global $db;
|
||||||
|
|
||||||
$template_path = $template_path . '/template/';
|
$template_path = $template_path . '/template/';
|
||||||
$includes = array();
|
$includes = array();
|
||||||
|
@ -2423,11 +2418,11 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
{
|
{
|
||||||
foreach ($file_ary as $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);
|
fclose($fp);
|
||||||
|
|
||||||
if (preg_match_all('#<!-- INCLUDE (.*?\.html) -->#is', $template_data, $matches))
|
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_id' => (int) $style_id,
|
||||||
'template_filename' => "$pathfile$file",
|
'template_filename' => "$pathfile$file",
|
||||||
'template_included' => (isset($includes[$file])) ? implode(':', $includes[$file]) . ':' : '',
|
'template_included' => (isset($includes[$file])) ? implode(':', $includes[$file]) . ':' : '',
|
||||||
'template_mtime' => (int) filemtime("{$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"),
|
'template_data' => (string) file_get_contents(PHPBB_ROOT_PATH . "styles/$template_path$pathfile$file"),
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($mode == 'insert')
|
if ($mode == 'insert')
|
||||||
|
@ -2484,11 +2479,11 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function template_cache_filelist($template_path)
|
function template_cache_filelist($template_path)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $user;
|
global $user;
|
||||||
|
|
||||||
$cache_prefix = 'tpl_' . $template_path;
|
$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);
|
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;
|
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);
|
closedir($dp);
|
||||||
|
@ -2520,7 +2515,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function clear_template_cache($template_row, $file_ary = false)
|
function clear_template_cache($template_row, $file_ary = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $user;
|
global $user;
|
||||||
|
|
||||||
$cache_prefix = 'tpl_' . $template_row['template_path'];
|
$cache_prefix = 'tpl_' . $template_row['template_path'];
|
||||||
|
|
||||||
|
@ -2538,7 +2533,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
{
|
{
|
||||||
$file = str_replace('/', '.', $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))
|
if (file_exists($file) && is_file($file))
|
||||||
{
|
{
|
||||||
@unlink($file);
|
@unlink($file);
|
||||||
|
@ -2554,7 +2549,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
*/
|
*/
|
||||||
function install($mode)
|
function install($mode)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
|
global $config, $db, $cache, $user, $template;
|
||||||
|
|
||||||
$l_type = strtoupper($mode);
|
$l_type = strtoupper($mode);
|
||||||
|
|
||||||
|
@ -2568,7 +2563,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
// Installing, obtain cfg file contents
|
// Installing, obtain cfg file contents
|
||||||
if ($install_path)
|
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";
|
$cfg_file = ($mode == 'style') ? "$root_path$mode.cfg" : "$root_path$mode/$mode.cfg";
|
||||||
|
|
||||||
if (!file_exists($cfg_file))
|
if (!file_exists($cfg_file))
|
||||||
|
@ -2617,7 +2612,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
$element . '_copyright' => '')
|
$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'])
|
if (!$style_row[$element . '_name'])
|
||||||
{
|
{
|
||||||
|
@ -2656,7 +2651,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
{
|
{
|
||||||
foreach ($element_ary as $element => $table)
|
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;
|
${$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);
|
$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)
|
function add($mode)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
|
global $config, $db, $cache, $user, $template;
|
||||||
|
|
||||||
$l_type = strtoupper($mode);
|
$l_type = strtoupper($mode);
|
||||||
$element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE);
|
$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)
|
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)
|
switch ($mode)
|
||||||
{
|
{
|
||||||
|
@ -3120,7 +3115,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||||
|
|
||||||
case 'theme':
|
case 'theme':
|
||||||
// We are only interested in the theme configuration for now
|
// 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'])
|
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(
|
$sql_ary += array(
|
||||||
'theme_storedb' => $store_db,
|
'theme_storedb' => $store_db,
|
||||||
'theme_data' => ($store_db) ? $this->db_theme_data($sql_ary, false, $root_path) : '',
|
'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;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ class acp_update
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache;
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('install');
|
$user->add_lang('install');
|
||||||
|
|
||||||
|
@ -48,7 +47,7 @@ class acp_update
|
||||||
$latest_version = trim($info[0]);
|
$latest_version = trim($info[0]);
|
||||||
|
|
||||||
$announcement_url = trim($info[1]);
|
$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...
|
// Determine automatic update...
|
||||||
$sql = 'SELECT config_value
|
$sql = 'SELECT config_value
|
||||||
|
|
|
@ -31,8 +31,7 @@ class acp_users
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache, $file_uploads;
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
|
|
||||||
|
|
||||||
$user->add_lang(array('posting', 'ucp', 'acp/users'));
|
$user->add_lang(array('posting', 'ucp', 'acp/users'));
|
||||||
$this->tpl_name = 'acp_users';
|
$this->tpl_name = 'acp_users';
|
||||||
|
@ -51,7 +50,7 @@ class acp_users
|
||||||
// Whois (special case)
|
// Whois (special case)
|
||||||
if ($action == 'whois')
|
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->page_title = 'WHOIS';
|
||||||
$this->tpl_name = 'simple_body';
|
$this->tpl_name = 'simple_body';
|
||||||
|
@ -78,7 +77,7 @@ class acp_users
|
||||||
'ANONYMOUS_USER_ID' => ANONYMOUS,
|
'ANONYMOUS_USER_ID' => ANONYMOUS,
|
||||||
|
|
||||||
'S_SELECT_USER' => true,
|
'S_SELECT_USER' => true,
|
||||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username&select_single=true'),
|
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=select_user&field=username&select_single=true'),
|
||||||
));
|
));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -146,7 +145,7 @@ class acp_users
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_BACK' => $this->u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'U_MODE_SELECT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&u=$user_id"),
|
'U_MODE_SELECT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&u=$user_id"),
|
||||||
'U_ACTION' => $this->u_action . '&u=' . $user_id,
|
'U_ACTION' => $this->u_action . '&u=' . $user_id,
|
||||||
'S_FORM_OPTIONS' => $s_form_options,
|
'S_FORM_OPTIONS' => $s_form_options,
|
||||||
'MANAGED_USERNAME' => $user_row['username'])
|
'MANAGED_USERNAME' => $user_row['username'])
|
||||||
|
@ -162,7 +161,7 @@ class acp_users
|
||||||
{
|
{
|
||||||
case 'overview':
|
case 'overview':
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
|
|
||||||
$user->add_lang('acp/ban');
|
$user->add_lang('acp/ban');
|
||||||
|
|
||||||
|
@ -303,7 +302,7 @@ class acp_users
|
||||||
|
|
||||||
if ($config['email_enable'])
|
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();
|
$server_url = generate_board_url();
|
||||||
|
|
||||||
|
@ -347,7 +346,7 @@ class acp_users
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
|
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
|
||||||
'USERNAME' => htmlspecialchars_decode($user_row['username']),
|
'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);
|
$messenger->send(NOTIFY_EMAIL);
|
||||||
|
@ -906,7 +905,7 @@ class acp_users
|
||||||
'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
|
'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
|
||||||
'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}",
|
'U_WHOIS' => $this->u_action . "&action=whois&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&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&u={$user_row['user_id']}") : '',
|
||||||
|
|
||||||
'USER' => $user_row['username'],
|
'USER' => $user_row['username'],
|
||||||
'USER_REGISTERED' => $user->format_date($user_row['user_regdate']),
|
'USER_REGISTERED' => $user->format_date($user_row['user_regdate']),
|
||||||
|
@ -1024,8 +1023,8 @@ class acp_users
|
||||||
|
|
||||||
case 'profile':
|
case 'profile':
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
|
||||||
|
|
||||||
$cp = new custom_profile();
|
$cp = new custom_profile();
|
||||||
|
|
||||||
|
@ -1227,7 +1226,7 @@ class acp_users
|
||||||
|
|
||||||
case 'prefs':
|
case 'prefs':
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'dateformat' => utf8_normalize_nfc(request_var('dateformat', $user_row['user_dateformat'], true)),
|
'dateformat' => utf8_normalize_nfc(request_var('dateformat', $user_row['user_dateformat'], true)),
|
||||||
|
@ -1438,10 +1437,10 @@ class acp_users
|
||||||
|
|
||||||
case 'avatar':
|
case 'avatar':
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
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)
|
if ($submit)
|
||||||
{
|
{
|
||||||
|
@ -1461,7 +1460,7 @@ class acp_users
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate users avatar
|
// 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;
|
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
|
||||||
$avatar_select = basename(request_var('avatar_select', ''));
|
$avatar_select = basename(request_var('avatar_select', ''));
|
||||||
|
@ -1532,8 +1531,8 @@ class acp_users
|
||||||
|
|
||||||
case 'sig':
|
case 'sig':
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
|
||||||
include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
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_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;
|
$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)
|
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);
|
$message_parser = new parse_message($signature);
|
||||||
|
|
||||||
|
@ -1602,7 +1601,7 @@ class acp_users
|
||||||
'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '',
|
'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '',
|
||||||
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' 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'],
|
'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'],
|
'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'],
|
'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'])
|
if ($row['in_message'])
|
||||||
{
|
{
|
||||||
$view_topic = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&p={$row['post_msg_id']}");
|
$view_topic = append_sid('ucp', "i=pm&p={$row['post_msg_id']}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}") . '#p' . $row['post_msg_id'];
|
$view_topic = append_sid('viewtopic', "t={$row['topic_id']}&p={$row['post_msg_id']}") . '#p' . $row['post_msg_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('attach', array(
|
$template->assign_block_vars('attach', array(
|
||||||
|
@ -1756,7 +1755,7 @@ class acp_users
|
||||||
|
|
||||||
'S_IN_MESSAGE' => $row['in_message'],
|
'S_IN_MESSAGE' => $row['in_message'],
|
||||||
|
|
||||||
'U_DOWNLOAD' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&id=' . $row['attach_id']),
|
'U_DOWNLOAD' => append_sid('download/file', 'mode=view&id=' . $row['attach_id']),
|
||||||
'U_VIEW_TOPIC' => $view_topic)
|
'U_VIEW_TOPIC' => $view_topic)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1775,7 +1774,7 @@ class acp_users
|
||||||
|
|
||||||
case 'groups':
|
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'));
|
$user->add_lang(array('groups', 'acp/groups'));
|
||||||
$group_id = request_var('g', 0);
|
$group_id = request_var('g', 0);
|
||||||
|
@ -1933,7 +1932,7 @@ class acp_users
|
||||||
foreach ($data_ary as $data)
|
foreach ($data_ary as $data)
|
||||||
{
|
{
|
||||||
$template->assign_block_vars('group', array(
|
$template->assign_block_vars('group', array(
|
||||||
'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&mode=manage&action=edit&u=$user_id&g={$data['group_id']}&back_link=acp_users_groups"),
|
'U_EDIT_GROUP' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=groups&mode=manage&action=edit&u=$user_id&g={$data['group_id']}&back_link=acp_users_groups"),
|
||||||
'U_DEFAULT' => $this->u_action . "&action=default&u=$user_id&g=" . $data['group_id'],
|
'U_DEFAULT' => $this->u_action . "&action=default&u=$user_id&g=" . $data['group_id'],
|
||||||
'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'],
|
'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'],
|
||||||
'U_DELETE' => $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'],
|
'U_DELETE' => $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'],
|
||||||
|
@ -1957,7 +1956,7 @@ class acp_users
|
||||||
|
|
||||||
case 'perm':
|
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();
|
$auth_admin = new auth_admin();
|
||||||
|
|
||||||
|
@ -2015,8 +2014,8 @@ class acp_users
|
||||||
'S_FORUM_OPTIONS' => $s_forum_options,
|
'S_FORUM_OPTIONS' => $s_forum_options,
|
||||||
|
|
||||||
'U_ACTION' => $this->u_action . '&u=' . $user_id,
|
'U_ACTION' => $this->u_action . '&u=' . $user_id,
|
||||||
'U_USER_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx" ,'i=permissions&mode=setting_user_global&user_id[]=' . $user_id),
|
'U_USER_PERMISSIONS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions&mode=setting_user_global&user_id[]=' . $user_id),
|
||||||
'U_USER_FORUM_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions&mode=setting_user_local&user_id[]=' . $user_id))
|
'U_USER_FORUM_PERMISSIONS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions&mode=setting_user_local&user_id[]=' . $user_id))
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -26,8 +26,7 @@ class acp_words
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
|
||||||
|
|
||||||
$user->add_lang('acp/posting');
|
$user->add_lang('acp/posting');
|
||||||
|
|
||||||
|
|
|
@ -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)
|
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
|
// Define names for template loops, might be able to be set
|
||||||
$tpl_pmask = 'p_mask';
|
$tpl_pmask = 'p_mask';
|
||||||
|
@ -606,7 +606,7 @@ class auth_admin extends auth
|
||||||
*/
|
*/
|
||||||
public function display_role_mask(array $hold_ary)
|
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))
|
if (!sizeof($hold_ary))
|
||||||
{
|
{
|
||||||
|
@ -650,7 +650,7 @@ class auth_admin extends auth
|
||||||
$template->assign_block_vars('role_mask.users', array(
|
$template->assign_block_vars('role_mask.users', array(
|
||||||
'USER_ID' => $row['user_id'],
|
'USER_ID' => $row['user_id'],
|
||||||
'USERNAME' => $row['username'],
|
'USERNAME' => $row['username'],
|
||||||
'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u={$row['user_id']}"))
|
'U_PROFILE' => append_sid('memberlist', "mode=viewprofile&u={$row['user_id']}"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
@ -669,7 +669,7 @@ class auth_admin extends auth
|
||||||
$template->assign_block_vars('role_mask.groups', array(
|
$template->assign_block_vars('role_mask.groups', array(
|
||||||
'GROUP_ID' => $row['group_id'],
|
'GROUP_ID' => $row['group_id'],
|
||||||
'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],
|
'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&g={$row['group_id']}"))
|
'U_PROFILE' => append_sid('memberlist', "mode=group&g={$row['group_id']}"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$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)
|
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);
|
@reset($category_array);
|
||||||
while (list($cat, $cat_array) = each($category_array))
|
while (list($cat, $cat_array) = each($category_array))
|
||||||
|
@ -1118,8 +1118,8 @@ class auth_admin extends auth
|
||||||
'FIELD_NAME' => $permission,
|
'FIELD_NAME' => $permission,
|
||||||
'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
|
'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
|
||||||
|
|
||||||
'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission") : '',
|
'U_TRACE' => ($show_trace) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=permissions&mode=trace&u=$ug_id&f=$forum_id&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) : '',
|
'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'])
|
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
|
||||||
);
|
);
|
||||||
|
@ -1136,8 +1136,8 @@ class auth_admin extends auth
|
||||||
'FIELD_NAME' => $permission,
|
'FIELD_NAME' => $permission,
|
||||||
'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
|
'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
|
||||||
|
|
||||||
'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission") : '',
|
'U_TRACE' => ($show_trace) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=permissions&mode=trace&u=$ug_id&f=$forum_id&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) : '',
|
'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'])
|
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
|
||||||
);
|
);
|
||||||
|
|
|
@ -848,10 +848,10 @@ class auth
|
||||||
*/
|
*/
|
||||||
public function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)
|
public function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $phpbb_root_path, $phpEx;
|
global $config, $db, $user;
|
||||||
|
|
||||||
$method = trim(basename($config['auth_method']));
|
$method = trim(basename($config['auth_method']));
|
||||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
|
||||||
|
|
||||||
$method = 'login_' . $method;
|
$method = 'login_' . $method;
|
||||||
if (function_exists($method))
|
if (function_exists($method))
|
||||||
|
@ -864,7 +864,7 @@ class auth
|
||||||
// we are going to use the user_add function so include functions_user.php if it wasn't defined yet
|
// we are going to use the user_add function so include functions_user.php if it wasn't defined yet
|
||||||
if (!function_exists('user_add'))
|
if (!function_exists('user_add'))
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false);
|
user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false);
|
||||||
|
|
|
@ -165,9 +165,7 @@ function autologin_apache()
|
||||||
|
|
||||||
if (!function_exists('user_add'))
|
if (!function_exists('user_add'))
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the user if he does not exist yet
|
// create the user if he does not exist yet
|
||||||
|
|
|
@ -137,8 +137,7 @@ function login_db(&$username, &$password)
|
||||||
{
|
{
|
||||||
if (!function_exists('utf8_to_cp1252'))
|
if (!function_exists('utf8_to_cp1252'))
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
include(PHPBB_ROOT_PATH . 'includes/utf/data/recode_basic.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// cp1252 is phpBB2's default encoding, characters outside ASCII range might work when converted into that encoding
|
// cp1252 is phpBB2's default encoding, characters outside ASCII range might work when converted into that encoding
|
||||||
|
|
|
@ -128,12 +128,12 @@ class bbcode
|
||||||
*/
|
*/
|
||||||
function bbcode_cache_init()
|
function bbcode_cache_init()
|
||||||
{
|
{
|
||||||
global $user, $phpbb_root_path;
|
global $user;
|
||||||
|
|
||||||
if (empty($this->template_filename))
|
if (empty($this->template_filename))
|
||||||
{
|
{
|
||||||
$this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
|
$this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
|
||||||
$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';
|
$this->template_filename = PHPBB_ROOT_PATH . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';
|
||||||
|
|
||||||
if (!@file_exists($this->template_filename))
|
if (!@file_exists($this->template_filename))
|
||||||
{
|
{
|
||||||
|
|
|
@ -324,7 +324,7 @@ class cache
|
||||||
*/
|
*/
|
||||||
public static function obtain_cfg_item($theme, $item = 'theme')
|
public static function obtain_cfg_item($theme, $item = 'theme')
|
||||||
{
|
{
|
||||||
global $config, $phpbb_root_path, $cache;
|
global $config, $cache;
|
||||||
|
|
||||||
$parsed_array = $cache->get('_cfg_' . $item . '_' . $theme[$item . '_path']);
|
$parsed_array = $cache->get('_cfg_' . $item . '_' . $theme[$item . '_path']);
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ class cache
|
||||||
}
|
}
|
||||||
|
|
||||||
$reparse = false;
|
$reparse = false;
|
||||||
$filename = $phpbb_root_path . 'styles/' . $theme[$item . '_path'] . '/' . $item . '/' . $item . '.cfg';
|
$filename = PHPBB_ROOT_PATH . 'styles/' . $theme[$item . '_path'] . '/' . $item . '/' . $item . '.cfg';
|
||||||
|
|
||||||
if (!file_exists($filename))
|
if (!file_exists($filename))
|
||||||
{
|
{
|
||||||
|
@ -395,22 +395,18 @@ class cache
|
||||||
|
|
||||||
if (($hook_files = $cache->get('_hooks')) === false)
|
if (($hook_files = $cache->get('_hooks')) === false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
|
||||||
|
|
||||||
$hook_files = array();
|
$hook_files = array();
|
||||||
|
|
||||||
// Now search for hooks...
|
// Now search for hooks...
|
||||||
$dh = @opendir($phpbb_root_path . 'includes/hooks/');
|
$dh = @opendir(PHPBB_ROOT_PATH . 'includes/hooks/');
|
||||||
|
|
||||||
if ($dh)
|
if ($dh)
|
||||||
{
|
{
|
||||||
global $phpEx;
|
|
||||||
|
|
||||||
while (($file = readdir($dh)) !== false)
|
while (($file = readdir($dh)) !== false)
|
||||||
{
|
{
|
||||||
if (strpos($file, 'hook_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx)
|
if (strpos($file, 'hook_') === 0 && substr($file, -(strlen(PHP_EXT) + 1)) === '.' . PHP_EXT)
|
||||||
{
|
{
|
||||||
$hook_files[] = substr($file, 0, -(strlen($phpEx) + 1));
|
$hook_files[] = substr($file, 0, -(strlen(PHP_EXT) + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($dh);
|
closedir($dh);
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MSSQL Database Abstraction Layer
|
* MSSQL Database Abstraction Layer
|
||||||
|
|
|
@ -618,7 +618,7 @@ class dbal
|
||||||
*/
|
*/
|
||||||
function sql_report($mode, $query = '')
|
function sql_report($mode, $query = '')
|
||||||
{
|
{
|
||||||
global $cache, $starttime, $phpbb_root_path, $user;
|
global $cache, $starttime, $user;
|
||||||
|
|
||||||
if (empty($_REQUEST['explain']))
|
if (empty($_REQUEST['explain']))
|
||||||
{
|
{
|
||||||
|
@ -649,7 +649,7 @@ class dbal
|
||||||
<meta http-equiv="Content-Style-Type" content="text/css" />
|
<meta http-equiv="Content-Style-Type" content="text/css" />
|
||||||
<meta http-equiv="imagetoolbar" content="no" />
|
<meta http-equiv="imagetoolbar" content="no" />
|
||||||
<title>SQL Report</title>
|
<title>SQL Report</title>
|
||||||
<link href="' . $phpbb_root_path . 'adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
|
<link href="' . PHPBB_ROOT_PATH . 'adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
|
||||||
</head>
|
</head>
|
||||||
<body id="errorpage">
|
<body id="errorpage">
|
||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Firebird/Interbase Database Abstraction Layer
|
* Firebird/Interbase Database Abstraction Layer
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MSSQL Database Abstraction Layer
|
* MSSQL Database Abstraction Layer
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MSSQL Database Abstraction Layer
|
* MSSQL Database Abstraction Layer
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unified ODBC functions
|
* Unified ODBC functions
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MySQL Database Abstraction Layer
|
* MySQL Database Abstraction Layer
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MySQLi Database Abstraction Layer
|
* MySQLi Database Abstraction Layer
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Oracle Database Abstraction Layer
|
* Oracle Database Abstraction Layer
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PostgreSQL Database Abstraction Layer
|
* PostgreSQL Database Abstraction Layer
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/db/dbal.' . PHP_EXT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sqlite Database Abstraction Layer
|
* Sqlite Database Abstraction Layer
|
||||||
|
|
|
@ -1581,16 +1581,37 @@ function on_page($num_items, $per_page, $start)
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* <code>
|
* <code>
|
||||||
* append_sid("{$phpbb_root_path}viewtopic.$phpEx?t=1&f=2");
|
* append_sid(PHPBB_ROOT_PATH . 'viewtopic.' . PHP_EXT . '?t=1&f=2');
|
||||||
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2');
|
* append_sid(PHPBB_ROOT_PATH . 'viewtopic.' . PHP_EXT, 't=1&f=2');
|
||||||
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2', false);
|
* append_sid('viewtopic', 't=1&f=2'); // short notation of the above example
|
||||||
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", array('t' => 1, 'f' => 2));
|
* append_sid('viewtopic', 't=1&f=2', false);
|
||||||
|
* append_sid('viewtopic', array('t' => 1, 'f' => 2));
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function append_sid($url, $params = false, $is_amp = true, $session_id = false)
|
function append_sid($url, $params = false, $is_amp = true, $session_id = false)
|
||||||
{
|
{
|
||||||
global $_SID, $_EXTRA_URL, $phpbb_hook;
|
global $_SID, $_EXTRA_URL, $phpbb_hook;
|
||||||
|
static $parsed_urls = array();
|
||||||
|
|
||||||
|
// Adjust internal url before calling the hook - we are able to just leave out any path and extension.
|
||||||
|
// In this case the root path and extension are added before going through this function.
|
||||||
|
if (isset($parsed_urls[$url]))
|
||||||
|
{
|
||||||
|
$url = $parsed_urls[$url];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (strpos($url, '.' . PHP_EXT) === false && $url[0] != '.' && $url[0] != '/')
|
||||||
|
{
|
||||||
|
$parsed_urls[$url] = $url = PHPBB_ROOT_PATH . $url . '.' . PHP_EXT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($params))
|
||||||
|
{
|
||||||
|
$params = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropiatly.
|
// Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropiatly.
|
||||||
// They could mimick most of what is within this function
|
// They could mimick most of what is within this function
|
||||||
|
@ -1727,7 +1748,7 @@ function generate_board_url($without_script_path = false)
|
||||||
*/
|
*/
|
||||||
function redirect($url, $return = false)
|
function redirect($url, $return = false)
|
||||||
{
|
{
|
||||||
global $db, $cache, $config, $user, $phpbb_root_path;
|
global $db, $cache, $config, $user;
|
||||||
|
|
||||||
if (empty($user->lang))
|
if (empty($user->lang))
|
||||||
{
|
{
|
||||||
|
@ -1786,8 +1807,8 @@ function redirect($url, $return = false)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Used ./ before, but $phpbb_root_path is working better with urls within another root path
|
// Used ./ before, but PHPBB_ROOT_PATH is working better with urls within another root path
|
||||||
$root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($phpbb_root_path)));
|
$root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath(PHPBB_ROOT_PATH)));
|
||||||
$page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($pathinfo['dirname'])));
|
$page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($pathinfo['dirname'])));
|
||||||
$intersection = array_intersect_assoc($root_dirs, $page_dirs);
|
$intersection = array_intersect_assoc($root_dirs, $page_dirs);
|
||||||
|
|
||||||
|
@ -1871,15 +1892,13 @@ function redirect($url, $return = false)
|
||||||
*/
|
*/
|
||||||
function reapply_sid($url)
|
function reapply_sid($url)
|
||||||
{
|
{
|
||||||
global $phpEx, $phpbb_root_path;
|
if ($url === 'index.' . PHP_EXT)
|
||||||
|
|
||||||
if ($url === "index.$phpEx")
|
|
||||||
{
|
{
|
||||||
return append_sid("index.$phpEx");
|
return append_sid('index.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
else if ($url === "{$phpbb_root_path}index.$phpEx")
|
else if ($url === PHPBB_ROOT_PATH . 'index.' . PHP_EXT)
|
||||||
{
|
{
|
||||||
return append_sid("{$phpbb_root_path}index.$phpEx");
|
return append_sid('index');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove previously added sid
|
// Remove previously added sid
|
||||||
|
@ -1904,7 +1923,7 @@ function reapply_sid($url)
|
||||||
*/
|
*/
|
||||||
function build_url($strip_vars = false)
|
function build_url($strip_vars = false)
|
||||||
{
|
{
|
||||||
global $user, $phpbb_root_path;
|
global $user;
|
||||||
|
|
||||||
// Append SID
|
// Append SID
|
||||||
$redirect = append_sid($user->page['page'], false, false);
|
$redirect = append_sid($user->page['page'], false, false);
|
||||||
|
@ -1957,7 +1976,7 @@ function build_url($strip_vars = false)
|
||||||
$redirect .= ($query) ? '?' . $query : '';
|
$redirect .= ($query) ? '?' . $query : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $phpbb_root_path . str_replace('&', '&', $redirect);
|
return PHPBB_ROOT_PATH . str_replace('&', '&', $redirect);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2055,7 +2074,6 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
|
||||||
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
|
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
|
||||||
{
|
{
|
||||||
global $user, $template, $db;
|
global $user, $template, $db;
|
||||||
global $phpEx, $phpbb_root_path;
|
|
||||||
|
|
||||||
if (isset($_POST['cancel']))
|
if (isset($_POST['cancel']))
|
||||||
{
|
{
|
||||||
|
@ -2125,7 +2143,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
|
||||||
}
|
}
|
||||||
|
|
||||||
// re-add sid / transform & to & for user->page (user->page is always using &)
|
// re-add sid / transform & to & for user->page (user->page is always using &)
|
||||||
$use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&', $user->page['page']);
|
$use_page = ($u_action) ? PHPBB_ROOT_PATH . $u_action : PHPBB_ROOT_PATH . str_replace('&', '&', $user->page['page']);
|
||||||
$u_action = reapply_sid($use_page);
|
$u_action = reapply_sid($use_page);
|
||||||
$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&') . 'confirm_key=' . $confirm_key;
|
$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&') . 'confirm_key=' . $confirm_key;
|
||||||
|
|
||||||
|
@ -2157,7 +2175,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
|
||||||
*/
|
*/
|
||||||
function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)
|
function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)
|
||||||
{
|
{
|
||||||
global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config;
|
global $db, $user, $template, $auth, $config;
|
||||||
|
|
||||||
$err = '';
|
$err = '';
|
||||||
|
|
||||||
|
@ -2241,9 +2259,9 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||||
// The result parameter is always an array, holding the relevant information...
|
// The result parameter is always an array, holding the relevant information...
|
||||||
if ($result['status'] == LOGIN_SUCCESS)
|
if ($result['status'] == LOGIN_SUCCESS)
|
||||||
{
|
{
|
||||||
$redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx");
|
$redirect = request_var('redirect', PHPBB_ROOT_PATH . 'index.' . PHP_EXT);
|
||||||
$message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT'];
|
$message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT'];
|
||||||
$l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "{$phpbb_root_path}index.$phpEx" || $redirect === "index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']);
|
$l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === PHPBB_ROOT_PATH . 'index.' . PHP_EXT || $redirect === "index." . PHP_EXT) ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']);
|
||||||
|
|
||||||
// append/replace SID (may change during the session for AOL users)
|
// append/replace SID (may change during the session for AOL users)
|
||||||
$redirect = reapply_sid($redirect);
|
$redirect = reapply_sid($redirect);
|
||||||
|
@ -2295,7 +2313,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_CONFIRM_CODE' => true,
|
'S_CONFIRM_CODE' => true,
|
||||||
'CONFIRM_ID' => $confirm_id,
|
'CONFIRM_ID' => $confirm_id,
|
||||||
'CONFIRM_IMAGE' => '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_LOGIN) . '" alt="" title="" />',
|
'CONFIRM_IMAGE' => '<img src="' . append_sid('ucp', 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_LOGIN) . '" alt="" title="" />',
|
||||||
'L_LOGIN_CONFIRM_EXPLAIN' => sprintf($user->lang['LOGIN_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
|
'L_LOGIN_CONFIRM_EXPLAIN' => sprintf($user->lang['LOGIN_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -2306,7 +2324,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||||
case LOGIN_ERROR_PASSWORD_CONVERT:
|
case LOGIN_ERROR_PASSWORD_CONVERT:
|
||||||
$err = sprintf(
|
$err = sprintf(
|
||||||
$user->lang[$result['error_msg']],
|
$user->lang[$result['error_msg']],
|
||||||
($config['email_enable']) ? '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') . '">' : '',
|
($config['email_enable']) ? '<a href="' . append_sid('ucp', 'mode=sendpassword') . '">' : '',
|
||||||
($config['email_enable']) ? '</a>' : '',
|
($config['email_enable']) ? '</a>' : '',
|
||||||
($config['board_contact']) ? '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">' : '',
|
($config['board_contact']) ? '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">' : '',
|
||||||
($config['board_contact']) ? '</a>' : ''
|
($config['board_contact']) ? '</a>' : ''
|
||||||
|
@ -2360,13 +2378,13 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||||
'LOGIN_ERROR' => $err,
|
'LOGIN_ERROR' => $err,
|
||||||
'LOGIN_EXPLAIN' => $l_explain,
|
'LOGIN_EXPLAIN' => $l_explain,
|
||||||
|
|
||||||
'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '',
|
'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid('ucp', 'mode=sendpassword') : '',
|
||||||
'U_RESEND_ACTIVATION' => ($config['require_activation'] != USER_ACTIVATION_NONE && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
|
'U_RESEND_ACTIVATION' => ($config['require_activation'] != USER_ACTIVATION_NONE && $config['email_enable']) ? append_sid('ucp', 'mode=resend_act') : '',
|
||||||
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
|
'U_TERMS_USE' => append_sid('ucp', 'mode=terms'),
|
||||||
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
|
'U_PRIVACY' => append_sid('ucp', 'mode=privacy'),
|
||||||
|
|
||||||
'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false,
|
'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false,
|
||||||
'S_LOGIN_ACTION' => (!$admin) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id), // Needs to stay index.$phpEx because we are within the admin directory
|
'S_LOGIN_ACTION' => (!$admin) ? append_sid('ucp', 'mode=login') : append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, false, true, $user->session_id),
|
||||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||||
|
|
||||||
'S_ADMIN_AUTH' => $admin,
|
'S_ADMIN_AUTH' => $admin,
|
||||||
|
@ -2381,7 +2399,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||||
$template->set_filenames(array(
|
$template->set_filenames(array(
|
||||||
'body' => 'login_body.html')
|
'body' => 'login_body.html')
|
||||||
);
|
);
|
||||||
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
|
make_jumpbox(append_sid('viewforum'));
|
||||||
|
|
||||||
page_footer();
|
page_footer();
|
||||||
}
|
}
|
||||||
|
@ -2391,7 +2409,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||||
*/
|
*/
|
||||||
function login_forum_box($forum_data)
|
function login_forum_box($forum_data)
|
||||||
{
|
{
|
||||||
global $db, $config, $user, $template, $phpEx;
|
global $db, $config, $user, $template;
|
||||||
|
|
||||||
$password = request_var('password', '', true);
|
$password = request_var('password', '', true);
|
||||||
|
|
||||||
|
@ -2628,11 +2646,9 @@ function add_log()
|
||||||
*/
|
*/
|
||||||
function get_backtrace()
|
function get_backtrace()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
|
||||||
|
|
||||||
$output = '<div style="font-family: monospace;">';
|
$output = '<div style="font-family: monospace;">';
|
||||||
$backtrace = debug_backtrace();
|
$backtrace = debug_backtrace();
|
||||||
$path = phpbb_realpath($phpbb_root_path);
|
$path = phpbb_realpath(PHPBB_ROOT_PATH);
|
||||||
|
|
||||||
foreach ($backtrace as $number => $trace)
|
foreach ($backtrace as $number => $trace)
|
||||||
{
|
{
|
||||||
|
@ -2835,7 +2851,7 @@ function phpbb_checkdnsrr($host, $type = '')
|
||||||
function msg_handler($errno, $msg_text, $errfile, $errline)
|
function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||||
{
|
{
|
||||||
global $cache, $db, $auth, $template, $config, $user;
|
global $cache, $db, $auth, $template, $config, $user;
|
||||||
global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text;
|
global $msg_title, $msg_long_text;
|
||||||
|
|
||||||
// Do not display notices if we suppress them via @
|
// Do not display notices if we suppress them via @
|
||||||
if (error_reporting() == 0)
|
if (error_reporting() == 0)
|
||||||
|
@ -2880,8 +2896,8 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove complete path to installation, with the risk of changing backslashes meant to be there
|
// remove complete path to installation, with the risk of changing backslashes meant to be there
|
||||||
$errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile);
|
$errfile = str_replace(array(phpbb_realpath(PHPBB_ROOT_PATH), '\\'), array('', '/'), $errfile);
|
||||||
$msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
|
$msg_text = str_replace(array(phpbb_realpath(PHPBB_ROOT_PATH), '\\'), array('', '/'), $msg_text);
|
||||||
|
|
||||||
echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
|
echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
|
||||||
}
|
}
|
||||||
|
@ -2898,7 +2914,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||||
$msg_text = (!empty($user->lang[$msg_text])) ? $user->lang[$msg_text] : $msg_text;
|
$msg_text = (!empty($user->lang[$msg_text])) ? $user->lang[$msg_text] : $msg_text;
|
||||||
$msg_title = (!isset($msg_title)) ? $user->lang['GENERAL_ERROR'] : ((!empty($user->lang[$msg_title])) ? $user->lang[$msg_title] : $msg_title);
|
$msg_title = (!isset($msg_title)) ? $user->lang['GENERAL_ERROR'] : ((!empty($user->lang[$msg_title])) ? $user->lang[$msg_title] : $msg_title);
|
||||||
|
|
||||||
$l_return_index = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $phpbb_root_path . '">', '</a>');
|
$l_return_index = sprintf($user->lang['RETURN_INDEX'], '<a href="' . PHPBB_ROOT_PATH . '">', '</a>');
|
||||||
$l_notify = '';
|
$l_notify = '';
|
||||||
|
|
||||||
if (!empty($config['board_contact']))
|
if (!empty($config['board_contact']))
|
||||||
|
@ -2909,7 +2925,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$msg_title = 'General Error';
|
$msg_title = 'General Error';
|
||||||
$l_return_index = '<a href="' . $phpbb_root_path . '">Return to index page</a>';
|
$l_return_index = '<a href="' . PHPBB_ROOT_PATH . '">Return to index page</a>';
|
||||||
$l_notify = '';
|
$l_notify = '';
|
||||||
|
|
||||||
if (!empty($config['board_contact']))
|
if (!empty($config['board_contact']))
|
||||||
|
@ -3034,7 +3050,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||||
*/
|
*/
|
||||||
function page_header($page_title = '', $display_online_list = true)
|
function page_header($page_title = '', $display_online_list = true)
|
||||||
{
|
{
|
||||||
global $db, $config, $template, $SID, $_SID, $user, $auth, $phpEx, $phpbb_root_path;
|
global $db, $config, $template, $SID, $_SID, $user, $auth;
|
||||||
|
|
||||||
if (defined('HEADER_INC'))
|
if (defined('HEADER_INC'))
|
||||||
{
|
{
|
||||||
|
@ -3055,12 +3071,12 @@ function page_header($page_title = '', $display_online_list = true)
|
||||||
// Generate logged in/logged out status
|
// Generate logged in/logged out status
|
||||||
if ($user->data['user_id'] != ANONYMOUS)
|
if ($user->data['user_id'] != ANONYMOUS)
|
||||||
{
|
{
|
||||||
$u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id);
|
$u_login_logout = append_sid('ucp', 'mode=logout', true, $user->session_id);
|
||||||
$l_login_logout = sprintf($user->lang['LOGOUT_USER'], $user->data['username']);
|
$l_login_logout = sprintf($user->lang['LOGOUT_USER'], $user->data['username']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login');
|
$u_login_logout = append_sid('ucp', 'mode=login');
|
||||||
$l_login_logout = $user->lang['LOGIN'];
|
$l_login_logout = $user->lang['LOGIN'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3280,7 +3296,7 @@ function page_header($page_title = '', $display_online_list = true)
|
||||||
'SITENAME' => $config['sitename'],
|
'SITENAME' => $config['sitename'],
|
||||||
'SITE_DESCRIPTION' => $config['site_desc'],
|
'SITE_DESCRIPTION' => $config['site_desc'],
|
||||||
'PAGE_TITLE' => $page_title,
|
'PAGE_TITLE' => $page_title,
|
||||||
'SCRIPT_NAME' => str_replace('.' . $phpEx, '', $user->page['page_name']),
|
'SCRIPT_NAME' => str_replace('.' . PHP_EXT, '', $user->page['page_name']),
|
||||||
'LAST_VISIT_DATE' => sprintf($user->lang['YOU_LAST_VISIT'], $s_last_visit),
|
'LAST_VISIT_DATE' => sprintf($user->lang['YOU_LAST_VISIT'], $s_last_visit),
|
||||||
'LAST_VISIT_YOU' => $s_last_visit,
|
'LAST_VISIT_YOU' => $s_last_visit,
|
||||||
'CURRENT_TIME' => sprintf($user->lang['CURRENT_TIME'], $user->format_date(time(), false, true)),
|
'CURRENT_TIME' => sprintf($user->lang['CURRENT_TIME'], $user->format_date(time(), false, true)),
|
||||||
|
@ -3296,32 +3312,32 @@ function page_header($page_title = '', $display_online_list = true)
|
||||||
'SID' => $SID,
|
'SID' => $SID,
|
||||||
'_SID' => $_SID,
|
'_SID' => $_SID,
|
||||||
'SESSION_ID' => $user->session_id,
|
'SESSION_ID' => $user->session_id,
|
||||||
'ROOT_PATH' => $phpbb_root_path,
|
'ROOT_PATH' => PHPBB_ROOT_PATH,
|
||||||
|
|
||||||
'L_LOGIN_LOGOUT' => $l_login_logout,
|
'L_LOGIN_LOGOUT' => $l_login_logout,
|
||||||
'L_INDEX' => $user->lang['FORUM_INDEX'],
|
'L_INDEX' => $user->lang['FORUM_INDEX'],
|
||||||
'L_ONLINE_EXPLAIN' => $l_online_time,
|
'L_ONLINE_EXPLAIN' => $l_online_time,
|
||||||
|
|
||||||
'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'),
|
'U_PRIVATEMSGS' => append_sid('ucp', 'i=pm&folder=inbox'),
|
||||||
'U_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'),
|
'U_RETURN_INBOX' => append_sid('ucp', 'i=pm&folder=inbox'),
|
||||||
'U_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup'),
|
'U_POPUP_PM' => append_sid('ucp', 'i=pm&mode=popup'),
|
||||||
'UA_POPUP_PM' => addslashes(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup')),
|
'UA_POPUP_PM' => addslashes(append_sid('ucp', 'i=pm&mode=popup')),
|
||||||
'U_MEMBERLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"),
|
'U_MEMBERLIST' => append_sid('memberlist'),
|
||||||
'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$phpbb_root_path}viewonline.$phpEx") : '',
|
'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid('viewonline') : '',
|
||||||
'U_LOGIN_LOGOUT' => $u_login_logout,
|
'U_LOGIN_LOGOUT' => $u_login_logout,
|
||||||
'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
|
'U_INDEX' => append_sid('index'),
|
||||||
'U_SEARCH' => append_sid("{$phpbb_root_path}search.$phpEx"),
|
'U_SEARCH' => append_sid('search'),
|
||||||
'U_REGISTER' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
|
'U_REGISTER' => append_sid('ucp', 'mode=register'),
|
||||||
'U_PROFILE' => append_sid("{$phpbb_root_path}ucp.$phpEx"),
|
'U_PROFILE' => append_sid('ucp'),
|
||||||
'U_MODCP' => append_sid("{$phpbb_root_path}mcp.$phpEx", false, true, $user->session_id),
|
'U_MODCP' => append_sid('mcp', false, true, $user->session_id),
|
||||||
'U_FAQ' => append_sid("{$phpbb_root_path}faq.$phpEx"),
|
'U_FAQ' => append_sid('faq'),
|
||||||
'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=egosearch'),
|
'U_SEARCH_SELF' => append_sid('search', 'search_id=egosearch'),
|
||||||
'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts'),
|
'U_SEARCH_NEW' => append_sid('search', 'search_id=newposts'),
|
||||||
'U_SEARCH_UNANSWERED' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered'),
|
'U_SEARCH_UNANSWERED' => append_sid('search', 'search_id=unanswered'),
|
||||||
'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),
|
'U_SEARCH_ACTIVE_TOPICS'=> append_sid('search', 'search_id=active_topics'),
|
||||||
'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'),
|
'U_DELETE_COOKIES' => append_sid('ucp', 'mode=delete_cookies'),
|
||||||
'U_TEAM' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders'),
|
'U_TEAM' => append_sid('memberlist', 'mode=leaders'),
|
||||||
'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '',
|
'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid('ucp', 'mode=restore_perm') : '',
|
||||||
|
|
||||||
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
|
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
|
||||||
'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false,
|
'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false,
|
||||||
|
@ -3347,18 +3363,18 @@ function page_header($page_title = '', $display_online_list = true)
|
||||||
'S_NEW_PM' => ($s_privmsg_new) ? 1 : 0,
|
'S_NEW_PM' => ($s_privmsg_new) ? 1 : 0,
|
||||||
'S_REGISTER_ENABLED' => ($config['require_activation'] != USER_ACTIVATION_DISABLE) ? true : false,
|
'S_REGISTER_ENABLED' => ($config['require_activation'] != USER_ACTIVATION_DISABLE) ? true : false,
|
||||||
|
|
||||||
'T_THEME_PATH' => "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme',
|
'T_THEME_PATH' => PHPBB_ROOT_PATH . 'styles/' . $user->theme['theme_path'] . '/theme',
|
||||||
'T_TEMPLATE_PATH' => "{$phpbb_root_path}styles/" . $user->theme['template_path'] . '/template',
|
'T_TEMPLATE_PATH' => PHPBB_ROOT_PATH . 'styles/' . $user->theme['template_path'] . '/template',
|
||||||
'T_IMAGESET_PATH' => "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset',
|
'T_IMAGESET_PATH' => PHPBB_ROOT_PATH . 'styles/' . $user->theme['imageset_path'] . '/imageset',
|
||||||
'T_IMAGESET_LANG_PATH' => "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->data['user_lang'],
|
'T_IMAGESET_LANG_PATH' => PHPBB_ROOT_PATH . 'styles/' . $user->theme['imageset_path'] . '/imageset/' . $user->data['user_lang'],
|
||||||
'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
|
'T_IMAGES_PATH' => PHPBB_ROOT_PATH . 'images/',
|
||||||
'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
|
'T_SMILIES_PATH' => PHPBB_ROOT_PATH . $config['smilies_path'] . '/',
|
||||||
'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/",
|
'T_AVATAR_PATH' => PHPBB_ROOT_PATH . $config['avatar_path'] . '/',
|
||||||
'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
|
'T_AVATAR_GALLERY_PATH' => PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/',
|
||||||
'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
|
'T_ICONS_PATH' => PHPBB_ROOT_PATH . $config['icons_path'] . '/',
|
||||||
'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
|
'T_RANKS_PATH' => PHPBB_ROOT_PATH . $config['ranks_path'] . '/',
|
||||||
'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
|
'T_UPLOAD_PATH' => PHPBB_ROOT_PATH . $config['upload_path'] . '/',
|
||||||
'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&id=" . $user->theme['style_id'] . '&lang=' . $user->data['user_lang'],
|
'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? PHPBB_ROOT_PATH . 'styles/' . $user->theme['theme_path'] . '/theme/stylesheet.css' : PHPBB_ROOT_PATH . 'style.' . PHP_EXT . "?sid=$user->session_id&id=" . $user->theme['style_id'] . '&lang=' . $user->data['user_lang'],
|
||||||
'T_STYLESHEET_NAME' => $user->theme['theme_name'],
|
'T_STYLESHEET_NAME' => $user->theme['theme_name'],
|
||||||
|
|
||||||
'SITE_LOGO_IMG' => $user->img('site_logo'))
|
'SITE_LOGO_IMG' => $user->img('site_logo'))
|
||||||
|
@ -3379,7 +3395,7 @@ function page_header($page_title = '', $display_online_list = true)
|
||||||
*/
|
*/
|
||||||
function page_footer($run_cron = true)
|
function page_footer($run_cron = true)
|
||||||
{
|
{
|
||||||
global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx;
|
global $db, $config, $template, $user, $auth, $cache, $starttime;
|
||||||
|
|
||||||
// Output page creation time
|
// Output page creation time
|
||||||
if (defined('DEBUG'))
|
if (defined('DEBUG'))
|
||||||
|
@ -3416,7 +3432,7 @@ function page_footer($run_cron = true)
|
||||||
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
|
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
|
||||||
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
|
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
|
||||||
|
|
||||||
'U_ACP' => ($auth->acl_get('a_') && $user->data['is_registered']) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id) : '')
|
'U_ACP' => ($auth->acl_get('a_') && $user->data['is_registered']) ? append_sid(CONFIG_ADM_FOLDER . 'index', false, true, $user->session_id) : '')
|
||||||
);
|
);
|
||||||
|
|
||||||
// Call cron-type script
|
// Call cron-type script
|
||||||
|
@ -3424,7 +3440,7 @@ function page_footer($run_cron = true)
|
||||||
{
|
{
|
||||||
$cron_type = '';
|
$cron_type = '';
|
||||||
|
|
||||||
if (time() - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
|
if (time() - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists(PHPBB_ROOT_PATH . 'cache/queue.' . PHP_EXT))
|
||||||
{
|
{
|
||||||
// Process email queue
|
// Process email queue
|
||||||
$cron_type = 'queue';
|
$cron_type = 'queue';
|
||||||
|
@ -3455,7 +3471,7 @@ function page_footer($run_cron = true)
|
||||||
|
|
||||||
if ($cron_type)
|
if ($cron_type)
|
||||||
{
|
{
|
||||||
$template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=' . $cron_type) . '" width="1" height="1" alt="cron" />');
|
$template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid('cron', 'cron_type=' . $cron_type) . '" width="1" height="1" alt="cron" />');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -630,7 +630,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
|
||||||
*/
|
*/
|
||||||
function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true, $call_delete_topics = true)
|
function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true, $call_delete_topics = true)
|
||||||
{
|
{
|
||||||
global $db, $config, $phpbb_root_path, $phpEx;
|
global $db, $config;
|
||||||
|
|
||||||
if ($where_type === 'range')
|
if ($where_type === 'range')
|
||||||
{
|
{
|
||||||
|
@ -739,12 +739,12 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||||
// Remove the message from the search index
|
// Remove the message from the search index
|
||||||
$search_type = basename($config['search_type']);
|
$search_type = basename($config['search_type']);
|
||||||
|
|
||||||
if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
|
if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
|
||||||
{
|
{
|
||||||
trigger_error('NO_SUCH_SEARCH_MODULE');
|
trigger_error('NO_SUCH_SEARCH_MODULE');
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
|
include_once(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT);
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
$search = new $search_type($error);
|
$search = new $search_type($error);
|
||||||
|
@ -1101,7 +1101,7 @@ function update_posted_info(&$topic_ids)
|
||||||
*/
|
*/
|
||||||
function phpbb_unlink($filename, $mode = 'file', $entry_removed = false)
|
function phpbb_unlink($filename, $mode = 'file', $entry_removed = false)
|
||||||
{
|
{
|
||||||
global $db, $phpbb_root_path, $config;
|
global $db, $config;
|
||||||
|
|
||||||
// Because of copying topics or modifications a physical filename could be assigned more than once. If so, do not remove the file itself.
|
// Because of copying topics or modifications a physical filename could be assigned more than once. If so, do not remove the file itself.
|
||||||
$sql = 'SELECT COUNT(attach_id) AS num_entries
|
$sql = 'SELECT COUNT(attach_id) AS num_entries
|
||||||
|
@ -1118,7 +1118,7 @@ function phpbb_unlink($filename, $mode = 'file', $entry_removed = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename = ($mode == 'thumbnail') ? 'thumb_' . basename($filename) : basename($filename);
|
$filename = ($mode == 'thumbnail') ? 'thumb_' . basename($filename) : basename($filename);
|
||||||
return @unlink($phpbb_root_path . $config['upload_path'] . '/' . $filename);
|
return @unlink(PHPBB_ROOT_PATH . $config['upload_path'] . '/' . $filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2154,7 +2154,7 @@ function remove_comments(&$output)
|
||||||
*/
|
*/
|
||||||
function cache_moderators()
|
function cache_moderators()
|
||||||
{
|
{
|
||||||
global $db, $cache, $auth, $phpbb_root_path, $phpEx;
|
global $db, $cache, $auth;
|
||||||
|
|
||||||
// Remove cached sql results
|
// Remove cached sql results
|
||||||
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
|
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
|
||||||
|
@ -2323,11 +2323,11 @@ function cache_moderators()
|
||||||
*/
|
*/
|
||||||
function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
|
function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $phpEx, $phpbb_root_path, $phpbb_admin_path;
|
global $db, $user, $auth;
|
||||||
|
|
||||||
$topic_id_list = $reportee_id_list = $is_auth = $is_mod = array();
|
$topic_id_list = $reportee_id_list = $is_auth = $is_mod = array();
|
||||||
|
|
||||||
$profile_url = (defined('IN_ADMIN')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview') : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile');
|
$profile_url = (defined('IN_ADMIN')) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&mode=overview') : append_sid('memberlist', 'mode=viewprofile');
|
||||||
|
|
||||||
switch ($mode)
|
switch ($mode)
|
||||||
{
|
{
|
||||||
|
@ -2411,7 +2411,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||||
'forum_id' => $row['forum_id'],
|
'forum_id' => $row['forum_id'],
|
||||||
'topic_id' => $row['topic_id'],
|
'topic_id' => $row['topic_id'],
|
||||||
|
|
||||||
'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : false,
|
'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? append_sid('viewforum', 'f=' . $row['forum_id']) : false,
|
||||||
'action' => (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
|
'action' => (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2498,8 +2498,8 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||||
|
|
||||||
foreach ($log as $key => $row)
|
foreach ($log as $key => $row)
|
||||||
{
|
{
|
||||||
$log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id']) : false;
|
$log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? append_sid('viewtopic', 'f=' . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id']) : false;
|
||||||
$log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, $user->session_id) : false;
|
$log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid('mcp', 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, $user->session_id) : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3005,7 +3005,7 @@ function tidy_database()
|
||||||
*/
|
*/
|
||||||
function add_permission_language()
|
function add_permission_language()
|
||||||
{
|
{
|
||||||
global $user, $phpEx;
|
global $user;
|
||||||
|
|
||||||
// First of all, our own file. We need to include it as the first file because it presets all relevant variables.
|
// First of all, our own file. We need to include it as the first file because it presets all relevant variables.
|
||||||
$user->add_lang('acp/permissions_phpbb');
|
$user->add_lang('acp/permissions_phpbb');
|
||||||
|
@ -3021,9 +3021,9 @@ function add_permission_language()
|
||||||
{
|
{
|
||||||
while (($file = readdir($dh)) !== false)
|
while (($file = readdir($dh)) !== false)
|
||||||
{
|
{
|
||||||
if ($file !== 'permissions_phpbb.' . $phpEx && strpos($file, 'permissions_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx)
|
if ($file !== 'permissions_phpbb.' . PHP_EXT && strpos($file, 'permissions_') === 0 && substr($file, -(strlen(PHP_EXT) + 1)) === '.' . PHP_EXT)
|
||||||
{
|
{
|
||||||
$files_to_add[] = $path . substr($file, 0, -(strlen($phpEx) + 1));
|
$files_to_add[] = $path . substr($file, 0, -(strlen(PHP_EXT) + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($dh);
|
closedir($dh);
|
||||||
|
|
|
@ -29,8 +29,6 @@ class compress
|
||||||
*/
|
*/
|
||||||
public function add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '')
|
public function add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '')
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
|
||||||
|
|
||||||
$skip_files = explode(',', $skip_files);
|
$skip_files = explode(',', $skip_files);
|
||||||
|
|
||||||
// Remove rm prefix from src path
|
// Remove rm prefix from src path
|
||||||
|
@ -40,22 +38,22 @@ class compress
|
||||||
// Remove initial "/" if present
|
// Remove initial "/" if present
|
||||||
$src_path = (substr($src_path, 0, 1) == '/') ? substr($src_path, 1) : $src_path;
|
$src_path = (substr($src_path, 0, 1) == '/') ? substr($src_path, 1) : $src_path;
|
||||||
|
|
||||||
if (is_file($phpbb_root_path . $src))
|
if (is_file(PHPBB_ROOT_PATH . $src))
|
||||||
{
|
{
|
||||||
$this->data($src_path, file_get_contents("$phpbb_root_path$src"), false, stat("$phpbb_root_path$src"));
|
$this->data($src_path, file_get_contents(PHPBB_ROOT_PATH . $src), false, stat(PHPBB_ROOT_PATH . $src));
|
||||||
}
|
}
|
||||||
else if (is_dir($phpbb_root_path . $src))
|
else if (is_dir(PHPBB_ROOT_PATH . $src))
|
||||||
{
|
{
|
||||||
// Clean up path, add closing / if not present
|
// Clean up path, add closing / if not present
|
||||||
$src_path = ($src_path && substr($src_path, -1) != '/') ? $src_path . '/' : $src_path;
|
$src_path = ($src_path && substr($src_path, -1) != '/') ? $src_path . '/' : $src_path;
|
||||||
|
|
||||||
$filelist = array();
|
$filelist = array();
|
||||||
$filelist = filelist("$phpbb_root_path$src", '', '*');
|
$filelist = filelist(PHPBB_ROOT_PATH . $src, '', '*');
|
||||||
krsort($filelist);
|
krsort($filelist);
|
||||||
|
|
||||||
if ($src_path)
|
if ($src_path)
|
||||||
{
|
{
|
||||||
$this->data($src_path, '', true, stat("$phpbb_root_path$src"));
|
$this->data($src_path, '', true, stat(PHPBB_ROOT_PATH . $src));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($filelist as $path => $file_ary)
|
foreach ($filelist as $path => $file_ary)
|
||||||
|
@ -66,7 +64,7 @@ class compress
|
||||||
$path = (substr($path, 0, 1) == '/') ? substr($path, 1) : $path;
|
$path = (substr($path, 0, 1) == '/') ? substr($path, 1) : $path;
|
||||||
$path = ($path && substr($path, -1) != '/') ? $path . '/' : $path;
|
$path = ($path && substr($path, -1) != '/') ? $path . '/' : $path;
|
||||||
|
|
||||||
$this->data("$src_path$path", '', true, stat("$phpbb_root_path$src$path"));
|
$this->data("$src_path$path", '', true, stat(PHPBB_ROOT_PATH . $src . $path));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($file_ary as $file)
|
foreach ($file_ary as $file)
|
||||||
|
@ -76,7 +74,7 @@ class compress
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), false, stat("$phpbb_root_path$src$path$file"));
|
$this->data("$src_path$path$file", file_get_contents(PHPBB_ROOT_PATH . $src . $path . $file), false, stat(PHPBB_ROOT_PATH . $src . $path . $file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -429,8 +427,6 @@ class compress_zip extends compress
|
||||||
*/
|
*/
|
||||||
public function download($filename, $download_name = false)
|
public function download($filename, $download_name = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
|
||||||
|
|
||||||
if ($download_name === false)
|
if ($download_name === false)
|
||||||
{
|
{
|
||||||
$download_name = $filename;
|
$download_name = $filename;
|
||||||
|
@ -442,7 +438,7 @@ class compress_zip extends compress
|
||||||
header("Content-Type: $mimetype; name=\"$download_name.zip\"");
|
header("Content-Type: $mimetype; name=\"$download_name.zip\"");
|
||||||
header("Content-disposition: attachment; filename=$download_name.zip");
|
header("Content-disposition: attachment; filename=$download_name.zip");
|
||||||
|
|
||||||
$fp = @fopen("{$phpbb_root_path}store/$filename.zip", 'rb');
|
$fp = @fopen(PHPBB_ROOT_PATH . "store/$filename.zip", 'rb');
|
||||||
if ($fp)
|
if ($fp)
|
||||||
{
|
{
|
||||||
while ($buffer = fread($fp, 1024))
|
while ($buffer = fread($fp, 1024))
|
||||||
|
@ -649,8 +645,6 @@ class compress_tar extends compress
|
||||||
*/
|
*/
|
||||||
public function download($filename, $download_name = false)
|
public function download($filename, $download_name = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
|
||||||
|
|
||||||
if ($download_name === false)
|
if ($download_name === false)
|
||||||
{
|
{
|
||||||
$download_name = $filename;
|
$download_name = $filename;
|
||||||
|
@ -679,7 +673,7 @@ class compress_tar extends compress
|
||||||
header("Content-Type: $mimetype; name=\"$download_name$this->type\"");
|
header("Content-Type: $mimetype; name=\"$download_name$this->type\"");
|
||||||
header("Content-disposition: attachment; filename=$download_name$this->type");
|
header("Content-disposition: attachment; filename=$download_name$this->type");
|
||||||
|
|
||||||
$fp = @fopen("{$phpbb_root_path}store/$filename$this->type", 'rb');
|
$fp = @fopen(PHPBB_ROOT_PATH . "store/$filename$this->type", 'rb');
|
||||||
if ($fp)
|
if ($fp)
|
||||||
{
|
{
|
||||||
while ($buffer = fread($fp, 1024))
|
while ($buffer = fread($fp, 1024))
|
||||||
|
|
|
@ -406,8 +406,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
|
||||||
{
|
{
|
||||||
if (!class_exists('bbcode'))
|
if (!class_exists('bbcode'))
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
include(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($bbcode))
|
if (empty($bbcode))
|
||||||
|
@ -435,8 +434,6 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
|
||||||
*/
|
*/
|
||||||
function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false)
|
function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$uid = $bitfield = '';
|
$uid = $bitfield = '';
|
||||||
|
|
||||||
if (!$text)
|
if (!$text)
|
||||||
|
@ -446,7 +443,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
|
||||||
|
|
||||||
if (!class_exists('parse_message'))
|
if (!class_exists('parse_message'))
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
$message_parser = new parse_message($text);
|
$message_parser = new parse_message($text);
|
||||||
|
@ -473,8 +470,6 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
|
||||||
*/
|
*/
|
||||||
function generate_text_for_edit($text, $uid, $flags)
|
function generate_text_for_edit($text, $uid, $flags)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
decode_message($text, $uid);
|
decode_message($text, $uid);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
@ -699,7 +694,7 @@ function bbcode_nl2br($text)
|
||||||
*/
|
*/
|
||||||
function smiley_text($text, $force_option = false)
|
function smiley_text($text, $force_option = false)
|
||||||
{
|
{
|
||||||
global $config, $user, $phpbb_root_path;
|
global $config, $user;
|
||||||
|
|
||||||
if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies'))
|
if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies'))
|
||||||
{
|
{
|
||||||
|
@ -707,7 +702,7 @@ function smiley_text($text, $force_option = false)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . $phpbb_root_path . $config['smilies_path'] . '/\2 />', $text);
|
return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . PHPBB_ROOT_PATH . $config['smilies_path'] . '/\2 />', $text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -728,7 +723,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||||
}
|
}
|
||||||
|
|
||||||
global $template, $cache, $user;
|
global $template, $cache, $user;
|
||||||
global $extensions, $config, $phpbb_root_path, $phpEx;
|
global $extensions, $config;
|
||||||
|
|
||||||
//
|
//
|
||||||
$compiled_attachments = array();
|
$compiled_attachments = array();
|
||||||
|
@ -816,8 +811,8 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||||
|
|
||||||
// Some basics...
|
// Some basics...
|
||||||
$attachment['extension'] = strtolower(trim($attachment['extension']));
|
$attachment['extension'] = strtolower(trim($attachment['extension']));
|
||||||
$filename = $phpbb_root_path . $config['upload_path'] . '/' . basename($attachment['physical_filename']);
|
$filename = PHPBB_ROOT_PATH . $config['upload_path'] . '/' . basename($attachment['physical_filename']);
|
||||||
$thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . basename($attachment['physical_filename']);
|
$thumbnail_filename = PHPBB_ROOT_PATH . $config['upload_path'] . '/thumb_' . basename($attachment['physical_filename']);
|
||||||
|
|
||||||
$upload_icon = '';
|
$upload_icon = '';
|
||||||
|
|
||||||
|
@ -829,7 +824,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||||
}
|
}
|
||||||
else if ($extensions[$attachment['extension']]['upload_icon'])
|
else if ($extensions[$attachment['extension']]['upload_icon'])
|
||||||
{
|
{
|
||||||
$upload_icon = '<img src="' . $phpbb_root_path . $config['upload_icons_path'] . '/' . trim($extensions[$attachment['extension']]['upload_icon']) . '" alt="" />';
|
$upload_icon = '<img src="' . PHPBB_ROOT_PATH . $config['upload_icons_path'] . '/' . trim($extensions[$attachment['extension']]['upload_icon']) . '" alt="" />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -907,14 +902,14 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||||
$display_cat = ATTACHMENT_CATEGORY_NONE;
|
$display_cat = ATTACHMENT_CATEGORY_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
|
$download_link = append_sid('download/file', 'id=' . $attachment['attach_id']);
|
||||||
|
|
||||||
switch ($display_cat)
|
switch ($display_cat)
|
||||||
{
|
{
|
||||||
// Images
|
// Images
|
||||||
case ATTACHMENT_CATEGORY_IMAGE:
|
case ATTACHMENT_CATEGORY_IMAGE:
|
||||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||||
$inline_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
|
$inline_link = append_sid('download/file', 'id=' . $attachment['attach_id']);
|
||||||
$download_link .= '&mode=view';
|
$download_link .= '&mode=view';
|
||||||
|
|
||||||
$block_array += array(
|
$block_array += array(
|
||||||
|
@ -928,7 +923,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||||
// Images, but display Thumbnail
|
// Images, but display Thumbnail
|
||||||
case ATTACHMENT_CATEGORY_THUMB:
|
case ATTACHMENT_CATEGORY_THUMB:
|
||||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||||
$thumbnail_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1');
|
$thumbnail_link = append_sid('download/file', 'id=' . $attachment['attach_id'] . '&t=1');
|
||||||
$download_link .= '&mode=view';
|
$download_link .= '&mode=view';
|
||||||
|
|
||||||
$block_array += array(
|
$block_array += array(
|
||||||
|
@ -1118,7 +1113,7 @@ function truncate_string($string, $max_length = 60, $allow_reply = true, $append
|
||||||
*/
|
*/
|
||||||
function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false)
|
function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $user, $auth;
|
global $user, $auth;
|
||||||
|
|
||||||
$profile_url = '';
|
$profile_url = '';
|
||||||
$username_colour = ($username_colour) ? '#' . $username_colour : '';
|
$username_colour = ($username_colour) ? '#' . $username_colour : '';
|
||||||
|
@ -1143,7 +1138,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id);
|
$profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : append_sid('memberlist', 'mode=viewprofile&u=' . (int) $user_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -418,7 +418,7 @@ function remote_avatar_dims()
|
||||||
|
|
||||||
function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false)
|
function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false)
|
||||||
{
|
{
|
||||||
global $config, $convert, $phpbb_root_path, $user;
|
global $config, $convert, $user;
|
||||||
|
|
||||||
$relative_path = empty($convert->convertor['source_path_absolute']);
|
$relative_path = empty($convert->convertor['source_path_absolute']);
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false
|
||||||
|
|
||||||
function import_attachment_files($category_name = '')
|
function import_attachment_files($category_name = '')
|
||||||
{
|
{
|
||||||
global $config, $convert, $phpbb_root_path, $db, $user;
|
global $config, $convert, $db, $user;
|
||||||
|
|
||||||
$sql = 'SELECT config_value AS upload_path
|
$sql = 'SELECT config_value AS upload_path
|
||||||
FROM ' . CONFIG_TABLE . "
|
FROM ' . CONFIG_TABLE . "
|
||||||
|
@ -550,7 +550,7 @@ function _import_check($config_var, $source, $use_target)
|
||||||
'relative_path' => (empty($convert->convertor['source_path_absolute'])) ? true : false,
|
'relative_path' => (empty($convert->convertor['source_path_absolute'])) ? true : false,
|
||||||
);
|
);
|
||||||
|
|
||||||
// copy file will prepend $phpBB_root_path
|
// copy file will prepend PHPBB_ROOT_PATH
|
||||||
$target = $config[$config_var] . '/' . basename(($use_target === false) ? $source : $use_target);
|
$target = $config[$config_var] . '/' . basename(($use_target === false) ? $source : $use_target);
|
||||||
|
|
||||||
if (!empty($convert->convertor[$config_var]) && strpos($source, $convert->convertor[$config_var]) !== 0)
|
if (!empty($convert->convertor[$config_var]) && strpos($source, $convert->convertor[$config_var]) !== 0)
|
||||||
|
@ -584,7 +584,7 @@ function import_attachment($source, $use_target = false)
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
global $convert, $phpbb_root_path, $config, $user;
|
global $convert, $config, $user;
|
||||||
|
|
||||||
if (empty($convert->convertor['upload_path']))
|
if (empty($convert->convertor['upload_path']))
|
||||||
{
|
{
|
||||||
|
@ -625,7 +625,7 @@ function import_rank($source, $use_target = false)
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
global $convert, $phpbb_root_path, $config, $user;
|
global $convert, $config, $user;
|
||||||
|
|
||||||
if (!isset($convert->convertor['ranks_path']))
|
if (!isset($convert->convertor['ranks_path']))
|
||||||
{
|
{
|
||||||
|
@ -643,7 +643,7 @@ function import_smiley($source, $use_target = false)
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
global $convert, $phpbb_root_path, $config, $user;
|
global $convert, $config, $user;
|
||||||
|
|
||||||
if (!isset($convert->convertor['smilies_path']))
|
if (!isset($convert->convertor['smilies_path']))
|
||||||
{
|
{
|
||||||
|
@ -663,7 +663,7 @@ function import_avatar($source, $use_target = false, $user_id = false)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
global $convert, $phpbb_root_path, $config, $user;
|
global $convert, $config, $user;
|
||||||
|
|
||||||
if (!isset($convert->convertor['avatar_path']))
|
if (!isset($convert->convertor['avatar_path']))
|
||||||
{
|
{
|
||||||
|
@ -741,7 +741,7 @@ function get_smiley_dim($source, $axis)
|
||||||
return $smiley_cache[$source][$axis];
|
return $smiley_cache[$source][$axis];
|
||||||
}
|
}
|
||||||
|
|
||||||
global $convert, $phpbb_root_path, $config, $user;
|
global $convert, $config, $user;
|
||||||
|
|
||||||
$orig_source = $source;
|
$orig_source = $source;
|
||||||
|
|
||||||
|
@ -856,7 +856,7 @@ function get_upload_avatar_dim($source, $axis)
|
||||||
$source = substr($source, 7);
|
$source = substr($source, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
global $convert, $phpbb_root_path, $config, $user;
|
global $convert, $config, $user;
|
||||||
|
|
||||||
if (!isset($convert->convertor['avatar_path']))
|
if (!isset($convert->convertor['avatar_path']))
|
||||||
{
|
{
|
||||||
|
@ -898,7 +898,7 @@ function get_gallery_avatar_dim($source, $axis)
|
||||||
return $avatar_cache[$source][$axis];
|
return $avatar_cache[$source][$axis];
|
||||||
}
|
}
|
||||||
|
|
||||||
global $convert, $phpbb_root_path, $config, $user;
|
global $convert, $config, $user;
|
||||||
|
|
||||||
$orig_source = $source;
|
$orig_source = $source;
|
||||||
|
|
||||||
|
@ -1111,7 +1111,7 @@ function words_unique(&$words)
|
||||||
*/
|
*/
|
||||||
function add_user_group($group_id, $user_id, $group_leader=false)
|
function add_user_group($group_id, $user_id, $group_leader=false)
|
||||||
{
|
{
|
||||||
global $convert, $phpbb_root_path, $config, $user, $db;
|
global $convert, $config, $user, $db;
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
||||||
'group_id' => $group_id,
|
'group_id' => $group_id,
|
||||||
|
@ -1131,7 +1131,7 @@ function add_user_group($group_id, $user_id, $group_leader=false)
|
||||||
*/
|
*/
|
||||||
function user_group_auth($group, $select_query, $use_src_db)
|
function user_group_auth($group, $select_query, $use_src_db)
|
||||||
{
|
{
|
||||||
global $convert, $phpbb_root_path, $config, $user, $db, $src_db, $same_db;
|
global $convert, $config, $user, $db, $src_db, $same_db;
|
||||||
|
|
||||||
if (!in_array($group, array('guests', 'registered', 'registered_coppa', 'global_moderators', 'administrators', 'bots')))
|
if (!in_array($group, array('guests', 'registered', 'registered_coppa', 'global_moderators', 'administrators', 'bots')))
|
||||||
{
|
{
|
||||||
|
@ -1187,7 +1187,7 @@ function get_config()
|
||||||
return $convert_config;
|
return $convert_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
global $src_db, $same_db, $phpbb_root_path, $config;
|
global $src_db, $same_db, $config;
|
||||||
global $convert;
|
global $convert;
|
||||||
|
|
||||||
if ($convert->config_schema['table_format'] != 'file')
|
if ($convert->config_schema['table_format'] != 'file')
|
||||||
|
@ -1354,14 +1354,14 @@ function extract_variables_from_file($_filename)
|
||||||
|
|
||||||
function get_path($src_path, $src_url, $test_file)
|
function get_path($src_path, $src_url, $test_file)
|
||||||
{
|
{
|
||||||
global $config, $phpbb_root_path, $phpEx;
|
global $config;
|
||||||
|
|
||||||
$board_config = get_config();
|
$board_config = get_config();
|
||||||
|
|
||||||
$test_file = preg_replace('/\.php$/i', ".$phpEx", $test_file);
|
$test_file = preg_replace('/\.php$/i', '.' . PHP_EXT, $test_file);
|
||||||
$src_path = path($src_path);
|
$src_path = path($src_path);
|
||||||
|
|
||||||
if (@file_exists($phpbb_root_path . $src_path . $test_file))
|
if (@file_exists(PHPBB_ROOT_PATH . $src_path . $test_file))
|
||||||
{
|
{
|
||||||
return $src_path;
|
return $src_path;
|
||||||
}
|
}
|
||||||
|
@ -1421,7 +1421,7 @@ function get_path($src_path, $src_url, $test_file)
|
||||||
|
|
||||||
if (!empty($path))
|
if (!empty($path))
|
||||||
{
|
{
|
||||||
if (@file_exists($phpbb_root_path . $path . $test_file))
|
if (@file_exists(PHPBB_ROOT_PATH . $path . $test_file))
|
||||||
{
|
{
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
@ -1763,7 +1763,7 @@ function sync_post_count($offset, $limit)
|
||||||
*/
|
*/
|
||||||
function add_bots()
|
function add_bots()
|
||||||
{
|
{
|
||||||
global $db, $convert, $user, $config, $phpbb_root_path, $phpEx;
|
global $db, $convert, $user, $config;
|
||||||
|
|
||||||
$db->sql_query($convert->truncate_statement . BOTS_TABLE);
|
$db->sql_query($convert->truncate_statement . BOTS_TABLE);
|
||||||
|
|
||||||
|
@ -1843,7 +1843,7 @@ function add_bots()
|
||||||
|
|
||||||
if (!function_exists('user_add'))
|
if (!function_exists('user_add'))
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($bots as $bot_name => $bot_ary)
|
foreach ($bots as $bot_name => $bot_ary)
|
||||||
|
@ -2112,7 +2112,7 @@ function fix_empty_primary_groups()
|
||||||
*/
|
*/
|
||||||
function remove_invalid_users()
|
function remove_invalid_users()
|
||||||
{
|
{
|
||||||
global $convert, $db, $phpEx, $phpbb_root_path;
|
global $convert, $db;
|
||||||
|
|
||||||
// username_clean is UNIQUE
|
// username_clean is UNIQUE
|
||||||
$sql = 'SELECT user_id
|
$sql = 'SELECT user_id
|
||||||
|
@ -2126,7 +2126,7 @@ function remove_invalid_users()
|
||||||
{
|
{
|
||||||
if (!function_exists('user_delete'))
|
if (!function_exists('user_delete'))
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
user_delete('remove', $row['user_id']);
|
user_delete('remove', $row['user_id']);
|
||||||
|
@ -2248,7 +2248,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals
|
||||||
|
|
||||||
function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $source_relative_path = true)
|
function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $source_relative_path = true)
|
||||||
{
|
{
|
||||||
global $convert, $phpbb_root_path, $config, $user, $db;
|
global $convert, $config, $user, $db;
|
||||||
|
|
||||||
if (substr($trg, -1) == '/')
|
if (substr($trg, -1) == '/')
|
||||||
{
|
{
|
||||||
|
@ -2267,7 +2267,7 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = $phpbb_root_path;
|
$path = PHPBB_ROOT_PATH;
|
||||||
$parts = explode('/', $trg);
|
$parts = explode('/', $trg);
|
||||||
unset($parts[sizeof($parts) - 1]);
|
unset($parts[sizeof($parts) - 1]);
|
||||||
|
|
||||||
|
@ -2286,15 +2286,15 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
|
||||||
@chmod($path, 0777);
|
@chmod($path, 0777);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!@copy($src_path, $phpbb_root_path . $trg_path))
|
if (!@copy($src_path, PHPBB_ROOT_PATH . $trg_path))
|
||||||
{
|
{
|
||||||
$convert->p_master->error(sprintf($user->lang['COULD_NOT_COPY'], $src_path, $phpbb_root_path . $trg_path), __LINE__, __FILE__, !$die_on_failure);
|
$convert->p_master->error(sprintf($user->lang['COULD_NOT_COPY'], $src_path, PHPBB_ROOT_PATH . $trg_path), __LINE__, __FILE__, !$die_on_failure);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($perm = @fileperms($src_path))
|
if ($perm = @fileperms($src_path))
|
||||||
{
|
{
|
||||||
@chmod($phpbb_root_path . $trg_path, $perm);
|
@chmod(PHPBB_ROOT_PATH . $trg_path, $perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -2302,13 +2302,13 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
|
||||||
|
|
||||||
function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_failure = true, $source_relative_path = true)
|
function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_failure = true, $source_relative_path = true)
|
||||||
{
|
{
|
||||||
global $convert, $phpbb_root_path, $config, $user, $db;
|
global $convert, $config, $user, $db;
|
||||||
|
|
||||||
$dirlist = $filelist = $bad_dirs = array();
|
$dirlist = $filelist = $bad_dirs = array();
|
||||||
$src = path($src, $source_relative_path);
|
$src = path($src, $source_relative_path);
|
||||||
$trg = path($trg);
|
$trg = path($trg);
|
||||||
$src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__);
|
$src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__);
|
||||||
$trg_path = $phpbb_root_path . $trg;
|
$trg_path = PHPBB_ROOT_PATH . $trg;
|
||||||
|
|
||||||
if (!is_dir($trg_path))
|
if (!is_dir($trg_path))
|
||||||
{
|
{
|
||||||
|
@ -2411,7 +2411,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
|
||||||
|
|
||||||
function relative_base($path, $is_relative = true, $line = false, $file = false)
|
function relative_base($path, $is_relative = true, $line = false, $file = false)
|
||||||
{
|
{
|
||||||
global $convert, $phpbb_root_path, $config, $user, $db;
|
global $convert, $config, $user, $db;
|
||||||
|
|
||||||
if (!$is_relative)
|
if (!$is_relative)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,8 +21,7 @@ if (!defined('IN_PHPBB'))
|
||||||
*/
|
*/
|
||||||
function display_forums($root_data = '', $display_moderators = true, $return_moderators = false)
|
function display_forums($root_data = '', $display_moderators = true, $return_moderators = false)
|
||||||
{
|
{
|
||||||
global $db, $auth, $user, $template;
|
global $db, $auth, $user, $template, $config;
|
||||||
global $phpbb_root_path, $phpEx, $config;
|
|
||||||
|
|
||||||
$forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array();
|
$forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array();
|
||||||
$parent_id = $visible_forums = 0;
|
$parent_id = $visible_forums = 0;
|
||||||
|
@ -274,9 +273,9 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
|
'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
|
||||||
'FORUM_FOLDER_IMG' => '',
|
'FORUM_FOLDER_IMG' => '',
|
||||||
'FORUM_FOLDER_IMG_SRC' => '',
|
'FORUM_FOLDER_IMG_SRC' => '',
|
||||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '',
|
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '',
|
||||||
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
|
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
|
||||||
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']))
|
'U_VIEWFORUM' => append_sid('viewforum', 'f=' . $row['forum_id']))
|
||||||
);
|
);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
@ -300,7 +299,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
if ($subforum_row['display'] && $subforum_row['name'])
|
if ($subforum_row['display'] && $subforum_row['name'])
|
||||||
{
|
{
|
||||||
$subforums_list[] = array(
|
$subforums_list[] = array(
|
||||||
'link' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $subforum_id),
|
'link' => append_sid('viewforum', 'f=' . $subforum_id),
|
||||||
'name' => $subforum_row['name'],
|
'name' => $subforum_row['name'],
|
||||||
'unread' => $subforum_unread,
|
'unread' => $subforum_unread,
|
||||||
);
|
);
|
||||||
|
@ -350,7 +349,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
{
|
{
|
||||||
$last_post_subject = $row['forum_last_post_subject'];
|
$last_post_subject = $row['forum_last_post_subject'];
|
||||||
$last_post_time = $user->format_date($row['forum_last_post_time']);
|
$last_post_time = $user->format_date($row['forum_last_post_time']);
|
||||||
$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
|
$last_post_url = append_sid('viewtopic', 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -378,7 +377,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
|
|
||||||
if ($row['forum_type'] != FORUM_LINK)
|
if ($row['forum_type'] != FORUM_LINK)
|
||||||
{
|
{
|
||||||
$u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
|
$u_viewforum = append_sid('viewforum', 'f=' . $row['forum_id']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -386,7 +385,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
// If the forum is having a password or no read access we do not expose the link, but instead handle it in viewforum
|
// If the forum is having a password or no read access we do not expose the link, but instead handle it in viewforum
|
||||||
if (($row['forum_flags'] & FORUM_FLAG_LINK_TRACK) || $row['forum_password'] || !$auth->acl_get('f_read', $forum_id))
|
if (($row['forum_flags'] & FORUM_FLAG_LINK_TRACK) || $row['forum_password'] || !$auth->acl_get('f_read', $forum_id))
|
||||||
{
|
{
|
||||||
$u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
|
$u_viewforum = append_sid('viewforum', 'f=' . $row['forum_id']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -411,8 +410,8 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
|
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
|
||||||
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
|
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
|
||||||
'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '',
|
'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '',
|
||||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
|
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
|
||||||
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
|
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
|
||||||
'LAST_POST_SUBJECT' => censor_text($last_post_subject),
|
'LAST_POST_SUBJECT' => censor_text($last_post_subject),
|
||||||
'LAST_POST_TIME' => $last_post_time,
|
'LAST_POST_TIME' => $last_post_time,
|
||||||
'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
|
'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
|
||||||
|
@ -444,7 +443,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $root_data['forum_id'] . '&mark=forums') : '',
|
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid('viewforum', 'f=' . $root_data['forum_id'] . '&mark=forums') : '',
|
||||||
'S_HAS_SUBFORUM' => ($visible_forums) ? true : false,
|
'S_HAS_SUBFORUM' => ($visible_forums) ? true : false,
|
||||||
'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'],
|
'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'],
|
||||||
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'))
|
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'))
|
||||||
|
@ -468,7 +467,7 @@ function generate_forum_rules(&$forum_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
global $template, $phpbb_root_path, $phpEx;
|
global $template;
|
||||||
|
|
||||||
if ($forum_data['forum_rules'])
|
if ($forum_data['forum_rules'])
|
||||||
{
|
{
|
||||||
|
@ -489,7 +488,6 @@ function generate_forum_rules(&$forum_data)
|
||||||
function generate_forum_nav(&$forum_data)
|
function generate_forum_nav(&$forum_data)
|
||||||
{
|
{
|
||||||
global $db, $user, $template, $auth;
|
global $db, $user, $template, $auth;
|
||||||
global $phpEx, $phpbb_root_path;
|
|
||||||
|
|
||||||
if (!$auth->acl_get('f_list', $forum_data['forum_id']))
|
if (!$auth->acl_get('f_list', $forum_data['forum_id']))
|
||||||
{
|
{
|
||||||
|
@ -518,7 +516,7 @@ function generate_forum_nav(&$forum_data)
|
||||||
'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false,
|
'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false,
|
||||||
'FORUM_NAME' => $parent_name,
|
'FORUM_NAME' => $parent_name,
|
||||||
'FORUM_ID' => $parent_forum_id,
|
'FORUM_ID' => $parent_forum_id,
|
||||||
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id))
|
'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $parent_forum_id))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -529,7 +527,7 @@ function generate_forum_nav(&$forum_data)
|
||||||
'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
|
'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
|
||||||
'FORUM_NAME' => $forum_data['forum_name'],
|
'FORUM_NAME' => $forum_data['forum_name'],
|
||||||
'FORUM_ID' => $forum_data['forum_id'],
|
'FORUM_ID' => $forum_data['forum_id'],
|
||||||
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id']))
|
'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_data['forum_id']))
|
||||||
);
|
);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
@ -630,7 +628,7 @@ function topic_generate_pagination($replies, $url)
|
||||||
*/
|
*/
|
||||||
function get_moderators(&$forum_moderators, $forum_id = false)
|
function get_moderators(&$forum_moderators, $forum_id = false)
|
||||||
{
|
{
|
||||||
global $config, $template, $db, $phpbb_root_path, $phpEx;
|
global $config, $template, $db;
|
||||||
|
|
||||||
// Have we disabled the display of moderators? If so, then return
|
// Have we disabled the display of moderators? If so, then return
|
||||||
// from whence we came ...
|
// from whence we came ...
|
||||||
|
@ -689,7 +687,7 @@ function get_moderators(&$forum_moderators, $forum_id = false)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
|
$forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid('memberlist', 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
@ -874,7 +872,6 @@ function display_reasons($reason_id = 0)
|
||||||
function display_user_activity(&$userdata)
|
function display_user_activity(&$userdata)
|
||||||
{
|
{
|
||||||
global $auth, $template, $db, $user;
|
global $auth, $template, $db, $user;
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
// Do not display user activity for users having more than 5000 posts...
|
// Do not display user activity for users having more than 5000 posts...
|
||||||
if ($userdata['user_posts'] > 5000)
|
if ($userdata['user_posts'] > 5000)
|
||||||
|
@ -972,10 +969,10 @@ function display_user_activity(&$userdata)
|
||||||
'ACTIVE_TOPIC' => censor_text($active_t_name),
|
'ACTIVE_TOPIC' => censor_text($active_t_name),
|
||||||
'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count),
|
'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count),
|
||||||
'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct),
|
'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct),
|
||||||
'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id),
|
'U_ACTIVE_FORUM' => append_sid('viewforum', 'f=' . $active_f_id),
|
||||||
'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id),
|
'U_ACTIVE_TOPIC' => append_sid('viewtopic', 't=' . $active_t_id),
|
||||||
'S_SHOW_ACTIVITY' => true)
|
'S_SHOW_ACTIVITY' => true,
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -983,7 +980,7 @@ function display_user_activity(&$userdata)
|
||||||
*/
|
*/
|
||||||
function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0)
|
function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0)
|
||||||
{
|
{
|
||||||
global $template, $db, $user, $phpEx, $start, $phpbb_root_path;
|
global $template, $db, $user, $start;
|
||||||
|
|
||||||
$table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;
|
$table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;
|
||||||
$where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id';
|
$where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id';
|
||||||
|
@ -1022,7 +1019,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
$redirect_url = append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||||
|
|
||||||
meta_refresh(3, $redirect_url);
|
meta_refresh(3, $redirect_url);
|
||||||
|
|
||||||
|
@ -1056,7 +1053,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
$redirect_url = append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||||
meta_refresh(3, $redirect_url);
|
meta_refresh(3, $redirect_url);
|
||||||
|
|
||||||
$message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
$message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||||
|
@ -1083,7 +1080,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||||
|
|
||||||
if ($can_watch)
|
if ($can_watch)
|
||||||
{
|
{
|
||||||
$s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start");
|
$s_watching['link'] = append_sid("view$mode", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start");
|
||||||
$s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
|
$s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
|
||||||
$s_watching['is_watching'] = $is_watching;
|
$s_watching['is_watching'] = $is_watching;
|
||||||
}
|
}
|
||||||
|
@ -1103,7 +1100,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||||
*/
|
*/
|
||||||
function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
|
function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
|
||||||
{
|
{
|
||||||
global $ranks, $config, $phpbb_root_path;
|
global $ranks, $config;
|
||||||
|
|
||||||
if (empty($ranks))
|
if (empty($ranks))
|
||||||
{
|
{
|
||||||
|
@ -1114,8 +1111,8 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
|
||||||
if (!empty($user_rank))
|
if (!empty($user_rank))
|
||||||
{
|
{
|
||||||
$rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
|
$rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
|
||||||
$rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
|
$rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
|
||||||
$rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
|
$rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1126,8 +1123,8 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
|
||||||
if ($user_posts >= $rank['rank_min'])
|
if ($user_posts >= $rank['rank_min'])
|
||||||
{
|
{
|
||||||
$rank_title = $rank['rank_title'];
|
$rank_title = $rank['rank_title'];
|
||||||
$rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
|
$rank_img = (!empty($rank['rank_image'])) ? '<img src="' . PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
|
||||||
$rank_img_src = (!empty($rank['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image'] : '';
|
$rank_img_src = (!empty($rank['rank_image'])) ? PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $rank['rank_image'] : '';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1148,7 +1145,7 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
|
||||||
*/
|
*/
|
||||||
function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
|
function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
|
||||||
{
|
{
|
||||||
global $user, $config, $phpbb_root_path, $phpEx;
|
global $user, $config;
|
||||||
|
|
||||||
if (empty($avatar) || !$avatar_type)
|
if (empty($avatar) || !$avatar_type)
|
||||||
{
|
{
|
||||||
|
@ -1160,11 +1157,11 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
|
||||||
switch ($avatar_type)
|
switch ($avatar_type)
|
||||||
{
|
{
|
||||||
case AVATAR_UPLOAD:
|
case AVATAR_UPLOAD:
|
||||||
$avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
|
$avatar_img = PHPBB_ROOT_PATH . 'download/file.' . PHP_EXT . '?avatar=';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AVATAR_GALLERY:
|
case AVATAR_GALLERY:
|
||||||
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
|
$avatar_img = PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -277,14 +277,14 @@ function get_tables($db)
|
||||||
*/
|
*/
|
||||||
function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix, $dbhost, $dbuser, $dbpasswd, $dbname, $dbport, $prefix_may_exist = false, $load_dbal = true, $unicode_check = true)
|
function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix, $dbhost, $dbuser, $dbpasswd, $dbname, $dbport, $prefix_may_exist = false, $load_dbal = true, $unicode_check = true)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $config, $lang;
|
global $config, $lang;
|
||||||
|
|
||||||
$dbms = $dbms_details['DRIVER'];
|
$dbms = $dbms_details['DRIVER'];
|
||||||
|
|
||||||
if ($load_dbal)
|
if ($load_dbal)
|
||||||
{
|
{
|
||||||
// Include the DB layer
|
// Include the DB layer
|
||||||
include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instantiate it and set return on error true
|
// Instantiate it and set return on error true
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* @copyright (c) 2005 phpBB Group
|
* @copyright (c) 2005 phpBB Group
|
||||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||||
*
|
*
|
||||||
|
* @todo handling email and jabber queue through the database, not relying on a single file/file transactions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,11 +17,17 @@ if (!defined('IN_PHPBB'))
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* phpbb_messenger
|
||||||
|
* phpbb_queue
|
||||||
|
* phpbb_smtp_mailer
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Messenger
|
* Messenger
|
||||||
* @package phpBB3
|
* @package phpBB3
|
||||||
*/
|
*/
|
||||||
class messenger
|
class phpbb_messenger
|
||||||
{
|
{
|
||||||
private $vars, $msg, $extra_headers, $replyto, $from, $subject;
|
private $vars, $msg, $extra_headers, $replyto, $from, $subject;
|
||||||
private $addresses = array();
|
private $addresses = array();
|
||||||
|
@ -53,7 +60,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Sets an email address to send to
|
* Sets an email address to send to
|
||||||
*/
|
*/
|
||||||
function to($address, $realname = '')
|
public function to($address, $realname = '')
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
@ -75,7 +82,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Sets an cc address to send to
|
* Sets an cc address to send to
|
||||||
*/
|
*/
|
||||||
function cc($address, $realname = '')
|
public function cc($address, $realname = '')
|
||||||
{
|
{
|
||||||
$pos = isset($this->addresses['cc']) ? sizeof($this->addresses['cc']) : 0;
|
$pos = isset($this->addresses['cc']) ? sizeof($this->addresses['cc']) : 0;
|
||||||
$this->addresses['cc'][$pos]['email'] = trim($address);
|
$this->addresses['cc'][$pos]['email'] = trim($address);
|
||||||
|
@ -85,7 +92,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Sets an bcc address to send to
|
* Sets an bcc address to send to
|
||||||
*/
|
*/
|
||||||
function bcc($address, $realname = '')
|
public function bcc($address, $realname = '')
|
||||||
{
|
{
|
||||||
$pos = isset($this->addresses['bcc']) ? sizeof($this->addresses['bcc']) : 0;
|
$pos = isset($this->addresses['bcc']) ? sizeof($this->addresses['bcc']) : 0;
|
||||||
$this->addresses['bcc'][$pos]['email'] = trim($address);
|
$this->addresses['bcc'][$pos]['email'] = trim($address);
|
||||||
|
@ -95,7 +102,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Sets a im contact to send to
|
* Sets a im contact to send to
|
||||||
*/
|
*/
|
||||||
function im($address, $realname = '')
|
public function im($address, $realname = '')
|
||||||
{
|
{
|
||||||
$pos = isset($this->addresses['im']) ? sizeof($this->addresses['im']) : 0;
|
$pos = isset($this->addresses['im']) ? sizeof($this->addresses['im']) : 0;
|
||||||
$this->addresses['im'][$pos]['uid'] = trim($address);
|
$this->addresses['im'][$pos]['uid'] = trim($address);
|
||||||
|
@ -105,7 +112,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Set the reply to address
|
* Set the reply to address
|
||||||
*/
|
*/
|
||||||
function replyto($address)
|
public function replyto($address)
|
||||||
{
|
{
|
||||||
$this->replyto = trim($address);
|
$this->replyto = trim($address);
|
||||||
}
|
}
|
||||||
|
@ -113,7 +120,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Set the from address
|
* Set the from address
|
||||||
*/
|
*/
|
||||||
function from($address)
|
public function from($address)
|
||||||
{
|
{
|
||||||
$this->from = trim($address);
|
$this->from = trim($address);
|
||||||
}
|
}
|
||||||
|
@ -121,7 +128,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* set up subject for mail
|
* set up subject for mail
|
||||||
*/
|
*/
|
||||||
function subject($subject = '')
|
public function subject($subject = '')
|
||||||
{
|
{
|
||||||
$this->subject = trim($subject);
|
$this->subject = trim($subject);
|
||||||
}
|
}
|
||||||
|
@ -129,7 +136,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* set up extra mail headers
|
* set up extra mail headers
|
||||||
*/
|
*/
|
||||||
function headers($headers)
|
public function headers($headers)
|
||||||
{
|
{
|
||||||
$this->extra_headers[] = trim($headers);
|
$this->extra_headers[] = trim($headers);
|
||||||
}
|
}
|
||||||
|
@ -137,7 +144,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Set the email priority
|
* Set the email priority
|
||||||
*/
|
*/
|
||||||
function set_mail_priority($priority = MAIL_NORMAL_PRIORITY)
|
public function set_mail_priority($priority = MAIL_NORMAL_PRIORITY)
|
||||||
{
|
{
|
||||||
$this->mail_priority = $priority;
|
$this->mail_priority = $priority;
|
||||||
}
|
}
|
||||||
|
@ -145,9 +152,9 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Set email template to use
|
* Set email template to use
|
||||||
*/
|
*/
|
||||||
function template($template_file, $template_lang = '')
|
public function template($template_file, $template_lang = '')
|
||||||
{
|
{
|
||||||
global $config, $phpbb_root_path;
|
global $config;
|
||||||
|
|
||||||
if (!trim($template_file))
|
if (!trim($template_file))
|
||||||
{
|
{
|
||||||
|
@ -161,7 +168,7 @@ class messenger
|
||||||
|
|
||||||
if (empty($this->tpl_msg[$template_lang . $template_file]))
|
if (empty($this->tpl_msg[$template_lang . $template_file]))
|
||||||
{
|
{
|
||||||
$tpl_file = "{$phpbb_root_path}language/$template_lang/email/$template_file.txt";
|
$tpl_file = PHPBB_ROOT_PATH . "language/$template_lang/email/$template_file.txt";
|
||||||
|
|
||||||
if (!file_exists($tpl_file))
|
if (!file_exists($tpl_file))
|
||||||
{
|
{
|
||||||
|
@ -184,7 +191,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* assign variables to email template
|
* assign variables to email template
|
||||||
*/
|
*/
|
||||||
function assign_vars($vars)
|
public function assign_vars($vars)
|
||||||
{
|
{
|
||||||
$this->vars = (empty($this->vars)) ? $vars : $this->vars + $vars;
|
$this->vars = (empty($this->vars)) ? $vars : $this->vars + $vars;
|
||||||
}
|
}
|
||||||
|
@ -192,7 +199,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Send the mail out to the recipients set previously in var $this->addresses
|
* Send the mail out to the recipients set previously in var $this->addresses
|
||||||
*/
|
*/
|
||||||
function send($method = NOTIFY_EMAIL, $break = false)
|
public function send($method = NOTIFY_EMAIL, $break = false)
|
||||||
{
|
{
|
||||||
global $config, $user;
|
global $config, $user;
|
||||||
|
|
||||||
|
@ -256,7 +263,7 @@ class messenger
|
||||||
*/
|
*/
|
||||||
public static function error($type, $msg)
|
public static function error($type, $msg)
|
||||||
{
|
{
|
||||||
global $user, $phpEx, $phpbb_root_path, $config;
|
global $user, $config;
|
||||||
|
|
||||||
// Session doesn't exist, create it
|
// Session doesn't exist, create it
|
||||||
if (!isset($user->session_id) || $user->session_id === '')
|
if (!isset($user->session_id) || $user->session_id === '')
|
||||||
|
@ -285,7 +292,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Save to queue
|
* Save to queue
|
||||||
*/
|
*/
|
||||||
function save_queue()
|
public function save_queue()
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
@ -436,7 +443,7 @@ class messenger
|
||||||
*/
|
*/
|
||||||
private function msg_jabber()
|
private function msg_jabber()
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $phpbb_root_path, $phpEx;
|
global $config, $db, $user;
|
||||||
|
|
||||||
if (empty($config['jab_enable']) || empty($config['jab_host']) || empty($config['jab_username']) || empty($config['jab_password']))
|
if (empty($config['jab_enable']) || empty($config['jab_host']) || empty($config['jab_username']) || empty($config['jab_password']))
|
||||||
{
|
{
|
||||||
|
@ -463,7 +470,7 @@ class messenger
|
||||||
|
|
||||||
if (!$use_queue)
|
if (!$use_queue)
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_jabber.' . PHP_EXT);
|
||||||
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']);
|
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']);
|
||||||
|
|
||||||
if (!$this->jabber->connect())
|
if (!$this->jabber->connect())
|
||||||
|
@ -498,11 +505,68 @@ class messenger
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Classes for handling queue objects - singletons
|
||||||
|
*/
|
||||||
|
class phpbb_queue_jabber
|
||||||
|
{
|
||||||
|
static $queue;
|
||||||
|
|
||||||
|
public function __construct(phpbb_queue &$queue)
|
||||||
|
{
|
||||||
|
self::queue = $queue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// singleton
|
||||||
|
public static function &get_instance(phpbb_queue &$queue)
|
||||||
|
{
|
||||||
|
static $self;
|
||||||
|
|
||||||
|
if (is_object($self) === true)
|
||||||
|
{
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
$self = new phpbb_queue_jabber($queue);
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function start()
|
||||||
|
{
|
||||||
|
echo "START";
|
||||||
|
print_r($queue);
|
||||||
|
exit;
|
||||||
|
/* if (!$config['jab_enable'])
|
||||||
|
{
|
||||||
|
unset($this->queue_data['jabber']);
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_jabber.' . PHP_EXT);
|
||||||
|
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']);
|
||||||
|
|
||||||
|
if (!$this->jabber->connect())
|
||||||
|
{
|
||||||
|
messenger::error('JABBER', $user->lang['ERR_JAB_CONNECT']);
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$this->jabber->login())
|
||||||
|
{
|
||||||
|
messenger::error('JABBER', $user->lang['ERR_JAB_AUTH']);
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class phpbb_queue_test(
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* handling email and jabber queue
|
* handling email and jabber queue
|
||||||
* @package phpBB3
|
* @package phpBB3
|
||||||
*/
|
*/
|
||||||
class queue
|
class phpbb_queue
|
||||||
{
|
{
|
||||||
private $data = array();
|
private $data = array();
|
||||||
private $queue_data = array();
|
private $queue_data = array();
|
||||||
|
@ -514,10 +578,8 @@ class queue
|
||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $phpEx, $phpbb_root_path;
|
|
||||||
|
|
||||||
$this->data = array();
|
$this->data = array();
|
||||||
$this->cache_file = "{$phpbb_root_path}cache/queue.$phpEx";
|
$this->cache_file = PHPBB_ROOT_PATH . 'cache/queue.' . PHP_EXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -544,7 +606,7 @@ class queue
|
||||||
*/
|
*/
|
||||||
public function process()
|
public function process()
|
||||||
{
|
{
|
||||||
global $db, $config, $phpEx, $phpbb_root_path, $user;
|
global $db, $config, $user;
|
||||||
|
|
||||||
set_config('last_queue_run', time(), true);
|
set_config('last_queue_run', time(), true);
|
||||||
|
|
||||||
|
@ -584,6 +646,13 @@ class queue
|
||||||
$num_items = sizeof($data_ary['data']);
|
$num_items = sizeof($data_ary['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$class = 'phpbb_queue_' . $object;
|
||||||
|
$queue_object &= $class->get_instance($this);
|
||||||
|
|
||||||
|
$queue_object->start();
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
switch ($object)
|
switch ($object)
|
||||||
{
|
{
|
||||||
case 'email':
|
case 'email':
|
||||||
|
@ -596,26 +665,6 @@ class queue
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'jabber':
|
case 'jabber':
|
||||||
if (!$config['jab_enable'])
|
|
||||||
{
|
|
||||||
unset($this->queue_data['jabber']);
|
|
||||||
continue 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
|
|
||||||
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']);
|
|
||||||
|
|
||||||
if (!$this->jabber->connect())
|
|
||||||
{
|
|
||||||
messenger::error('JABBER', $user->lang['ERR_JAB_CONNECT']);
|
|
||||||
continue 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$this->jabber->login())
|
|
||||||
{
|
|
||||||
messenger::error('JABBER', $user->lang['ERR_JAB_AUTH']);
|
|
||||||
continue 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -682,6 +731,7 @@ class queue
|
||||||
$this->jabber->disconnect();
|
$this->jabber->disconnect();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sizeof($this->queue_data))
|
if (!sizeof($this->queue_data))
|
||||||
|
|
|
@ -44,8 +44,7 @@ class p_master
|
||||||
*/
|
*/
|
||||||
function list_modules($p_class)
|
function list_modules($p_class)
|
||||||
{
|
{
|
||||||
global $auth, $db, $user, $cache;
|
global $auth, $db, $user, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
// Sanitise for future path use, it's escaped as appropriate for queries
|
// Sanitise for future path use, it's escaped as appropriate for queries
|
||||||
$this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class));
|
$this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class));
|
||||||
|
@ -393,9 +392,9 @@ class p_master
|
||||||
*/
|
*/
|
||||||
function load_active($mode = false, $module_url = false, $execute_module = true)
|
function load_active($mode = false, $module_url = false, $execute_module = true)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user;
|
global $user;
|
||||||
|
|
||||||
$module_path = $phpbb_root_path . 'includes/' . $this->p_class;
|
$module_path = PHPBB_ROOT_PATH . 'includes/' . $this->p_class;
|
||||||
$icat = request_var('icat', '');
|
$icat = request_var('icat', '');
|
||||||
|
|
||||||
if ($this->active_module === false)
|
if ($this->active_module === false)
|
||||||
|
@ -405,16 +404,16 @@ class p_master
|
||||||
|
|
||||||
if (!class_exists("{$this->p_class}_$this->p_name"))
|
if (!class_exists("{$this->p_class}_$this->p_name"))
|
||||||
{
|
{
|
||||||
if (!file_exists("$module_path/{$this->p_class}_$this->p_name.$phpEx"))
|
if (!file_exists("$module_path/{$this->p_class}_$this->p_name." . PHP_EXT))
|
||||||
{
|
{
|
||||||
trigger_error("Cannot find module $module_path/{$this->p_class}_$this->p_name.$phpEx", E_USER_ERROR);
|
trigger_error("Cannot find module $module_path/{$this->p_class}_$this->p_name." . PHP_EXT, E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
include("$module_path/{$this->p_class}_$this->p_name.$phpEx");
|
include("$module_path/{$this->p_class}_$this->p_name." . PHP_EXT);
|
||||||
|
|
||||||
if (!class_exists("{$this->p_class}_$this->p_name"))
|
if (!class_exists("{$this->p_class}_$this->p_name"))
|
||||||
{
|
{
|
||||||
trigger_error("Module file $module_path/{$this->p_class}_$this->p_name.$phpEx does not contain correct class [{$this->p_class}_$this->p_name]", E_USER_ERROR);
|
trigger_error("Module file $module_path/{$this->p_class}_$this->p_name." . PHP_EXT . " does not contain correct class [{$this->p_class}_$this->p_name]", E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($mode))
|
if (!empty($mode))
|
||||||
|
@ -438,7 +437,7 @@ class p_master
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not being able to overwrite ;)
|
// Not being able to overwrite ;)
|
||||||
$this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
$this->module->u_action = append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -449,7 +448,7 @@ class p_master
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->module->u_action = $phpbb_root_path . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'];
|
$this->module->u_action = PHPBB_ROOT_PATH . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->module->u_action = append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
$this->module->u_action = append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||||
|
@ -816,7 +815,7 @@ class p_master
|
||||||
*/
|
*/
|
||||||
function add_mod_info($module_class)
|
function add_mod_info($module_class)
|
||||||
{
|
{
|
||||||
global $user, $phpEx;
|
global $user;
|
||||||
|
|
||||||
if (file_exists($user->lang_path . 'mods'))
|
if (file_exists($user->lang_path . 'mods'))
|
||||||
{
|
{
|
||||||
|
@ -828,9 +827,9 @@ class p_master
|
||||||
{
|
{
|
||||||
while (($entry = readdir($dir)) !== false)
|
while (($entry = readdir($dir)) !== false)
|
||||||
{
|
{
|
||||||
if (strpos($entry, 'info_' . strtolower($module_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == $phpEx)
|
if (strpos($entry, 'info_' . strtolower($module_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == PHP_EXT)
|
||||||
{
|
{
|
||||||
$add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen($phpEx) + 1));
|
$add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen(PHP_EXT) + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
|
|
|
@ -22,7 +22,6 @@ if (!defined('IN_PHPBB'))
|
||||||
function generate_smilies($mode, $forum_id)
|
function generate_smilies($mode, $forum_id)
|
||||||
{
|
{
|
||||||
global $auth, $db, $user, $config, $template;
|
global $auth, $db, $user, $config, $template;
|
||||||
global $phpEx, $phpbb_root_path;
|
|
||||||
|
|
||||||
if ($mode == 'window')
|
if ($mode == 'window')
|
||||||
{
|
{
|
||||||
|
@ -89,7 +88,7 @@ function generate_smilies($mode, $forum_id)
|
||||||
$template->assign_block_vars('smiley', array(
|
$template->assign_block_vars('smiley', array(
|
||||||
'SMILEY_CODE' => $row['code'],
|
'SMILEY_CODE' => $row['code'],
|
||||||
'A_SMILEY_CODE' => addslashes($row['code']),
|
'A_SMILEY_CODE' => addslashes($row['code']),
|
||||||
'SMILEY_IMG' => $phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url'],
|
'SMILEY_IMG' => PHPBB_ROOT_PATH . $config['smilies_path'] . '/' . $row['smiley_url'],
|
||||||
'SMILEY_WIDTH' => $row['smiley_width'],
|
'SMILEY_WIDTH' => $row['smiley_width'],
|
||||||
'SMILEY_HEIGHT' => $row['smiley_height'],
|
'SMILEY_HEIGHT' => $row['smiley_height'],
|
||||||
'SMILEY_DESC' => $row['emotion'])
|
'SMILEY_DESC' => $row['emotion'])
|
||||||
|
@ -101,7 +100,7 @@ function generate_smilies($mode, $forum_id)
|
||||||
{
|
{
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_SHOW_SMILEY_LINK' => true,
|
'S_SHOW_SMILEY_LINK' => true,
|
||||||
'U_MORE_SMILIES' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&f=' . $forum_id))
|
'U_MORE_SMILIES' => append_sid('posting', 'mode=smilies&f=' . $forum_id))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,7 +245,7 @@ function update_post_information($type, $ids, $return_update_sql = false)
|
||||||
*/
|
*/
|
||||||
function posting_gen_topic_icons($mode, $icon_id)
|
function posting_gen_topic_icons($mode, $icon_id)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $config, $template, $cache;
|
global $config, $template, $cache;
|
||||||
|
|
||||||
// Grab icons
|
// Grab icons
|
||||||
$icons = cache::obtain_icons();
|
$icons = cache::obtain_icons();
|
||||||
|
@ -264,7 +263,7 @@ function posting_gen_topic_icons($mode, $icon_id)
|
||||||
{
|
{
|
||||||
$template->assign_block_vars('topic_icon', array(
|
$template->assign_block_vars('topic_icon', array(
|
||||||
'ICON_ID' => $id,
|
'ICON_ID' => $id,
|
||||||
'ICON_IMG' => $phpbb_root_path . $config['icons_path'] . '/' . $data['img'],
|
'ICON_IMG' => PHPBB_ROOT_PATH . $config['icons_path'] . '/' . $data['img'],
|
||||||
'ICON_WIDTH' => $data['width'],
|
'ICON_WIDTH' => $data['width'],
|
||||||
'ICON_HEIGHT' => $data['height'],
|
'ICON_HEIGHT' => $data['height'],
|
||||||
|
|
||||||
|
@ -349,13 +348,12 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
|
||||||
function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false)
|
function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false)
|
||||||
{
|
{
|
||||||
global $auth, $user, $config, $db, $cache;
|
global $auth, $user, $config, $db, $cache;
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$filedata = array(
|
$filedata = array(
|
||||||
'error' => array()
|
'error' => array()
|
||||||
);
|
);
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_upload.' . PHP_EXT);
|
||||||
$upload = new fileupload();
|
$upload = new fileupload();
|
||||||
|
|
||||||
if ($config['check_attachment_content'])
|
if ($config['check_attachment_content'])
|
||||||
|
@ -463,7 +461,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check free disk space
|
// Check free disk space
|
||||||
if ($free_space = @disk_free_space($phpbb_root_path . $config['upload_path']))
|
if ($free_space = @disk_free_space(PHPBB_ROOT_PATH . $config['upload_path']))
|
||||||
{
|
{
|
||||||
if ($free_space <= $file->get('filesize'))
|
if ($free_space <= $file->get('filesize'))
|
||||||
{
|
{
|
||||||
|
@ -763,7 +761,7 @@ function posting_gen_inline_attachments(&$attachment_data)
|
||||||
*/
|
*/
|
||||||
function posting_gen_attachment_entry($attachment_data, &$filename_data)
|
function posting_gen_attachment_entry($attachment_data, &$filename_data)
|
||||||
{
|
{
|
||||||
global $template, $config, $phpbb_root_path, $phpEx, $user;
|
global $template, $config, $user;
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_SHOW_ATTACH_BOX' => true)
|
'S_SHOW_ATTACH_BOX' => true)
|
||||||
|
@ -788,7 +786,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data)
|
||||||
$hidden .= '<input type="hidden" name="attachment_data[' . $count . '][' . $key . ']" value="' . $value . '" />';
|
$hidden .= '<input type="hidden" name="attachment_data[' . $count . '][' . $key . ']" value="' . $value . '" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
$download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $user->session_id : false);
|
$download_link = append_sid('download/file', 'mode=view&id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $user->session_id : false);
|
||||||
|
|
||||||
$template->assign_block_vars('attach_row', array(
|
$template->assign_block_vars('attach_row', array(
|
||||||
'FILENAME' => basename($attach_row['real_filename']),
|
'FILENAME' => basename($attach_row['real_filename']),
|
||||||
|
@ -822,7 +820,6 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data)
|
||||||
function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
|
function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
|
||||||
{
|
{
|
||||||
global $user, $db, $template, $auth;
|
global $user, $db, $template, $auth;
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$topic_ids = $forum_ids = $draft_rows = array();
|
$topic_ids = $forum_ids = $draft_rows = array();
|
||||||
|
|
||||||
|
@ -895,24 +892,24 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
|
||||||
$topic_forum_id = ($topic_rows[$draft['topic_id']]['forum_id']) ? $topic_rows[$draft['topic_id']]['forum_id'] : $forum_id;
|
$topic_forum_id = ($topic_rows[$draft['topic_id']]['forum_id']) ? $topic_rows[$draft['topic_id']]['forum_id'] : $forum_id;
|
||||||
|
|
||||||
$link_topic = true;
|
$link_topic = true;
|
||||||
$view_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_forum_id . '&t=' . $draft['topic_id']);
|
$view_url = append_sid('viewtopic', 'f=' . $topic_forum_id . '&t=' . $draft['topic_id']);
|
||||||
$title = $topic_rows[$draft['topic_id']]['topic_title'];
|
$title = $topic_rows[$draft['topic_id']]['topic_title'];
|
||||||
|
|
||||||
$insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $topic_forum_id . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']);
|
$insert_url = append_sid('posting', 'f=' . $topic_forum_id . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']);
|
||||||
}
|
}
|
||||||
else if ($draft['forum_id'] && $auth->acl_get('f_read', $draft['forum_id']))
|
else if ($draft['forum_id'] && $auth->acl_get('f_read', $draft['forum_id']))
|
||||||
{
|
{
|
||||||
$link_forum = true;
|
$link_forum = true;
|
||||||
$view_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $draft['forum_id']);
|
$view_url = append_sid('viewforum', 'f=' . $draft['forum_id']);
|
||||||
$title = $draft['forum_name'];
|
$title = $draft['forum_name'];
|
||||||
|
|
||||||
$insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']);
|
$insert_url = append_sid('posting', 'f=' . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Either display as PM draft if forum_id and topic_id are empty or if access to the forums has been denied afterwards...
|
// Either display as PM draft if forum_id and topic_id are empty or if access to the forums has been denied afterwards...
|
||||||
$link_pm = true;
|
$link_pm = true;
|
||||||
$insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&d={$draft['draft_id']}");
|
$insert_url = append_sid('ucp', "i=$id&mode=compose&d={$draft['draft_id']}");
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('draftrow', array(
|
$template->assign_block_vars('draftrow', array(
|
||||||
|
@ -936,8 +933,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
|
||||||
*/
|
*/
|
||||||
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
|
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
|
||||||
{
|
{
|
||||||
global $user, $auth, $db, $template, $bbcode, $cache;
|
global $user, $auth, $db, $template, $bbcode, $cache, $config;
|
||||||
global $config, $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
// Go ahead and pull all data for this topic
|
// Go ahead and pull all data for this topic
|
||||||
$sql = 'SELECT p.post_id
|
$sql = 'SELECT p.post_id
|
||||||
|
@ -995,7 +991,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||||
// Instantiate BBCode class
|
// Instantiate BBCode class
|
||||||
if (!isset($bbcode) && $bbcode_bitfield !== '')
|
if (!isset($bbcode) && $bbcode_bitfield !== '')
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
|
||||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1075,8 +1071,8 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||||
'MESSAGE' => $message,
|
'MESSAGE' => $message,
|
||||||
'DECODED_MESSAGE' => $decoded_message,
|
'DECODED_MESSAGE' => $decoded_message,
|
||||||
'POST_ID' => $row['post_id'],
|
'POST_ID' => $row['post_id'],
|
||||||
'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
|
'U_MINI_POST' => append_sid('viewtopic', 'p=' . $row['post_id']) . '#p' . $row['post_id'],
|
||||||
'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
|
'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid('mcp', 'i=main&mode=post_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
|
||||||
'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '')
|
'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1107,7 +1103,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||||
*/
|
*/
|
||||||
function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id)
|
function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id)
|
||||||
{
|
{
|
||||||
global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;
|
global $db, $user, $config, $auth;
|
||||||
|
|
||||||
$topic_notification = ($mode == 'reply' || $mode == 'quote') ? true : false;
|
$topic_notification = ($mode == 'reply' || $mode == 'quote') ? true : false;
|
||||||
$forum_notification = ($mode == 'post') ? true : false;
|
$forum_notification = ($mode == 'post') ? true : false;
|
||||||
|
@ -1238,7 +1234,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
|
||||||
// Now, we are able to really send out notifications
|
// Now, we are able to really send out notifications
|
||||||
if (sizeof($msg_users))
|
if (sizeof($msg_users))
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
|
||||||
$messenger = new messenger();
|
$messenger = new messenger();
|
||||||
|
|
||||||
$msg_list_ary = array();
|
$msg_list_ary = array();
|
||||||
|
@ -1268,11 +1264,11 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
|
||||||
'TOPIC_TITLE' => htmlspecialchars_decode($topic_title),
|
'TOPIC_TITLE' => htmlspecialchars_decode($topic_title),
|
||||||
'FORUM_NAME' => htmlspecialchars_decode($forum_name),
|
'FORUM_NAME' => htmlspecialchars_decode($forum_name),
|
||||||
|
|
||||||
'U_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id",
|
'U_FORUM' => generate_board_url() . '/viewforum.' . PHP_EXT . "?f=$forum_id",
|
||||||
'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id",
|
'U_TOPIC' => generate_board_url() . '/viewtopic.' . PHP_EXT . "?f=$forum_id&t=$topic_id",
|
||||||
'U_NEWEST_POST' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id",
|
'U_NEWEST_POST' => generate_board_url() . '/viewtopic.' . PHP_EXT . "?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id",
|
||||||
'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&unwatch=topic",
|
'U_STOP_WATCHING_TOPIC' => generate_board_url() . '/viewtopic.' . PHP_EXT . "?f=$forum_id&t=$topic_id&unwatch=topic",
|
||||||
'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&unwatch=forum",
|
'U_STOP_WATCHING_FORUM' => generate_board_url() . '/viewforum.' . PHP_EXT . "?f=$forum_id&unwatch=forum",
|
||||||
));
|
));
|
||||||
|
|
||||||
$messenger->send($addr['method']);
|
$messenger->send($addr['method']);
|
||||||
|
@ -1333,8 +1329,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
|
||||||
*/
|
*/
|
||||||
function delete_post($forum_id, $topic_id, $post_id, &$data)
|
function delete_post($forum_id, $topic_id, $post_id, &$data)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth;
|
global $db, $user, $auth, $config;
|
||||||
global $config, $phpEx, $phpbb_root_path;
|
|
||||||
|
|
||||||
// Specify our post mode
|
// Specify our post mode
|
||||||
$post_mode = 'delete';
|
$post_mode = 'delete';
|
||||||
|
@ -1353,7 +1348,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
|
||||||
$sql_data = array();
|
$sql_data = array();
|
||||||
$next_post_id = false;
|
$next_post_id = false;
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||||
|
|
||||||
$db->sql_transaction('begin');
|
$db->sql_transaction('begin');
|
||||||
|
|
||||||
|
@ -1555,7 +1550,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
|
||||||
*/
|
*/
|
||||||
function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true)
|
function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true)
|
||||||
{
|
{
|
||||||
global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path;
|
global $db, $auth, $user, $config, $template;
|
||||||
|
|
||||||
// We do not handle erasing posts here
|
// We do not handle erasing posts here
|
||||||
if ($mode == 'delete')
|
if ($mode == 'delete')
|
||||||
|
@ -2053,7 +2048,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// insert attachment into db
|
// insert attachment into db
|
||||||
if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
|
if (!@file_exists(PHPBB_ROOT_PATH . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -2346,14 +2341,14 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
// Select the search method and do some additional checks to ensure it can actually be utilised
|
// Select the search method and do some additional checks to ensure it can actually be utilised
|
||||||
$search_type = basename($config['search_type']);
|
$search_type = basename($config['search_type']);
|
||||||
|
|
||||||
if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
|
if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
|
||||||
{
|
{
|
||||||
trigger_error('NO_SUCH_SEARCH_MODULE');
|
trigger_error('NO_SUCH_SEARCH_MODULE');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists($search_type))
|
if (!class_exists($search_type))
|
||||||
{
|
{
|
||||||
include("{$phpbb_root_path}includes/search/$search_type.$phpEx");
|
include(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
|
@ -2447,7 +2442,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
$params .= '&t=' . $data['topic_id'];
|
$params .= '&t=' . $data['topic_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx";
|
$url = (!$params) ? 'viewforum' : 'viewtopic';
|
||||||
$url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor;
|
$url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor;
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
|
|
|
@ -116,7 +116,6 @@ $global_rule_conditions = array(
|
||||||
function get_folder($user_id, $folder_id = false)
|
function get_folder($user_id, $folder_id = false)
|
||||||
{
|
{
|
||||||
global $db, $user, $template;
|
global $db, $user, $template;
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$folder = array();
|
$folder = array();
|
||||||
|
|
||||||
|
@ -200,7 +199,7 @@ function get_folder($user_id, $folder_id = false)
|
||||||
'NUM_MESSAGES' => $folder_ary['num_messages'],
|
'NUM_MESSAGES' => $folder_ary['num_messages'],
|
||||||
'UNREAD_MESSAGES' => $folder_ary['unread_messages'],
|
'UNREAD_MESSAGES' => $folder_ary['unread_messages'],
|
||||||
|
|
||||||
'U_FOLDER' => ($f_id > 0) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $f_id) : append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $folder_id_name),
|
'U_FOLDER' => ($f_id > 0) ? append_sid('ucp', 'i=pm&folder=' . $f_id) : append_sid('ucp', 'i=pm&folder=' . $folder_id_name),
|
||||||
|
|
||||||
'S_CUR_FOLDER' => ($f_id === $folder_id) ? true : false,
|
'S_CUR_FOLDER' => ($f_id === $folder_id) ? true : false,
|
||||||
'S_UNREAD_MESSAGES' => ($folder_ary['unread_messages']) ? true : false,
|
'S_UNREAD_MESSAGES' => ($folder_ary['unread_messages']) ? true : false,
|
||||||
|
@ -731,7 +730,6 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
|
||||||
function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_folder_id)
|
function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_folder_id)
|
||||||
{
|
{
|
||||||
global $db, $user;
|
global $db, $user;
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$num_moved = 0;
|
$num_moved = 0;
|
||||||
|
|
||||||
|
@ -762,7 +760,7 @@ function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_fol
|
||||||
if ($message_limit && $row['pm_count'] + sizeof($move_msg_ids) > $message_limit)
|
if ($message_limit && $row['pm_count'] + sizeof($move_msg_ids) > $message_limit)
|
||||||
{
|
{
|
||||||
$message = sprintf($user->lang['NOT_ENOUGH_SPACE_FOLDER'], $row['folder_name']) . '<br /><br />';
|
$message = sprintf($user->lang['NOT_ENOUGH_SPACE_FOLDER'], $row['folder_name']) . '<br /><br />';
|
||||||
$message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $row['folder_id']) . '">', '</a>', $row['folder_name']);
|
$message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . append_sid('ucp', 'i=pm&folder=' . $row['folder_id']) . '">', '</a>', $row['folder_name']);
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -779,7 +777,7 @@ function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_fol
|
||||||
if ($message_limit && $num_messages + sizeof($move_msg_ids) > $message_limit)
|
if ($message_limit && $num_messages + sizeof($move_msg_ids) > $message_limit)
|
||||||
{
|
{
|
||||||
$message = sprintf($user->lang['NOT_ENOUGH_SPACE_FOLDER'], $user->lang['PM_INBOX']) . '<br /><br />';
|
$message = sprintf($user->lang['NOT_ENOUGH_SPACE_FOLDER'], $user->lang['PM_INBOX']) . '<br /><br />';
|
||||||
$message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox') . '">', '</a>', $user->lang['PM_INBOX']);
|
$message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . append_sid('ucp', 'i=pm&folder=inbox') . '">', '</a>', $user->lang['PM_INBOX']);
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -868,7 +866,7 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
|
||||||
*/
|
*/
|
||||||
function handle_mark_actions($user_id, $mark_action)
|
function handle_mark_actions($user_id, $mark_action)
|
||||||
{
|
{
|
||||||
global $db, $user, $phpbb_root_path, $phpEx;
|
global $db, $user;
|
||||||
|
|
||||||
$msg_ids = request_var('marked_msg_id', array(0));
|
$msg_ids = request_var('marked_msg_id', array(0));
|
||||||
$cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX);
|
$cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX);
|
||||||
|
@ -899,7 +897,7 @@ function handle_mark_actions($user_id, $mark_action)
|
||||||
delete_pm($user_id, $msg_ids, $cur_folder_id);
|
delete_pm($user_id, $msg_ids, $cur_folder_id);
|
||||||
|
|
||||||
$success_msg = (sizeof($msg_ids) == 1) ? 'MESSAGE_DELETED' : 'MESSAGES_DELETED';
|
$success_msg = (sizeof($msg_ids) == 1) ? 'MESSAGE_DELETED' : 'MESSAGES_DELETED';
|
||||||
$redirect = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $cur_folder_id);
|
$redirect = append_sid('ucp', 'i=pm&folder=' . $cur_folder_id);
|
||||||
|
|
||||||
meta_refresh(3, $redirect);
|
meta_refresh(3, $redirect);
|
||||||
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FOLDER'], '<a href="' . $redirect . '">', '</a>'));
|
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FOLDER'], '<a href="' . $redirect . '">', '</a>'));
|
||||||
|
@ -1105,7 +1103,7 @@ function rebuild_header($check_ary)
|
||||||
*/
|
*/
|
||||||
function write_pm_addresses($check_ary, $author_id, $plaintext = false)
|
function write_pm_addresses($check_ary, $author_id, $plaintext = false)
|
||||||
{
|
{
|
||||||
global $db, $user, $template, $phpbb_root_path, $phpEx;
|
global $db, $user, $template;
|
||||||
|
|
||||||
$addresses = array();
|
$addresses = array();
|
||||||
|
|
||||||
|
@ -1228,7 +1226,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$tpl_ary = array_merge($tpl_ary, array(
|
$tpl_ary = array_merge($tpl_ary, array(
|
||||||
'U_VIEW' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $id),
|
'U_VIEW' => append_sid('memberlist', 'mode=group&g=' . $id),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1281,7 +1279,7 @@ function get_folder_status($folder_id, $folder)
|
||||||
*/
|
*/
|
||||||
function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
|
function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
|
||||||
{
|
{
|
||||||
global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path;
|
global $db, $auth, $config, $template, $user;
|
||||||
|
|
||||||
// We do not handle erasing pms here
|
// We do not handle erasing pms here
|
||||||
if ($mode == 'delete')
|
if ($mode == 'delete')
|
||||||
|
@ -1528,7 +1526,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// insert attachment into db
|
// insert attachment into db
|
||||||
if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
|
if (!@file_exists(PHPBB_ROOT_PATH . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1585,7 +1583,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
|
||||||
*/
|
*/
|
||||||
function pm_notification($mode, $author, $recipients, $subject, $message)
|
function pm_notification($mode, $author, $recipients, $subject, $message)
|
||||||
{
|
{
|
||||||
global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;
|
global $db, $user, $config, $auth;
|
||||||
|
|
||||||
$subject = censor_text($subject);
|
$subject = censor_text($subject);
|
||||||
|
|
||||||
|
@ -1640,7 +1638,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
|
||||||
$messenger = new messenger();
|
$messenger = new messenger();
|
||||||
|
|
||||||
foreach ($msg_list_ary as $pos => $addr)
|
foreach ($msg_list_ary as $pos => $addr)
|
||||||
|
@ -1655,7 +1653,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
|
||||||
'AUTHOR_NAME' => htmlspecialchars_decode($author),
|
'AUTHOR_NAME' => htmlspecialchars_decode($author),
|
||||||
'USERNAME' => htmlspecialchars_decode($addr['name']),
|
'USERNAME' => htmlspecialchars_decode($addr['name']),
|
||||||
|
|
||||||
'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&folder=inbox")
|
'U_INBOX' => generate_board_url() . '/ucp.' . PHP_EXT . '?i=pm&folder=inbox')
|
||||||
);
|
);
|
||||||
|
|
||||||
$messenger->send($addr['method']);
|
$messenger->send($addr['method']);
|
||||||
|
@ -1672,7 +1670,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
|
||||||
*/
|
*/
|
||||||
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
|
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
|
||||||
{
|
{
|
||||||
global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode;
|
global $db, $user, $config, $template, $auth, $bbcode;
|
||||||
|
|
||||||
// Get History Messages (could be newer)
|
// Get History Messages (could be newer)
|
||||||
$sql = 'SELECT t.*, p.*, u.*
|
$sql = 'SELECT t.*, p.*, u.*
|
||||||
|
@ -1703,7 +1701,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
|
||||||
|
|
||||||
$rowset = array();
|
$rowset = array();
|
||||||
$bbcode_bitfield = '';
|
$bbcode_bitfield = '';
|
||||||
$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&folder=';
|
$folder_url = append_sid('ucp', 'i=pm') . '&folder=';
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -1736,14 +1734,14 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
|
||||||
{
|
{
|
||||||
if (!class_exists('bbcode'))
|
if (!class_exists('bbcode'))
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = censor_text($title);
|
$title = censor_text($title);
|
||||||
|
|
||||||
$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
|
$url = append_sid('ucp', 'i=pm');
|
||||||
$next_history_pm = $previous_history_pm = $prev_id = 0;
|
$next_history_pm = $previous_history_pm = $prev_id = 0;
|
||||||
|
|
||||||
foreach ($rowset as $id => $row)
|
foreach ($rowset as $id => $row)
|
||||||
|
|
|
@ -728,8 +728,7 @@ class custom_profile
|
||||||
*/
|
*/
|
||||||
private function generate_text($profile_row, $preview = false)
|
private function generate_text($profile_row, $preview = false)
|
||||||
{
|
{
|
||||||
global $template;
|
global $template, $user;
|
||||||
global $user, $phpEx, $phpbb_root_path;
|
|
||||||
|
|
||||||
$field_length = explode('|', $profile_row['field_length']);
|
$field_length = explode('|', $profile_row['field_length']);
|
||||||
$profile_row['field_rows'] = $field_length[0];
|
$profile_row['field_rows'] = $field_length[0];
|
||||||
|
@ -838,7 +837,6 @@ class custom_profile
|
||||||
*/
|
*/
|
||||||
private function get_profile_field($profile_row)
|
private function get_profile_field($profile_row)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$var_name = 'pf_' . $profile_row['field_ident'];
|
$var_name = 'pf_' . $profile_row['field_ident'];
|
||||||
|
|
|
@ -735,9 +735,7 @@ class template_compile
|
||||||
*/
|
*/
|
||||||
public function compile_write($handle, $data)
|
public function compile_write($handle, $data)
|
||||||
{
|
{
|
||||||
global $phpEx;
|
$filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . PHP_EXT;
|
||||||
|
|
||||||
$filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx;
|
|
||||||
|
|
||||||
if ($fp = @fopen($filename, 'wb'))
|
if ($fp = @fopen($filename, 'wb'))
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,13 +38,11 @@ class transfer
|
||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
|
||||||
|
|
||||||
$this->file_perms = 0644;
|
$this->file_perms = 0644;
|
||||||
$this->dir_perms = 0777;
|
$this->dir_perms = 0777;
|
||||||
|
|
||||||
// We use the store directory as temporary path to circumvent open basedir restrictions
|
// We use the store directory as temporary path to circumvent open basedir restrictions
|
||||||
$this->tmp_path = $phpbb_root_path . 'store/';
|
$this->tmp_path = PHPBB_ROOT_PATH . 'store/';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,9 +50,7 @@ class transfer
|
||||||
*/
|
*/
|
||||||
public function write_file($destination_file = '', $contents = '')
|
public function write_file($destination_file = '', $contents = '')
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$destination_file = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $destination_file);
|
||||||
|
|
||||||
$destination_file = $this->root_path . str_replace($phpbb_root_path, '', $destination_file);
|
|
||||||
|
|
||||||
// need to create a temp file and then move that temp file.
|
// need to create a temp file and then move that temp file.
|
||||||
// ftp functions can only move files around and can't create.
|
// ftp functions can only move files around and can't create.
|
||||||
|
@ -104,9 +100,7 @@ class transfer
|
||||||
*/
|
*/
|
||||||
public function make_dir($dir)
|
public function make_dir($dir)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$dir = str_replace(PHPBB_ROOT_PATH, '', $dir);
|
||||||
|
|
||||||
$dir = str_replace($phpbb_root_path, '', $dir);
|
|
||||||
$dir = explode('/', $dir);
|
$dir = explode('/', $dir);
|
||||||
$dirs = '';
|
$dirs = '';
|
||||||
|
|
||||||
|
@ -120,7 +114,7 @@ class transfer
|
||||||
}
|
}
|
||||||
$cur_dir = $dir[$i] . '/';
|
$cur_dir = $dir[$i] . '/';
|
||||||
|
|
||||||
if (!file_exists($phpbb_root_path . $dirs . $cur_dir))
|
if (!file_exists(PHPBB_ROOT_PATH . $dirs . $cur_dir))
|
||||||
{
|
{
|
||||||
// create the directory
|
// create the directory
|
||||||
$result = $this->_mkdir($dir[$i]);
|
$result = $this->_mkdir($dir[$i]);
|
||||||
|
@ -144,10 +138,8 @@ class transfer
|
||||||
*/
|
*/
|
||||||
public function copy_file($from_loc, $to_loc)
|
public function copy_file($from_loc, $to_loc)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$from_loc = ((strpos($from_loc, PHPBB_ROOT_PATH) !== 0) ? PHPBB_ROOT_PATH : '') . $from_loc;
|
||||||
|
$to_loc = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $to_loc);
|
||||||
$from_loc = ((strpos($from_loc, $phpbb_root_path) !== 0) ? $phpbb_root_path : '') . $from_loc;
|
|
||||||
$to_loc = $this->root_path . str_replace($phpbb_root_path, '', $to_loc);
|
|
||||||
|
|
||||||
if (!file_exists($from_loc))
|
if (!file_exists($from_loc))
|
||||||
{
|
{
|
||||||
|
@ -164,9 +156,7 @@ class transfer
|
||||||
*/
|
*/
|
||||||
public function delete_file($file)
|
public function delete_file($file)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$file = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $file);
|
||||||
|
|
||||||
$file = $this->root_path . str_replace($phpbb_root_path, '', $file);
|
|
||||||
|
|
||||||
return $this->_delete($file);
|
return $this->_delete($file);
|
||||||
}
|
}
|
||||||
|
@ -177,9 +167,7 @@ class transfer
|
||||||
*/
|
*/
|
||||||
public function remove_dir($dir)
|
public function remove_dir($dir)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$dir = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $dir);
|
||||||
|
|
||||||
$dir = $this->root_path . str_replace($phpbb_root_path, '', $dir);
|
|
||||||
|
|
||||||
return $this->_rmdir($dir);
|
return $this->_rmdir($dir);
|
||||||
}
|
}
|
||||||
|
@ -189,9 +177,7 @@ class transfer
|
||||||
*/
|
*/
|
||||||
public function rename($old_handle, $new_handle)
|
public function rename($old_handle, $new_handle)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$old_handle = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $old_handle);
|
||||||
|
|
||||||
$old_handle = $this->root_path . str_replace($phpbb_root_path, '', $old_handle);
|
|
||||||
|
|
||||||
return $this->_rename($old_handle, $new_handle);
|
return $this->_rename($old_handle, $new_handle);
|
||||||
}
|
}
|
||||||
|
@ -201,9 +187,7 @@ class transfer
|
||||||
*/
|
*/
|
||||||
public function file_exists($directory, $filename)
|
public function file_exists($directory, $filename)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
$directory = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $directory);
|
||||||
|
|
||||||
$directory = $this->root_path . str_replace($phpbb_root_path, '', $directory);
|
|
||||||
|
|
||||||
$this->_chdir($directory);
|
$this->_chdir($directory);
|
||||||
$result = $this->_ls('');
|
$result = $this->_ls('');
|
||||||
|
|
|
@ -268,7 +268,7 @@ class filespec
|
||||||
*/
|
*/
|
||||||
function move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = 0666)
|
function move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = 0666)
|
||||||
{
|
{
|
||||||
global $user, $phpbb_root_path;
|
global $user;
|
||||||
|
|
||||||
if (sizeof($this->error))
|
if (sizeof($this->error))
|
||||||
{
|
{
|
||||||
|
@ -276,7 +276,7 @@ class filespec
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to trust the admin in specifying valid upload directories and an attacker not being able to overwrite it...
|
// We need to trust the admin in specifying valid upload directories and an attacker not being able to overwrite it...
|
||||||
$this->destination_path = $phpbb_root_path . $destination;
|
$this->destination_path = PHPBB_ROOT_PATH . $destination;
|
||||||
|
|
||||||
// Check if the destination path exist...
|
// Check if the destination path exist...
|
||||||
if (!file_exists($this->destination_path))
|
if (!file_exists($this->destination_path))
|
||||||
|
@ -693,7 +693,7 @@ class fileupload
|
||||||
*/
|
*/
|
||||||
function remote_upload($upload_url)
|
function remote_upload($upload_url)
|
||||||
{
|
{
|
||||||
global $user, $phpbb_root_path;
|
global $user;
|
||||||
|
|
||||||
$upload_ary = array();
|
$upload_ary = array();
|
||||||
$upload_ary['local_mode'] = true;
|
$upload_ary['local_mode'] = true;
|
||||||
|
@ -783,7 +783,7 @@ class fileupload
|
||||||
return $file;
|
return $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $phpbb_root_path . 'cache';
|
$tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : PHPBB_ROOT_PATH . 'cache';
|
||||||
$filename = tempnam($tmp_path, unique_id() . '-');
|
$filename = tempnam($tmp_path, unique_id() . '-');
|
||||||
|
|
||||||
if (!($fp = @fopen($filename, 'wb')))
|
if (!($fp = @fopen($filename, 'wb')))
|
||||||
|
|
|
@ -151,7 +151,7 @@ function user_update_name($old_name, $new_name)
|
||||||
*/
|
*/
|
||||||
function user_add($user_row, $cp_data = false)
|
function user_add($user_row, $cp_data = false)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $config, $phpbb_root_path, $phpEx;
|
global $db, $user, $auth, $config;
|
||||||
|
|
||||||
if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type']))
|
if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type']))
|
||||||
{
|
{
|
||||||
|
@ -256,7 +256,7 @@ function user_add($user_row, $cp_data = false)
|
||||||
|
|
||||||
if (!class_exists('custom_profile'))
|
if (!class_exists('custom_profile'))
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' .
|
$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' .
|
||||||
|
@ -301,7 +301,6 @@ function user_add($user_row, $cp_data = false)
|
||||||
function user_delete($mode, $user_id, $post_username = false)
|
function user_delete($mode, $user_id, $post_username = false)
|
||||||
{
|
{
|
||||||
global $cache, $config, $db, $user, $auth;
|
global $cache, $config, $db, $user, $auth;
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . USERS_TABLE . '
|
FROM ' . USERS_TABLE . '
|
||||||
|
@ -438,7 +437,7 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||||
|
|
||||||
if (!function_exists('delete_posts'))
|
if (!function_exists('delete_posts'))
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT topic_id, COUNT(post_id) AS total_posts
|
$sql = 'SELECT topic_id, COUNT(post_id) AS total_posts
|
||||||
|
@ -1769,7 +1768,7 @@ function validate_jabber($jid)
|
||||||
*/
|
*/
|
||||||
function avatar_delete($mode, $row, $clean_db = false)
|
function avatar_delete($mode, $row, $clean_db = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $config, $db, $user;
|
global $config, $db, $user;
|
||||||
|
|
||||||
// Check if the users avatar is actually *not* a group avatar
|
// Check if the users avatar is actually *not* a group avatar
|
||||||
if ($mode == 'user')
|
if ($mode == 'user')
|
||||||
|
@ -1785,9 +1784,9 @@ function avatar_delete($mode, $row, $clean_db = false)
|
||||||
avatar_remove_db($row[$mode . '_avatar']);
|
avatar_remove_db($row[$mode . '_avatar']);
|
||||||
}
|
}
|
||||||
$filename = get_avatar_filename($row[$mode . '_avatar']);
|
$filename = get_avatar_filename($row[$mode . '_avatar']);
|
||||||
if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . $filename))
|
if (file_exists(PHPBB_ROOT_PATH . $config['avatar_path'] . '/' . $filename))
|
||||||
{
|
{
|
||||||
@unlink($phpbb_root_path . $config['avatar_path'] . '/' . $filename);
|
@unlink(PHPBB_ROOT_PATH . $config['avatar_path'] . '/' . $filename);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1799,7 +1798,7 @@ function avatar_delete($mode, $row, $clean_db = false)
|
||||||
*/
|
*/
|
||||||
function avatar_remote($data, &$error)
|
function avatar_remote($data, &$error)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $phpbb_root_path, $phpEx;
|
global $config, $db, $user;
|
||||||
|
|
||||||
if (!preg_match('#^(http|https|ftp)://#i', $data['remotelink']))
|
if (!preg_match('#^(http|https|ftp)://#i', $data['remotelink']))
|
||||||
{
|
{
|
||||||
|
@ -1834,7 +1833,7 @@ function avatar_remote($data, &$error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check image type
|
// Check image type
|
||||||
include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_upload.' . PHP_EXT);
|
||||||
$types = fileupload::image_types();
|
$types = fileupload::image_types();
|
||||||
$extension = strtolower(filespec::get_extension($data['remotelink']));
|
$extension = strtolower(filespec::get_extension($data['remotelink']));
|
||||||
|
|
||||||
|
@ -1877,10 +1876,10 @@ function avatar_remote($data, &$error)
|
||||||
*/
|
*/
|
||||||
function avatar_upload($data, &$error)
|
function avatar_upload($data, &$error)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $config, $db, $user, $phpEx;
|
global $config, $db, $user;
|
||||||
|
|
||||||
// Init upload class
|
// Init upload class
|
||||||
include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_upload.' . PHP_EXT);
|
||||||
$upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], explode('|', $config['mime_triggers']));
|
$upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], explode('|', $config['mime_triggers']));
|
||||||
|
|
||||||
if (!empty($_FILES['uploadfile']['name']))
|
if (!empty($_FILES['uploadfile']['name']))
|
||||||
|
@ -1948,12 +1947,11 @@ function get_avatar_filename($avatar_entry)
|
||||||
*/
|
*/
|
||||||
function avatar_gallery($category, $avatar_select, $items_per_column, $block_var = 'avatar_row')
|
function avatar_gallery($category, $avatar_select, $items_per_column, $block_var = 'avatar_row')
|
||||||
{
|
{
|
||||||
global $user, $cache, $template;
|
global $user, $cache, $template, $config;
|
||||||
global $config, $phpbb_root_path;
|
|
||||||
|
|
||||||
$avatar_list = array();
|
$avatar_list = array();
|
||||||
|
|
||||||
$path = $phpbb_root_path . $config['avatar_gallery_path'];
|
$path = PHPBB_ROOT_PATH . $config['avatar_gallery_path'];
|
||||||
|
|
||||||
if (!file_exists($path) || !is_dir($path))
|
if (!file_exists($path) || !is_dir($path))
|
||||||
{
|
{
|
||||||
|
@ -2032,13 +2030,13 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var
|
||||||
foreach ($avatar_row_ary as $avatar_col_ary)
|
foreach ($avatar_row_ary as $avatar_col_ary)
|
||||||
{
|
{
|
||||||
$template->assign_block_vars($block_var . '.avatar_column', array(
|
$template->assign_block_vars($block_var . '.avatar_column', array(
|
||||||
'AVATAR_IMAGE' => $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
|
'AVATAR_IMAGE' => PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
|
||||||
'AVATAR_NAME' => $avatar_col_ary['name'],
|
'AVATAR_NAME' => $avatar_col_ary['name'],
|
||||||
'AVATAR_FILE' => $avatar_col_ary['filename'])
|
'AVATAR_FILE' => $avatar_col_ary['filename'])
|
||||||
);
|
);
|
||||||
|
|
||||||
$template->assign_block_vars($block_var . '.avatar_option_column', array(
|
$template->assign_block_vars($block_var . '.avatar_option_column', array(
|
||||||
'AVATAR_IMAGE' => $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
|
'AVATAR_IMAGE' => PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
|
||||||
'S_OPTIONS_AVATAR' => $avatar_col_ary['filename'])
|
'S_OPTIONS_AVATAR' => $avatar_col_ary['filename'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -2053,7 +2051,7 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var
|
||||||
*/
|
*/
|
||||||
function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $current_y = 0)
|
function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $current_y = 0)
|
||||||
{
|
{
|
||||||
global $config, $phpbb_root_path, $user;
|
global $config, $user;
|
||||||
|
|
||||||
switch ($avatar_type)
|
switch ($avatar_type)
|
||||||
{
|
{
|
||||||
|
@ -2061,11 +2059,11 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AVATAR_UPLOAD :
|
case AVATAR_UPLOAD :
|
||||||
$avatar = $phpbb_root_path . $config['avatar_path'] . '/' . get_avatar_filename($avatar);
|
$avatar = PHPBB_ROOT_PATH . $config['avatar_path'] . '/' . get_avatar_filename($avatar);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AVATAR_GALLERY :
|
case AVATAR_GALLERY :
|
||||||
$avatar = $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar ;
|
$avatar = PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $avatar ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2106,7 +2104,7 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $
|
||||||
*/
|
*/
|
||||||
function avatar_process_user(&$error, $custom_userdata = false)
|
function avatar_process_user(&$error, $custom_userdata = false)
|
||||||
{
|
{
|
||||||
global $config, $phpbb_root_path, $auth, $user, $db;
|
global $config, $auth, $user, $db;
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'uploadurl' => request_var('uploadurl', ''),
|
'uploadurl' => request_var('uploadurl', ''),
|
||||||
|
@ -2143,7 +2141,7 @@ function avatar_process_user(&$error, $custom_userdata = false)
|
||||||
$avatar_select = basename(request_var('avatar_select', ''));
|
$avatar_select = basename(request_var('avatar_select', ''));
|
||||||
|
|
||||||
// Can we upload?
|
// Can we upload?
|
||||||
$can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
|
$can_upload = ($config['allow_avatar_upload'] && file_exists(PHPBB_ROOT_PATH . $config['avatar_path']) && @is_writable(PHPBB_ROOT_PATH . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
|
||||||
|
|
||||||
if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload)
|
if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload)
|
||||||
{
|
{
|
||||||
|
@ -2161,14 +2159,14 @@ function avatar_process_user(&$error, $custom_userdata = false)
|
||||||
$sql_ary['user_avatar'] = $avatar_select;
|
$sql_ary['user_avatar'] = $avatar_select;
|
||||||
|
|
||||||
// check avatar gallery
|
// check avatar gallery
|
||||||
if (!is_dir($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category))
|
if (!is_dir(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category))
|
||||||
{
|
{
|
||||||
$sql_ary['user_avatar'] = '';
|
$sql_ary['user_avatar'] = '';
|
||||||
$sql_ary['user_avatar_type'] = $sql_ary['user_avatar_width'] = $sql_ary['user_avatar_height'] = 0;
|
$sql_ary['user_avatar_type'] = $sql_ary['user_avatar_width'] = $sql_ary['user_avatar_height'] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
list($sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $sql_ary['user_avatar']);
|
list($sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = getimagesize(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category . '/' . $sql_ary['user_avatar']);
|
||||||
$sql_ary['user_avatar'] = $category . '/' . $sql_ary['user_avatar'];
|
$sql_ary['user_avatar'] = $category . '/' . $sql_ary['user_avatar'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2260,7 +2258,7 @@ function avatar_process_user(&$error, $custom_userdata = false)
|
||||||
*/
|
*/
|
||||||
function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false)
|
function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $config, $db, $user, $file_upload;
|
global $config, $db, $user, $file_upload;
|
||||||
|
|
||||||
$error = array();
|
$error = array();
|
||||||
$attribute_ary = array(
|
$attribute_ary = array(
|
||||||
|
@ -2420,7 +2418,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
||||||
*/
|
*/
|
||||||
function group_correct_avatar($group_id, $old_entry)
|
function group_correct_avatar($group_id, $old_entry)
|
||||||
{
|
{
|
||||||
global $config, $db, $phpbb_root_path;
|
global $config, $db;
|
||||||
|
|
||||||
$group_id = (int)$group_id;
|
$group_id = (int)$group_id;
|
||||||
$ext = substr(strrchr($old_entry, '.'), 1);
|
$ext = substr(strrchr($old_entry, '.'), 1);
|
||||||
|
@ -2428,7 +2426,7 @@ function group_correct_avatar($group_id, $old_entry)
|
||||||
$new_filename = $config['avatar_salt'] . "_g$group_id.$ext";
|
$new_filename = $config['avatar_salt'] . "_g$group_id.$ext";
|
||||||
$new_entry = 'g' . $group_id . '_' . substr(time(), -5) . ".$ext";
|
$new_entry = 'g' . $group_id . '_' . substr(time(), -5) . ".$ext";
|
||||||
|
|
||||||
$avatar_path = $phpbb_root_path . $config['avatar_path'];
|
$avatar_path = PHPBB_ROOT_PATH . $config['avatar_path'];
|
||||||
if (@rename($avatar_path . '/'. $old_filename, $avatar_path . '/' . $new_filename))
|
if (@rename($avatar_path . '/'. $old_filename, $avatar_path . '/' . $new_filename))
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . GROUPS_TABLE . '
|
$sql = 'UPDATE ' . GROUPS_TABLE . '
|
||||||
|
@ -2459,7 +2457,7 @@ function avatar_remove_db($avatar_name)
|
||||||
*/
|
*/
|
||||||
function group_delete($group_id, $group_name = false)
|
function group_delete($group_id, $group_name = false)
|
||||||
{
|
{
|
||||||
global $db, $phpbb_root_path, $phpEx;
|
global $db;
|
||||||
|
|
||||||
if (!$group_name)
|
if (!$group_name)
|
||||||
{
|
{
|
||||||
|
@ -2513,7 +2511,7 @@ function group_delete($group_id, $group_name = false)
|
||||||
// Re-cache moderators
|
// Re-cache moderators
|
||||||
if (!function_exists('cache_moderators'))
|
if (!function_exists('cache_moderators'))
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
cache_moderators();
|
cache_moderators();
|
||||||
|
@ -2833,7 +2831,7 @@ function remove_default_rank($group_id, $user_ids)
|
||||||
*/
|
*/
|
||||||
function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)
|
function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)
|
||||||
{
|
{
|
||||||
global $db, $auth, $phpbb_root_path, $phpEx, $config;
|
global $db, $auth, $config;
|
||||||
|
|
||||||
// We need both username and user_id info
|
// We need both username and user_id info
|
||||||
$result = user_get_id_name($user_id_ary, $username_ary);
|
$result = user_get_id_name($user_id_ary, $username_ary);
|
||||||
|
@ -2891,7 +2889,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
// Send approved email to users...
|
// Send approved email to users...
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
|
||||||
$messenger = new messenger();
|
$messenger = new messenger();
|
||||||
|
|
||||||
foreach ($email_users as $row)
|
foreach ($email_users as $row)
|
||||||
|
@ -2904,8 +2902,8 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||||
$messenger->assign_vars(array(
|
$messenger->assign_vars(array(
|
||||||
'USERNAME' => htmlspecialchars_decode($row['username']),
|
'USERNAME' => htmlspecialchars_decode($row['username']),
|
||||||
'GROUP_NAME' => htmlspecialchars_decode($group_name),
|
'GROUP_NAME' => htmlspecialchars_decode($group_name),
|
||||||
'U_GROUP' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=membership")
|
'U_GROUP' => generate_board_url() . '/ucp.' . PHP_EXT . '?i=groups&mode=membership',
|
||||||
);
|
));
|
||||||
|
|
||||||
$messenger->send($row['user_notify_type']);
|
$messenger->send($row['user_notify_type']);
|
||||||
}
|
}
|
||||||
|
@ -3246,8 +3244,7 @@ function group_update_listings($group_id)
|
||||||
{
|
{
|
||||||
if (!function_exists('cache_moderators'))
|
if (!function_exists('cache_moderators'))
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
|
||||||
}
|
}
|
||||||
cache_moderators();
|
cache_moderators();
|
||||||
}
|
}
|
||||||
|
@ -3256,8 +3253,7 @@ function group_update_listings($group_id)
|
||||||
{
|
{
|
||||||
if (!function_exists('update_foes'))
|
if (!function_exists('update_foes'))
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||||
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
|
||||||
}
|
}
|
||||||
update_foes(array($group_id));
|
update_foes(array($group_id));
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue