1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-29 10:39:19 +02:00

Merge remote-tracking branch 'upstream/develop' into feature/dic

* upstream/develop: (39 commits)
  [ticket/11025] Add underline for hover to classes
  [ticket/11025] Replace <b> with <strong> and/or class for semantic styling in subsilver2
  [ticket/11025] Replace <b> with <strong> and/or class for semantic styling
  [ticket/11025] Make last topic titles in forum list Bold
  [prep-release-3.0.11] Update Changelog for 3.0.11-RC2 release.
  [prep-release-3.0.11] Bumping version number for 3.0.11-RC2.
  [ticket/10965] Profile data is only grabbed when show_novalue is enabled
  [ticket/10965] Make sure all profile fields are always grabbed on viewtopic
  [ticket/10965] Database update was referring to 3.0.5 instead of 3.0.11-RC1
  [ticket/10965] Introduce a new profile field option to display no value
  [ticket/10990] Changes for develop
  [ticket/10990] Do not use comma separator when storing it as a log.
  [ticket/10990] Use $user->lang['COMMA_SEPARATOR'] when appropriate
  [ticket/10667] Fix tests under MySQL 5.5 strict mode (once again)
  [ticket/10667] Fix tests under MySQL 5.5 strict mode (once again)
  [ticket/11012] Fix php_ext change in mock_extension_manager
  [ticket/11012] Normalize $phpEx member vars to $php_ext
  [ticket/11002] Use translating option to rename the Etc/GMT options
  [ticket/11009] Backport build.xml from develop to fix Bamboo Unit Testing.
  [ticket/11008] Change onunload_functions to not use eval()
  ...
This commit is contained in:
Igor Wiedler 2012-07-26 16:12:21 +02:00
commit cec4c94f2e
58 changed files with 682 additions and 233 deletions

View File

@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
<property name="newversion" value="3.0.11-RC1" />
<property name="newversion" value="3.0.11-RC2" />
<property name="prevversion" value="3.0.10" />
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9" />
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9, 3.0.11-RC1" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />

View File

@ -67,6 +67,10 @@
<dt><label for="field_required">{L_REQUIRED_FIELD}:</label><br /><span>{L_REQUIRED_FIELD_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" id="field_required" name="field_required" value="1"<!-- IF S_FIELD_REQUIRED --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
<dt><label for="field_show_novalue">{L_SHOW_NOVALUE_FIELD}:</label><br /><span>{L_SHOW_NOVALUE_FIELD_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" id="field_show_novalue" name="field_show_novalue" value="1"<!-- IF S_FIELD_SHOW_NOVALUE --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
<dt><label for="field_hide">{L_HIDE_PROFILE_FIELD}:</label><br /><span>{L_HIDE_PROFILE_FIELD_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" id="field_hide" name="field_hide" value="1"<!-- IF S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd>

View File

@ -62,11 +62,7 @@ function dE(n, s, type)
*/
function marklist(id, name, state)
{
var parent = document.getElementById(id);
if (!parent)
{
eval('parent = document.' + id);
}
var parent = document.getElementById(id) || document[id];
if (!parent)
{

View File

@ -1461,6 +1461,7 @@ function get_schema_struct()
'field_default_value' => array('VCHAR_UNI', ''),
'field_validation' => array('VCHAR_UNI:20', ''),
'field_required' => array('BOOL', 0),
'field_show_novalue' => array('BOOL', 0),
'field_show_on_reg' => array('BOOL', 0),
'field_show_on_pm' => array('BOOL', 0),
'field_show_on_vt' => array('BOOL', 0),

View File

@ -151,6 +151,14 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10890">PHPBB3-10890</a>] - test_sql_fetchrow_returns_false_when_empty() fails on MSSQL and Oracle</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10908">PHPBB3-10908</a>] - No remote avatar size limit results in files limited only by PHP memory limit</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10913">PHPBB3-10913</a>] - Admin is logged out when accessing any url under adm/ without session id</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10441">PHPBB3-10441</a>] - Update to docs/README.html</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10773">PHPBB3-10773</a>] - ACP phpBB logo needs registered trademark symbol</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10935">PHPBB3-10935</a>] - Limit number of PM rules per user</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10937">PHPBB3-10937</a>] - Comment removal functions: Backward compatibility broken</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10950">PHPBB3-10950</a>] - Deleting user with undelivered PMs causes SQL error</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10952">PHPBB3-10952</a>] - includes/constants.php version number incorrect</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10965">PHPBB3-10965</a>] - Dropdown CPF now shows in profile when no value is selected</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10978">PHPBB3-10978</a>] - Typo in prosilvers ucp_groups_membership.html</li>
</ul>
<h4>Improvement</h4>
<ul>
@ -181,6 +189,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10891">PHPBB3-10891</a>] - Allow specifying test config file name via environment variable</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10892">PHPBB3-10892</a>] - Cosmetic improvements to RUNNING_TESTS.txt</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10898">PHPBB3-10898</a>] - Do not write ?&gt; into config.php to avoid whitespace output</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10925">PHPBB3-10925</a>] - Clarify that SQLite3 is not supported for phpBB 3.0.x</li>
</ul>
<h4>New Feature</h4>
<ul>

View File

@ -98,7 +98,7 @@ class acp_attachments
}
$db->sql_freeresult($result);
$l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode(', ', $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']';
$l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode($user->lang['COMMA_SEPARATOR'], $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']';
$display_vars = array(
'title' => 'ACP_ATTACHMENT_SETTINGS',
@ -917,7 +917,7 @@ class acp_attachments
$db->sql_query($sql);
add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode(', ', $delete_files));
$notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode(', ', $delete_files));
$notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode($user->lang['COMMA_SEPARATOR'], $delete_files));
}
$upload_list = array();
@ -1074,7 +1074,7 @@ class acp_attachments
$error[] = $user->lang['FILES_GONE'];
}
add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $deleted_filenames));
$notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode(', ', $deleted_filenames));
$notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode($user->lang['COMMA_SEPARATOR'], $deleted_filenames));
}
else
{

View File

@ -497,7 +497,7 @@ class acp_permissions
$template->assign_vars(array(
'S_FORUM_NAMES' => (sizeof($forum_names)) ? true : false,
'FORUM_NAMES' => implode(', ', $forum_names))
'FORUM_NAMES' => implode($user->lang['COMMA_SEPARATOR'], $forum_names))
);
}

View File

