aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_attachments.php12
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php8
-rw-r--r--phpBB/includes/acp/acp_bots.php4
-rw-r--r--phpBB/includes/acp/acp_captcha.php6
-rw-r--r--phpBB/includes/acp/acp_database.php8
-rwxr-xr-xphpBB/includes/acp/acp_inactive.php6
-rw-r--r--phpBB/includes/acp/acp_language.php4
-rw-r--r--phpBB/includes/acp/acp_main.php8
-rw-r--r--phpBB/includes/acp/acp_modules.php63
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php2
-rw-r--r--phpBB/includes/acp/acp_permissions.php8
-rw-r--r--phpBB/includes/acp/acp_search.php6
-rw-r--r--phpBB/includes/acp/acp_styles.php44
-rw-r--r--phpBB/includes/acp/acp_users.php2
-rw-r--r--phpBB/includes/functions.php22
-rw-r--r--phpBB/includes/ucp/ucp_pm.php2
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php2
17 files changed, 112 insertions, 95 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 36acaf0366..91d7c024f3 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -417,12 +417,12 @@ class acp_attachments
if ($action != 'add' && $action != 'edit')
{
- trigger_error('WRONG_MODE', E_USER_WARNING);
+ trigger_error('NO_MODE', E_USER_ERROR);
}
if (!$group_id && $action == 'edit')
{
- trigger_error('NO_EXT_GROUP_SPECIFIED', E_USER_WARNING);
+ trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($group_id)
@@ -592,7 +592,7 @@ class acp_attachments
if (!$group_id)
{
- trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@@ -784,7 +784,7 @@ class acp_attachments
if (!$group_id)
{
- trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
@@ -1362,7 +1362,7 @@ class acp_attachments
add_log('admin', $log_entry, $ip_list_log);
}
- trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']);
+ trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action));
}
else if (isset($_POST['unsecuresubmit']))
{
@@ -1391,7 +1391,7 @@ class acp_attachments
add_log('admin', 'LOG_DOWNLOAD_REMOVE_IP', $l_unip_list);
}
- trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']);
+ trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action));
}
}
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index aaa16deeda..68ef4d3134 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -47,7 +47,7 @@ class acp_bbcodes
if (!$row)
{
- trigger_error('BBCODE_NOT_EXIST', E_USER_WARNING);
+ trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$bbcode_match = $row['bbcode_match'];
@@ -66,7 +66,7 @@ class acp_bbcodes
if (!$row)
{
- trigger_error('BBCODE_NOT_EXIST', E_USER_WARNING);
+ trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// No break here
@@ -129,7 +129,7 @@ class acp_bbcodes
if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded))
{
- trigger_error('BBCODE_INVALID_TAG_NAME', E_USER_WARNING);
+ trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -170,7 +170,7 @@ class acp_bbcodes
if ($bbcode_id > 1511)
{
- trigger_error('TOO_MANY_BBCODES', E_USER_WARNING);
+ trigger_error($user->lang['TOO_MANY_BBCODES'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql_ary['bbcode_id'] = (int) $bbcode_id;
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index 5e633aaee2..2dbcc463e9 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -143,7 +143,7 @@ class acp_bots
$bot_row['bot_ip'] = str_replace(' ', '', $bot_row['bot_ip']);
// Make sure the admin is not adding a bot with an user agent similar to his one
- if ($bot_row['bot_agent'] && substr($user->data['session_browser'], 0, 149) === substr($bot_row['bot_agent']))
+ if ($bot_row['bot_agent'] && substr($user->data['session_browser'], 0, 149) === substr($bot_row['bot_agent'], 0, 149))
{
$error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA'];
}
@@ -165,7 +165,7 @@ class acp_bots
if (!$group_row)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING);
+ trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING);
}
$user_id = user_add(array(
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index b3d13c42f9..b16b76495f 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -86,17 +86,17 @@ class acp_captcha
if (!@extension_loaded('gd'))
{
- trigger_error($user->lang['NO_GD'], E_USER_WARNING);
+ trigger_error($user->lang['NO_GD'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!($policy === 'policy_entropy' || $policy === 'policy_3dbitmap') && (!function_exists('imagettfbbox') || !function_exists('imagettftext')))
{
- trigger_error($user->lang['NO_TTF'], E_USER_WARNING);
+ trigger_error($user->lang['NO_TTF'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!in_array($policy, $policy_modules))
{
- trigger_error($user->lang['BAD_POLICY'], E_USER_WARNING);
+ trigger_error($user->lang['BAD_POLICY'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$user->add_lang('ucp');
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 265f73114e..d4d4cf89b1 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -1051,7 +1051,7 @@ class acp_database
unset($sql_data);
add_log('admin', 'LOG_DB_BACKUP');
- trigger_error($user->lang['BACKUP_SUCCESS']);
+ trigger_error($user->lang['BACKUP_SUCCESS'] . adm_back_link($this->u_action));
break;
default:
@@ -1194,13 +1194,13 @@ class acp_database
if (!(file_exists($file_name) && is_readable($file_name)))
{
- trigger_error($user->lang['BACKUP_INVALID'], E_USER_WARNING);
+ trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($delete)
{
unlink($file_name);
- trigger_error($user->lang['BACKUP_DELETE']);
+ trigger_error($user->lang['BACKUP_DELETE'] . adm_back_link($this->u_action));
}
$data = file_get_contents($file_name);
@@ -1290,7 +1290,7 @@ class acp_database
}
}
add_log('admin', 'LOG_DB_RESTORE');
- trigger_error($user->lang['RESTORE_SUCCESS']);
+ trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action));
break;
default:
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php
index ebadb8446d..05db9fa95b 100755
--- a/phpBB/includes/acp/acp_inactive.php
+++ b/phpBB/includes/acp/acp_inactive.php
@@ -26,6 +26,8 @@ class acp_inactive
global $config, $db, $user, $auth, $template;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ $user->add_lang('memberlist');
+
$action = request_var('action', '');
$mark = (isset($_REQUEST['mark'])) ? request_var('mark', array(0)) : array();
$start = request_var('start', 0);
@@ -71,7 +73,7 @@ class acp_inactive
{
if (!$auth->acl_get('a_userdel'))
{
- trigger_error($user->lang['NO_ADMIN'], E_USER_WARNING);
+ trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'DELETE FROM ' . USER_GROUP_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark);
@@ -87,7 +89,7 @@ class acp_inactive
case 'remind':
if (empty($config['email_enable']))
{
- trigger_error($user->lang['EMAIL_DISABLED'], E_USER_WARNING);
+ trigger_error($user->lang['EMAIL_DISABLED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index 2c4e4f71f6..660f1fd421 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -201,7 +201,7 @@ class acp_language
if (!$fp)
{
- trigger_error($user->lang['UNABLE_TO_WRITE_FILE'], E_USER_WARNING);
+ trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($this->language_directory == 'email')
@@ -320,7 +320,7 @@ class acp_language
add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file);
- trigger_error($user->lang['UPLOAD_COMPLETED']);
+ trigger_error($user->lang['UPLOAD_COMPLETED'] . adm_back_link($this->u_action));
}
$action = 'details';
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index cefb80badc..87d8050e2f 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -56,7 +56,7 @@ class acp_main
case 'online':
if (!$auth->acl_get('a_board'))
{
- trigger_error($user->lang['NO_ADMIN'], E_USER_WARNING);
+ trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
set_config('record_online_users', 1, true);
@@ -67,7 +67,7 @@ class acp_main
case 'stats':
if (!$auth->acl_get('a_board'))
{
- trigger_error($user->lang['NO_ADMIN'], E_USER_WARNING);
+ trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT COUNT(post_id) AS stat
@@ -119,7 +119,7 @@ class acp_main
case 'user':
if (!$auth->acl_get('a_board'))
{
- trigger_error($user->lang['NO_ADMIN'], E_USER_WARNING);
+ trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
@@ -141,7 +141,7 @@ class acp_main
case 'date':
if (!$auth->acl_get('a_board'))
{
- trigger_error($user->lang['NO_ADMIN'], E_USER_WARNING);
+ trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
set_config('board_startdate', time() - 1);
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index e8d12b9d93..04457c0e13 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -24,6 +24,7 @@
class acp_modules
{
var $module_class = '';
+ var $parent_id;
var $u_action;
function main($id, $mode)
@@ -51,7 +52,7 @@ class acp_modules
$this->page_title = strtoupper($this->module_class);
- $parent_id = request_var('parent_id', 0);
+ $this->parent_id = request_var('parent_id', 0);
$module_id = request_var('m', 0);
$action = request_var('action', '');
$errors = array();
@@ -61,7 +62,7 @@ class acp_modules
case 'delete':
if (!$module_id)
{
- trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id), E_USER_WARNING);
+ trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
}
if (confirm_box(true))
@@ -71,7 +72,7 @@ class acp_modules
if (!sizeof($errors))
{
$this->remove_cache_file();
- trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
+ trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
}
}
else
@@ -79,7 +80,7 @@ class acp_modules
confirm_box(false, 'DELETE_MODULE', build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
- 'parent_id' => $parent_id,
+ 'parent_id' => $this->parent_id,
'module_id' => $module_id,
'action' => $action,
)));
@@ -91,7 +92,7 @@ class acp_modules
case 'disable':
if (!$module_id)
{
- trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id), E_USER_WARNING);
+ trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'UPDATE ' . MODULES_TABLE . '
@@ -108,7 +109,7 @@ class acp_modules
case 'move_down':
if (!$module_id)
{
- trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id), E_USER_WARNING);
+ trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'SELECT *
@@ -121,7 +122,7 @@ class acp_modules
if (!$row)
{
- trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id), E_USER_WARNING);
+ trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
}
$move_module_name = $this->move_module_by($row, $action, 1);
@@ -156,7 +157,7 @@ class acp_modules
'module_basename' => $module_basename,
'module_enabled' => 0,
'module_display' => (isset($fileinfo['modes'][$module_mode]['display'])) ? $fileinfo['modes'][$module_mode]['display'] : 1,
- 'parent_id' => $parent_id,
+ 'parent_id' => $this->parent_id,
'module_class' => $this->module_class,
'module_langname' => $fileinfo['modes'][$module_mode]['title'],
'module_mode' => $module_mode,
@@ -169,7 +170,7 @@ class acp_modules
{
$this->remove_cache_file();
- trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
+ trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
}
}
}
@@ -178,7 +179,7 @@ class acp_modules
confirm_box(false, 'ADD_MODULE', build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
- 'parent_id' => $parent_id,
+ 'parent_id' => $this->parent_id,
'action' => 'quickadd',
'quick_install' => $quick_install,
)));
@@ -190,7 +191,7 @@ class acp_modules
if (!$module_id)
{
- trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id), E_USER_WARNING);
+ trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
}
$module_row = $this->get_module_row($module_id);
@@ -228,7 +229,7 @@ class acp_modules
{
if (!$module_data['module_langname'])
{
- trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id), E_USER_WARNING);
+ trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
}
$module_type = request_var('module_type', 'category');
@@ -257,7 +258,7 @@ class acp_modules
{
$this->remove_cache_file();
- trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
+ trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
}
}
@@ -306,8 +307,8 @@ class acp_modules
'S_CAT_OPTIONS' => $s_cat_option . $this->make_module_select($module_data['parent_id'], ($action == 'edit') ? $module_row['module_id'] : false, false, false, false, true),
'S_MODULE_NAMES' => $s_name_options,
'S_MODULE_MODES' => $s_mode_options,
- 'U_BACK' => $this->u_action . '&parent_id=' . $parent_id,
- 'U_EDIT_ACTION' => $this->u_action . '&parent_id=' . $parent_id,
+ 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id,
+ 'U_EDIT_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id,
'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'],
@@ -341,7 +342,7 @@ class acp_modules
);
}
- if (!$parent_id)
+ if (!$this->parent_id)
{
$navigation = strtoupper($this->module_class);
}
@@ -349,12 +350,12 @@ class acp_modules
{
$navigation = '<a href="' . $this->u_action . '">' . strtoupper($this->module_class) . '</a>';
- $modules_nav = $this->get_module_branch($parent_id, 'parents', 'descending');
+ $modules_nav = $this->get_module_branch($this->parent_id, 'parents', 'descending');
foreach ($modules_nav as $row)
{
$langname = $this->lang_name($row['module_langname']);
- if ($row['module_id'] == $parent_id)
+ if ($row['module_id'] == $this->parent_id)
{
$navigation .= ' -&gt; ' . $langname;
}
@@ -366,11 +367,11 @@ class acp_modules
}
// Jumpbox
- $module_box = $this->make_module_select($parent_id, false, false, false, false);
+ $module_box = $this->make_module_select($this->parent_id, false, false, false, false);
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE parent_id = $parent_id
+ WHERE parent_id = {$this->parent_id}
AND module_class = '" . $db->sql_escape($this->module_class) . "'
ORDER BY left_id";
$result = $db->sql_query($sql);
@@ -390,7 +391,7 @@ class acp_modules
$module_image = (!$row['module_basename'] || $row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['CATEGORY'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['MODULE'] . '" />';
}
- $url = $this->u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
+ $url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;m=' . $row['module_id'];
$template->assign_block_vars('modules', array(
'MODULE_IMAGE' => $module_image,
@@ -409,11 +410,11 @@ class acp_modules
}
while ($row = $db->sql_fetchrow($result));
}
- else if ($parent_id)
+ else if ($this->parent_id)
{
- $row = $this->get_module_row($parent_id);
+ $row = $this->get_module_row($this->parent_id);
- $url = $this->u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
+ $url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;m=' . $row['module_id'];
$template->assign_vars(array(
'S_NO_MODULES' => true,
@@ -449,11 +450,11 @@ class acp_modules
}
$template->assign_vars(array(
- 'U_SEL_ACTION' => $this->u_action,
- 'U_ACTION' => $this->u_action . '&amp;parent_id=' . $parent_id,
- 'NAVIGATION' => $navigation,
- 'MODULE_BOX' => $module_box,
- 'PARENT_ID' => $parent_id,
+ 'U_SEL_ACTION' => $this->u_action,
+ 'U_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
+ 'NAVIGATION' => $navigation,
+ 'MODULE_BOX' => $module_box,
+ 'PARENT_ID' => $this->parent_id,
'S_INSTALL_OPTIONS' => $s_install_options,
)
);
@@ -476,7 +477,7 @@ class acp_modules
if (!$row)
{
- trigger_error($user->lang['NO_MODULE'], E_USER_WARNING);
+ trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
return $row;
@@ -721,7 +722,7 @@ class acp_modules
return 'PARENT_NO_EXIST';
}
- trigger_error($user->lang['PARENT_NO_EXIST'], E_USER_WARNING);
+ trigger_error($user->lang['PARENT_NO_EXIST'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'UPDATE ' . MODULES_TABLE . "
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index be69618516..35ec5919a8 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -58,7 +58,7 @@ class acp_permission_roles
break;
default:
- trigger_error('INVALID_MODE', E_USER_ERROR);
+ trigger_error('NO_MODE', E_USER_ERROR);
break;
}
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index fd99362f60..36eac665c2 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -190,7 +190,7 @@ class acp_permissions
break;
default:
- trigger_error('INVALID_MODE', E_USER_ERROR);
+ trigger_error('NO_MODE', E_USER_ERROR);
break;
}
@@ -593,7 +593,7 @@ class acp_permissions
// Check the permission setting again
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
{
- trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$ug_id = $forum_id = 0;
@@ -672,7 +672,7 @@ class acp_permissions
// Check the permission setting again
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
{
- trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$auth_settings = (isset($_POST['setting'])) ? $_POST['setting'] : array();
@@ -777,7 +777,7 @@ class acp_permissions
// Check the permission setting again
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
{
- trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$auth_admin->acl_delete($ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : false), $permission_type);
diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php
index ca6fab89db..fee5beb8eb 100644
--- a/phpBB/includes/acp/acp_search.php
+++ b/phpBB/includes/acp/acp_search.php
@@ -152,7 +152,7 @@ class acp_search
}
else
{
- trigger_error($error, E_USER_WARNING);
+ trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
}
else
@@ -168,7 +168,7 @@ class acp_search
}
else
{
- trigger_error($error, E_USER_WARNING);
+ trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -241,7 +241,7 @@ class acp_search
$error = false;
if ($this->init_search($this->state[0], $this->search, $error))
{
- trigger_error($error, E_USER_WARNING);
+ trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
$action = &$this->state[1];
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index fd8500d68f..9bca995249 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -316,7 +316,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$theme_row['theme_storedb'])
{
- trigger_error($user->lang['THEME_ERR_REFRESH_FS'] . adm_back_link($this->u_action));
+ trigger_error($user->lang['THEME_ERR_REFRESH_FS'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@@ -590,7 +590,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$_POST['template_data'] = (isset($_POST['template_data']) && !empty($_POST['template_data'])) ? str_replace(array("\r\n", "\r"), array("\n", "\n"), $_POST['template_data']) : '';
$template_data = (STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data'];
- $template_file = request_var('template_file', '');
+ $template_file = request_var('template_file', '');
$text_rows = max(5, min(999, request_var('text_rows', 20)));
$save_changes = (isset($_POST['save'])) ? true : false;
@@ -602,12 +602,13 @@ pagination_sep = \'{PAGINATION_SEP}\'
FROM ' . STYLES_TEMPLATE_TABLE . "
WHERE template_id = $template_id";
$result = $db->sql_query($sql);
+ $template_info = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- if (!($template_info = $db->sql_fetchrow($result)))
+ if (!$template_info)
{
- trigger_error($user->lang['NO_TEMPLATE'], E_USER_WARNING);
+ trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $db->sql_freeresult($result);
// save changes to the template if the user submitted any
if ($save_changes && $template_file)
@@ -621,7 +622,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!($fp = fopen($file, 'wb')))
{
- trigger_error($user->lang['NO_TEMPLATE'], E_USER_WARNING);
+ trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
fwrite($fp, $template_data);
fclose($fp);
@@ -674,7 +675,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!file_exists($template_path . "/$template_file") || !($template_data = file_get_contents($template_path . "/$template_file")))
{
- trigger_error($user->lang['NO_TEMPLATE'], E_USER_WARNING);
+ trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
}
@@ -801,12 +802,13 @@ pagination_sep = \'{PAGINATION_SEP}\'
FROM ' . STYLES_TEMPLATE_TABLE . "
WHERE template_id = $template_id";
$result = $db->sql_query($sql);
+ $template_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- if (!($template_row = $db->sql_fetchrow($result)))
+ if (!$template_row)
{
- trigger_error($user->lang['NO_TEMPLATE'], E_USER_WARNING);
+ trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $db->sql_freeresult($result);
// User wants to delete one or more files ...
if ($submit && $file_ary)
@@ -941,7 +943,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!($theme_info = $db->sql_fetchrow($result)))
{
- trigger_error($user->lang['NO_THEME'], E_USER_WARNING);
+ trigger_error($user->lang['NO_THEME'] . adm_bacl_link($this->u_action), E_USER_WARNING);
}
$db->sql_freeresult($result);
@@ -951,7 +953,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!file_exists($stylesheet_path) || !($stylesheet = file_get_contents($stylesheet_path)))
{
- trigger_error($user->lang['NO_THEME'], E_USER_WARNING);
+ trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
else
@@ -1015,11 +1017,11 @@ pagination_sep = \'{PAGINATION_SEP}\'
$units = array('px', '%', 'em', 'pt');
$repeat_types = array(
- '' => $user->lang['UNSET'],
- 'none' => $user->lang['REPEAT_NO'],
- 'repeat-x' => $user->lang['REPEAT_X'],
- 'repeat-y' => $user->lang['REPEAT_Y'],
- 'both' => $user->lang['REPEAT_ALL'],
+ '' => $user->lang['UNSET'],
+ 'none' => $user->lang['REPEAT_NO'],
+ 'repeat-x' => $user->lang['REPEAT_X'],
+ 'repeat-y' => $user->lang['REPEAT_Y'],
+ 'both' => $user->lang['REPEAT_ALL'],
);
// Fill css_data with the class contents from the stylesheet
@@ -1030,7 +1032,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!isset($matches[1]))
{
- trigger_error($user->lang['NO_CLASS'], E_USER_WARNING);
+ trigger_error($user->lang['NO_CLASS'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$css_data = implode(";\n", array_diff(array_map('trim', explode("\n", preg_replace("#;[\n]*#s", "\n", $matches[1]))), array('')));
@@ -1278,7 +1280,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// write stylesheet to file
if (!($fp = fopen($stylesheet_path, 'wb')))
{
- trigger_error($user->lang['NO_THEME'], E_USER_WARNING);
+ trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
fwrite($fp, $stylesheet);
fclose($fp);
@@ -1355,7 +1357,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!extract($db->sql_fetchrow($result)))
{
- trigger_error($user->lang['NO_IMAGESET'], E_USER_WARNING);
+ trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$db->sql_freeresult($result);
@@ -2396,7 +2398,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!($dp = @opendir("{$phpbb_root_path}cache")))
{
- trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ'], E_USER_ERROR);
+ trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$file_ary = array();
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 87c9fc4edc..06a6f3c97a 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -158,7 +158,7 @@ class acp_users
{
if (!$auth->acl_get('a_userdel'))
{
- trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
+ trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
// Check if the user wants to remove himself or the guest user account
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 6093976084..8ada82cffe 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2683,10 +2683,17 @@ function get_preg_expression($mode)
* Truncates string while retaining special characters if going over the max length
* The default max length is 60 at the moment
*/
-function truncate_string($string, $max_length = 60)
+function truncate_string($string, $max_length = 60, $allow_reply = true)
{
$chars = array();
+ $strip_reply = false;
+ if ($allow_reply && strpos($string, 'Re: ') === 0)
+ {
+ $strip_reply = true;
+ $string = substr($string, 4);
+ }
+
// split the multibyte characters first
$string_ary = preg_split('/(&#[0-9]+;)/', $string, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
@@ -2705,13 +2712,18 @@ function truncate_string($string, $max_length = 60)
}
// Now check the length ;)
- if (sizeof($chars) <= $max_length)
+ if (sizeof($chars) > $max_length)
+ {
+ // Cut off the last elements from the array
+ $string = implode('', array_slice($chars, 0, $max_length));
+ }
+
+ if ($strip_reply)
{
- return $string;
+ $string = 'Re: ' . $string;
}
- // Cut off the last elements from the array
- return implode('', array_slice($chars, 0, $max_length));
+ return $string;
}
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index 18b8bbfff2..14afc81686 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -403,7 +403,7 @@ class ucp_pm
break;
default:
- trigger_error('NO_ACTION_MODE');
+ trigger_error('NO_ACTION_MODE', E_USER_ERROR);
break;
}
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index e8a7a4a538..fc05c36290 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -149,7 +149,7 @@ function compose_pm($id, $mode, $action)
break;
default:
- trigger_error('NO_ACTION_MODE');
+ trigger_error('NO_ACTION_MODE', E_USER_ERROR);
}
if ($action == 'forward' && (!$config['forward_pm'] || !$auth->acl_get('u_pm_forward')))