@ -383,6 +383,7 @@ class acp_profile
$field_row = array_merge($default_values[$field_type], array(
'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))),
'field_required' => 0,
'field_show_novalue'=> 0,
'field_hide' => 0,
'field_show_profile'=> 0,
'field_no_view' => 0,
@ -399,7 +400,7 @@ class acp_profile
// $exclude contains the data we gather in each step
$exclude = array(
1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),
1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'),
2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);
@ -424,6 +425,7 @@ class acp_profile
// Visibility Options...
$visibility_ary = array(
'field_required',
'field_show_novalue',
'field_show_on_reg',
'field_show_on_pm',
'field_show_on_vt',
@ -779,6 +781,7 @@ class acp_profile
$template->assign_vars(array(
'S_STEP_ONE' => true,
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,
'S_FIELD_SHOW_NOVALUE'=> ($cp->vars['field_show_novalue']) ? true : false,
'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false,
'S_SHOW_ON_PM' => ($cp->vars['field_show_on_pm']) ? true : false,
'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false,
@ -1096,6 +1099,7 @@ class acp_profile
'field_default_value' => $cp->vars['field_default_value'],
'field_validation' => $cp->vars['field_validation'],
'field_required' => $cp->vars['field_required'],
'field_show_novalue' => $cp->vars['field_show_novalue'],
'field_show_on_reg' => $cp->vars['field_show_on_reg'],
'field_show_on_pm' => $cp->vars['field_show_on_pm'],
'field_show_on_vt' => $cp->vars['field_show_on_vt'],

View File

@ -113,7 +113,7 @@ class acp_reasons
$result = $db->sql_query($sql);
$max_order = (int) $db->sql_fetchfield('max_reason_order');
$db->sql_freeresult($result);
$sql_ary = array(
'reason_title' => (string) $reason_row['reason_title'],
'reason_description' => (string) $reason_row['reason_description'],
@ -171,14 +171,14 @@ class acp_reasons
'U_ACTION' => $this->u_action . "&amp;id=$reason_id&amp;action=$action",
'U_BACK' => $this->u_action,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'REASON_TITLE' => $reason_row['reason_title'],
'REASON_DESCRIPTION' => $reason_row['reason_description'],
'TRANSLATED_TITLE' => ($translated) ? $user->lang['report_reasons']['TITLE'][strtoupper($reason_row['reason_title'])] : '',
'TRANSLATED_DESCRIPTION'=> ($translated) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])] : '',
'S_AVAILABLE_TITLES' => implode(', ', array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))),
'S_AVAILABLE_TITLES' => implode($user->lang['COMMA_SEPARATOR'], array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))),
'S_EDIT_REASON' => true,
'S_TRANSLATED' => $translated,
'S_ERROR' => (sizeof($error)) ? true : false,
@ -303,7 +303,7 @@ class acp_reasons
do
{
++$order;
if ($row['reason_order'] != $order)
{
$sql = 'UPDATE ' . REPORTS_REASONS_TABLE . "

View File

@ -36,11 +36,11 @@ class acp_styles
protected $cache;
protected $auth;
protected $phpbb_root_path;
protected $phpEx;
protected $php_ext;
public function main($id, $mode)
{
global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config;
global $db, $user, $phpbb_admin_path, $phpbb_root_path, $php_ext, $template, $request, $cache, $auth, $config;
$this->db = $db;
$this->user = $user;
@ -50,12 +50,12 @@ class acp_styles
$this->auth = $auth;
$this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;
$this->phpEx = $phpEx;
$this->php_ext = $php_ext;
$this->default_style = $config['default_style'];
$this->styles_path = $this->phpbb_root_path . $this->styles_path_absolute . '/';
$this->u_base_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$id}");
$this->u_base_action = append_sid("{$phpbb_admin_path}index.$php_ext", "i={$id}");
$this->s_hidden_fields = array(
'mode' => $mode,
);
@ -939,7 +939,7 @@ class acp_styles
// Preview
$actions[] = array(
'U_ACTION' => append_sid($this->phpbb_root_path . 'index.' . $this->phpEx, 'style=' . $style['style_id']),
'U_ACTION' => append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'style=' . $style['style_id']),
'L_ACTION' => $this->user->lang['PREVIEW']
);
}

View File

@ -1943,7 +1943,7 @@ class acp_users
$message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $log_attachments));
add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode($user->lang['COMMA_SEPARATOR'], $log_attachments));
trigger_error($message . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
else

View File

@ -529,8 +529,8 @@ class auth_admin extends phpbb_auth
'NAME' => $ug_name,
'CATEGORIES' => implode('</th><th>', $categories),
'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode(', ', $user_groups_default[$ug_id]) : '',
'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode(', ', $user_groups_custom[$ug_id]) : '',
'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_default[$ug_id]) : '',
'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_custom[$ug_id]) : '',
'L_ACL_TYPE' => $l_acl_type,
'S_LOCAL' => ($local) ? true : false,

View File

@ -50,7 +50,7 @@ abstract class phpbb_extension_controller implements phpbb_extension_controller_
/**
* @var string PHP Extension
*/
protected $phpEx;
protected $php_ext;
/**
* @var string Relative path to board root
@ -64,14 +64,14 @@ abstract class phpbb_extension_controller implements phpbb_extension_controller_
public function __construct()
{
global $request, $db, $user, $template, $config;
global $phpEx, $phpbb_root_path;
global $php_ext, $phpbb_root_path;
$this->request = $request;
$this->db = $db;
$this->user = $user;
$this->template = $template;
$this->config = $config;
$this->phpEx = $phpEx;
$this->php_ext = $php_ext;
$this->phpbb_root_path = $phpbb_root_path;
}
}

View File

@ -25,7 +25,7 @@ class phpbb_extension_finder
protected $extension_manager;
protected $phpbb_root_path;
protected $cache;
protected $phpEx;
protected $php_ext;
/**
* The cache variable name used to store $this->cached_queries in $this->cache.
@ -56,16 +56,16 @@ class phpbb_extension_finder
* extensions and their locations
* @param string $phpbb_root_path Path to the phpbb root directory
* @param phpbb_cache_driver_interface $cache A cache instance or null
* @param string $phpEx php file extension
* @param string $php_ext php file extension
* @param string $cache_name The name of the cache variable, defaults to
* _ext_finder
*/
public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $phpEx = '.php', $cache_name = '_ext_finder')
public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $php_ext = '.php', $cache_name = '_ext_finder')
{
$this->extension_manager = $extension_manager;
$this->phpbb_root_path = $phpbb_root_path;
$this->cache = $cache;
$this->phpEx = $phpEx;
$this->php_ext = $php_ext;
$this->cache_name = $cache_name;
$this->query = array(
@ -251,8 +251,8 @@ class phpbb_extension_finder
*/
public function get_classes($cache = true)
{
$this->query['extension_suffix'] .= $this->phpEx;
$this->query['core_suffix'] .= $this->phpEx;
$this->query['extension_suffix'] .= $this->php_ext;
$this->query['core_suffix'] .= $this->php_ext;
$files = $this->find($cache, false);
@ -261,7 +261,7 @@ class phpbb_extension_finder
{
$file = preg_replace('#^includes/#', '', $file);
$classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen($this->phpEx)));
$classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen($this->php_ext)));
}
return $classes;
}

View File

@ -23,7 +23,7 @@ if (!defined('IN_PHPBB'))
class phpbb_extension_manager
{
protected $cache;
protected $phpEx;
protected $php_ext;
protected $extensions;
protected $extension_table;
protected $phpbb_root_path;
@ -35,16 +35,16 @@ class phpbb_extension_manager
* @param dbal $db A database connection
* @param string $extension_table The name of the table holding extensions
* @param string $phpbb_root_path Path to the phpbb includes directory.
* @param string $phpEx php file extension
* @param string $php_ext php file extension
* @param phpbb_cache_driver_interface $cache A cache instance or null
* @param string $cache_name The name of the cache variable, defaults to _ext
*/
public function __construct(dbal $db, $extension_table, $phpbb_root_path, $phpEx = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext')
public function __construct(dbal $db, $extension_table, $phpbb_root_path, $php_ext = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext')
{
$this->phpbb_root_path = $phpbb_root_path;
$this->db = $db;
$this->cache = $cache;
$this->phpEx = $phpEx;
$this->php_ext = $php_ext;
$this->extension_table = $extension_table;
$this->cache_name = $cache_name;
@ -362,7 +362,7 @@ class phpbb_extension_manager
RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $file_info)
{
if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->phpEx)
if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->php_ext)
{
$ext_name = $iterator->getInnerIterator()->getSubPath();
@ -432,7 +432,7 @@ class phpbb_extension_manager
}
return $disabled;
}
/**
* Check to see if a given extension is available on the filesystem
*
@ -462,6 +462,6 @@ class phpbb_extension_manager
*/
public function get_finder()
{
return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->phpEx, $this->cache_name . '_finder');
return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder');
}
}

View File

@ -411,7 +411,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
if ($display_moderators && !empty($forum_moderators[$forum_id]))
{
$l_moderator = (sizeof($forum_moderators[$forum_id]) == 1) ? $user->lang['MODERATOR'] : $user->lang['MODERATORS'];
$moderators_list = implode(', ', $forum_moderators[$forum_id]);
$moderators_list = implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]);
}
$l_post_click_count = ($row['forum_type'] == FORUM_LINK) ? 'CLICKS' : 'POSTS';
@ -422,7 +422,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
{
$s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['UNREAD_POSTS'] : $user->lang['NO_UNREAD_POSTS']) . '">' . $subforum['name'] . '</a>';
}
$s_subforums_list = (string) implode(', ', $s_subforums_list);
$s_subforums_list = (string) implode($user->lang['COMMA_SEPARATOR'], $s_subforums_list);
$catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false;
if ($row['forum_type'] != FORUM_LINK)

View File

@ -1147,127 +1147,166 @@ function phpbb_delete_user_pms($user_id)
// Get PM Information for later deleting
// The two queries where split, so we can use our indexes
$undelivered_msg = $delete_ids = array();
// Part 1: get PMs the user received
$sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE user_id = ' . $user_id;
$result = $db->sql_query($sql);
$undelivered_msg = $undelivered_user = $delete_ids = array();
while ($row = $db->sql_fetchrow($result))
{
if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX)
{
// Undelivered messages
$undelivered_msg[] = $row['msg_id'];
if (isset($undelivered_user[$row['user_id']]))
{
++$undelivered_user[$row['user_id']];
}
else
{
$undelivered_user[$row['user_id']] = 1;
}
}
$delete_ids[(int) $row['msg_id']] = (int) $row['msg_id'];
$msg_id = (int) $row['msg_id'];
$delete_ids[$msg_id] = $msg_id;
}
$db->sql_freeresult($result);
// Part 2: get PMs the user sent
$sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new
// Part 2: get PMs the user sent, but have yet to be received
// We cannot simply delete them. First we have to check,
// whether another user already received and read the message.
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE author_id = ' . $user_id . '
AND folder_id = ' . PRIVMSGS_NO_BOX;
AND folder_id = ' . PRIVMSGS_NO_BOX;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX)
{
// Undelivered messages
$undelivered_msg[] = $row['msg_id'];
if (isset($undelivered_user[$row['user_id']]))
{
++$undelivered_user[$row['user_id']];
}
else
{
$undelivered_user[$row['user_id']] = 1;
}
}
$delete_ids[(int) $row['msg_id']] = (int) $row['msg_id'];
$msg_id = (int) $row['msg_id'];
$undelivered_msg[$msg_id] = $msg_id;
}
$db->sql_freeresult($result);
if (empty($delete_ids))
if (empty($delete_ids) && empty($undelivered_msg))
{
return false;
}
$db->sql_transaction('begin');
if (sizeof($undelivered_msg))
if (!empty($undelivered_msg))
{
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
$db->sql_query($sql);
// A pm is delivered, if for any recipient the message was moved
// from their NO_BOX to another folder. We do not delete such
// messages, but only delete them for users, who have not yet
// received them.
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE author_id = ' . $user_id . '
AND folder_id <> ' . PRIVMSGS_NO_BOX . '
AND folder_id <> ' . PRIVMSGS_OUTBOX . '
AND folder_id <> ' . PRIVMSGS_SENTBOX;
$result = $db->sql_query($sql);
$delivered_msg = array();
while ($row = $db->sql_fetchrow($result))
{
$msg_id = (int) $row['msg_id'];
$delivered_msg[$msg_id] = $msg_id;
unset($undelivered_msg[$msg_id]);
}
$db->sql_freeresult($result);
$undelivered_user = array();
// Count the messages we delete, so we can correct the user pm data
$sql = 'SELECT user_id, COUNT(msg_id) as num_undelivered_privmsgs
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE author_id = ' . $user_id . '
AND folder_id = ' . PRIVMSGS_NO_BOX . '
AND ' . $db->sql_in_set('msg_id', array_merge($undelivered_msg, $delivered_msg)) . '
GROUP BY user_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$num_pms = (int) $row['num_undelivered_privmsgs'];
$undelivered_user[$num_pms][] = (int) $row['user_id'];
if (sizeof($undelivered_user[$num_pms]) > 50)
{
// If there are too many users affected the query might get
// too long, so we update the value for the first bunch here.
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ',
user_unread_privmsg = user_unread_privmsg - ' . $num_pms . '
WHERE ' . $db->sql_in_set('user_id', $undelivered_user[$num_pms]);
$db->sql_query($sql);
unset($undelivered_user[$num_pms]);
}
}
$db->sql_freeresult($result);
foreach ($undelivered_user as $num_pms => $undelivered_user_set)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ',
user_unread_privmsg = user_unread_privmsg - ' . $num_pms . '
WHERE ' . $db->sql_in_set('user_id', $undelivered_user_set);
$db->sql_query($sql);
}
if (!empty($delivered_msg))
{
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
WHERE folder_id = ' . PRIVMSGS_NO_BOX . '
AND ' . $db->sql_in_set('msg_id', $delivered_msg);
$db->sql_query($sql);
}
if (!empty($undelivered_msg))
{
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
$db->sql_query($sql);
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
$db->sql_query($sql);
}
}
// Reset the user´s pm count to 0
if (isset($undelivered_user[$user_id]))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_new_privmsg = 0,
user_unread_privmsg = 0
WHERE user_id = ' . $user_id;
$db->sql_query($sql);
unset($undelivered_user[$user_id]);
}
foreach ($undelivered_user as $_user_id => $count)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_new_privmsg = user_new_privmsg - ' . $count . ',
user_unread_privmsg = user_unread_privmsg - ' . $count . '
WHERE user_id = ' . $_user_id;
$db->sql_query($sql);
}
// Delete private message data
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . "
WHERE user_id = $user_id
AND " . $db->sql_in_set('msg_id', $delete_ids);
// Reset the user's pm count to 0
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_new_privmsg = 0,
user_unread_privmsg = 0
WHERE user_id = ' . $user_id;
$db->sql_query($sql);
// Now we have to check which messages we can delete completely
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
unset($delete_ids[$row['msg_id']]);
}
$db->sql_freeresult($result);
// Delete private message data of the user
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
WHERE user_id = ' . (int) $user_id;
$db->sql_query($sql);
if (!empty($delete_ids))
{
// Check if there are any attachments we need to remove
if (!function_exists('delete_attachments'))
{
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
delete_attachments('message', $delete_ids, false);
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
// Now we have to check which messages we can delete completely
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
$db->sql_query($sql);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
unset($delete_ids[$row['msg_id']]);
}
$db->sql_freeresult($result);
if (!empty($delete_ids))
{
// Check if there are any attachments we need to remove
if (!function_exists('delete_attachments'))
{
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
delete_attachments('message', $delete_ids, false);
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
$db->sql_query($sql);
}
}
// Set the remaining author id to anonymous
@ -2045,7 +2084,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
'SUBJECT' => $subject,
'SENT_DATE' => $user->format_date($row['message_time']),
'MESSAGE' => $message,
'FOLDER' => implode(', ', $row['folder']),
'FOLDER' => implode($user->lang['COMMA_SEPARATOR'], $row['folder']),
'DECODED_MESSAGE' => $decoded_message,
'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id),

View File

@ -121,7 +121,7 @@ class custom_profile
case FIELD_BOOL:
$field_value = (bool) $field_value;
if (!$field_value && $field_data['field_required'])
{
return 'FIELD_REQUIRED';
@ -133,7 +133,7 @@ class custom_profile
{
return false;
}
$field_value = (int) $field_value;
if ($field_value < $field_data['field_minlen'])
@ -455,6 +455,8 @@ class custom_profile
$user_fields = array();
$user_ids = $user_id;
// Go through the fields in correct order
foreach (array_keys($this->profile_cache) as $used_ident)
{
@ -463,6 +465,15 @@ class custom_profile
$user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident];
$user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
}
foreach ($user_ids as $user_id)
{
if (!isset($user_fields[$user_id][$used_ident]) && $this->profile_cache[$used_ident]['field_show_novalue'])
{
$user_fields[$user_id][$used_ident]['value'] = '';
$user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
}
}
}
return $user_fields;
@ -520,7 +531,7 @@ class custom_profile
switch ($this->profile_types[$field_type])
{
case 'int':
if ($value === '')
if ($value === '' && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@ -529,7 +540,7 @@ class custom_profile
case 'string':
case 'text':
if (!$value)
if (!$value && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@ -547,7 +558,7 @@ class custom_profile
$month = (isset($date[1])) ? (int) $date[1] : 0;
$year = (isset($date[2])) ? (int) $date[2] : 0;
if (!$day && !$month && !$year)
if (!$day && !$month && !$year && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@ -573,12 +584,7 @@ class custom_profile
$this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false);
}
// If a dropdown field is required, users
// cannot choose the "no value" option.
// They must choose one of the other options.
// Therefore, here we treat a value equal to
// the "no value" as a lack of value, i.e. NULL.
if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required'])
if ($value == $ident_ary['data']['field_novalue'] && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@ -588,7 +594,14 @@ class custom_profile
// User not having a value assigned
if (!isset($this->options_lang[$field_id][$lang_id][$value]))
{
return NULL;
if ($ident_ary['data']['field_show_novalue'])
{
$value = $ident_ary['data']['field_novalue'];
}
else
{
return NULL;
}
}
return $this->options_lang[$field_id][$lang_id][$value];
@ -602,6 +615,11 @@ class custom_profile
$this->get_option_lang($field_id, $lang_id, FIELD_BOOL, false);
}
if (!$value && $ident_ary['data']['field_show_novalue'])
{
$value = $ident_ary['data']['field_default_value'];
}
if ($ident_ary['data']['field_length'] == 1)
{
return (isset($this->options_lang[$field_id][$lang_id][(int) $value])) ? $this->options_lang[$field_id][$lang_id][(int) $value] : NULL;

View File

@ -291,7 +291,7 @@ class mcp_pm_reports
'REPORT_ID' => $row['report_id'],
'REPORT_TIME' => $user->format_date($row['report_time']),
'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]),
'RECIPIENTS' => implode($user->lang['COMMA_SEPARATOR'], $address_list[$row['msg_id']]),
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
));
}

View File

@ -334,7 +334,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
// throw an error if we shall not ignore unexistant words
else if (!$ignore_no_id && sizeof($non_common_words))
{
trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $non_common_words)));
trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode($user->lang['COMMA_SEPARATOR'], $non_common_words)));
}
unset($non_common_words);
}

View File

@ -38,7 +38,7 @@ class phpbb_style
* PHP file extension
* @var string
*/
private $phpEx;
private $php_ext;
/**
* phpBB config instance
@ -73,10 +73,10 @@ class phpbb_style
* @param phpbb_style_path_provider $provider style path provider
* @param phpbb_template $template template
*/
public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider, phpbb_template $template)
public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider, phpbb_template $template)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->phpEx = $phpEx;
$this->php_ext = $php_ext;
$this->config = $config;
$this->user = $user;
$this->locator = $locator;

View File

@ -54,7 +54,7 @@ class phpbb_template
* PHP file extension
* @var string
*/
private $phpEx;
private $php_ext;
/**
* phpBB config instance
@ -87,10 +87,10 @@ class phpbb_template
* @param user $user current user
* @param phpbb_template_locator $locator template locator
*/
public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_template_locator $locator)
public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_template_locator $locator)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->phpEx = $phpEx;
$this->php_ext = $php_ext;
$this->config = $config;
$this->user = $user;
$this->locator = $locator;
@ -313,7 +313,7 @@ class phpbb_template
private function _compiled_file_for_handle($handle)
{
$source_file = $this->locator->get_filename_for_handle($handle);
$compiled_file = $this->cachepath . str_replace('/', '.', $source_file) . '.' . $this->phpEx;
$compiled_file = $this->cachepath . str_replace('/', '.', $source_file) . '.' . $this->php_ext;
return $compiled_file;
}

View File

@ -846,7 +846,7 @@ class ucp_groups
$base_url = $this->u_action . "&amp;action=$action&amp;g=$group_id";
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total_members, $config['topics_per_page'], $start);
$template->assign_vars(array(
'S_LIST' => true,
'S_ACTION_OPTIONS' => $s_action_options,
@ -1069,7 +1069,8 @@ class ucp_groups
'mode' => $mode,
'action' => $action
);
confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode(', ', $name_ary)), build_hidden_fields($s_hidden_fields));
confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode($user->lang['COMMA_SEPARATOR'], $name_ary)), build_hidden_fields($s_hidden_fields));
}
trigger_error($user->lang['NO_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&amp;action=list&amp;g=' . $group_id . '">', '</a>'));

View File

@ -874,7 +874,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject));
$forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time, false, true));
$forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text);
$forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to']));
$forward_text[] = sprintf($user->lang['FWD_TO'], implode($user->lang['COMMA_SEPARATOR'], $fwd_to_field['to']));
$message_parser->message = implode("\n", $forward_text) . "\n\n[quote=&quot;{$quote_username}&quot;]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]";
$message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject);

View File

@ -176,7 +176,7 @@ function view_folder($id, $mode, $folder_id, $folder)
'U_VIEW_PM' => ($row['pm_deleted']) ? '' : $view_message_url,
'U_REMOVE_PM' => ($row['pm_deleted']) ? $remove_message_url : '',
'U_MCP_REPORT' => (isset($row['report_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&amp;mode=pm_report_details&amp;r=' . $row['report_id']) : '',
'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '')
'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode($user->lang['COMMA_SEPARATOR'], $address_list[$message_id]) : '')
);
}
unset($folder_info['rowset']);
@ -266,9 +266,9 @@ function view_folder($id, $mode, $folder_id, $folder)
}
}
// There is the chance that all recipients of the message got deleted. To avoid creating
// There is the chance that all recipients of the message got deleted. To avoid creating
// exports without recipients, we add a bogus "undisclosed recipient".
if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) &&
if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) &&
!(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u'])))
{
$address[$message_id]['u'] = array();
@ -277,7 +277,7 @@ function view_folder($id, $mode, $folder_id, $folder)
}
decode_message($message_row['message_text'], $message_row['bbcode_uid']);
$data[] = array(
'subject' => censor_text($row['message_subject']),
'sender' => $row['username'],

View File

@ -26,85 +26,85 @@ class phpbb_update_helpers
switch ($timezone)
{
case '-12':
return 'Etc/GMT' . $offset; //'[UTC - 12] Baker Island Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 12] Baker Island Time'
case '-11':
return 'Etc/GMT' . $offset; //'[UTC - 11] Niue Time, Samoa Standard Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 11] Niue Time, Samoa Standard Time'
case '-10':
return 'Etc/GMT' . $offset; //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time'
case '-9.5':
return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time'
return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time'
case '-9':
return 'Etc/GMT' . $offset; //'[UTC - 9] Alaska Standard Time, Gambier Island Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 9] Alaska Standard Time, Gambier Island Time'
case '-8':
return 'Etc/GMT' . $offset; //'[UTC - 8] Pacific Standard Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 8] Pacific Standard Time'
case '-7':
return 'Etc/GMT' . $offset; //'[UTC - 7] Mountain Standard Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 7] Mountain Standard Time'
case '-6':
return 'Etc/GMT' . $offset; //'[UTC - 6] Central Standard Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 6] Central Standard Time'
case '-5':
return 'Etc/GMT' . $offset; //'[UTC - 5] Eastern Standard Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 5] Eastern Standard Time'
case '-4.5':
return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time'
return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time'
case '-4':
return 'Etc/GMT' . $offset; //'[UTC - 4] Atlantic Standard Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 4] Atlantic Standard Time'
case '-3.5':
return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time'
return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time'
case '-3':
return 'Etc/GMT' . $offset; //'[UTC - 3] Amazon Standard Time, Central Greenland Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 3] Amazon Standard Time, Central Greenland Time'
case '-2':
return 'Etc/GMT' . $offset; //'[UTC - 2] Fernando de Noronha Time, South Georgia &amp; the South Sandwich Islands Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 2] Fernando de Noronha Time, South Georgia &amp; the South Sandwich Islands Time'
case '-1':
return 'Etc/GMT' . $offset; //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time'
return 'Etc/GMT+' . abs($offset); //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time'
case '0':
return (!$dst) ? 'UTC' : 'Etc/GMT+1'; //'[UTC] Western European Time, Greenwich Mean Time'
return (!$dst) ? 'UTC' : 'Etc/GMT-1'; //'[UTC] Western European Time, Greenwich Mean Time'
case '1':
return 'Etc/GMT+' . $offset; //'[UTC + 1] Central European Time, West African Time'
return 'Etc/GMT-' . $offset; //'[UTC + 1] Central European Time, West African Time'
case '2':
return 'Etc/GMT+' . $offset; //'[UTC + 2] Eastern European Time, Central African Time'
return 'Etc/GMT-' . $offset; //'[UTC + 2] Eastern European Time, Central African Time'
case '3':
return 'Etc/GMT+' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time'
return 'Etc/GMT-' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time'
case '3.5':
return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time'
return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time'
case '4':
return 'Etc/GMT+' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time'
return 'Etc/GMT-' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time'
case '4.5':
return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time'
return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time'
case '5':
return 'Etc/GMT+' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time'
return 'Etc/GMT-' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time'
case '5.5':
return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time'
return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time'
case '5.75':
return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time'
return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time'
case '6':
return 'Etc/GMT+' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time'
return 'Etc/GMT-' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time'
case '6.5':
return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time'
return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time'
case '7':
return 'Etc/GMT+' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time'
return 'Etc/GMT-' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time'
case '8':
return 'Etc/GMT+' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time'
return 'Etc/GMT-' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time'
case '8.75':
return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time'
return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time'
case '9':
return 'Etc/GMT+' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time'
return 'Etc/GMT-' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time'
case '9.5':
return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time'
return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time'
case '10':
return 'Etc/GMT+' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time'
return 'Etc/GMT-' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time'
case '10.5':
return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time'
return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time'
case '11':
return 'Etc/GMT+' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time'
return 'Etc/GMT-' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time'
case '11.5':
return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time'
return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time'
case '12':
return 'Etc/GMT+12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time'
return 'Etc/GMT-12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time'
case '12.75':
return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time'
return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time'
case '13':
return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time'
return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time'
case '14':
return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time'
return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time'
default:
return 'UTC';
}

View File

@ -104,7 +104,7 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
$legend = implode(', ', $legend);
$legend = implode($user->lang['COMMA_SEPARATOR'], $legend);
// Generate birthday list if required ...
$birthday_list = array();
@ -157,7 +157,7 @@ $template->assign_vars(array(
'NEWEST_USER' => $user->lang('NEWEST_USER', get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
'LEGEND' => $legend,
'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode(', ', $birthday_list),
'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode($user->lang['COMMA_SEPARATOR'], $birthday_list),
'FORUM_IMG' => $user->img('forum_read', 'NO_UNREAD_POSTS'),
'FORUM_UNREAD_IMG' => $user->img('forum_unread', 'UNREAD_POSTS'),

View File

@ -1071,6 +1071,14 @@ function database_update_info()
'3.0.10-RC3' => array(),
// No changes from 3.0.10 to 3.0.11-RC1
'3.0.10' => array(),
// Changes from 3.0.11-RC1 to 3.0.11-RC2
'3.0.11-RC1' => array(
'add_columns' => array(
PROFILE_FIELDS_TABLE => array(
'field_show_novalue' => array('BOOL', 0),
),
),
),
/** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 */
@ -2210,6 +2218,10 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
// No changes from 3.0.11-RC1 to 3.0.11-RC2
case '3.0.11-RC1':
break;
// Changes from 3.1.0-dev to 3.1.0-A1
case '3.1.0-dev':

View File

@ -933,7 +933,7 @@ class install_convert extends module
}
else if (sizeof($missing_tables))
{
$this->p_master->error(sprintf($user->lang['TABLES_MISSING'], implode(', ', $missing_tables)) . '<br /><br />' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__);
$this->p_master->error(sprintf($user->lang['TABLES_MISSING'], implode($user->lang['COMMA_SEPARATOR'], $missing_tables)) . '<br /><br />' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__);
}
$url = $this->save_convert_progress('&amp;confirm=1');

View File

@ -818,6 +818,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
field_required INTEGER DEFAULT 0 NOT NULL,
field_show_novalue INTEGER DEFAULT 0 NOT NULL,
field_show_on_reg INTEGER DEFAULT 0 NOT NULL,
field_show_on_pm INTEGER DEFAULT 0 NOT NULL,
field_show_on_vt INTEGER DEFAULT 0 NOT NULL,

View File

@ -992,6 +992,7 @@ CREATE TABLE [phpbb_profile_fields] (
[field_default_value] [varchar] (255) DEFAULT ('') NOT NULL ,
[field_validation] [varchar] (20) DEFAULT ('') NOT NULL ,
[field_required] [int] DEFAULT (0) NOT NULL ,
[field_show_novalue] [int] DEFAULT (0) NOT NULL ,
[field_show_on_reg] [int] DEFAULT (0) NOT NULL ,
[field_show_on_pm] [int] DEFAULT (0) NOT NULL ,
[field_show_on_vt] [int] DEFAULT (0) NOT NULL ,

View File

@ -582,6 +582,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value blob NOT NULL,
field_validation varbinary(60) DEFAULT '' NOT NULL,
field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,

View File

@ -582,6 +582,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value varchar(255) DEFAULT '' NOT NULL,
field_validation varchar(20) DEFAULT '' NOT NULL,
field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,

View File

@ -1100,6 +1100,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value varchar2(765) DEFAULT '' ,
field_validation varchar2(60) DEFAULT '' ,
field_required number(1) DEFAULT '0' NOT NULL,
field_show_novalue number(1) DEFAULT '0' NOT NULL,
field_show_on_reg number(1) DEFAULT '0' NOT NULL,
field_show_on_pm number(1) DEFAULT '0' NOT NULL,
field_show_on_vt number(1) DEFAULT '0' NOT NULL,

View File

@ -774,6 +774,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value varchar(255) DEFAULT '' NOT NULL,
field_validation varchar(20) DEFAULT '' NOT NULL,
field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0),
field_show_novalue INT2 DEFAULT '0' NOT NULL CHECK (field_show_novalue >= 0),
field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0),
field_show_on_pm INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_pm >= 0),
field_show_on_vt INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_vt >= 0),

View File

@ -565,6 +565,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value varchar(255) NOT NULL DEFAULT '',
field_validation varchar(20) NOT NULL DEFAULT '',
field_required INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_show_novalue INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_show_on_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0',

View File

@ -132,6 +132,8 @@ $lang = array_merge($lang, array(
'SAVE' => 'Save',
'SECOND_OPTION' => 'Second option',
'SHOW_NOVALUE_FIELD' => 'Show field if no value was selected',
'SHOW_NOVALUE_FIELD_EXPLAIN' => 'Determines if the profile field should be displayed if no value was selected for optional fields or if no value has been selected yet for required fields.',
'STEP_1_EXPLAIN_CREATE' => 'Here you can enter the first basic parameters of your new profile field. This information is needed for the second step where youll be able to set remaining options and tweak your profile field further.',
'STEP_1_EXPLAIN_EDIT' => 'Here you can change the basic parameters of your profile field. The relevant options are re-calculated within the second step.',
'STEP_1_TITLE_CREATE' => 'Add profile field',

View File

@ -58,7 +58,7 @@ $lang = array_merge($lang, array(
'DELETE_POSTS' => 'Delete posts',
'DELETE_USER' => 'Delete user',
'DELETE_USER_EXPLAIN' => 'Please note that deleting a user is final, they cannot be recovered.',
'DELETE_USER_EXPLAIN' => 'Please note that deleting a user is final, they cannot be recovered. Unread private messages sent by this user will be deleted and will not be available to their recipients.',
'FORCE_REACTIVATION_SUCCESS' => 'Successfully forced reactivation.',
'FOUNDER' => 'Founder',

View File

@ -134,7 +134,7 @@ $lang = array_merge($lang, array(
'COLLAPSE_VIEW' => 'Collapse view',
'CLOSE_WINDOW' => 'Close window',
'COLOUR_SWATCH' => 'Colour swatch',
'COMMA_SEPARATOR' => ', ', // Used in pagination of ACP & prosilver, use localised comma if appropriate, eg: Ideographic or Arabic
'COMMA_SEPARATOR' => ', ', // Comma used to join lists into a single string, use localised comma if appropriate, eg: Ideographic or Arabic
'CONFIRM' => 'Confirm',
'CONFIRM_CODE' => 'Confirmation code',
'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as it appears. All letters are case insensitive.',
@ -836,6 +836,35 @@ $lang = array_merge($lang, array(
'Dec' => 'Dec',
),
// Timezones can be translated. We use this for the Etc/GMT timezones here,
// because they are named invers to their offset.
'timezones' => array(
'Etc/GMT-12' => 'GMT+12',
'Etc/GMT-11' => 'GMT+11',
'Etc/GMT-10' => 'GMT+10',
'Etc/GMT-9' => 'GMT+9',
'Etc/GMT-8' => 'GMT+8',
'Etc/GMT-7' => 'GMT+7',
'Etc/GMT-6' => 'GMT+6',
'Etc/GMT-5' => 'GMT+5',
'Etc/GMT-4' => 'GMT+4',
'Etc/GMT-3' => 'GMT+3',
'Etc/GMT-2' => 'GMT+2',
'Etc/GMT-1' => 'GMT+1',
'Etc/GMT+1' => 'GMT-1',
'Etc/GMT+2' => 'GMT-2',
'Etc/GMT+3' => 'GMT-3',
'Etc/GMT+4' => 'GMT-4',
'Etc/GMT+5' => 'GMT-5',
'Etc/GMT+6' => 'GMT-6',
'Etc/GMT+7' => 'GMT-7',
'Etc/GMT+8' => 'GMT-8',
'Etc/GMT+9' => 'GMT-9',
'Etc/GMT+10' => 'GMT-10',
'Etc/GMT+11' => 'GMT-11',
'Etc/GMT+12' => 'GMT-12',
),
// The value is only an example and will get replaced by the current time on view
'dateformats' => array(
'd M Y, H:i' => '01 Jan 2007, 13:37',

View File

@ -1362,7 +1362,7 @@ $template->assign_vars(array(
'FORUM_NAME' => $post_data['forum_name'],
'FORUM_DESC' => ($post_data['forum_desc']) ? generate_text_for_display($post_data['forum_desc'], $post_data['forum_desc_uid'], $post_data['forum_desc_bitfield'], $post_data['forum_desc_options']) : '',
'TOPIC_TITLE' => censor_text($post_data['topic_title']),
'MODERATORS' => (sizeof($moderators)) ? implode(', ', $moderators[$forum_id]) : '',
'MODERATORS' => (sizeof($moderators)) ? implode($user->lang['COMMA_SEPARATOR'], $moderators[$forum_id]) : '',
'USERNAME' => ((!$preview && $mode != 'quote') || $preview) ? $post_data['username'] : '',
'SUBJECT' => $post_data['post_subject'],
'MESSAGE' => $post_data['post_text'],

View File

@ -42,11 +42,7 @@ function jumpto()
*/
function marklist(id, name, state)
{
var parent = document.getElementById(id);
if (!parent)
{
eval('parent = document.' + id);
}
var parent = document.getElementById(id) || document[id];
if (!parent)
{

View File

@ -51,7 +51,7 @@
<!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF -->
<!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn>
<!-- IF forumrow.S_DISPLAY_SUBJECT -->
<a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a> <br />
<a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a> <br />
<!-- ENDIF -->
{L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
<!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{forumrow.LAST_POST_TIME}<!-- ELSE -->{L_NO_POSTS}<br />&nbsp;<!-- ENDIF --></span>

View File

@ -2,7 +2,9 @@
<script type="text/javascript">
// <![CDATA[
onload_functions.push('document.getElementById("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->").focus();');
onload_functions.push(function () {
document.getElementById("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->").focus();
});
// ]]>
</script>

View File

@ -56,7 +56,7 @@
{
for (var i = 0; i < onload_functions.length; i++)
{
eval(onload_functions[i]);
onload_functions[i]();
}
};
@ -64,7 +64,7 @@
{
for (var i = 0; i < onunload_functions.length; i++)
{
eval(onunload_functions[i]);
onunload_functions[i]();
}
};

View File

@ -1,6 +1,6 @@
<script type="text/javascript">
// <![CDATA[
onload_functions.push('apply_onkeypress_event()');
onload_functions.push(apply_onkeypress_event);
// ]]>
</script>

View File

@ -2,7 +2,9 @@
<script type="text/javascript">
// <![CDATA[
onload_functions.push('document.getElementById("keywords").focus();');
onload_functions.push(function () {
document.getElementById("keywords").focus();
});
// ]]>
</script>

View File

@ -26,7 +26,7 @@
{
for (var i = 0; i < onload_functions.length; i++)
{
eval(onload_functions[i]);
onload_functions[i]();
}
}
@ -34,7 +34,7 @@
{
for (var i = 0; i < onunload_functions.length; i++)
{
eval(onunload_functions[i]);
onunload_functions[i]();
}
}

View File

@ -12,7 +12,7 @@
}
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_REFRESH -->
onload_functions.push('apply_onkeypress_event()');
onload_functions.push(apply_onkeypress_event);
<!-- ENDIF -->
// ]]>

View File

@ -66,6 +66,15 @@ a.topictitle:hover {
text-decoration: underline;
}
a.lastsubject {
font-weight: bold;
text-decoration: none;
}
a.lastsubject:hover {
text-decoration: underline;
}
/* Post body links */
.postlink {
text-decoration: none;

View File

@ -61,7 +61,7 @@
<td class="row2" align="center" nowrap="nowrap">
<!-- IF forumrow.LAST_POST_TIME -->
<!-- IF forumrow.S_DISPLAY_SUBJECT -->
<p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a></p>
<p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a></p>
<!-- ENDIF -->
<p class="topicdetails"><!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}" class="imageset">{UNAPPROVED_IMG}</a>&nbsp;<!-- ENDIF -->{forumrow.LAST_POST_TIME}</p>
<p class="topicdetails">{forumrow.LAST_POSTER_FULL}

View File

@ -43,11 +43,7 @@
*/
function marklist(id, name, state)
{
var parent = document.getElementById(id);
if (!parent)
{
eval('parent = document.' + id);
}
var parent = document.getElementById(id) || document[id];
if (!parent)
{

View File

@ -71,11 +71,7 @@ function find_username(url)
*/
function marklist(id, name, state)
{
var parent = document.getElementById(id);
if (!parent)
{
eval('parent = document.' + id);
}
var parent = document.getElementById(id) || document[id];
if (!parent)
{

View File

@ -422,6 +422,15 @@ a.topictitle:visited {
text-decoration: none;
}
a.lastsubject {
font-weight: bold;
text-decoration: none;
}
a.lastsubject:hover {
text-decoration: underline;
}
th a,
th a:visited {
color: #FFA34F !important;

View File

@ -293,7 +293,7 @@ if (!empty($_EXTRA_URL))
}
$template->assign_vars(array(
'MODERATORS' => (!empty($moderators[$forum_id])) ? implode(', ', $moderators[$forum_id]) : '',
'MODERATORS' => (!empty($moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $moderators[$forum_id]) : '',
'POST_IMG' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', $post_alt) : $user->img('button_topic_new', $post_alt),
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),

View File

@ -602,7 +602,7 @@ $template->assign_vars(array(
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total_posts, $config['posts_per_page'], $start),
'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total_posts),
'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=topic_view&amp;f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start") . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : ''), true, $user->session_id) : '',
'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : '',
'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]) : '',
'POST_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'FORUM_LOCKED') : $user->img('button_topic_new', 'POST_NEW_TOPIC'),
'QUOTE_IMG' => $user->img('icon_post_quote', 'REPLY_WITH_QUOTE'),

View File

@ -12,7 +12,7 @@ class phpbb_mock_extension_manager extends phpbb_extension_manager
public function __construct($phpbb_root_path, $extensions = array())
{
$this->phpbb_root_path = $phpbb_root_path;
$this->phpEx = '.php';
$this->php_ext = '.php';
$this->extensions = $extensions;
}
}

View File

@ -0,0 +1,102 @@
<?php
/**
*
* @package testing
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_privmsgs.php';
class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case
{
public function getDataSet()
{
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/delete_user_pms.xml');
}
public static function delete_user_pms_data()
{
return array(
// array(
// (user we delete),
// array(remaining privmsgs ids),
// array(remaining privmsgs_to),
// ),
array(
2,
array(
array('msg_id' => 1),
),
array(
array('msg_id' => 1, 'user_id' => 3),
),
),
array(
3,
array(
array('msg_id' => 1),
array('msg_id' => 2),
array('msg_id' => 3),
array('msg_id' => 5),
),
array(
array('msg_id' => 1, 'user_id' => 2),
array('msg_id' => 1, 'user_id' => 4),
array('msg_id' => 2, 'user_id' => 2),
array('msg_id' => 2, 'user_id' => 4),
array('msg_id' => 3, 'user_id' => 2),
array('msg_id' => 5, 'user_id' => 2),
array('msg_id' => 5, 'user_id' => 4),
),
),
array(
5,
array(
array('msg_id' => 1),
array('msg_id' => 2),
array('msg_id' => 3),
array('msg_id' => 4),
array('msg_id' => 5),
),
array(
array('msg_id' => 1, 'user_id' => 2),
array('msg_id' => 1, 'user_id' => 3),
array('msg_id' => 1, 'user_id' => 4),
array('msg_id' => 2, 'user_id' => 2),
array('msg_id' => 2, 'user_id' => 4),
array('msg_id' => 3, 'user_id' => 2),
array('msg_id' => 4, 'user_id' => 3),
array('msg_id' => 5, 'user_id' => 2),
array('msg_id' => 5, 'user_id' => 3),
array('msg_id' => 5, 'user_id' => 4),
),
),
);
}
/**
* @dataProvider delete_user_pms_data
*/
public function test_delete_user_pms($delete_user, $remaining_privmsgs, $remaining_privmsgs_to)
{
global $db;
$db = $this->new_dbal();
phpbb_delete_user_pms($delete_user);
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TABLE;
$result = $db->sql_query($sql);
$this->assertEquals($remaining_privmsgs, $db->sql_fetchrowset($result));
$sql = 'SELECT msg_id, user_id
FROM ' . PRIVMSGS_TO_TABLE;
$result = $db->sql_query($sql);
$this->assertEquals($remaining_privmsgs_to, $db->sql_fetchrowset($result));
}
}

View File

@ -0,0 +1,215 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dataset>
<table name="phpbb_users">
<column>user_id</column>
<column>username</column>
<column>username_clean</column>
<column>user_new_privmsg</column>
<column>user_unread_privmsg</column>
<column>user_permissions</column>
<column>user_sig</column>
<column>user_occ</column>
<column>user_interests</column>
<row>
<value>2</value>
<value>sender</value>
<value>sender</value>
<value>0</value>
<value>0</value>
<value></value>
<value></value>
<value></value>
<value></value>
</row>
<row>
<value>3</value>
<value>pm in inbox</value>
<value>pm in inbox</value>
<value>0</value>
<value>0</value>
<value></value>
<value></value>
<value></value>
<value></value>
</row>
<row>
<value>4</value>
<value>pm in no box</value>
<value>pm in no box</value>
<value>2</value>
<value>2</value>
<value></value>
<value></value>
<value></value>
<value></value>
</row>
<row>
<value>5</value>
<value>no pms</value>
<value>no pms</value>
<value>0</value>
<value>0</value>
<value></value>
<value></value>
<value></value>
<value></value>
</row>
</table>
<table name="phpbb_privmsgs">
<column>msg_id</column>
<column>root_level</column>
<column>author_id</column>
<column>message_subject</column>
<column>message_text</column>
<column>to_address</column>
<column>bcc_address</column>
<row>
<value>1</value>
<value>0</value>
<value>2</value>
<value>#1</value>
<value>
2 - outbox
3 - inbox
4 - nobox
</value>
<value></value>
<value></value>
</row>
<row>
<value>2</value>
<value>0</value>
<value>2</value>
<value>#2</value>
<value>
2 - outbox
4 - nobox
</value>
<value></value>
<value></value>
</row>
<row>
<value>3</value>
<value>0</value>
<value>2</value>
<value>#3</value>
<value>
2 - outbox
</value>
<value></value>
<value></value>
</row>
<row>
<value>4</value>
<value>0</value>
<value>2</value>
<value>#4</value>
<value>
3 - nobox
</value>
<value></value>
<value></value>
</row>
<row>
<value>5</value>
<value>0</value>
<value>2</value>
<value>#5</value>
<value>
2 - outbox
3 - nobox
4 - nobox
</value>
<value></value>
<value></value>
</row>
</table>
<table name="phpbb_privmsgs_to">
<column>msg_id</column>
<column>user_id</column>
<column>author_id</column>
<column>pm_new</column>
<column>pm_unread</column>
<column>folder_id</column>
<row>
<value>1</value>
<value>2</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>-2</value>
</row>
<row>
<value>1</value>
<value>3</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>0</value>
</row>
<row>
<value>1</value>
<value>4</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>-3</value>
</row>
<row>
<value>2</value>
<value>2</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>-2</value>
</row>
<row>
<value>2</value>
<value>4</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>-3</value>
</row>
<row>
<value>3</value>
<value>2</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>-2</value>
</row>
<row>
<value>4</value>
<value>3</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>-3</value>
</row>
<row>
<value>5</value>
<value>2</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>-2</value>
</row>
<row>
<value>5</value>
<value>3</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>-3</value>
</row>
<row>
<value>5</value>
<value>4</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>-3</value>
</row>
</table>
</dataset>