diff options
58 files changed, 1686 insertions, 3066 deletions
diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php index a3b5b64e7e..05587a897e 100644 --- a/phpBB/adm/admin_attachments.php +++ b/phpBB/adm/admin_attachments.php @@ -104,23 +104,6 @@ if ($mode == 'attach') if ($submit) { -/* - // Update Extension Group Filesizes - if ($config_name == 'max_filesize') - { - $old_size = (int) $default_config[$config_name]; - $new_size = (int) $new[$config_name]; - - if ($old_size != $new_size) - { - // check for similar value of old_size in Extension Groups. If so, update these values. - $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . " - SET max_filesize = $new_size - WHERE max_filesize = $old_size"; - $db->sql_query($sql); - } - } -*/ set_config($config_name, $new[$config_name]); if (in_array($config_name, array('max_filesize', 'attachment_quota', 'max_filesize_pm'))) @@ -299,12 +282,13 @@ if ($submit && $mode == 'ext_groups') if (!sizeof($error)) { // Ok, build the update/insert array - $upload_icon = request_var('upload_icon', 'no_image'); - $size_select = request_var('size_select', 'b'); - $forum_select = request_var('forum_select', false); - $allowed_forums = isset($_REQUEST['allowed_forums']) ? array_map('intval', array_values($_REQUEST['allowed_forums'])) : array(); - $max_filesize = request_var('max_filesize', 0); - $max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize); + $upload_icon = request_var('upload_icon', 'no_image'); + $size_select = request_var('size_select', 'b'); + $forum_select = request_var('forum_select', false); + $allowed_forums = isset($_REQUEST['allowed_forums']) ? array_map('intval', array_values($_REQUEST['allowed_forums'])) : array(); + $allow_in_pm = isset($_REQUEST['allow_in_pm']) ? true : false; + $max_filesize = request_var('max_filesize', 0); + $max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize); if ($max_filesize == $config['max_filesize']) { @@ -323,7 +307,8 @@ if ($submit && $mode == 'ext_groups') 'download_mode' => request_var('download_mode', INLINE_LINK), 'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon, 'max_filesize' => $max_filesize, - 'allowed_forums'=> ($forum_select) ? serialize($allowed_forums) : '' + 'allowed_forums'=> ($forum_select) ? serialize($allowed_forums) : '', + 'allow_in_pm' => ($allow_in_pm) ? 1 : 0 ); $sql = ($action == 'add') ? 'INSERT INTO ' . EXTENSION_GROUPS_TABLE . ' ' : 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET '; @@ -377,7 +362,7 @@ if ($submit && $mode == 'ext_groups') if ($submit && $mode == 'orphan') { $delete_files = array_keys(request_var('delete', '')); - $add_files = array_keys(request_var('add', '')); + $add_files = (isset($_REQUEST['add'])) ? array_keys(request_var('add', '')) : array(); $post_ids = request_var('post_id', 0); foreach ($delete_files as $delete) @@ -802,6 +787,7 @@ if ($mode == 'ext_groups') $group_name = request_var('group_name', ''); $cat_id = 0; $allow_group = 1; + $allow_in_pm = 1; $download_mode = 1; $upload_icon = ''; $max_filesize = 0; @@ -838,7 +824,8 @@ if ($mode == 'ext_groups') $max_filesize = ($max_filesize >= 1048576) ? round($max_filesize / 1048576 * 100) / 100 : (($max_filesize >= 1024) ? round($max_filesize / 1024 * 100) / 100 : $max_filesize); - $s_allowed = ($allow_group == 1) ? 'checked="checked"' : ''; + $s_allowed = ($allow_group) ? ' checked="checked"' : ''; + $s_in_pm_allowed = ($allow_in_pm) ? ' checked="checked"' : ''; $filename_list = ''; $no_image_select = false; @@ -926,7 +913,11 @@ if ($mode == 'ext_groups') </tr> <tr> <td class="row1" width="35%"><b><?php echo $user->lang['ALLOWED']; ?></b>:</td> - <td class="row2"><input type="checkbox" name="allow_group" value="<?php echo $group_id; ?>" <?php echo $s_allowed; ?> /></td> + <td class="row2"><input type="checkbox" name="allow_group" value="<?php echo $group_id; ?>"<?php echo $s_allowed; ?> /></td> + </tr> + <tr> + <td class="row1" width="35%"><b><?php echo $user->lang['ALLOW_IN_PM']; ?></b>:</td> + <td class="row2"><input type="checkbox" name="allow_in_pm" value="1"<?php echo $s_in_pm_allowed; ?> /></td> </tr> <tr> <td class="row1" width="35%"><b><?php echo $user->lang['DOWNLOAD_MODE']; ?></b>:</td> @@ -1416,9 +1407,10 @@ function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename) if ($filedata['post_attach'] && !sizeof($filedata['error'])) { $message_parser->attachment_data = array( - 'post_id' => $post_id, + 'post_msg_id' => $post_id, 'poster_id' => $user->data['user_id'], 'topic_id' => $topic_id, + 'in_message' => 0, 'physical_filename' => $filedata['destination_filename'], 'real_filename' => $filedata['filename'], 'comment' => $message_parser->filename_data['filecomment'], @@ -1725,8 +1717,15 @@ function rewrite_extensions() $extensions[$extension]['upload_icon'] = (string) $row['upload_icon']; $extensions[$extension]['max_filesize'] = (int) $row['max_filesize']; + $allowed_forums = ($row['allowed_forums']) ? unserialize(trim($row['allowed_forums'])) : array(); + + if ($row['allow_in_pm']) + { + $allowed_forums = array_merge($allowed_forums, array(0)); + } + // Store allowed extensions forum wise - $extensions['_allowed_'][$extension] = (!$row['allowed_forums']) ? 0 : unserialize(trim($row['allowed_forums'])); + $extensions['_allowed_'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums; } $db->sql_freeresult($result); diff --git a/phpBB/adm/admin_board.php b/phpBB/adm/admin_board.php index c55205c116..ac65b60816 100644 --- a/phpBB/adm/admin_board.php +++ b/phpBB/adm/admin_board.php @@ -22,6 +22,7 @@ if (!empty($setmodules)) $module['GENERAL']['EMAIL_SETTINGS'] = ($auth->acl_get('a_server')) ? "$filename$SID&mode=email" : ''; $module['GENERAL']['LOAD_SETTINGS'] = ($auth->acl_get('a_server')) ? "$filename$SID&mode=load" : ''; $module['GENERAL']['SERVER_SETTINGS'] = ($auth->acl_get('a_server')) ? "$filename$SID&mode=server" : ''; + $module['GENERAL']['MESSAGE_SETTINGS'] = ($auth->acl_get('a_defaults')) ? "$filename$SID&mode=message" : ''; $module['USER']['KARMA_SETTINGS'] = ($auth->acl_get('a_user')) ? "$filename$SID&mode=karma" : ''; return; } @@ -76,6 +77,10 @@ switch ($mode) $l_title = 'KARMA_SETTINGS'; $which_auth = 'a_user'; break; + case 'message': + $l_title = 'MESSAGE_SETTINGS'; + $which_auth = 'a_defaults'; + break; default: return; } @@ -86,32 +91,21 @@ if (!$auth->acl_get($which_auth)) trigger_error($user->lang['NO_ADMIN']); } -// Pull all config data -$sql = 'SELECT * - FROM ' . CONFIG_TABLE; -$result = $db->sql_query($sql); +$new = $config; +$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', '') : $new; -while ($row = $db->sql_fetchrow($result)) +foreach ($cfg_array as $config_name => $config_value) { - $config_name = $row['config_name']; - $config_value = $row['config_value']; - - $default_config[$config_name] = $config_value; - $new[$config_name] = request_var($config_name, $default_config[$config_name]); - - if ($config_name == 'bump_interval' && $submit) - { - $new['bump_interval'] = request_var('bump_interval', 2) . request_var('bump_type', 'd'); - } + $new[$config_name] = $config_value; if ($config_name == 'email_function_name') { $new['email_function_name'] = (empty($new['email_function_name']) || !function_exists($new['email_function_name'])) ? 'mail' : str_replace(array('(', ')'), array('', ''), trim($new['email_function_name'])); } - + if ($submit) { - set_config($config_name, $new[$config_name]); + set_config($config_name, $config_value); } } @@ -147,19 +141,19 @@ switch ($mode) ?> <tr> <td class="row1" width="50%"><b><?php echo $user->lang['COOKIE_DOMAIN']; ?>: </b></td> - <td class="row2"><input class="post" type="text" maxlength="255" name="cookie_domain" value="<?php echo $new['cookie_domain']; ?>" /></td> + <td class="row2"><input class="post" type="text" maxlength="255" name="config[cookie_domain]" value="<?php echo $new['cookie_domain']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['COOKIE_NAME']; ?>: </b></td> - <td class="row2"><input class="post" type="text" maxlength="16" name="cookie_name" value="<?php echo $new['cookie_name']; ?>" /></td> + <td class="row2"><input class="post" type="text" maxlength="16" name="config[cookie_name]" value="<?php echo $new['cookie_name']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['COOKIE_PATH']; ?>: </b></td> - <td class="row2"><input class="post" type="text" maxlength="255" name="cookie_path" value="<?php echo $new['cookie_path']; ?>" /></td> + <td class="row2"><input class="post" type="text" maxlength="255" name="config[cookie_p]" value="<?php echo $new['cookie_path']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['COOKIE_SECURE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['COOKIE_SECURE_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="cookie_secure" value="0"<?php echo $cookie_secure_no; ?> /><?php echo $user->lang['DISABLED']; ?> <input type="radio" name="cookie_secure" value="1"<?php echo $cookie_secure_yes; ?> /><?php echo $user->lang['ENABLED']; ?></td> + <td class="row2"><input type="radio" name="config[cookie_secure]" value="0"<?php echo $cookie_secure_no; ?> /><?php echo $user->lang['DISABLED']; ?> <input type="radio" name="config[cookie_secure]" value="1"<?php echo $cookie_secure_yes; ?> /><?php echo $user->lang['ENABLED']; ?></td> </tr> <?php @@ -177,35 +171,35 @@ switch ($mode) ?> <tr> <td class="row1" width="50%"><b><?php echo $user->lang['ALLOW_LOCAL']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_avatar_local" value="1"<?php echo $avatars_local_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_avatar_local" value="0"<?php echo $avatars_local_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_avatar_local]" value="1"<?php echo $avatars_local_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_avatar_local]" value="0"<?php echo $avatars_local_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_REMOTE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ALLOW_REMOTE_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="allow_avatar_remote" value="1"<?php echo $avatars_remote_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_avatar_remote" value="0"<?php echo $avatars_remote_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_avatar_remote]" value="1"<?php echo $avatars_remote_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_avatar_remote]" value="0"<?php echo $avatars_remote_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_UPLOAD']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_avatar_upload" value="1"<?php echo $avatars_upload_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_avatar_upload" value="0"<?php echo $avatars_upload_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_avatar_upload]" value="1"<?php echo $avatars_upload_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_avatar_upload]" value="0"<?php echo $avatars_upload_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['MAX_FILESIZE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['MAX_FILESIZE_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="4" maxlength="10" name="avatar_filesize" value="<?php echo $new['avatar_filesize']; ?>" /> Bytes</td> + <td class="row2"><input class="post" type="text" size="4" maxlength="10" name="config[avatar_filesize]" value="<?php echo $new['avatar_filesize']; ?>" /> Bytes</td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['MIN_AVATAR_SIZE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['MIN_AVATAR_SIZE_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="avatar_min_height" value="<?php echo $new['avatar_min_height']; ?>" /> x <input class="post" type="text" size="3" maxlength="4" name="avatar_min_width" value="<?php echo $new['avatar_min_width']; ?>"></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="config[avatar_min_height]" value="<?php echo $new['avatar_min_height']; ?>" /> x <input class="post" type="text" size="3" maxlength="4" name="config[avatar_min_width]" value="<?php echo $new['avatar_min_width']; ?>"></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['MAX_AVATAR_SIZE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['MAX_AVATAR_SIZE_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="avatar_max_height" value="<?php echo $new['avatar_max_height']; ?>" /> x <input class="post" type="text" size="3" maxlength="4" name="avatar_max_width" value="<?php echo $new['avatar_max_width']; ?>"></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="config[avatar_max_height]" value="<?php echo $new['avatar_max_height']; ?>" /> x <input class="post" type="text" size="3" maxlength="4" name="config[avatar_max_width]" value="<?php echo $new['avatar_max_width']; ?>"></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['AVATAR_STORAGE_PATH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['AVATAR_STORAGE_PATH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="avatar_path" value="<?php echo $new['avatar_path']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="config[avatar_path]" value="<?php echo $new['avatar_path']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['AVATAR_GALLERY_PATH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['AVATAR_GALLERY_PATH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="avatar_gallery_path" value="<?php echo $new['avatar_gallery_path']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="config[avatar_gallery_path]" value="<?php echo $new['avatar_gallery_path']; ?>" /></td> </tr> <?php @@ -220,7 +214,7 @@ switch ($mode) $dst_yes = ($new['board_dst']) ? 'checked="checked"' : ''; $dst_no = (!$new['board_dst']) ? 'checked="checked"' : ''; - $yes_no_switches = array('override_user_style', 'allow_topic_notify', 'allow_forum_notify', 'allow_html', 'allow_bbcode', 'allow_smilies', 'allow_sig', 'allow_nocensors', 'allow_namechange', 'allow_attachments', 'allow_pm_attach', 'board_dst'); + $yes_no_switches = array('override_user_style', 'allow_privmsg', 'allow_topic_notify', 'allow_forum_notify', 'allow_html', 'allow_bbcode', 'allow_smilies', 'allow_sig', 'allow_nocensors', 'allow_namechange', 'allow_attachments', 'allow_pm_attach', 'board_dst'); foreach ($yes_no_switches as $switch) { @@ -232,83 +226,79 @@ switch ($mode) ?> <tr> <td class="row1" width="50%"><b><?php echo $user->lang['DEFAULT_STYLE']; ?></td> - <td class="row2"><select name="default_style"><?php echo $style_select; ?></select></td> + <td class="row2"><select name="config[default_style]"><?php echo $style_select; ?></select></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['OVERRIDE_STYLE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['OVERRIDE_STYLE_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="override_user_style" value="1" <?php echo $override_user_style_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="override_user_style" value="0" <?php echo $override_user_style_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[override_user_style]" value="1" <?php echo $override_user_style_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[override_user_style]" value="0" <?php echo $override_user_style_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['DEFAULT_LANGUAGE']; ?>: </b></td> - <td class="row2"><select name="default_lang"><?php echo $lang_select; ?></select></td> + <td class="row2"><select name="config[default_lang]"><?php echo $lang_select; ?></select></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['DEFAULT_DATE_FORMAT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['DEFAULT_DATE_FORMAT_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" name="default_dateformat" value="<?php echo $new['default_dateformat']; ?>" /></td> + <td class="row2"><input class="post" type="text" name="config[default_dateformat]" value="<?php echo $new['default_dateformat']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SYSTEM_TIMEZONE']; ?>: </b></td> - <td class="row2"><select name="board_timezone"><?php echo $timezone_select; ?></select></td> + <td class="row2"><select name="config[board_timezone]"><?php echo $timezone_select; ?></select></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SYSTEM_DST']; ?>: </b></td> - <td class="row2"><input type="radio" name="board_dst" value="1" <?php echo $board_dst_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="board_dst" value="0" <?php echo $board_dst_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[board_dst]" value="1" <?php echo $board_dst_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[board_dst]" value="0" <?php echo $board_dst_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> - <td class="row1"><b><?php echo $user->lang['BOXES_MAX']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['BOXES_MAX_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" maxlength="4" size="4" name="pm_max_boxes" value="<?php echo $new['pm_max_boxes']; ?>" /></td> - </tr> - <tr> - <td class="row1"><b><?php echo $user->lang['BOXES_LIMIT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['BOXES_LIMIT_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" maxlength="4" size="4" name="pm_max_msgs" value="<?php echo $new['pm_max_msgs']; ?>" /></td> + <td class="row1"><b><?php echo $user->lang['BOARD_PM']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['BOARD_PM_EXPLAIN']; ?></span></td> + <td class="row2"><input type="radio" name="config[allow_privmsg]" value="1" <?php echo $privmsg_yes; ?> /><?php echo $user->lang['ENABLED']; ?> <input type="radio" name="config[allow_privmsg]" value="0" <?php echo $privmsg_no; ?> /><?php echo $user->lang['DISABLED']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_TOPIC_NOTIFY']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_topic_notify" value="1" <?php echo $topic_notify_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_topic_notify" value="0" <?php echo $topic_notify_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_topic_notify]" value="1" <?php echo $topic_notify_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_topic_notify]" value="0" <?php echo $topic_notify_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_FORUM_NOTIFY']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_forum_notify" value="1" <?php echo $forum_notify_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_forum_notify" value="0" <?php echo $forum_notify_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_forum_notify]" value="1" <?php echo $forum_notify_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_forum_notify]" value="0" <?php echo $forum_notify_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_NAME_CHANGE']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_namechange" value="1" <?php echo $namechange_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_namechange" value="0" <?php echo $namechange_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_namechange]" value="1" <?php echo $namechange_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_namechange]" value="0" <?php echo $namechange_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_ATTACHMENTS']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_attachments" value="1" <?php echo $attachments_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_attachments" value="0" <?php echo $attachments_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_attachments]" value="1" <?php echo $attachments_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_attachments]" value="0" <?php echo $attachments_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_PM_ATTACHMENTS']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_pm_attach" value="1" <?php echo $pm_attach_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_pm_attach" value="0" <?php echo $pm_attach_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_pm_attach]" value="1" <?php echo $pm_attach_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_pm_attach]" value="0" <?php echo $pm_attach_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_HTML']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_html" value="1" <?php echo $html_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_html" value="0" <?php echo $html_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_html]" value="1" <?php echo $html_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_html]" value="0" <?php echo $html_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOWED_TAGS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ALLOWED_TAGS_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="30" maxlength="255" name="allow_html_tags" value="<?php echo $new['allow_html_tags']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="30" maxlength="255" name="config[allow_html_tags]" value="<?php echo $new['allow_html_tags']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_BBCODE']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_bbcode" value="1" <?php echo $bbcode_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_bbcode" value="0" <?php echo $bbcode_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_bbcode]" value="1" <?php echo $bbcode_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_bbcode]" value="0" <?php echo $bbcode_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_SMILIES']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_smilies" value="1" <?php echo $smilies_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_smilies" value="0" <?php echo $smilies_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_smilies]" value="1" <?php echo $smilies_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_smilies]" value="0" <?php echo $smilies_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_SIG']; ?>: </b></td> - <td class="row2"><input type="radio" name="allow_sig" value="1" <?php echo $sig_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_sig" value="0" <?php echo $sig_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_sig]" value="1" <?php echo $sig_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_sig]" value="0" <?php echo $sig_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['MAX_SIG_LENGTH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['MAX_SIG_LENGTH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="5" maxlength="4" name="max_sig_chars" value="<?php echo $new['max_sig_chars']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="5" maxlength="4" name="config[max_sig_chars]" value="<?php echo $new['max_sig_chars']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_NO_CENSORS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ALLOW_NO_CENSORS_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="allow_nocensors" value="1" <?php echo $nocensors_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_nocensors" value="0" <?php echo $nocensors_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[allow_nocensors]" value="1" <?php echo $nocensors_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_nocensors]" value="0" <?php echo $nocensors_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <?php @@ -316,7 +306,7 @@ switch ($mode) case 'setting': - $yes_no_switches = array('board_disable', 'enable_confirm', 'coppa_enable', 'privmsg_disable', 'display_last_edited', 'emailreuse'); + $yes_no_switches = array('board_disable', 'enable_confirm', 'coppa_enable', 'display_last_edited', 'allow_emailreuse'); foreach ($yes_no_switches as $switch) { @@ -330,14 +320,11 @@ switch ($mode) $activation_admin = ($new['require_activation'] == USER_ACTIVATION_ADMIN) ? 'checked="checked"' : ''; $activation_disable = ($new['require_activation'] == USER_ACTIVATION_DISABLE) ? 'checked="checked"' : ''; - preg_match('#^([0-9]+)([m|h|d])$#', $new['bump_interval'], $match); - $bump_time = $match[1]; - $s_bump_type = ''; $types = array('m' => 'MINUTES', 'h' => 'HOURS', 'd' => 'DAYS'); foreach ($types as $type => $lang) { - $selected = ($type == $match[2]) ? 'selected="selected" ' : ''; + $selected = ($new['bump_type'] == $type) ? 'selected="selected" ' : ''; $s_bump_type .= '<option value="' . $type . '" ' . $selected . '>' . $user->lang[$lang] . '</option>'; } @@ -353,118 +340,114 @@ switch ($mode) $pass_char_options = ''; foreach ($pass_type_ary as $lang => $value) { - $selected = ($new['allow_pass_chars'] == $value) ? ' selected="selected"' : ''; + $selected = ($new['pass_complex'] == $value) ? ' selected="selected"' : ''; $pass_char_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$lang] . '</option>'; } ?> <tr> <td class="row1" width="50%"><b><?php echo $user->lang['SITE_NAME']; ?>: </b></td> - <td class="row2"><input class="post" type="text" size="40" maxlength="255" name="sitename" value="<?php echo $new['sitename']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="40" maxlength="255" name="config[sitename]" value="<?php echo $new['sitename']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SITE_DESC']; ?>: </b></td> - <td class="row2"><input class="post" type="text" size="40" maxlength="255" name="site_desc" value="<?php echo $new['site_desc']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="40" maxlength="255" name="config[site_desc]" value="<?php echo $new['site_desc']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['DISABLE_BOARD']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['DISABLE_BOARD_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="board_disable" value="1" <?php echo $board_disable_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="board_disable" value="0" <?php echo $board_disable_no; ?> /> <?php echo $user->lang['NO']; ?><br /><input class="post" type="text" name="board_disable_msg" maxlength="255" size="40" value="<?php echo $new['board_disable_msg']; ?>" /></td> + <td class="row2"><input type="radio" name="config[board_disable]" value="1" <?php echo $board_disable_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[board_disable]" value="0" <?php echo $board_disable_no; ?> /> <?php echo $user->lang['NO']; ?><br /><input class="post" type="text" name="config[board_disable_msg]" maxlength="255" size="40" value="<?php echo $new['board_disable_msg']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ACC_ACTIVATION']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ACC_ACTIVATION_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_NONE; ?>" <?php echo $activation_none; ?> /> <?php echo $user->lang['ACC_NONE']; ?><?php if ($config['email_enable']) { ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_SELF; ?>" <?php echo $activation_user; ?> /> <?php echo $user->lang['ACC_USER']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_ADMIN; ?>" <?php echo $activation_admin; ?> /> <?php echo $user->lang['ACC_ADMIN']; ?><?php } ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_DISABLE; ?>" <?php echo $activation_disable; ?> /> <?php echo $user->lang['ACC_DISABLE']; ?></td> + <td class="row2"><input type="radio" name="config[require_activation]" value="<?php echo USER_ACTIVATION_NONE; ?>" <?php echo $activation_none; ?> /> <?php echo $user->lang['ACC_NONE']; ?><?php if ($config['email_enable']) { ?> <input type="radio" name="config[require_activation]" value="<?php echo USER_ACTIVATION_SELF; ?>" <?php echo $activation_user; ?> /> <?php echo $user->lang['ACC_USER']; ?> <input type="radio" name="config[require_activation]" value="<?php echo USER_ACTIVATION_ADMIN; ?>" <?php echo $activation_admin; ?> /> <?php echo $user->lang['ACC_ADMIN']; ?><?php } ?> <input type="radio" name="config[require_activation]" value="<?php echo USER_ACTIVATION_DISABLE; ?>" <?php echo $activation_disable; ?> /> <?php echo $user->lang['ACC_DISABLE']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ENABLE_COPPA']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ENABLE_COPPA_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="coppa_enable" value="1" <?php echo $enable_confirm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="coppa_enable" value="0" <?php echo $enable_confirm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[coppa_enable]" value="1" <?php echo $enable_confirm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[coppa_enable]" value="0" <?php echo $enable_confirm_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['COPPA_FAX']; ?>: </b></td> - <td class="row2"><input class="post" type="text" size="25" maxlength="100" name="coppa_fax" value="<?php echo $new['coppa_fax']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="25" maxlength="100" name="config[coppa_fax]" value="<?php echo $new['coppa_fax']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['COPPA_MAIL']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['COPPA_MAIL_EXPLAIN']; ?></span></td> - <td class="row2"><textarea name="coppa_mail" rows="5" cols="40"><?php echo $new['coppa_mail']; ?></textarea></td> + <td class="row2"><textarea name="config[coppa_mail]" rows="5" cols="40"><?php echo $new['coppa_mail']; ?></textarea></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['VISUAL_CONFIRM']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['VISUAL_CONFIRM_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="enable_confirm" value="1"<?php echo $enable_confirm_yes ?> /> <?php echo $user->lang['YES'] ?> <input type="radio" name="enable_confirm" value="0" <?php echo $enable_confirm_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[enable_confirm]" value="1"<?php echo $enable_confirm_yes ?> /> <?php echo $user->lang['YES'] ?> <input type="radio" name="config[enable_confirm]" value="0" <?php echo $enable_confirm_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['REG_LIMIT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['REG_LIMIT_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" maxlength="4" size="4" name="max_reg_attempts" value="<?php echo $new['max_reg_attempts']; ?>" /></td> + <td class="row2"><input class="post" type="text" maxlength="4" size="4" name="config[max_reg_attempts]" value="<?php echo $new['max_reg_attempts']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['USERNAME_LENGTH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['USERNAME_LENGTH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="min_name_chars" value="<?php echo $new['min_name_chars']; ?>" /> <?php echo $user->lang['MIN_CHARS']; ?> <input class="post" type="text" size="3" maxlength="3" name="max_name_chars" value="<?php echo $new['max_name_chars']; ?>" /> <?php echo $user->lang['MAX_CHARS']; ?></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="config[min_name_chars]" value="<?php echo $new['min_name_chars']; ?>" /> <?php echo $user->lang['MIN_CHARS']; ?> <input class="post" type="text" size="3" maxlength="3" name="config[max_name_chars]" value="<?php echo $new['max_name_chars']; ?>" /> <?php echo $user->lang['MAX_CHARS']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['USERNAME_CHARS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['USERNAME_CHARS_EXPLAIN']; ?></span></td> - <td class="row2"><select name="allow_name_chars"><?php echo $user_char_options; ?></select></td> + <td class="row2"><select name="config[allow_name_chars]"><?php echo $user_char_options; ?></select></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['PASSWORD_LENGTH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['PASSWORD_LENGTH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="min_pass_chars" value="<?php echo $new['min_pass_chars']; ?>" /> <?php echo $user->lang['MIN_CHARS']; ?> <input class="post" type="text" size="3" maxlength="3" name="max_pass_chars" value="<?php echo $new['max_pass_chars']; ?>" /> <?php echo $user->lang['MAX_CHARS']; ?></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="config[min_pass_chars]" value="<?php echo $new['min_pass_chars']; ?>" /> <?php echo $user->lang['MIN_CHARS']; ?> <input class="post" type="text" size="3" maxlength="3" name="config[max_pass_chars]" value="<?php echo $new['max_pass_chars']; ?>" /> <?php echo $user->lang['MAX_CHARS']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['PASSWORD_TYPE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['PASSWORD_TYPE_EXPLAIN']; ?></span></td> - <td class="row2"><select name="pass_complex"><?php echo $pass_char_options; ?></select></td> + <td class="row2"><select name="config[pass_complex]"><?php echo $pass_char_options; ?></select></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['FORCE_PASS_CHANGE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['FORCE_PASS_CHANGE_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="chg_passforce" value="<?php echo $new['chg_passforce']; ?>" /> <?php echo $user->lang['DAYS']; ?></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="config[chg_passforce]" value="<?php echo $new['chg_passforce']; ?>" /> <?php echo $user->lang['DAYS']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ALLOW_EMAIL_REUSE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ALLOW_EMAIL_REUSE_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="allow_emailreuse" value="1" <?php echo $emailreuse_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_emailreuse" value="0" <?php echo $emailreuse_no; ?> /> <?php echo $user->lang['NO']; ?></td> - </tr> - <tr> - <td class="row1"><b><?php echo $user->lang['BOARD_PM']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['BOARD_PM_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="privmsg_disable" value="0" <?php echo $privmsg_disable_no; ?> /><?php echo $user->lang['ENABLED']; ?> <input type="radio" name="privmsg_disable" value="1" <?php echo $privmsg_disable_yes; ?> /><?php echo $user->lang['DISABLED']; ?></td> + <td class="row2"><input type="radio" name="config[allow_emailreuse]" value="1" <?php echo $emailreuse_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_emailreuse]" value="0" <?php echo $emailreuse_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['EDIT_TIME']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['EDIT_TIME_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" maxlength="3" size="3" name="edit_time" value="<?php echo $new['edit_time']; ?>" /></td> + <td class="row2"><input class="post" type="text" maxlength="3" size="3" name="config[edit_time]" value="<?php echo $new['edit_time']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['DISPLAY_LAST_EDITED']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['DISPLAY_LAST_EDITED_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="display_last_edited" value="1" <?php echo $display_last_edited_yes; ?> /><?php echo $user->lang['YES']; ?> <input type="radio" name="display_last_edited" value="0" <?php echo $display_last_edited_no; ?> /><?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[display_last_edited]" value="1" <?php echo $display_last_edited_yes; ?> /><?php echo $user->lang['YES']; ?> <input type="radio" name="config[display_last_edited]" value="0" <?php echo $display_last_edited_no; ?> /><?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['FLOOD_INTERVAL']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['FLOOD_INTERVAL_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="flood_interval" value="<?php echo $new['flood_interval']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="config[flood_interval]" value="<?php echo $new['flood_interval']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['BUMP_INTERVAL']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['BUMP_INTERVAL_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="bump_interval" value="<?php echo $bump_time ?>" /> <select name="bump_type"><?php echo $s_bump_type; ?></select></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="config[bump_interval]" value="<?php echo $new['bump_interval'] ?>" /> <select name="config[bump_type]"><?php echo $s_bump_type; ?></select></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['TOPICS_PER_PAGE']; ?>: </b></td> - <td class="row2"><input class="post" type="text" name="topics_per_page" size="3" maxlength="4" value="<?php echo $new['topics_per_page']; ?>" /></td> + <td class="row2"><input class="post" type="text" name="config[topics_per_page]" size="3" maxlength="4" value="<?php echo $new['topics_per_page']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['POSTS_PER_PAGE']; ?>: </b></td> - <td class="row2"><input class="post" type="text" name="posts_per_page" size="3" maxlength="4" value="<?php echo $new['posts_per_page']; ?>" /></td> + <td class="row2"><input class="post" type="text" name="config[posts_per_page]" size="3" maxlength="4" value="<?php echo $new['posts_per_page']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['HOT_THRESHOLD']; ?>: </b></td> - <td class="row2"><input class="post" type="text" name="hot_threshold" size="3" maxlength="4" value="<?php echo $new['hot_threshold']; ?>" /></td> + <td class="row2"><input class="post" type="text" name="config[hot_threshold]" size="3" maxlength="4" value="<?php echo $new['hot_threshold']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['MAX_POLL_OPTIONS']; ?>: </b></td> - <td class="row2"><input class="post" type="text" name="max_poll_options" size="4" maxlength="4" value="<?php echo $new['max_poll_options']; ?>" /></td> + <td class="row2"><input class="post" type="text" name="config[max_poll_options]" size="4" maxlength="4" value="<?php echo $new['max_poll_options']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['CHAR_LIMIT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['CHAR_LIMIT_EXPLAIN']; ?></span</td> - <td class="row2"><input class="post" type="text" size="4" maxlength="6" name="max_post_chars" value="<?php echo $new['max_post_chars']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="4" maxlength="6" name="config[max_post_chars]" value="<?php echo $new['max_post_chars']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SMILIES_LIMIT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SMILIES_LIMIT_EXPLAIN']; ?></span</td> - <td class="row2"><input class="post" type="text" size="4" maxlength="4" name="max_post_smilies" value="<?php echo $new['max_post_smilies']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="4" maxlength="4" name="config[max_post_smilies]" value="<?php echo $new['max_post_smilies']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['QUOTE_DEPTH_LIMIT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['QUOTE_DEPTH_LIMIT_EXPLAIN']; ?></span</td> - <td class="row2"><input class="post" type="text" size="4" maxlength="4" name="max_quote_depth" value="<?php echo $new['max_quote_depth']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="4" maxlength="4" name="config[max_quote_depth]" value="<?php echo $new['max_quote_depth']; ?>" /></td> </tr> <?php @@ -491,55 +474,55 @@ switch ($mode) ?> <tr> <td class="row1" width="50%"><b><?php echo $user->lang['ENABLE_EMAIL']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ENABLE_EMAIL_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="email_enable" value="1" <?php echo $email_yes; ?> /> <?php echo $user->lang['ENABLED']; ?> <input type="radio" name="email_enable" value="0" <?php echo $email_no; ?> /> <?php echo $user->lang['DISABLED']; ?></td> + <td class="row2"><input type="radio" name="config[email_enable]" value="1" <?php echo $email_yes; ?> /> <?php echo $user->lang['ENABLED']; ?> <input type="radio" name="config[email_enable]" value="0" <?php echo $email_no; ?> /> <?php echo $user->lang['DISABLED']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['BOARD_EMAIL_FORM']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['BOARD_EMAIL_FORM_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="board_email_form" value="1" <?php echo $board_email_form_yes; ?> /> <?php echo $user->lang['ENABLED']; ?> <input type="radio" name="board_email_form" value="0" <?php echo $board_email_form_no; ?> /> <?php echo $user->lang['DISABLED']; ?></td> + <td class="row2"><input type="radio" name="config[board_email_form]" value="1" <?php echo $board_email_form_yes; ?> /> <?php echo $user->lang['ENABLED']; ?> <input type="radio" name="config[board_email_form]" value="0" <?php echo $board_email_form_no; ?> /> <?php echo $user->lang['DISABLED']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['EMAIL_FUNCTION_NAME']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['EMAIL_FUNCTION_NAME_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="20" maxlength="50" name="email_function_name" value="<?php echo $new['email_function_name']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="20" maxlength="50" name="config[email_function_name]" value="<?php echo $new['email_function_name']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['EMAIL_PACKAGE_SIZE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['EMAIL_PACKAGE_SIZE_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="5" maxlength="5" name="email_package_size" value="<?php echo $new['email_package_size']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="5" maxlength="5" name="config[email_package_size]" value="<?php echo $new['email_package_size']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['CONTACT_EMAIL']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['CONTACT_EMAIL_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="25" maxlength="100" name="board_contact" value="<?php echo $new['board_contact']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="25" maxlength="100" name="config[board_contact]" value="<?php echo $new['board_contact']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ADMIN_EMAIL']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ADMIN_EMAIL_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="25" maxlength="100" name="board_email" value="<?php echo $new['board_email']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="25" maxlength="100" name="config[board_email]" value="<?php echo $new['board_email']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['EMAIL_SIG']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['EMAIL_SIG_EXPLAIN']; ?></span></td> - <td class="row2"><textarea name="board_email_sig" rows="5" cols="30"><?php echo $new['board_email_sig']; ?></textarea></td> + <td class="row2"><textarea name="config[board_email_sig]" rows="5" cols="30"><?php echo $new['board_email_sig']; ?></textarea></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['USE_SMTP']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['USE_SMTP_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="smtp_delivery" value="1" <?php echo $smtp_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="smtp_delivery" value="0" <?php echo $smtp_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[smtp_delivery]" value="1" <?php echo $smtp_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[smtp_delivery]" value="0" <?php echo $smtp_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SMTP_SERVER']; ?>: </b></td> - <td class="row2"><input class="post" type="text" name="smtp_host" value="<?php echo $new['smtp_host']; ?>" size="25" maxlength="50" /></td> + <td class="row2"><input class="post" type="text" name="config[smtp_host]" value="<?php echo $new['smtp_host']; ?>" size="25" maxlength="50" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SMTP_PORT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SMTP_PORT_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" name="smtp_port" value="<?php echo $new['smtp_port']; ?>" size="4" maxlength="5" /></td> + <td class="row2"><input class="post" type="text" name="config[smtp_port]" value="<?php echo $new['smtp_port']; ?>" size="4" maxlength="5" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SMTP_AUTH_METHOD']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SMTP_AUTH_METHOD_EXPLAIN']; ?></span></td> - <td class="row2"><select name="smtp_auth_method"><?php echo $s_smtp_auth_options; ?></select></td> + <td class="row2"><select name="config[smtp_auth_method]"><?php echo $s_smtp_auth_options; ?></select></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SMTP_USERNAME']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SMTP_USERNAME_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" name="smtp_username" value="<?php echo $new['smtp_username']; ?>" size="25" maxlength="255" /></td> + <td class="row2"><input class="post" type="text" name="config[smtp_username]" value="<?php echo $new['smtp_username']; ?>" size="25" maxlength="255" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SMTP_PASSWORD']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SMTP_PASSWORD_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="password" name="smtp_password" value="<?php echo $new['smtp_password']; ?>" size="25" maxlength="255" /></td> + <td class="row2"><input class="post" type="password" name="config[smtp_password]" value="<?php echo $new['smtp_password']; ?>" size="25" maxlength="255" /></td> </tr> <?php @@ -560,43 +543,43 @@ switch ($mode) ?> <tr> <td class="row1" width="50%"><b><?php echo $user->lang['SERVER_NAME']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SERVER_NAME_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" maxlength="255" size="40" name="server_name" value="<?php echo $new['server_name']; ?>" /></td> + <td class="row2"><input class="post" type="text" maxlength="255" size="40" name="config[server_name]" value="<?php echo $new['server_name']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SERVER_PORT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SERVER_PORT_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" maxlength="5" size="5" name="server_port" value="<?php echo $new['server_port']; ?>" /></td> + <td class="row2"><input class="post" type="text" maxlength="5" size="5" name="config[server_port]" value="<?php echo $new['server_port']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SCRIPT_PATH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SCRIPT_PATH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" maxlength="255" name="script_path" value="<?php echo $new['script_path']; ?>" /></td> + <td class="row2"><input class="post" type="text" maxlength="255" name="config[script_path]" value="<?php echo $new['script_path']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['IP_VALID']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['IP_VALID_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="ip_check" value="4" <?php echo $ip_all; ?> /> <?php echo $user->lang['ALL']; ?> <input type="radio" name="ip_check" value="3" <?php echo $ip_classc; ?> /> <?php echo $user->lang['CLASS_C']; ?> <input type="radio" name="ip_check" value="2" <?php echo $ip_classb; ?> /> <?php echo $user->lang['CLASS_B']; ?> <input type="radio" name="ip_check" value="0" <?php echo $ip_none; ?> /> <?php echo $user->lang['NONE']; ?> </td> + <td class="row2"><input type="radio" name="config[ip_check]" value="4" <?php echo $ip_all; ?> /> <?php echo $user->lang['ALL']; ?> <input type="radio" name="config[ip_check]" value="3" <?php echo $ip_classc; ?> /> <?php echo $user->lang['CLASS_C']; ?> <input type="radio" name="config[ip_check]" value="2" <?php echo $ip_classb; ?> /> <?php echo $user->lang['CLASS_B']; ?> <input type="radio" name="config[ip_check]" value="0" <?php echo $ip_none; ?> /> <?php echo $user->lang['NONE']; ?> </td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['BROWSER_VALID']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['BROWSER_VALID_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="browser_check" value="1" <?php echo $browser_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="browser_check" value="0" <?php echo $browser_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[browser_check]" value="1" <?php echo $browser_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[browser_check]" value="0" <?php echo $browser_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ENABLE_GZIP']; ?>: </b></td> - <td class="row2"><input type="radio" name="gzip_compress" value="1" <?php echo $gzip_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="gzip_compress" value="0" <?php echo $gzip_no; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[gzip_compress]" value="1" <?php echo $gzip_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[gzip_compress]" value="0" <?php echo $gzip_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SMILIES_PATH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SMILIES_PATH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="smilies_path" value="<?php echo $new['smilies_path']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="config[smilies_path]" value="<?php echo $new['smilies_path']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ICONS_PATH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ICONS_PATH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="icons_path" value="<?php echo $new['icons_path']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="config[icons_path]" value="<?php echo $new['icons_path']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['UPLOAD_ICONS_PATH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['UPLOAD_ICONS_PATH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="upload_icons_path" value="<?php echo $new['upload_icons_path']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="config[upload_icons_path]" value="<?php echo $new['upload_icons_path']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['RANKS_PATH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['RANKS_PATH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="ranks_path" value="<?php echo $new['ranks_path']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="config[ranks_path]" value="<?php echo $new['ranks_path']; ?>" /></td> </tr> <?php @@ -630,75 +613,168 @@ switch ($mode) ?> <tr> <td class="row1" width="50%"><b><?php echo $user->lang['LIMIT_LOAD']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['LIMIT_LOAD_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="4" maxlength="4" name="limit_load" value="<?php echo $new['limit_load']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="4" maxlength="4" name="config[limit_load]" value="<?php echo $new['limit_load']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SESSION_LENGTH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SESSION_LENGTH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" maxlength="5" size="5" name="session_length" value="<?php echo $new['session_length']; ?>" /></td> + <td class="row2"><input class="post" type="text" maxlength="5" size="5" name="config[session_length]" value="<?php echo $new['session_length']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['LIMIT_SESSIONS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['LIMIT_SESSIONS_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="4" maxlength="4" name="active_sessions" value="<?php echo $new['active_sessions']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="4" maxlength="4" name="config[active_sessions]" value="<?php echo $new['active_sessions']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['YES_POST_MARKING']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['YES_POST_MARKING_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="load_db_track" value="1"<?php echo $load_db_track_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_db_track" value="0" <?php echo $load_db_track_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_db_track]" value="1"<?php echo $load_db_track_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_db_track]" value="0" <?php echo $load_db_track_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['YES_READ_MARKING']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['YES_READ_MARKING_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="load_db_lastread" value="1"<?php echo $load_db_lastread_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_db_lastread" value="0" <?php echo $load_db_lastread_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_db_lastread]" value="1"<?php echo $load_db_lastread_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_db_lastread]" value="0" <?php echo $load_db_lastread_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['YES_ONLINE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['YES_ONLINE_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="load_online" value="1"<?php echo $load_online_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_online" value="0" <?php echo $load_online_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_online]" value="1"<?php echo $load_online_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_online]" value="0" <?php echo $load_online_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['YES_ONLINE_TRACK']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['YES_ONLINE_TRACK_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="load_onlinetrack" value="1"<?php echo $load_onlinetrack_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_onlinetrack" value="0" <?php echo $load_onlinetrack_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_onlinetrack]" value="1"<?php echo $load_onlinetrack_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_onlinetrack]" value="0" <?php echo $load_onlinetrack_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['ONLINE_LENGTH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['ONLINE_LENGTH_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="4" maxlength="3" name="load_online_time" value="<?php echo $new['load_online_time']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="4" maxlength="3" name="config[load_online_time]" value="<?php echo $new['load_online_time']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['YES_BIRTHDAYS']; ?>: </b></td> - <td class="row2"><input type="radio" name="load_birthdays" value="1"<?php echo $load_birthdays_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_birthdays" value="0" <?php echo $load_birthdays_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_birthdays]" value="1"<?php echo $load_birthdays_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_birthdays]" value="0" <?php echo $load_birthdays_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['YES_MODERATORS']; ?>: </b></td> - <td class="row2"><input type="radio" name="load_moderators" value="1"<?php echo $moderators_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_moderators" value="0" <?php echo $moderators_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_moderators]" value="1"<?php echo $moderators_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_moderators]" value="0" <?php echo $moderators_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['YES_JUMPBOX']; ?>: </b></td> - <td class="row2"><input type="radio" name="load_jumpbox" value="1"<?php echo $jumpbox_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_jumpbox" value="0" <?php echo $jumpbox_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_jumpbox]" value="1"<?php echo $jumpbox_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_jumpbox]" value="0" <?php echo $jumpbox_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['YES_SEARCH']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['YES_SEARCH_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="load_search" value="1"<?php echo $search_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_search" value="0" <?php echo $search_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_search]" value="1"<?php echo $search_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_search]" value="0" <?php echo $search_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['SEARCH_INTERVAL']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SEARCH_INTERVAL_EXPLAIN']; ?></span></td> - <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="search_interval" value="<?php echo $new['search_interval']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="config[search_interval]" value="<?php echo $new['search_interval']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['MIN_SEARCH_CHARS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['MIN_SEARCH_CHARS_EXPLAIN']; ?></span</td> - <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="min_search_chars" value="<?php echo $new['min_search_chars']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="config[min_search_chars]" value="<?php echo $new['min_search_chars']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['MAX_SEARCH_CHARS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['MAX_SEARCH_CHARS_EXPLAIN']; ?></span</td> - <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="max_search_chars" value="<?php echo $new['max_search_chars']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="config[max_search_chars]" value="<?php echo $new['max_search_chars']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['YES_SEARCH_UPDATE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['YES_SEARCH_UPDATE_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="load_search_upd" value="1"<?php echo $search_update_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_search_upd" value="0" <?php echo $search_update_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_search_upd]" value="1"<?php echo $search_update_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_search_upd]" value="0" <?php echo $search_update_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <!--tr> <td class="row1"><b><?php echo $user->lang['YES_SEARCH_PHRASE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['YES_SEARCH_PHRASE_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="load_search_phr" value="1"<?php echo $search_phrase_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_search_phr" value="0" <?php echo $search_phrase_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_search_phr]" value="1"<?php echo $search_phrase_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_search_phr]" value="0" <?php echo $search_phrase_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr--> <tr> <td class="row1"><b><?php echo $user->lang['RECOMPILE_TEMPLATES']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['RECOMPILE_TEMPLATES_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="load_tplcompile" value="1"<?php echo $tplcompile_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_tplcompile" value="0" <?php echo $tplcompile_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[load_tplcompile]" value="1"<?php echo $tplcompile_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[load_tplcompile]" value="0" <?php echo $tplcompile_no ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> +<?php + + break; + + case 'message': + + $yes_no_switches = array('auth_html_pm', 'auth_bbcode_pm', 'auth_smilies_pm', 'auth_download_pm', 'allow_sig_pm', 'enable_karma_pm', 'auth_report_pm', 'auth_quote_pm', 'print_pm', 'email_pm', 'forward_pm', 'auth_img_pm', 'auth_flash_pm', 'enable_pm_icons', 'allow_mass_pm'); + + foreach ($yes_no_switches as $switch) + { + $switch_var = str_replace(array('allow_', 'auth_'), array('', ''), $switch); + ${$switch_var . '_yes'} = ($new[$switch]) ? ' checked="checked"' : ''; + ${$switch_var . '_no'} = (!$new[$switch]) ? ' checked="checked"' : ''; + } + +?> + + <tr> + <td class="row1"><b><?php echo $user->lang['BOXES_MAX']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['BOXES_MAX_EXPLAIN']; ?></span></td> + <td class="row2"><input class="post" type="text" maxlength="4" size="4" name="config[pm_max_boxes]" value="<?php echo $new['pm_max_boxes']; ?>" /></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['BOXES_LIMIT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['BOXES_LIMIT_EXPLAIN']; ?></span></td> + <td class="row2"><input class="post" type="text" maxlength="4" size="4" name="config[pm_max_msgs]" value="<?php echo $new['pm_max_msgs']; ?>" /></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['FULL_FOLDER_ACTION']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['FULL_FOLDER_ACTION_EXPLAIN']; ?></span></td> + <td class="row2"><select name="config[full_folder_action]"><option value="1"><?php echo $user->lang['DELETE_OLD_MESSAGES']; ?></option><option value="2"><?php echo $user->lang['HOLD_NEW_MESSAGES']; ?></option></select></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['PM_EDIT_TIME']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['PM_EDIT_TIME_EXPLAIN']; ?></span></td> + <td class="row2"><input class="post" type="text" maxlength="3" size="3" name="config[pm_edit_time]" value="<?php echo $new['pm_edit_time']; ?>" /></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['ALLOW_MASS_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[allow_mass_pm]" value="1" <?php echo $mass_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_mass_pm]" value="0" <?php echo $mass_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['ALLOW_HTML_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[auth_html_pm]" value="1" <?php echo $html_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[auth_html_pm]" value="0" <?php echo $html_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['ALLOW_BBCODE_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[auth_bbcode_pm]" value="1" <?php echo $bbcode_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[auth_bbcode_pm]" value="0" <?php echo $bbcode_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['ALLOW_SMILIES_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[auth_smilies_pm]" value="1" <?php echo $smilies_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[auth_smilies_pm]" value="0" <?php echo $smilies_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['AUTH_DOWNLOAD_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[auth_download_pm]" value="1" <?php echo $download_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[auth_download_pm]" value="0" <?php echo $download_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['ALLOW_SIG_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[allow_sig_pm]" value="1" <?php echo $sig_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[allow_sig_pm]" value="0" <?php echo $sig_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> +<!-- <tr> + <td class="row1" width="50%"><?php echo $user->lang['ENABLE_KARMA_PM']; ?>: </td> + <td class="row2"><input type="radio" name="config[enable_karma_pm]" value="1"<?php echo $enable_karma_pm_yes ?> /> <?php echo $user->lang['YES'] ?> <input type="radio" name="config[enable_karma_pm]" value="0" <?php echo $enable_karma_pm_no ?> /> <?php echo $user->lang['NO']; ?></td> + </tr>//--> + <tr> + <td class="row1"><b><?php echo $user->lang['AUTH_REPORT_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[auth_report_pm]" value="1" <?php echo $report_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[auth_report_pm]" value="0" <?php echo $report_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['AUTH_QUOTE_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[auth_quote_pm]" value="1" <?php echo $quote_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[auth_quote_pm]" value="0" <?php echo $quote_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['PRINT_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[print_pm]" value="1" <?php echo $print_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[print_pm]" value="0" <?php echo $print_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['EMAIL_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[email_pm]" value="1" <?php echo $email_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[email_pm]" value="0" <?php echo $email_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['FORWARD_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[forward_pm]" value="1" <?php echo $forward_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[forward_pm]" value="0" <?php echo $forward_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['AUTH_IMG_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[auth_img_pm]" value="1" <?php echo $img_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[auth_img_pm]" value="0" <?php echo $img_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['AUTH_FLASH_PM']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[auth_flash_pm]" value="1" <?php echo $flash_pm_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[auth_flash_pm]" value="0" <?php echo $flash_pm_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1"><b><?php echo $user->lang['ENABLE_PM_ICONS']; ?>: </b></td> + <td class="row2"><input type="radio" name="config[enable_pm_icons]" value="1" <?php echo $enable_pm_icons_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="config[enable_pm_icons]" value="0" <?php echo $enable_pm_icons_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <?php @@ -729,7 +805,7 @@ switch ($mode) ?> <tr> <td class="row1" width="50%"><b><?php echo $user->lang['AUTH_METHOD']; ?>: </b></td> - <td class="row2"><select name="auth_method"><?php echo $auth_select; ?></select></td> + <td class="row2"><select name="config[auth_method]"><?php echo $auth_select; ?></select></td> </tr> <?php @@ -769,27 +845,27 @@ switch ($mode) ?> <tr> <td class="row1" width="50%"><?php echo $user->lang['ENABLE_KARMA']; ?>: </td> - <td class="row2"><input type="radio" name="enable_karma" value="1"<?php echo $enable_karma_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="enable_karma" value="0" <?php echo $enable_karma_no ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row2"><input type="radio" name="config[enable_karma]" value="1"<?php echo $enable_karma_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="config[enable_karma]" value="0" <?php echo $enable_karma_no ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['MIN_RATINGS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['MIN_RATINGS_EXPLAIN']; ?></span</td> - <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="min_ratings" value="<?php echo $new['min_ratings']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="config[min_ratings]" value="<?php echo $new['min_ratings']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['KARMA_HIST_WEIGHT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['KARMA_HIST_WEIGHT_EXPLAIN']; ?></span</td> - <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="karma_hist_weight" value="<?php echo $new['karma_hist_weight']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="config[karma_hist_weight]" value="<?php echo $new['karma_hist_weight']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['KARMA_DAY_WEIGHT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['KARMA_DAY_WEIGHT_EXPLAIN']; ?></span</td> - <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="karma_day_weight" value="<?php echo $new['karma_30_weight']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="config[karma_day_weight]" value="<?php echo $new['karma_30_weight']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['KARMA_REG_WEIGHT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['KARMA_REG_WEIGHT_EXPLAIN']; ?></span</td> - <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="karma_reg_weight" value="<?php echo $new['karma_reg_weight']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="config[karma_reg_weight]" value="<?php echo $new['karma_reg_weight']; ?>" /></td> </tr> <tr> <td class="row1"><b><?php echo $user->lang['KARMA_POST_WEIGHT']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['KARMA_POST_WEIGHT_EXPLAIN']; ?></span</td> - <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="karma_post_weight" value="<?php echo $new['karma_post_weight']; ?>" /></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="config[karma_post_weight]" value="<?php echo $new['karma_post_weight']; ?>" /></td> </tr> <?php diff --git a/phpBB/adm/admin_database.php b/phpBB/adm/admin_database.php index 8c73927951..e26997fb93 100644 --- a/phpBB/adm/admin_database.php +++ b/phpBB/adm/admin_database.php @@ -19,7 +19,7 @@ if (!empty($setmodules)) $file_uploads = @ini_get('file_uploads'); if (!empty($file_uploads) && $file_uploads !== 0 && strtolower($file_uploads) != 'off' && $auth->acl_get('a_restore')) { - $module['DB']['DB_RESTORE'] = "$filenamex$SID&mode=restore"; + $module['DB']['DB_RESTORE'] = "$filename$SID&mode=restore"; } return; @@ -30,7 +30,7 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); require('pagestart.' . $phpEx); -include($phpbb_root_path . 'functions_compress.'.$phpEx); +include($phpbb_root_path . 'includes/functions_compress.'.$phpEx); @set_time_limit(1200); diff --git a/phpBB/adm/admin_forums.php b/phpBB/adm/admin_forums.php index 19cab76e6b..fb203999f5 100644 --- a/phpBB/adm/admin_forums.php +++ b/phpBB/adm/admin_forums.php @@ -1332,28 +1332,27 @@ function delete_forum_content($forum_id) // Use delete_attachments('topic', $ids, false) here... // Select then delete all attachments - $sql = 'SELECT a.physical_filename, a.thumbnail + $sql = 'SELECT a.topic_id FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_TABLE . " a WHERE p.forum_id = $forum_id - AND a.post_id = p.post_id"; + AND a.in_message = 0 + AND a.topic_id = p.topic_id"; $result = $db->sql_query($sql); + $topic_ids = array(); while ($row = $db->sql_fetchrow($result)) { - phpbb_unlink($row['physical_filename'], 'file'); - if ($row['thumbnail']) - { - phpbb_unlink($row['physical_filename'], 'thumbnail'); - } + $topic_ids[] = $row['topic_id']; } $db->sql_freeresult($result); + + delete_attachments('topic', $topic_ids, false); // Delete everything else and thank MySQL for offering multi-table deletion $tables_ary = array( SEARCH_MATCH_TABLE => 'wm.post_id', RATINGS_TABLE => 'ra.post_id', REPORTS_TABLE => 're.post_id', - ATTACHMENTS_TABLE => 'a.post_id', TOPICS_WATCH_TABLE => 'tw.topic_id', TOPICS_TRACK_TABLE => 'tt.topic_id', POLL_OPTIONS_TABLE => 'po.post_id', @@ -1391,7 +1390,8 @@ function delete_forum_content($forum_id) $sql = 'SELECT a.attach_id, a.physical_filename, a.thumbnail FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_TABLE . " a WHERE p.forum_id = $forum_id - AND a.post_id = p.post_id"; + AND a.in_message = 0 + AND a.post_msg_id = p.post_id"; $result = $db->sql_query($sql); $attach_ids = array(); diff --git a/phpBB/adm/admin_groups.php b/phpBB/adm/admin_groups.php index 75e2e6c126..8d51b867e2 100644 --- a/phpBB/adm/admin_groups.php +++ b/phpBB/adm/admin_groups.php @@ -245,12 +245,14 @@ function marklist(match, status) $group_desc = request_var('group_description', ''); $group_type = request_var('group_type', 0); - $colour = request_var('group_colour', ''); - $rank = request_var('group_rank', 0); + $colour = request_var('group_colour', ''); + $rank = request_var('group_rank', 0); $data['uploadurl'] = request_var('uploadurl', ''); $data['remotelink'] = request_var('remotelink', ''); $delete = request_var('delete', ''); + $receive_pm = isset($_REQUEST['group_receive_pm']) ? 1 : 0; + $message_limit = request_var('group_message_limit', 0); if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink']) { @@ -293,12 +295,12 @@ function marklist(match, status) // Only set the rank, colour, etc. if it's changed or if we're adding a new // group. This prevents existing group members being updated if no changes // were made. - foreach (array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height') as $test) + foreach (array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'message_limit') as $test) { ${'group_' . $test} = ($action == 'add' || (isset($$test) && $$test != ${'group_' . $test})) ? $$test : false; } - if (!($error = group_create($group_id, $group_type, $group_name, $group_description, $group_colour, $group_rank, $group_avatar, $group_avatar_type, $group_avatar_width, $group_avatar_height))) + if (!($error = group_create($group_id, $group_type, $group_name, $group_description, $group_colour, $group_rank, $group_avatar, $group_avatar_type, $group_avatar_width, $group_avatar_height, $group_receive_pm, $group_message_limit))) { $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; trigger_error($message); @@ -369,7 +371,7 @@ function marklist(match, status) function swatch() { - window.open('./swatch.<?php echo $phpEx; ?>?form=settings&name=group_colour', '_swatch', 'HEIGHT=115,resizable=yes,scrollbars=no,WIDTH=636'); + window.open('./swatch.<?php echo $phpEx; ?>?form=settings&name=group_colour', '_swatch', 'HEIGHT=115,resizable=yes,scrollbars=no,WIDTH=636'); return false; } @@ -436,6 +438,14 @@ function swatch() <th colspan="2"><?php echo $user->lang['GROUP_SETTINGS_SAVE']; ?></th> </tr> <tr> + <td class="row2"><b><?php echo $user->lang['GROUP_RECEIVE_PM']; ?>:</b></td> + <td class="row1" nowrap="nowrap"><input type="checkbox" name="group_receive_pm"<?php echo ($group_receive_pm) ? ' checked="checked"' : ''; ?> /></td> + </tr> + <tr> + <td class="row2"><b><?php echo $user->lang['GROUP_MESSAGE_LIMIT']; ?>:</b></td> + <td class="row1" nowrap="nowrap"><input class="post" type="text" maxlength="4" size="4" name="group_message_limit" value="<?php echo $group_message_limit; ?>" /></td> + </tr> + <tr> <td class="row2"><b><?php echo $user->lang['GROUP_COLOR']; ?>:</b><br /><span class="gensmall"><?php echo $user->lang['GROUP_COLOR_EXPLAIN']; ?></span></td> <td class="row1" nowrap="nowrap"><input class="post" type="text" name="group_colour" value="<?php echo (!empty($group_colour)) ? $group_colour : ''; ?>" size="6" maxlength="6" /> [ <a href="<?php echo "swatch.$phpEx"; ?>" onclick="swatch();return false" target="_swatch"><?php echo $user->lang['COLOUR_SWATCH']; ?></a> ]</td> </tr> diff --git a/phpBB/adm/admin_permissions.php b/phpBB/adm/admin_permissions.php index b29dc5e995..7bfed014b4 100644 --- a/phpBB/adm/admin_permissions.php +++ b/phpBB/adm/admin_permissions.php @@ -1320,7 +1320,7 @@ function update_foes() global $db; $perms = array(); - foreach (auth::acl_get_list(false, array('a_', 'm_'), false) as $forum_id => $forum_ary) + foreach ($auth->acl_get_list(false, array('a_', 'm_'), false) as $forum_id => $forum_ary) { foreach ($forum_ary as $auth_option => $user_ary) { diff --git a/phpBB/adm/admin_search.php b/phpBB/adm/admin_search.php index 6d5999575c..4d5e660b64 100644 --- a/phpBB/adm/admin_search.php +++ b/phpBB/adm/admin_search.php @@ -36,7 +36,7 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); require('pagestart.' . $phpEx); -include($phpbb_root_path . 'includes/functions_posting.'.$phpEx); +include($phpbb_root_path . 'includes/message_parser.'.$phpEx); // Check permissions if (!$auth->acl_get('a_search')) @@ -48,10 +48,11 @@ if (!$auth->acl_get('a_search')) if (isset($_POST['start']) || isset($_GET['batchstart'])) { $batchsize = 200; // Process this many posts per batch - $batchstart = (!isset($_GET['batchstart'])) ? $row['min_post_id'] : $_GET['batchstart']; - $batchcount = (!isset($_GET['batchcount'])) ? 1 : $_GET['batchcount']; + $batchcount = request_var('batchcount', 1); + $batchstart = request_var('batchstart', 0); $loopcount = 0; - $batchend = $batchstart + $batchsize; + + $fulltext = new fulltext_search(); // Search re-indexing is tough on the server ... so we'll check the load // each loop and if we're on a 1min load of 3 or more we'll re-load the page @@ -64,12 +65,13 @@ if (isset($_POST['start']) || isset($_GET['batchstart'])) if ($load > 3) { - redirect("admin_search.$phpEx$SID&batchstart=$batchstart&batchcount=$batch_count"); + redirect("admin_search.$phpEx$SID&batchstart=$batchstart&batchcount=$batchcount"); } } } - // Try and load stopword and synonym files + /* Try and load stopword and synonym files + // Do this with the mode "admin" and the fulltext class $stopword_array = array(); $synonym_array = array(); @@ -95,8 +97,9 @@ if (isset($_POST['start']) || isset($_GET['batchstart'])) } closedir($dir); + */ - if (!isset($_GET['batchstart'])) + if (!$batchstart) { // Take board offline set_config('board_disable', 1); @@ -109,17 +112,20 @@ if (isset($_POST['start']) || isset($_GET['batchstart'])) // Fetch a batch of posts_text entries $sql = "SELECT COUNT(*) AS total, MAX(post_id) AS max_post_id, MIN(post_id) AS min_post_id - FROM " . POSTS_TEXT_TABLE; + FROM " . POSTS_TABLE; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $totalposts = $row['total']; $max_post_id = $row['max_post_id']; + $batchstart = (!$batchstart) ? $row['min_post_id'] : $batchstart; + $batchend = $batchstart + $batchsize; + $db->sql_freeresult($result); $sql = "SELECT * - FROM " . POSTS_TEXT_TABLE . " + FROM " . POSTS_TABLE . " WHERE post_id BETWEEN $batchstart AND $batchend"; @@ -129,7 +135,9 @@ if (isset($_POST['start']) || isset($_GET['batchstart'])) { do { - $post_id = $row['post_id']; + $mode = 'admin'; + $fulltext->add($mode, $row['post_id'], $row['post_text'], $row['post_subject']); + /*$post_id = $row['post_id']; $search_raw_words = array(); $search_raw_words['text'] = split_words(clean_words('post', $row['post_text'], $stopword_array, $synonym_array)); @@ -162,7 +170,7 @@ if (isset($_POST['start']) || isset($_GET['batchstart'])) for($i = 0; $i < count($word); $i++) { - $word_text_sql .= (($word_text_sql != '') ? ', ' : '') . "'" . $word[$i] . "'"; + $word_text_sql .= (($word_text_sql != '') ? ', ' : '') . "'" . $db->sql_escape($word[$i]) . "'"; } $check_words = array(); @@ -201,17 +209,17 @@ if (isset($_POST['start']) || isset($_GET['batchstart'])) { case 'mysql': case 'mysql4': - $value_sql .= (($value_sql != '') ? ', ' : '') . "('" . $word[$i] . "')"; + $value_sql .= (($value_sql != '') ? ', ' : '') . "('" . $db->sql_escape($word[$i]) . "')"; break; case 'mssql': case 'sqlite': - $value_sql .= (($value_sql != '') ? ' UNION ALL ' : '') . "SELECT '" . $word[$i] . "'"; + $value_sql .= (($value_sql != '') ? ' UNION ALL ' : '') . "SELECT '" . $db->sql_escape($word[$i]) . "'"; break; default: $sql = 'INSERT INTO ' . SEARCH_WORD_TABLE . " (word_text) - VALUES ('" . $word[$i] . "')"; + VALUES ('" . $db->sql_escape($word[$i]) . "')"; $db->sql_query($sql); break; } @@ -252,7 +260,7 @@ if (isset($_POST['start']) || isset($_GET['batchstart'])) $db->sql_query($sql); } } - + */ } while ($row = $db->sql_fetchrow($result)); } @@ -309,7 +317,7 @@ else if (isset($_POST['cancel'])) } else { - adm_page_header($user->lang['Search_index']); + adm_page_header($user->lang['SEARCH_INDEX']); ?> diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index ae825fa697..194d8bf979 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -508,6 +508,7 @@ elseif ($pane == 'right') view_log('admin', $log_data, $log_count, 5); + $row_class = 'row2'; for($i = 0; $i < sizeof($log_data); $i++) { $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; diff --git a/phpBB/adm/pagestart.php b/phpBB/adm/pagestart.php index 20ffec69e0..716d07563f 100644 --- a/phpBB/adm/pagestart.php +++ b/phpBB/adm/pagestart.php @@ -84,7 +84,7 @@ th { background-image: url('images/cellpic3.gif') } td.cat { background-image: url('images/cellpic1.gif') } //--> </style> -<title><?php echo $config['sitename'] . ' - ' . $page_title; ?></title> +<title><?php echo $config['sitename'] . ' - ' . $sub_title; ?></title> </head> <body> diff --git a/phpBB/common.php b/phpBB/common.php index ffac022403..59a3d81b79 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -58,12 +58,6 @@ require($phpbb_root_path . 'includes/template.'.$phpEx); require($phpbb_root_path . 'includes/session.'.$phpEx); require($phpbb_root_path . 'includes/functions.'.$phpEx); -// Warn about install/ directory -if (file_exists('install')) -{ -// trigger_error('REMOVE_INSTALL'); -} - // User related define('ANONYMOUS', 1); @@ -127,10 +121,12 @@ define('LOG_MOD', 1); define('LOG_CRITICAL', 2); define('LOG_USERS', 3); -// Private messaging -define('PRIVMSGS_READ_MAIL', 0); -define('PRIVMSGS_NEW_MAIL', 1); -define('PRIVMSGS_UNREAD_MAIL', 5); +// Private messaging - Do NOT change these values +define('PRIVMSGS_HOLD_BOX', -4); +define('PRIVMSGS_NO_BOX', -3); +define('PRIVMSGS_OUTBOX', -2); +define('PRIVMSGS_SENTBOX', -1); +define('PRIVMSGS_INBOX', 0); // Download Modes - Attachments define('INLINE_LINK', 1); @@ -142,7 +138,7 @@ define('IMAGE_CAT', 1); // Inline Images define('WM_CAT', 2); // Windows Media Files - Streaming define('RM_CAT', 3); // Real Media Files - Streaming define('THUMB_CAT', 4); // Not used within the database, only while displaying posts -//define('SWF_CAT', 5); // Replaced by [flash] ? or an additional possibility ? +//define('SWF_CAT', 5); // Replaced by [flash]? or an additional possibility? // BBCode UID length define('BBCODE_UID_LEN', 5); @@ -189,7 +185,9 @@ define('MODERATOR_TABLE', $table_prefix.'moderator_cache'); define('MODULES_TABLE', $table_prefix . 'modules'); define('POSTS_TABLE', $table_prefix.'posts'); define('PRIVMSGS_TABLE', $table_prefix.'privmsgs'); -define('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text'); +define('PRIVMSGS_TO_TABLE', $table_prefix.'privmsgs_to'); +define('PRIVMSGS_FOLDER_TABLE', $table_prefix.'privmsgs_folder'); +define('PRIVMSGS_RULES_TABLE', $table_prefix.'privmsgs_rules'); define('RANKS_TABLE', $table_prefix.'ranks'); define('RATINGS_TABLE', $table_prefix.'ratings'); define('REPORTS_TABLE', $table_prefix.'reports'); @@ -288,6 +286,12 @@ if (time() - $config['queue_interval'] >= $config['last_queue_run'] && !defined( } } +// Warn about install/ directory +if (file_exists('install')) +{ +// trigger_error('REMOVE_INSTALL'); +} + // Show 'Board is disabled' message if ($config['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN')) { diff --git a/phpBB/download.php b/phpBB/download.php index 19b0b1c5b8..c6a91e09f1 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -31,7 +31,7 @@ if (!$download_id) trigger_error('NO_ATTACHMENT_SELECTED'); } -if (!$config['allow_attachments']) +if (!$config['allow_attachments'] && !$config['allow_pm_attach']) { trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); } @@ -47,30 +47,47 @@ if (!($attachment = $db->sql_fetchrow($result))) } $db->sql_freeresult($result); -// -$sql = 'SELECT p.forum_id, f.forum_password, f.parent_id - FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f - WHERE p.post_id = ' . $attachment['post_id'] . ' - AND p.forum_id = f.forum_id'; -$result = $db->sql_query_limit($sql, 1); -$row = $db->sql_fetchrow($result); -$db->sql_freeresult($result); +if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach'])) +{ + trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); +} -if ($auth->acl_gets('f_download', 'u_download', $row['forum_id'])) +$row = array(); +if (!$attachment['in_message']) { - if ($row['forum_password']) + // + $sql = 'SELECT p.forum_id, f.forum_password, f.parent_id + FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f + WHERE p.post_id = ' . $attachment['post_msg_id'] . ' + AND p.forum_id = f.forum_id'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($auth->acl_gets('f_download', 'u_download', $row['forum_id'])) { - // Do something else ... ? - login_forum_box($row); + if ($row['forum_password']) + { + // Do something else ... ? + login_forum_box($row); + } + } + else + { + trigger_error('SORRY_AUTH_VIEW_ATTACH'); } } else { - trigger_error('SORRY_AUTH_VIEW_ATTACH'); + $row['forum_id'] = 0; + if (!$auth->acl_get('u_pm_download') || !$config['auth_download_pm']) + { + trigger_error('SORRY_AUTH_VIEW_ATTACH'); + } } // disallowed ? -if (extension_allowed($row['forum_id'], $attachment['extension'])) +if (!extension_allowed($row['forum_id'], $attachment['extension'])) { trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])); } diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 6a3d6335a9..229685d431 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -188,7 +188,12 @@ class acm $this->load(); } - return (time() > $this->var_expires[$var_name]) ? FALSE : isset($this->vars[$var_name]); + if (!isset($this->var_expires[$var_name])) + { + return false; + } + + return (time() > $this->var_expires[$var_name]) ? false : isset($this->vars[$var_name]); } } @@ -225,7 +230,7 @@ class acm $query = preg_replace('/[\n\r\s\t]+/', ' ', $query); $query_id = 'Cache id #' . count($this->sql_rowset); - include($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); + @include($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); if (!isset($expired)) { return FALSE; diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index f2df2803b9..537199fb57 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -46,10 +46,8 @@ class bbcode return $message; } - if (empty($this->bbcode_cache)) - { - $this->bbcode_cache_init(); - } + // Init those added with a new bbcode_bitfield (already stored codes will not get parsed again) + $this->bbcode_cache_init(); $str = array('search' => array(), 'replace' => array()); $preg = array('search' => array(), 'replace' => array()); diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 5c982e7a2c..abfdd576f6 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -206,7 +206,7 @@ class sql_db $query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')'; } - else if ($query == 'UPDATE') + else if ($query == 'UPDATE' || $query == 'SELECT') { $values = array(); foreach ($assoc_ary as $key => $var) @@ -224,7 +224,7 @@ class sql_db $values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var"; } } - $query = implode(', ', $values); + $query = implode(($query == 'UPDATE') ? ', ' : ' AND ', $values); } return $query; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index af1a0370fc..6cef26844d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -68,13 +68,13 @@ function set_config($config_name, $config_value, $is_dynamic = FALSE) $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = '" . $db->sql_escape($config_value) . "' - WHERE config_name = '$config_name'"; + WHERE config_name = '" . $db->sql_escape($config_name) . "'"; $db->sql_query($sql); if (!$db->sql_affectedrows() && !isset($config[$config_name])) { $sql = 'INSERT INTO ' . CONFIG_TABLE . " (config_name, config_value) - VALUES ('$config_name', '" . $db->sql_escape($config_value) . "')"; + VALUES ('" . $db->sql_escape($config_name) . "', '" . $db->sql_escape($config_value) . "')"; $db->sql_query($sql); } @@ -422,6 +422,7 @@ function tz_select($default = '') { global $sys_timezone, $user; + $tz_select = ''; foreach ($user->lang['tz'] as $offset => $zone) { if (is_numeric($offset)) @@ -551,21 +552,25 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) return; } + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + // Default tracking type $type = TRACK_NORMAL; $current_time = ($marktime) ? $marktime : time(); + $topic_id = (int) $topic_id; switch ($mode) { case 'mark': if ($config['load_db_lastread']) { - $sql_where = (is_array($forum_id)) ? ' IN (' . implode(', ', array_map('intval', $forum_id)) . ')' : ' = ' . (int) $forum_id; - $sql = 'SELECT forum_id FROM ' . FORUMS_TRACK_TABLE . ' - WHERE user_id = ' . $user->data['user_id'] . " - AND forum_id $sql_where"; + WHERE user_id = ' . $user->data['user_id'] . ' + AND forum_id IN (' . implode(', ', array_map('intval', $forum_id)) . ')'; $result = $db->sql_query($sql); $sql_update = array(); @@ -623,12 +628,10 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) { $tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); - $forum_id_ary = (!is_array($forum_id)) ? array($forum_id) : $forum_id; - - foreach ($forum_id_ary as $forum_id) + foreach ($forum_id as $f_id) { - unset($tracking[$forum_id]); - $tracking[$forum_id][0] = base_convert($current_time - $config['board_startdate'], 10, 36); + unset($tracking[$f_id]); + $tracking[$f_id][0] = base_convert($current_time - $config['board_startdate'], 10, 36); } setcookie($config['cookie_name'] . '_track', serialize($tracking), time() + 31536000, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']); @@ -641,6 +644,8 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) $type = TRACK_POSTED; case 'topic': + $forum_id = (int) $forum_id[0]; + // Mark a topic as read if ($config['load_db_lastread'] || ($config['load_db_track'] && $type == TRACK_POSTED)) { @@ -668,7 +673,7 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) { $tracking = unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])); - // If the cookie grows larger than 3000 characters we will remove + // If the cookie grows larger than 2000 characters we will remove // the smallest value if (strlen($_COOKIE[$config['cookie_name'] . '_track']) > 2000) { @@ -906,8 +911,15 @@ function obtain_attach_extensions(&$extensions) $extensions[$extension]['upload_icon'] = trim($row['upload_icon']); $extensions[$extension]['max_filesize'] = (int) $row['max_filesize']; + $allowed_forums = ($row['allowed_forums']) ? unserialize(trim($row['allowed_forums'])) : array(); + + if ($row['allow_in_pm']) + { + $allowed_forums = array_merge($allowed_forums, array(0)); + } + // Store allowed extensions forum wise - $extensions['_allowed_'][$extension] = (!$row['allowed_forums']) ? 0 : unserialize(trim($row['allowed_forums'])); + $extensions['_allowed_'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums; } $db->sql_freeresult($result); @@ -967,6 +979,42 @@ function meta_refresh($time, $url) ); } +// Build Confirm box with session id and user id check +function confirm_box($check, $title = '', $url = '', $hidden = '') +{ + global $user, $template; + + if ($check) + { + $user_id = request_var('user_id', 0); + $session_id = request_var('sess', 0); + + if ($user_id != $user->data['user_id'] || $session_id != $user->session_id) + { + return false; + } + + return true; + } + + $s_hidden_fields = '<input type="hidden" name="user_id" value="' . $user->data['user_id'] . '" /><input type="hidden" name="sess" value="' . $user->session_id . '" />'; + + page_header($user->lang[$title]); + + $template->set_filenames(array( + 'body' => 'confirm_body.html') + ); + + $template->assign_vars(array( + 'MESSAGE_TITLE' => $user->lang[$title], + 'MESSAGE_TEXT' => $user->lang[$title . '_CONFIRM'], + + 'S_CONFIRM_ACTION' => $url, + 'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields) + ); + + page_footer(); +} // Generate login box or verify password function login_box($s_action, $s_hidden_fields = '', $login_explain = '', $ucp_login = false) @@ -1149,7 +1197,7 @@ function smilie_text($text, $force_option = false) return ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies')) ? preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILE_PATH\}\/.*? \/><!\-\- s\1 \-\->#', '\1', $text) : str_replace('<img src="{SMILE_PATH}', '<img src="' . $phpbb_root_path . $config['smilies_path'], $text); } -// Check if extension is allowed to be posted within forum X +// Check if extension is allowed to be posted within forum X (forum_id 0 == private messaging) function extension_allowed($forum_id, $extension) { global $extensions; @@ -1160,14 +1208,36 @@ function extension_allowed($forum_id, $extension) obtain_attach_extensions($extensions); } - return (is_array($extensions['_allowed_'][$extension]) && !in_array($forum_id, $extensions['_allowed_'][$extension])) || !isset($extensions['_allowed_'][$extension]); + if (!isset($extensions['_allowed_'][$extension])) + { + return false; + } + + $check = $extensions['_allowed_'][$extension]; + + if (is_array($check)) + { + // Check for private messaging + if (sizeof($check) == 1 && $check[0] == 0) + { + return true; + } + + return (!in_array($forum_id, $check)) ? false : true; + } + else + { + return ($forum_id == 0) ? false : true; + } + + return false; } // Error and message handler, call with trigger_error if reqd function msg_handler($errno, $msg_text, $errfile, $errline) { global $cache, $db, $auth, $template, $config, $user; - global $phpEx, $phpbb_root_path, $starttime; + global $phpEx, $phpbb_root_path, $starttime, $display_header; switch ($errno) { @@ -1218,6 +1288,8 @@ function msg_handler($errno, $msg_text, $errfile, $errline) } $msg_text = (!empty($user->lang[$msg_text])) ? $user->lang[$msg_text] : $msg_text; + $msg_title = (!isset($msg_title)) ? $user->lang['INFORMATION'] : ((!empty($user->lang[$msg_title])) ? $user->lang[$msg_title] : $msg_title); + $display_header = (!isset($display_header)) ? false : (bool) $display_header; if (defined('IN_ADMIN')) { @@ -1231,7 +1303,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) ); $template->assign_vars(array( - 'MESSAGE_TITLE' => $msg_title, + 'MESSAGE_TITLE' => (isset($msg_title)) ? $msg_title : $user->lang['INFORMATION'], 'MESSAGE_TEXT' => $msg_text) ); @@ -1410,7 +1482,7 @@ function page_header($page_title = '') $l_message_new = ($user->data['user_new_privmsg'] == 1) ? $user->lang['NEW_PM'] : $user->lang['NEW_PMS']; $l_privmsgs_text = sprintf($l_message_new, $user->data['user_new_privmsg']); - if ($user->data['user_last_privmsg'] > $user->data['session_last_visit']) + if (!$user->data['user_last_privmsg'] || $user->data['user_last_privmsg'] > $user->data['session_last_visit']) { $sql = 'UPDATE ' . USERS_TABLE . ' SET user_last_privmsg = ' . $user->data['session_last_visit'] . ' @@ -1430,15 +1502,13 @@ function page_header($page_title = '') $s_privmsg_new = false; } - if ($user->data['user_unread_privmsg']) + $l_privmsgs_text_unread = ''; + + if ($user->data['user_unread_privmsg'] && $user->data['user_unread_privmsg'] != $user->data['user_new_privmsg']) { $l_message_unread = ($user->data['user_unread_privmsg'] == 1) ? $user->lang['UNREAD_PM'] : $user->lang['UNREAD_PMS']; $l_privmsgs_text_unread = sprintf($l_message_unread, $user->data['user_unread_privmsg']); } - else - { - $l_privmsgs_text_unread = $user->lang['NO_UNREAD_PM']; - } } // Which timezone? @@ -1462,7 +1532,9 @@ function page_header($page_title = '') 'L_INDEX' => $user->lang['FORUM_INDEX'], 'L_ONLINE_EXPLAIN' => $l_online_time, - 'U_PRIVATEMSGS' => $phpbb_root_path . 'ucp.'.$phpEx.$SID.'&mode=pm&folder=inbox', + 'U_PRIVATEMSGS' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=" . (($user->data['user_new_privmsg'] || $l_privmsgs_text_unread) ? 'unread' : 'view_messages'), + 'U_RETURN_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", + 'U_POPUP_PM' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup", 'U_MEMBERLIST' => "{$phpbb_root_path}memberlist.$phpEx$SID", 'U_VIEWONLINE' => "{$phpbb_root_path}viewonline.$phpEx$SID", 'U_MEMBERSLIST' => "{$phpbb_root_path}memberlist.$phpEx$SID", @@ -1481,7 +1553,7 @@ function page_header($page_title = '') 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, 'S_USER_PM_POPUP' => $user->optionget('popuppm'), 'S_USER_LANG' => $user->data['user_lang'], - 'S_USER_BROWSER' => $user->data['session_browser'], + 'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'], @@ -1489,9 +1561,9 @@ function page_header($page_title = '') 'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], ''), 'S_DISPLAY_ONLINE_LIST' => (!empty($config['load_online'])) ? 1 : 0, 'S_DISPLAY_SEARCH' => (!empty($config['load_search'])) ? 1 : 0, - 'S_DISPLAY_PM' => (empty($config['privmsg_disable'])) ? 1 : 0, + 'S_DISPLAY_PM' => (!empty($config['allow_privmsg'])) ? 1 : 0, 'S_DISPLAY_MEMBERLIST' => (isset($auth)) ? $auth->acl_get('u_viewprofile') : 0, - 'S_NEW_PM' => $s_privmsg_new, + 'S_NEW_PM' => ($s_privmsg_new) ? 1 : 0, 'T_THEME_PATH' => "{$phpbb_root_path}styles/" . $user->theme['primary']['theme_path'] . '/theme', 'T_TEMPLATE_PATH' => "{$phpbb_root_path}styles/" . $user->theme['primary']['template_path'] . '/template', diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 865be1065e..4209f72938 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -292,7 +292,8 @@ function move_posts($post_ids, $topic_id, $auto_sync = TRUE) $sql = 'UPDATE ' . ATTACHMENTS_TABLE . " SET topic_id = $topic_id - WHERE post_id IN (" . implode(', ', $post_ids) . ')'; + AND in_message = 0 + WHERE post_msg_id IN (" . implode(', ', $post_ids) . ')'; $db->sql_query($sql); if ($auto_sync) @@ -490,14 +491,14 @@ function delete_attachments($mode, $ids, $resync = TRUE) return false; } - $sql_id = ($mode == 'user') ? 'poster_id' : (($mode == 'post') ? 'post_id' : (($mode == 'topic') ? 'topic_id' : 'attach_id')); + $sql_id = ($mode == 'user') ? 'poster_id' : (($mode == 'post') ? 'post_msg_id' : (($mode == 'topic') ? 'topic_id' : 'attach_id')); $post_ids = $topic_ids = $physical = array(); // Collect post and topics ids for later use if ($mode == 'attach' || $mode == 'user' || ($mode == 'topic' && $resync)) { - $sql = 'SELECT post_id, topic_id, physical_filename, thumbnail, filesize + $sql = 'SELECT post_msg_id as post_id, topic_id, physical_filename, thumbnail, filesize FROM ' . ATTACHMENTS_TABLE . ' WHERE ' . $sql_id . ' IN (' . implode(', ', $ids) . ')'; $result = $db->sql_query($sql); @@ -515,7 +516,8 @@ function delete_attachments($mode, $ids, $resync = TRUE) { $sql = 'SELECT topic_id, physical_filename, thumbnail, filesize FROM ' . ATTACHMENTS_TABLE . ' - WHERE post_id IN (' . implode(', ', $ids) . ')'; + WHERE post_msg_id IN (' . implode(', ', $ids) . ') + AND in_message = 0'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -581,14 +583,15 @@ function delete_attachments($mode, $ids, $resync = TRUE) { $remaining = array(); - $sql = 'SELECT post_id + $sql = 'SELECT post_msg_id FROM ' . ATTACHMENTS_TABLE . ' - WHERE post_id IN (' . implode(', ', $post_ids) . ')'; + WHERE post_msg_id IN (' . implode(', ', $post_ids) . ') + AND in_message = 0'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $remaining[] = $row['post_id']; + $remaining[] = $row['post_msg_id']; } $db->sql_freeresult($result); @@ -599,6 +602,28 @@ function delete_attachments($mode, $ids, $resync = TRUE) SET post_attachment = 0 WHERE post_id IN (' . implode(', ', $unset_ids) . ')'); } + + $remaining = array(); + + $sql = 'SELECT post_msg_id + FROM ' . ATTACHMENTS_TABLE . ' + WHERE post_msg_id IN (' . implode(', ', $post_ids) . ') + AND in_message = 1'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $remaining[] = $row['post_msg_id']; + } + $db->sql_freeresult($result); + + $unset_ids = array_diff($post_ids, $remaining); + if (sizeof($unset_ids)) + { + $db->sql_query('UPDATE ' . PRIVMSGS_TABLE . ' + SET message_attachment = 0 + WHERE msg_id IN (' . implode(', ', $unset_ids) . ')'); + } } } diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 30aa392286..9f1611ace0 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -32,7 +32,7 @@ function display_forums($root_data = '', $display_moderators = TRUE) } // Display list of active topics for this category? - $show_active = ($root_data['forum_flags'] & 16) ? true : false; + $show_active = (isset($root_data['forum_flags']) && $root_data['forum_flags'] & 16) ? true : false; if ($config['load_db_lastread'] && $user->data['user_id'] != ANONYMOUS) { @@ -353,6 +353,7 @@ function display_attachments($forum_id, $blockname, $attachment_data, &$update_c $attachment_tpl = array(); // Generate Template + // TODO: secondary template $template_filename = $phpbb_root_path . 'styles/' . $user->theme['primary']['template_path'] . '/template/attachment.html'; if (!($fp = @fopen($template_filename, 'rb'))) { @@ -411,7 +412,7 @@ function display_attachments($forum_id, $blockname, $attachment_data, &$update_c $denied = false; - if (extension_allowed($forum_id, $attachment['extension'])) + if (!extension_allowed($forum_id, $attachment['extension'])) { $denied = true; diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index e6158eb370..a0ccf9f1a3 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -19,19 +19,21 @@ function generate_smilies($mode, $forum_id) if ($mode == 'window') { - if (!$forum_id && !$topic_id) + if ($forum_id) { - trigger_error('NO_TOPIC'); - } + $sql = 'SELECT forum_style + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - $sql = 'SELECT forum_style - FROM ' . FORUMS_TABLE . " - WHERE forum_id = $forum_id"; - $result = $db->sql_query_limit($sql, 1); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - $user->setup('posting', (int) $row['forum_style']); + $user->setup('posting', (int) $row['forum_style']); + } + else + { + $user->setup('posting'); + } page_header($user->lang['SMILIES']); @@ -89,22 +91,27 @@ function generate_smilies($mode, $forum_id) } // Format text to be displayed - from viewtopic.php - centralizing this would be nice ;) -function format_display(&$message, &$signature, $uid, $siguid, $html, $bbcode, $url, $smilies, $sig) +function format_display(&$message, &$signature, $uid, $siguid, $enable_html, $enable_bbcode, $enable_url, $enable_smilies, $enable_sig, $bbcode = '') { - global $auth, $forum_id, $config, $user, $bbcode, $phpbb_root_path; + global $auth, $forum_id, $config, $user, $phpbb_root_path; + + if (!$bbcode) + { + global $bbcode; + } // Second parse bbcode here $bbcode->bbcode_second_pass($message, $uid); // If we allow users to disable display of emoticons we'll need an appropriate // check and preg_replace here - $message = smilie_text($message, !$smilies); + $message = smilie_text($message, !$enbale_smilies); // Replace naughty words such as farty pants $message = str_replace("\n", '<br />', censor_text($message)); // Signature - if ($sig && $config['allow_sig'] && $signature && $auth->acl_get('f_sigs', $forum_id)) + if ($enable_sig && $config['allow_sig'] && $signature && $auth->acl_get('f_sigs', $forum_id)) { $signature = trim($signature); @@ -162,7 +169,7 @@ function update_last_post_information($type, $id) } // Upload Attachment - filedata is generated here -function upload_attachment($forum_id, $filename, $local = false, $local_storage = '') +function upload_attachment($forum_id, $filename, $local = false, $local_storage = '', $is_message = false) { global $auth, $user, $config, $db; @@ -188,14 +195,17 @@ function upload_attachment($forum_id, $filename, $local = false, $local_storage obtain_attach_extensions($extensions); // Check Extension - if (extension_allowed($forum_id, $filedata['extension'])) + if (!extension_allowed($forum_id, $filedata['extension'])) { $filedata['error'][] = sprintf($user->lang['DISALLOWED_EXTENSION'], $filedata['extension']); $filedata['post_attach'] = false; return $filedata; - } + } - $allowed_filesize = ($extensions[$filedata['extension']]['max_filesize'] != 0) ? $extensions[$filedata['extension']]['max_filesize'] : $config['max_filesize']; + $cfg = array(); + $cfg['max_filesize'] = ($is_message) ? $config['max_filesize_pm'] : $config['max_filesize']; + + $allowed_filesize = ($extensions[$filedata['extension']]['max_filesize'] != 0) ? $extensions[$filedata['extension']]['max_filesize'] : $cfg['max_filesize']; $cat_id = $extensions[$filedata['extension']]['display_cat']; // check Filename @@ -253,7 +263,7 @@ function upload_attachment($forum_id, $filename, $local = false, $local_storage } } - // TODO - Check Free Disk Space - need testing under windows [commented out] + // TODO - Check Free Disk Space - need testing under windows if ($free_space = disk_free_space($config['upload_dir'])) { if ($free_space <= $filedata['filesize']) @@ -508,14 +518,14 @@ function create_thumbnail($source, $new_file, $mimetype) // // DECODE TEXT -> This will/should be handled by bbcode.php eventually -function decode_text(&$message, $bbcode_uid) +function decode_text(&$message, $bbcode_uid = '') { global $config; $server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://'; $server_port = ($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/'; - $search = array( + $match = array( '<br />', "[/*:m:$bbcode_uid]", ":u:$bbcode_uid", @@ -531,7 +541,7 @@ function decode_text(&$message, $bbcode_uid) '' ); - $message = ($bbcode_uid) ? str_replace($search, $replace, $message) : str_replace('<br />', "\n", $message); + $message = ($bbcode_uid) ? str_replace($match, $replace, $message) : str_replace('<br />', "\n", $message); $match = array( '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#', @@ -569,4 +579,286 @@ function decode_text(&$message, $bbcode_uid) return; } +// Temp Function - strtolower - borrowed from php.net +function phpbb_strtolower($string) +{ + $new_string = ''; + + for ($i = 0; $i < strlen($string); $i++) + { + if (ord(substr($string, $i, 1)) > 0xa0) + { + $new_string .= strtolower(substr($string, $i, 2)); + $i++; + } + else + { + $new_string .= strtolower($string{$i}); + } + } + + return $new_string; +} + +function posting_gen_topic_icons($mode, $icon_id) +{ + global $phpbb_root_path, $config, $template; + + // Grab icons + $icons = array(); + obtain_icons($icons); + + if (sizeof($icons)) + { + foreach ($icons as $id => $data) + { + if ($data['display']) + { + $template->assign_block_vars('topic_icon', array( + 'ICON_ID' => $id, + 'ICON_IMG' => $phpbb_root_path . $config['icons_path'] . '/' . $data['img'], + 'ICON_WIDTH' => $data['width'], + 'ICON_HEIGHT' => $data['height'], + + 'S_ICON_CHECKED' => ($id == $icon_id && $mode != 'reply') ? ' checked="checked"' : '') + ); + } + } + + return true; + } + + return false; +} + +function posting_gen_inline_attachments($message_parser) +{ + global $template; + + if (sizeof($message_parser->attachment_data)) + { + $s_inline_attachment_options = ''; + + foreach ($message_parser->attachment_data as $i => $attachment) + { + $s_inline_attachment_options .= '<option value="' . $i . '">' . $attachment['real_filename'] . '</option>'; + } + + $template->assign_var('S_INLINE_ATTACHMENT_OPTIONS', $s_inline_attachment_options); + + return true; + } + + return false; +} + +function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) +{ + global $auth, $user, $template; + + $toggle = false; + + $topic_types = array( + 'sticky' => array('const' => POST_STICKY, 'lang' => 'POST_STICKY'), + 'announce' => array('const' => POST_ANNOUNCE, 'lang' => 'POST_ANNOUNCEMENT'), + 'global' => array('const' => POST_GLOBAL, 'lang' => 'POST_GLOBAL') + ); + + $topic_type_array = array(); + + foreach ($topic_types as $auth_key => $topic_value) + { + // Temp - we do not have a special post global announcement permission + $auth_key = ($auth_key == 'global') ? 'announce' : $auth_key; + + if ($auth->acl_get('f_' . $auth_key, $forum_id)) + { + $toggle = true; + + $topic_type_array[] = array( + 'VALUE' => $topic_value['const'], + 'S_CHECKED' => ($cur_topic_type == $topic_value['const'] || ($forum_id == 0 && $topic_value['const'] == POST_GLOBAL)) ? ' checked="checked"' : '', + 'L_TOPIC_TYPE' => $user->lang[$topic_value['lang']] + ); + } + } + + if ($toggle) + { + $topic_type_array = array_merge(array(0 => array( + 'VALUE' => POST_NORMAL, + 'S_CHECKED' => ($topic_type == POST_NORMAL) ? ' checked="checked"' : '', + 'L_TOPIC_TYPE' => $user->lang['POST_NORMAL'])), + + $topic_type_array + ); + + foreach ($topic_type_array as $array) + { + $template->assign_block_vars('topic_type', $array); + } + + $template->assign_vars(array( + 'S_TOPIC_TYPE_STICKY' => ($auth->acl_get('f_sticky', $forum_id)), + 'S_TOPIC_TYPE_ANNOUNCE' => ($auth->acl_get('f_announce', $forum_id))) + ); + } + + return $toggle; +} + +function posting_gen_attachment_entry($message_parser) +{ + global $template, $config, $phpbb_root_path, $SID, $phpEx; + + $template->assign_vars(array( + 'S_SHOW_ATTACH_BOX' => true) + ); + + if (sizeof($message_parser->attachment_data)) + { + $template->assign_vars(array( + 'S_HAS_ATTACHMENTS' => true) + ); + + $count = 0; + foreach ($message_parser->attachment_data as $attach_row) + { + $hidden = ''; + $attach_row['real_filename'] = stripslashes($attach_row['real_filename']); + + foreach ($attach_row as $key => $value) + { + $hidden .= '<input type="hidden" name="attachment_data[' . $count . '][' . $key . ']" value="' . $value . '" />'; + } + + $download_link = (!$attach_row['attach_id']) ? $config['upload_dir'] . '/' . $attach_row['physical_filename'] : $phpbb_root_path . "download.$phpEx$SID&id=" . intval($attach_row['attach_id']); + + $template->assign_block_vars('attach_row', array( + 'FILENAME' => $attach_row['real_filename'], + 'ATTACH_FILENAME' => $attach_row['physical_filename'], + 'FILE_COMMENT' => $attach_row['comment'], + 'ATTACH_ID' => $attach_row['attach_id'], + 'ASSOC_INDEX' => $count, + + 'U_VIEW_ATTACHMENT' => $download_link, + 'S_HIDDEN' => $hidden) + ); + + $count++; + } + } + + $template->assign_vars(array( + 'FILE_COMMENT' => $message_parser->filename_data['filecomment'], + 'FILESIZE' => $config['max_filesize'], + 'FILENAME' => $message_parser->filename_data['filename']) + ); + + return sizeof($message_parser->attachment_data); +} + +// Load Drafts +function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) +{ + global $user, $db, $template, $phpEx, $SID, $auth; + + // Only those fitting into this forum... + if ($forum_id || $topic_id) + { + $sql = 'SELECT d.draft_id, d.topic_id, d.forum_id, d.draft_subject, d.save_time, f.forum_name + FROM ' . DRAFTS_TABLE . ' d, ' . FORUMS_TABLE . ' f + WHERE d.user_id = ' . $user->data['user_id'] . ' + AND f.forum_id = d.forum_id ' . + (($forum_id) ? " AND f.forum_id = $forum_id" : '') . ' + ORDER BY d.save_time DESC'; + } + else + { + $sql = 'SELECT * + FROM ' . DRAFTS_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' + AND forum_id = 0 + AND topic_id = 0 + ORDER BY save_time DESC'; + } + $result = $db->sql_query($sql); + + $draftrows = $topic_ids = array(); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_id']) + { + $topic_ids[] = (int) $row['topic_id']; + } + $draftrows[] = $row; + } + $db->sql_freeresult($result); + + if (sizeof($topic_ids)) + { + $sql = 'SELECT topic_id, forum_id, topic_title + FROM ' . TOPICS_TABLE . ' + WHERE topic_id IN (' . implode(',', array_unique($topic_ids)) . ')'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_rows[$row['topic_id']] = $row; + } + $db->sql_freeresult($result); + } + unset($topic_ids); + + if (sizeof($draftrows)) + { + $row_count = 0; + $template->assign_var('S_SHOW_DRAFTS', true); + + foreach ($draftrows as $draft) + { + $link_topic = $link_forum = $link_pm = false; + $insert_url = $view_url = $title = ''; + + if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) + { + $link_topic = true; + $view_url = "viewtopic.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . "&t=" . $draft['topic_id']; + $title = $topic_rows[$draft['topic_id']]['topic_title']; + + $insert_url = "posting.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']; + } + else if ($auth->acl_get('f_read', $draft['forum_id'])) + { + $link_forum = true; + $view_url = "viewforum.$phpEx$SID&f=" . $draft['forum_id']; + $title = $draft['forum_name']; + + $insert_url = "posting.$phpEx$SID&f=" . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']; + } + else + { + $link_pm = true; + $insert_url = "ucp.$phpEx$SID&i=$id&mode=compose&d=" . $draft['draft_id']; + } + + $template->assign_block_vars('draftrow', array( + 'DRAFT_ID' => $draft['draft_id'], + 'DATE' => $user->format_date($draft['save_time']), + 'DRAFT_SUBJECT' => $draft['draft_subject'], + + 'TITLE' => $title, + 'U_VIEW' => $view_url, + 'U_INSERT' => $insert_url, + + 'S_ROW_COUNT' => $row_count++, + 'S_LINK_PM' => $link_pm, + 'S_LINK_TOPIC' => $link_topic, + 'S_LINK_FORUM' => $link_forum) + ); + } + } +} + ?>
\ No newline at end of file diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 97553ce321..c058cd2b9d 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1114,7 +1114,7 @@ function group_create($group_id, $type, $name, $desc) 'group_type' => (int) $type, ); - $attribute_ary = array('group_colour' => 'string', 'group_rank' => 'int', 'group_avatar' => 'string', 'group_avatar_type' => 'int', 'group_avatar_width' => 'int', 'group_avatar_height' => 'int'); + $attribute_ary = array('group_colour' => 'string', 'group_rank' => 'int', 'group_avatar' => 'string', 'group_avatar_type' => 'int', 'group_avatar_width' => 'int', 'group_avatar_height' => 'int', 'group_receive_pm' => 'int', 'group_message_limit' => 'int'); $i = 4; foreach ($attribute_ary as $attribute => $type) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index b1f272eefa..22377000df 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -134,11 +134,10 @@ class parse_message $server_protocol = ( $config['cookie_secure'] ) ? 'https://' : 'http://'; $server_port = ( $config['server_port'] <> 80 ) ? ':' . trim($config['server_port']) . '/' : '/'; - $match = array(); - $replace = array(); + $match = $replace = array(); // relative urls for this board - $match[] = '#(^|[\n ])' . $server_protocol . trim($config['server_name']) . $server_port . preg_replace('/^\/?(.*?)(\/)?$/', '$1', trim($config['script_path'])) . '(?:/[^ \t\n\r<"\']*)?)#i'; + $match[] = '#((^|[\n ])' . $server_protocol . trim($config['server_name']) . $server_port . preg_replace('/^\/?(.*?)(\/)?$/', '$1', trim($config['script_path'])) . '(?:/[^ \t\n\r<"\']*)?)#i'; $replace[] = '<!-- l --><a href="$1" target="_blank">$1</a><!-- l -->'; // matches a xxxx://aaaaa.bbb.cccc. ... @@ -291,6 +290,7 @@ class parse_message } } + // Hardcode inline attachments [ia] function bbcode_attachment($stx, $in) { $out = '[attachment=' . $stx . ':' . $this->bbcode_uid . ']<!-- ia' . $stx . ' -->' . $in . '<!-- ia' . $stx . ' -->[/attachment:' . $this->bbcode_uid . ']'; @@ -704,14 +704,14 @@ class parse_message } // Parse Attachments - function parse_attachments($mode, $post_id, $submit, $preview, $refresh) + function parse_attachments($mode, $post_id, $submit, $preview, $refresh, $is_message = false) { global $config, $auth, $user, $forum_id; global $_FILES, $_POST; $error = array(); - $num_attachments = count($this->attachment_data); + $num_attachments = sizeof($this->attachment_data); $this->filename_data['filecomment'] = preg_replace('#&(\#[0-9]+;)#', '&\1', request_var('filecomment', '')); $this->filename_data['filename'] = ($_FILES['fileupload']['name'] != 'none') ? trim($_FILES['fileupload']['name']) : ''; @@ -719,15 +719,19 @@ class parse_message $delete_file = (isset($_POST['delete_file'])); $edit_comment = (isset($_POST['edit_comment'])); + $cfg = array(); + $cfg['max_attachments'] = ($is_message) ? $config['max_attachments_pm'] : $config['max_attachments']; + $forum_id = ($is_message) ? 0 : $forum_id; + if ($submit && in_array($mode, array('post', 'reply', 'quote', 'edit')) && $this->filename_data['filename']) { - if ($num_attachments < $config['max_attachments'] || $auth->acl_gets('m_', 'a_')) + if ($num_attachments < $cfg['max_attachments'] || $auth->acl_gets('m_', 'a_')) { - $filedata = upload_attachment($forum_id, $this->filename_data['filename']); + $filedata = upload_attachment($forum_id, $this->filename_data['filename'], false, '', $is_message); $error = $filedata['error']; - if ($filedata['post_attach'] && !count($error)) + if ($filedata['post_attach'] && !sizeof($error)) { $new_entry = array( 'physical_filename' => $filedata['destination_filename'], @@ -759,7 +763,7 @@ class parse_message } else { - $error[] = sprintf($user->lang['TOO_MANY_ATTACHMENTS'], $config['max_attachments']); + $error[] = sprintf($user->lang['TOO_MANY_ATTACHMENTS'], $cfg['max_attachments']); } } @@ -805,10 +809,10 @@ class parse_message if (($add_file || $preview) && $this->filename_data['filename']) { - if ($num_attachments < $config['max_attachments'] || $auth->acl_gets('m_', 'a_')) + if ($num_attachments < $cfg['max_attachments'] || $auth->acl_gets('m_', 'a_')) { - $filedata = upload_attachment($forum_id, $this->filename_data['filename']); - + $filedata = upload_attachment($forum_id, $this->filename_data['filename'], false, '', $is_message); + $error = array_merge($error, $filedata['error']); if (!count($error)) @@ -832,7 +836,7 @@ class parse_message } else { - $error[] = sprintf($user->lang['TOO_MANY_ATTACHMENTS'], $config['max_attachments']); + $error[] = sprintf($user->lang['TOO_MANY_ATTACHMENTS'], $cfg['max_attachments']); } } } @@ -844,6 +848,35 @@ class parse_message } } + // Get Attachment Data + function get_submitted_attachment_data() + { + global $_FILES, $_POST; + + $this->filename_data['filecomment'] = preg_replace('#&(\#[0-9]+;)#', '&\1', request_var('filecomment', '')); + $this->filename_data['filename'] = ($_FILES['fileupload']['name'] != 'none') ? trim($_FILES['fileupload']['name']) : ''; + + $this->attachment_data = (isset($_POST['attachment_data'])) ? $_POST['attachment_data'] : array(); + + // + $data_prepare = array('physical_filename' => 's', 'real_filename' => 's', 'comment' => 's', 'extension' => 's', 'mimetype' => 's', + 'filesize' => 'i', 'filetime' => 'i', 'attach_id' => 'i', 'thumbnail' => 'i'); + foreach ($this->attachment_data as $pos => $var_ary) + { + foreach ($data_prepare as $var => $type) + { + if ($type == 's') + { + $this->attachment_data[$pos][$var] = htmlspecialchars(trim(stripslashes(preg_replace(array("#[ \xFF]{2,}#s", "#[\r\n]{2,}#s"), array(' ', "\n"), $this->attachment_data[$pos][$var])))); + } + else + { + $this->attachment_data[$pos][$var] = (int) $this->attachment_data[$pos][$var]; + } + } + } + } + // Parse Poll function parse_poll(&$poll, $poll_data) { diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index dfbd3122ac..0caa1b304b 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -420,7 +420,7 @@ class template default: $this->compile_var_tags($blocks[0][$curr_tb]); $trim_check = trim($blocks[0][$curr_tb]); - $compile_blocks[] = (!$do_not_echo) ? ((!empty($trim_check)) ? $blocks[0][$curr_tb] : '') : ((!empty($trim_check)) ? $blocks[0][$curr_tb] : ''); + $compile_blocks[] = (!$no_echo) ? ((!empty($trim_check)) ? $blocks[0][$curr_tb] : '') : ((!empty($trim_check)) ? $blocks[0][$curr_tb] : ''); break; } } @@ -644,7 +644,7 @@ class template function compile_tag_define($tag_args, $op) { - preg_match('#^(([a-z0-9\-_]+?\.)+?)?\$([A-Z][A-Z0-9_\-]*?) = (\'?)(.*?)(\'?)$#', $tag_args, $match); + preg_match('#^(([a-z0-9\-_]+?\.)+?)?\$([A-Z][A-Z0-9_\-]*?) = (\'?)(.*?)(\'?)$#', $tag_args, $match); if (empty($match[3]) || empty($match[5])) { diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index e2becf7275..b708d209bf 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -107,7 +107,7 @@ class ucp_attachments extends module $view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . '#' . $row['post_id']; $template->assign_block_vars('attachrow', array( - 'ROW_NUMBER' => $i + ($start + 1), + 'ROW_NUMBER' => $row_count + ($start + 1), 'FILENAME' => $row['real_filename'], 'COMMENT' => str_replace("\n", '<br />', $row['comment']), 'EXTENSION' => $row['extension'], diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index c7783b88b9..3419cb2993 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -502,6 +502,11 @@ class ucp_main extends module break; case 'drafts': + global $ucp; + + $pm_drafts = ($ucp->name == 'pm') ? true : false; + + $user->add_lang('posting'); $edit = (isset($_REQUEST['edit'])) ? true : false; $submit = (isset($_POST['submit'])) ? true : false; @@ -558,12 +563,24 @@ class ucp_main extends module } } - $sql = 'SELECT d.*, f.forum_name - FROM ' . DRAFTS_TABLE . ' d, ' . FORUMS_TABLE . ' f - WHERE d.user_id = ' . $user->data['user_id'] . ' ' . - (($edit) ? "AND d.draft_id = $draft_id" : '') . ' - AND f.forum_id = d.forum_id - ORDER BY save_time DESC'; + if (!$pm_drafts) + { + $sql = 'SELECT d.*, f.forum_name + FROM ' . DRAFTS_TABLE . ' d, ' . FORUMS_TABLE . ' f + WHERE d.user_id = ' . $user->data['user_id'] . ' ' . + (($edit) ? "AND d.draft_id = $draft_id" : '') . ' + AND f.forum_id = d.forum_id + ORDER BY d.save_time DESC'; + } + else + { + $sql = 'SELECT * FROM ' . DRAFTS_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' ' . + (($edit) ? "AND draft_id = $draft_id" : '') . ' + AND forum_id = 0 + AND topic_id = 0 + ORDER BY save_time DESC'; + } $result = $db->sql_query($sql); $draftrows = $topic_ids = array(); @@ -598,7 +615,7 @@ class ucp_main extends module $row_count = 0; foreach ($draftrows as $draft) { - $link_topic = $link_forum = 0; + $link_topic = $link_forum = $link_pm = false; $insert_url = $view_url = $title = ''; if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) @@ -617,6 +634,11 @@ class ucp_main extends module $insert_url = "posting.$phpEx$SID&f=" . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']; } + else if ($pm_drafts) + { + $link_pm = true; + $insert_url = "ucp.$phpEx$SID&i=$id&mode=compose&d=" . $draft['draft_id']; + } $template_row = array( 'DATE' => $user->format_date($draft['save_time']), @@ -635,6 +657,7 @@ class ucp_main extends module 'S_ROW_COUNT' => $row_count++, 'S_LINK_TOPIC' => $link_topic, 'S_LINK_FORUM' => $link_forum, + 'S_LINK_PM' => $link_pm, 'S_HIDDEN_FIELDS' => $s_hidden_fields ); @@ -643,7 +666,7 @@ class ucp_main extends module if (!$edit) { - $template->assign_vars('S_DRAFT_ROWS', $row_count); + $template->assign_var('S_DRAFT_ROWS', $row_count); } break; diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 0ef90bde51..4b121c316a 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -1,1896 +1,54 @@ <?php -/*************************************************************************** - * usercp_profile.php - * ------------------- - * begin : Saturday, Feb 21, 2003 - * copyright : (C) 2001 The phpBB Group - * email : support@phpbb.com - * - * $Id$ - * - * - ***************************************************************************/ - -/*************************************************************************** - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * - ***************************************************************************/ +// ------------------------------------------------------------- +// +// $Id$ +// +// FILENAME : ucp_pm.php +// STARTED : Sat Mar 27, 2004 +// COPYRIGHT : � 2004 phpBB Group +// WWW : http://www.phpbb.com/ +// LICENCE : GPL vs2.0 [ see /docs/COPYING ] +// +// ------------------------------------------------------------- // TODO for 2.2: // -// * Integrate as part of UCP // * Utilise more code from posting, modularise as appropriate -// * Introduce (admin limited) folders to replace saved (inbox, outbox and sentbox remain) -// * Introduce (admin limited) numbers of messages within each folder -// * Introduce (admin definable) differing limits for certain users/groups -// * Introduce (admin/user switchable) different methods of dealing with full inboxes // * Give option of recieving a receipt upon reading (sender) // * Give option of not sending a receipt upon reading (recipient) -// * Topic based approach? i.e. single topic threading // * Archive inbox to text file? to email? -// * Implement white (buddy) and black (ignore) list marking (see UCP) -// * Mark rows of white list users different colour? // * Review of post when replying/quoting // * Introduce post/post thread forwarding -// * Introduce (admin definable) mass mailing -// * Introduce (admin definable) group mailing // * Introduce (option of) emailing entire PM when notifying user of new message -class ucp_pm extends ucp +class ucp_pm extends module { - function main($module_id) + function ucp_pm($id, $mode) { - global $config, $db, $user, $auth, $SID, $template, $phpEx; - - // Is PM disabled? - if (!empty($config['privmsg_disable'])) - { - trigger_error($user->lang['PM_DISABLED']); - } - - $html_entities_match = array('#&#', '#<#', '#>#'); - $html_entities_replace = array('&', '<', '>'); - - // Parameters - $submit = (isset($_POST['post'])) ? TRUE : 0; - $submit_search = (isset($_POST['usersubmit'])) ? TRUE : 0; - $submit_msgdays = (isset($_POST['submit_msgdays'])) ? TRUE : 0; - $cancel = (isset($_POST['cancel'])) ? TRUE : 0; - $preview = (isset($_POST['preview'])) ? TRUE : 0; - $confirm = (isset($_POST['confirm'])) ? TRUE : 0; - $delete = (isset($_POST['delete'])) ? TRUE : 0; - $delete_all = (isset($_POST['deleteall'])) ? TRUE : 0; - - $refresh = $preview || $submit_search; - - $mark_list = (!empty($_POST['mark'])) ? $_POST['mark'] : 0; - - if (isset($_POST['folder']) || isset($_GET['folder'])) - { - $folder = (isset($_POST['folder'])) ? $_POST['folder'] : $_GET['folder']; - - if ($folder != 'inbox' && $folder != 'outbox' && $folder != 'sentbox' && $folder != 'savebox') - { - $folder = 'inbox'; - } - } - else - { - $folder = 'inbox'; - } - - // Cancel - if ($cancel) - { - redirect("privmsg.$phpEx$SIDfolder=$folder"); - } - - - // Var definitions - if (!empty($_POST['mode']) || !empty($_GET['mode'])) - { - $mode = (!empty($_POST['mode'])) ? $_POST['mode'] : $_GET['mode']; - } - else - { - $mode = ''; - } - - $start = (!empty($_GET['start'])) ? intval($_GET['start']) : 0; - - if (isset($_POST['p']) || isset($_GET['p'])) - { - $privmsg_id = (isset($_POST['p'])) ? intval($_POST['p']) : intval($_GET['p']); - } - else - { - $privmsg_id = ''; - } - - $error = FALSE; - - // - // Define the box image links - // - $inbox_img = ($folder != 'inbox' || $mode != '') ? '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '"><img src="' . $images['pm_inbox'] . '" border="0" alt="' . $lang['Inbox'] . '" /></a>' : '<img src="' . $images['pm_inbox'] . '" border="0" alt="' . $lang['Inbox'] . '" />'; - $inbox_url = ($folder != 'inbox' || $mode != '') ? '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">' . $lang['Inbox'] . '</a>' : $lang['Inbox']; - - $outbox_img = ($folder != 'outbox' || $mode != '') ? '<a href="' . append_sid("privmsg.$phpEx?folder=outbox") . '"><img src="' . $images['pm_outbox'] . '" border="0" alt="' . $lang['Outbox'] . '" /></a>' : '<img src="' . $images['pm_outbox'] . '" border="0" alt="' . $lang['Outbox'] . '" />'; - $outbox_url = ($folder != 'outbox' || $mode != '') ? '<a href="' . append_sid("privmsg.$phpEx?folder=outbox") . '">' . $lang['Outbox'] . '</a>' : $lang['Outbox']; - - $sentbox_img = ($folder != 'sentbox' || $mode != '') ? '<a href="' . append_sid("privmsg.$phpEx?folder=sentbox") . '"><img src="' . $images['pm_sentbox'] . '" border="0" alt="' . $lang['Sentbox'] . '" /></a>' : '<img src="' . $images['pm_sentbox'] . '" border="0" alt="' . $lang['Sentbox'] . '" />'; - $sentbox_url = ($folder != 'sentbox' || $mode != '') ? '<a href="' . append_sid("privmsg.$phpEx?folder=sentbox") . '">' . $lang['Sentbox'] . '</a>' : $lang['Sentbox']; - - $savebox_img = ($folder != 'savebox' || $mode != '') ? '<a href="' . append_sid("privmsg.$phpEx?folder=savebox") . '"><img src="' . $images['pm_savebox'] . '" border="0" alt="' . $lang['Savebox'] . '" /></a>' : '<img src="' . $images['pm_savebox'] . '" border="0" alt="' . $lang['Savebox'] . '" />'; - $savebox_url = ($folder != 'savebox' || $mode != '') ? '<a href="' . append_sid("privmsg.$phpEx?folder=savebox") . '">' . $lang['Savebox'] . '</a>' : $lang['Savebox']; - - // ---------- - // Start main - // - if ($mode == 'newpm') - { - $gen_simple_header = TRUE; - - $page_title = $lang['Private_Messaging']; - include($phpbb_root_path . 'includes/page_header.'.$phpEx); - - $template->set_filenames(array( - 'body' => 'privmsgs_popup.tpl') - ); - - if ($userdata['user_id']) - { - if ($userdata['user_new_privmsg']) - { - $l_new_message = ($userdata['user_new_privmsg'] == 1) ? $lang['You_new_pm'] : $lang['You_new_pms']; - } - else - { - $l_new_message = $lang['You_no_new_pm']; - } - - $l_new_message .= '<br /><br />' . sprintf($lang['Click_view_privmsg'], '<a href="' . append_sid("privmsg.".$phpEx."?folder=inbox") . '" onClick="jump_to_inbox();return false;" target="_new">', '</a>'); - } - else - { - $l_new_message = $lang['Login_check_pm']; - } - - $template->assign_vars(array( - 'L_CLOSE_WINDOW' => $lang['Close_window'], - 'L_MESSAGE' => $l_new_message) - ); - - $template->pparse('body'); - - include($phpbb_root_path . 'includes/page_tail.'.$phpEx); - - } - else if ($mode == 'read') - { - if (!empty($_GET['p'])) - { - $privmsgs_id = intval($_GET['p']); - } - else - { - message_die(MESSAGE, $lang['No_post_id']); - } - - if (!$userdata['user_id']) - { - $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode&" . POST_POST_URL . "=$privmsgs_id", true)); - } - - // - // SQL to pull appropriate message, prevents nosey people - // reading other peoples messages ... hopefully! - // - switch($folder) - { - case 'inbox': - $l_box_name = $lang['Inbox']; - $pm_sql_user = "AND pm.privmsgs_to_userid = " . $userdata['user_id'] . " - AND (pm.privmsgs_type = " . PRIVMSGS_READ_MAIL . " - OR pm.privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR pm.privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ")"; - break; - case 'outbox': - $l_box_name = $lang['Outbox']; - $pm_sql_user = "AND pm.privmsgs_from_userid = " . $userdata['user_id'] . " - AND (pm.privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR pm.privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ") "; - break; - case 'sentbox': - $l_box_name = $lang['Sentbox']; - $pm_sql_user = "AND pm.privmsgs_from_userid = " . $userdata['user_id'] . " - AND pm.privmsgs_type = " . PRIVMSGS_SENT_MAIL; - break; - case 'savebox': - $l_box_name = $lang['Savebox']; - $pm_sql_user .= "AND ((pm.privmsgs_to_userid = " . $userdata['user_id'] . " - AND pm.privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . ") - OR (pm.privmsgs_from_userid = " . $userdata['user_id'] . " - AND pm.privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ") - )"; - break; - default: - message_die(MESSAGE, $lang['No_such_folder']); - break; - } - - // - // Major query obtains the message ... - // - $sql = "SELECT u.username AS username_1, u.user_id AS user_id_1, u2.username AS username_2, u2.user_id AS user_id_2, u.user_sig_bbcode_uid, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_avatar, pm.*, pmt.privmsgs_bbcode_uid, pmt.privmsgs_text - FROM " . PRIVMSGS_TABLE . " pm, " . PRIVMSGS_TEXT_TABLE . " pmt, " . USERS_TABLE . " u, " . USERS_TABLE . " u2 - WHERE pm.privmsgs_id = $privmsgs_id - AND pmt.privmsgs_text_id = pm.privmsgs_id - $pm_sql_user - AND u.user_id = pm.privmsgs_from_userid - AND u2.user_id = pm.privmsgs_to_userid"; - $result = $db->sql_query($sql); - - // - // Did the query return any data? - // - if (!($privmsg = $db->sql_fetchrow($result))) - { - $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true)); - } - - $privmsg_id = $privmsg['privmsgs_id']; - - // - // Is this a new message in the inbox? If it is then save - // a copy in the posters sent box - // - if (($privmsg['privmsgs_type'] == PRIVMSGS_NEW_MAIL || $privmsg['privmsgs_type'] == PRIVMSGS_UNREAD_MAIL) && $folder == 'inbox') - { - $sql = "UPDATE " . PRIVMSGS_TABLE . " - SET privmsgs_type = " . PRIVMSGS_READ_MAIL . " - WHERE privmsgs_id = " . $privmsg['privmsgs_id']; - $db->sql_query($sql); - - $sql = "UPDATE " . USERS_TABLE . " - SET user_unread_privmsg = user_unread_privmsg - 1 - WHERE user_id = " . $userdata['user_id']; - $db->sql_query($sql); - - // - // Check to see if the poster has a 'full' sent box - // - $sql = "SELECT COUNT(privmsgs_id) AS sent_items, MIN(privmsgs_date) AS oldest_post_time - FROM " . PRIVMSGS_TABLE . " - WHERE privmsgs_type = " . PRIVMSGS_SENT_MAIL . " - AND privmsgs_from_userid = " . $privmsg['privmsgs_from_userid']; - $result = $db->sql_query($sql); - - $sql_priority = (SQL_LAYER == 'mysql') ? 'LOW_PRIORITY' : ''; - - if ($sent_info = $db->sql_fetchrow($result)) - { - if ($sent_info['sent_items'] >= $config['max_sentbox_privmsgs']) - { - $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . " - WHERE privmsgs_type = " . PRIVMSGS_SENT_MAIL . " - AND privmsgs_date = " . $sent_info['oldest_post_time'] . " - AND privmsgs_from_userid = " . $privmsg['privmsgs_from_userid']; - $db->sql_query($sql); - } - } - - // - // This makes a copy of the post and stores it as a SENT message from the sendee. Perhaps - // not the most DB friendly way but a lot easier to manage, besides the admin will be able to - // set limits on numbers of storable posts for users ... hopefully! - // - $sql = "INSERT $sql_priority INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) - VALUES (" . PRIVMSGS_SENT_MAIL . ", '" . str_replace("\'", "''", addslashes($privmsg['privmsgs_subject'])) . "', " . $privmsg['privmsgs_from_userid'] . ", " . $privmsg['privmsgs_to_userid'] . ", " . $privmsg['privmsgs_date'] . ", '" . $privmsg['privmsgs_ip'] . "', " . $privmsg['privmsgs_enable_html'] . ", " . $privmsg['privmsgs_enable_bbcode'] . ", " . $privmsg['privmsgs_enable_smilies'] . ", " . $privmsg['privmsgs_attach_sig'] . ")"; - $db->sql_query($sql); - - $privmsg_sent_id = $db->sql_nextid(); - - $sql = "INSERT $sql_priority INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) - VALUES ($privmsg_sent_id, '" . $privmsg['privmsgs_bbcode_uid'] . "', '" . str_replace("\'", "''", addslashes($privmsg['privmsgs_text'])) . "')"; - $db->sql_query($sql); - } - - // - // Pick a folder, any folder, so long as it's one below ... - // - $post_urls = array( - 'post' => append_sid("privmsg.$phpEx?mode=post"), - 'reply' => append_sid("privmsg.$phpEx?mode=reply&" . POST_POST_URL . "=$privmsg_id"), - 'quote' => append_sid("privmsg.$phpEx?mode=quote&" . POST_POST_URL . "=$privmsg_id"), - 'edit' => append_sid("privmsg.$phpEx?mode=edit&" . POST_POST_URL . "=$privmsg_id") - ); - $post_icons = array( - 'post_img' => '<a href="' . $post_urls['post'] . '"><img src="' . $images['pm_postmsg'] . '" alt="' . $lang['Post_new_pm'] . '" border="0"></a>', - 'post' => '<a href="' . $post_urls['post'] . '">' . $lang['Post_new_pm'] . '</a>', - 'reply_img' => '<a href="' . $post_urls['reply'] . '"><img src="' . $images['pm_replymsg'] . '" alt="' . $lang['Post_reply_pm'] . '" border="0"></a>', - 'reply' => '<a href="' . $post_urls['reply'] . '">' . $lang['Post_reply_pm'] . '</a>', - 'quote_img' => '<a href="' . $post_urls['quote'] . '"><img src="' . $images['pm_quotemsg'] . '" alt="' . $lang['Post_quote_pm'] . '" border="0"></a>', - 'quote' => '<a href="' . $post_urls['quote'] . '">' . $lang['Post_quote_pm'] . '</a>', - 'edit_img' => '<a href="' . $post_urls['edit'] . '"><img src="' . $images['pm_editmsg'] . '" alt="' . $lang['Edit_pm'] . '" border="0"></a>', - 'edit' => '<a href="' . $post_urls['edit'] . '">' . $lang['Edit_pm'] . '</a>' - ); - - if ($folder == 'inbox') - { - $post_img = $post_icons['post_img']; - $reply_img = $post_icons['reply_img']; - $quote_img = $post_icons['quote_img']; - $edit_img = ''; - $post = $post_icons['post']; - $reply = $post_icons['reply']; - $quote = $post_icons['quote']; - $edit = ''; - $l_box_name = $lang['Inbox']; - } - else if ($folder == 'outbox') - { - $post_img = $post_icons['post_img']; - $reply_img = ''; - $quote_img = ''; - $edit_img = $post_icons['edit_img']; - $post = $post_icons['post']; - $reply = ''; - $quote = ''; - $edit = $post_icons['edit']; - $l_box_name = $lang['Outbox']; - } - else if ($folder == 'savebox') - { - if ($privmsg['privmsgs_type'] == PRIVMSGS_SAVED_IN_MAIL) - { - $post_img = $post_icons['post_img']; - $reply_img = $post_icons['reply_img']; - $quote_img = $post_icons['quote_img']; - $edit_img = ''; - $post = $post_icons['post']; - $reply = $post_icons['reply']; - $quote = $post_icons['quote']; - $edit = ''; - } - else - { - $post_img = $post_icons['post_img']; - $reply_img = ''; - $quote_img = ''; - $edit_img = ''; - $post = $post_icons['post']; - $reply = ''; - $quote = ''; - $edit = ''; - } - $l_box_name = $lang['Saved']; - } - else if ($folder == 'sentbox') - { - $post_img = $post_icons['post_img']; - $reply_img = ''; - $quote_img = ''; - $edit_img = ''; - $post = $post_icons['post']; - $reply = ''; - $quote = ''; - $edit = ''; - $l_box_name = $lang['Sent']; - } - - $s_hidden_fields = '<input type="hidden" name="mark[]" value="' . $privmsgs_id . '" />'; - - $page_title = $lang['Read_private_message']; - include($phpbb_root_path . 'includes/page_header.'.$phpEx); - - // - // Load templates - // - $template->set_filenames(array( - 'body' => 'privmsgs_read_body.tpl') - ); - make_jumpbox('viewforum.'.$phpEx); - - $template->assign_vars(array( - 'INBOX_IMG' => $inbox_img, - 'SENTBOX_IMG' => $sentbox_img, - 'OUTBOX_IMG' => $outbox_img, - 'SAVEBOX_IMG' => $savebox_img, - 'INBOX' => $inbox_url, - - 'POST_PM_IMG' => $post_img, - 'REPLY_PM_IMG' => $reply_img, - 'EDIT_PM_IMG' => $edit_img, - 'QUOTE_PM_IMG' => $quote_img, - 'POST_PM' => $post, - 'REPLY_PM' => $reply, - 'EDIT_PM' => $edit, - 'QUOTE_PM' => $quote, - - 'SENTBOX' => $sentbox_url, - 'OUTBOX' => $outbox_url, - 'SAVEBOX' => $savebox_url, - - 'BOX_NAME' => $l_box_name, - - 'L_INBOX' => $lang['Inbox'], - 'L_OUTBOX' => $lang['Outbox'], - 'L_SENTBOX' => $lang['Sent'], - 'L_SAVEBOX' => $lang['Saved'], - 'L_FLAG' => $lang['Flag'], - 'L_SUBJECT' => $lang['Subject'], - 'L_POSTED' => $lang['Posted'], - 'L_DATE' => $lang['Date'], - 'L_FROM' => $lang['From'], - 'L_TO' => $lang['To'], - 'L_SAVE_MSG' => $lang['Save_message'], - 'L_DELETE_MSG' => $lang['Delete_message'], - - 'S_PRIVMSGS_ACTION' => append_sid("privmsg.$phpEx?folder=$folder"), - 'S_HIDDEN_FIELDS' => $s_hidden_fields) - ); - - $username_from = $privmsg['username_1']; - $user_id_from = $privmsg['user_id_1']; - $username_to = $privmsg['username_2']; - $user_id_to = $privmsg['user_id_2']; - - $post_date = $user->format_date($privmsg['privmsgs_date']); - - $temp_url = append_sid("ucp.$phpEx?mode=viewprofile&u=$user_id_from"); - $profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" /></a>'; - $profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>'; - - $temp_url = append_sid("privmsg.$phpEx?mode=post&u=$poster_id"); - $pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>'; - $pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>'; - - if (!empty($privmsg['user_viewemail']) || $auth->acl_get('a_')) - { - $email_uri = ($config['board_email_form']) ? append_sid("ucp.$phpEx?mode=email&u$user_id_from") : 'mailto:' . $privmsg['user_email']; - - $email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>'; - $email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>'; - } - else - { - $email_img = ''; - $email = ''; - } - - $www_img = ($privmsg['user_website']) ? '<a href="' . $privmsg['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : ''; - $www = ($privmsg['user_website']) ? '<a href="' . $privmsg['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : ''; - - if (!empty($privmsg['user_icq'])) - { - $icq_status_img = '<a href="http://wwp.icq.com/' . $privmsg['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $privmsg['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>'; - $icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $privmsg['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>'; - $icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $privmsg['user_icq'] . '">' . $lang['ICQ'] . '</a>'; - } - else - { - $icq_status_img = ''; - $icq_img = ''; - $icq = ''; - } - - $aim_img = ($privmsg['user_aim']) ? '<a href="aim:goim?screenname=' . $privmsg['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : ''; - $aim = ($privmsg['user_aim']) ? '<a href="aim:goim?screenname=' . $privmsg['user_aim'] . '&message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : ''; - - $temp_url = append_sid("ucp.$phpEx?mode=viewprofile&u=$poster_id"); - $msn_img = ($privmsg['user_msnm']) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['MSNM'] . '" title="' . $lang['MSNM'] . '" border="0" /></a>' : ''; - $msn = ($privmsg['user_msnm']) ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : ''; - - $yim_img = ($privmsg['user_yim']) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $privmsg['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : ''; - $yim = ($privmsg['user_yim']) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $privmsg['user_yim'] . '&.src=pg">' . $lang['YIM'] . '</a>' : ''; - - $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username_from) . "&showresults=posts"); - $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" border="0" /></a>'; - $search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>'; - - // - // Processing of post - // - $post_subject = $privmsg['privmsgs_subject']; - - $private_message = $privmsg['privmsgs_text']; - $bbcode_uid = $privmsg['privmsgs_bbcode_uid']; - - if ($config['allow_sig']) - { - $user_sig = ($privmsg['privmsgs_from_userid'] == $userdata['user_id']) ? $userdata['user_sig'] : $privmsg['user_sig']; - } - else - { - $user_sig = ''; - } - - $user_sig_bbcode_uid = ($privmsg['privmsgs_from_userid'] == $userdata['user_id']) ? $userdata['user_sig_bbcode_uid'] : $privmsg['user_sig_bbcode_uid']; - - // - // If the board has HTML off but the post has HTML - // on then we process it, else leave it alone - // - if (!$config['allow_html']) - { - if ($user_sig != '' && $privmsg['privmsgs_enable_sig'] && $userdata['user_allowhtml']) - { - $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig); - } - - if ($privmsg['privmsgs_enable_html']) - { - $private_message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $private_message); - } - } - - if ($user_sig != '' && $privmsg['privmsgs_attach_sig'] && $user_sig_bbcode_uid != '') - { - $user_sig = ($config['allow_bbcode']) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig); - } - - if ($bbcode_uid != '') - { - $private_message = ($config['allow_bbcode']) ? bbencode_second_pass($private_message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $private_message); - } - - $private_message = make_clickable($private_message); - - if ($privmsg['privmsgs_attach_sig'] && $user_sig != '') - { - $private_message .= '<br /><br />_________________<br />' . make_clickable($user_sig); - } - - if (count($censors['match'])) - { - $post_subject = preg_replace($censors['match'], $censors['replace'], $post_subject); - $private_message = preg_replace($censors['match'], $censors['replace'], $private_message); - } - - if ($config['allow_smilies'] && $privmsg['privmsgs_enable_smilies']) - { - $private_message = smilies_pass($private_message); - } - - $private_message = nl2br($private_message); - - // - // Dump it to the templating engine - // - $template->assign_vars(array( - 'MESSAGE_TO' => $username_to, - 'MESSAGE_FROM' => $username_from, - 'RANK_IMAGE' => $rank_image, - 'POSTER_JOINED' => $poster_joined, - 'POSTER_POSTS' => $poster_posts, - 'POSTER_FROM' => $poster_from, - 'POSTER_AVATAR' => $poster_avatar, - 'POST_SUBJECT' => $post_subject, - 'POST_DATE' => $post_date, - 'MESSAGE' => $private_message, - - 'PROFILE_IMG' => $profile_img, - 'PROFILE' => $profile, - 'SEARCH_IMG' => $search_img, - 'SEARCH' => $search, - 'EMAIL_IMG' => $email_img, - 'EMAIL' => $email, - 'WWW_IMG' => $www_img, - 'WWW' => $www, - 'ICQ_STATUS_IMG' => $icq_status_img, - 'ICQ_IMG' => $icq_img, - 'ICQ' => $icq, - 'AIM_IMG' => $aim_img, - 'AIM' => $aim, - 'MSN_IMG' => $msn_img, - 'MSN' => $msn, - 'YIM_IMG' => $yim_img, - 'YIM' => $yim) - ); - - $template->pparse('body'); - - include($phpbb_root_path . 'includes/page_tail.'.$phpEx); - - } - else if (($delete && $mark_list) || $delete_all) - { - if (!$userdata['user_id']) - { - $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true)); - } - if (isset($mark_list) && !is_array($mark_list)) - { - // Set to empty array instead of '0' if nothing is selected. - $mark_list = array(); - } - - if (!$confirm) - { - $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />'; - $s_hidden_fields .= (isset($_POST['delete'])) ? '<input type="hidden" name="delete" value="true" />' : '<input type="hidden" name="deleteall" value="true" />'; - - for($i = 0; $i < count($mark_list); $i++) - { - $s_hidden_fields .= '<input type="hidden" name="mark[]" value="' . $mark_list[$i] . '" />'; - } - - // - // Output confirmation page - // - include($phpbb_root_path . 'includes/page_header.'.$phpEx); - - $template->set_filenames(array( - 'confirm_body' => 'confirm_body.tpl') - ); - $template->assign_vars(array( - 'MESSAGE_TITLE' => $lang['Information'], - 'MESSAGE_TEXT' => (count($mark_list) == 1) ? $lang['Confirm_delete_pm'] : $lang['Confirm_delete_pms'], - - 'L_YES' => $lang['Yes'], - 'L_NO' => $lang['No'], - - 'S_CONFIRM_ACTION' => append_sid("privmsg.$phpEx?folder=$folder"), - 'S_HIDDEN_FIELDS' => $s_hidden_fields) - ); - - $template->pparse('confirm_body'); - - include($phpbb_root_path . 'includes/page_tail.'.$phpEx); - - } - else if ($confirm) - { - if ($delete_all) - { - switch($folder) - { - case 'inbox': - $delete_type = "privmsgs_to_userid = " . $userdata['user_id'] . " AND ( - privmsgs_type = " . PRIVMSGS_READ_MAIL . " OR privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ")"; - break; - - case 'outbox': - $delete_type = "privmsgs_from_userid = " . $userdata['user_id'] . " AND (privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ")"; - break; - - case 'sentbox': - $delete_type = "privmsgs_from_userid = " . $userdata['user_id'] . " AND privmsgs_type = " . PRIVMSGS_SENT_MAIL; - break; - - case 'savebox': - $delete_type = "((privmsgs_from_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ") - OR (privmsgs_to_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . "))"; - break; - } - - $sql = "SELECT privmsgs_id - FROM " . PRIVMSGS_TABLE . " - WHERE $delete_type"; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $mark_list[] = $row['privmsgs_id']; - } - - unset($delete_type); - } - - if (count($mark_list)) - { - $delete_sql_id = implode(', ', $mark_list); - - // Need to decrement the new message counter of recipient - // problem is this doesn't affect the unread counter even - // though it may be the one that needs changing ... hhmmm - if ($folder == 'outbox') - { - $sql = "SELECT privmsgs_to_userid - FROM " . PRIVMSGS_TABLE . " - WHERE privmsgs_id IN ($delete_sql_id) - AND privmsgs_from_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_NEW_MAIL; - $result = $db->sql_query($sql); - - $update_pm_sql = ''; - while($row = $db->sql_fetchrow($result)) - { - $update_pm_sql .= (($update_pm_sql != '') ? ', ' : '') . $row['privmsgs_to_userid']; - } - - if ($update_pm_sql != '') - { - $sql = "UPDATE " . USERS_TABLE . " - SET user_new_privmsg = user_new_privmsg - 1 - WHERE user_id IN ($update_pm_sql)"; - $db->sql_query($sql); - } - - $sql = "SELECT privmsgs_to_userid - FROM " . PRIVMSGS_TABLE . " - WHERE privmsgs_id IN ($delete_sql_id) - AND privmsgs_from_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_UNREAD_MAIL; - $result = $db->sql_query($sql); - - $update_pm_sql = ''; - while($row = $db->sql_fetchrow($result)) - { - $update_pm_sql .= (($update_pm_sql != '') ? ', ' : '') . $row['privmsgs_to_userid']; - } - - if ($update_pm_sql != '') - { - $sql = "UPDATE " . USERS_TABLE . " - SET user_unread_privmsg = user_unread_privmsg - 1 - WHERE user_id IN ($update_pm_sql)"; - $db->sql_query($sql); - } - } - - $delete_text_sql = "DELETE FROM " . PRIVMSGS_TEXT_TABLE . " - WHERE privmsgs_text_id IN ($delete_sql_id)"; - $delete_sql = "DELETE FROM " . PRIVMSGS_TABLE . " - WHERE privmsgs_id IN ($delete_sql_id) - AND "; - - switch($folder) - { - case 'inbox': - $delete_sql .= "privmsgs_to_userid = " . $userdata['user_id'] . " AND ( - privmsgs_type = " . PRIVMSGS_READ_MAIL . " OR privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ")"; - break; - - case 'outbox': - $delete_sql .= "privmsgs_from_userid = " . $userdata['user_id'] . " AND ( - privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ")"; - break; - - case 'sentbox': - $delete_sql .= "privmsgs_from_userid = " . $userdata['user_id'] . " AND privmsgs_type = " . PRIVMSGS_SENT_MAIL; - break; - - case 'savebox': - $delete_sql .= "((privmsgs_from_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ") - OR (privmsgs_to_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . "))"; - break; - } - - $db->sql_query($delete_sql); - $db->sql_query($delete_text_sql); - } - } - } - else if ($save && $mark_list && $folder != 'savebox' && $folder != 'outbox') - { - if (!$userdata['user_id']) - { - $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true)); - } - - // - // See if recipient is at their savebox limit - // - $sql = "SELECT COUNT(privmsgs_id) AS savebox_items, MIN(privmsgs_date) AS oldest_post_time - FROM " . PRIVMSGS_TABLE . " - WHERE ((privmsgs_to_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . ") - OR (privmsgs_from_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . "))"; - $result = $db->sql_query($sql); - - $sql_priority = (SQL_LAYER == 'mysql') ? 'LOW_PRIORITY' : ''; - - if ($saved_info = $db->sql_fetchrow($result)) - { - if ($saved_info['savebox_items'] >= $config['max_savebox_privmsgs']) - { - $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . " - WHERE ((privmsgs_to_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . ") - OR (privmsgs_from_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ")) - AND privmsgs_date = " . $saved_info['oldest_post_time']; - $db->sql_query($sql); - } - } - - // - // Process request - // - $saved_sql = "UPDATE " . PRIVMSGS_TABLE; - - switch($folder) - { - case 'inbox': - $saved_sql .= " SET privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . " - WHERE privmsgs_to_userid = " . $userdata['user_id'] . " - AND (privmsgs_type = " . PRIVMSGS_READ_MAIL . " - OR privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ")"; - break; - - case 'outbox': - $saved_sql .= " SET privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . " - WHERE privmsgs_from_userid = " . $userdata['user_id'] . " - AND (privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR privmsgs_type = " . PRIVMSGS_UNERAD_MAIL . ") "; - break; - - case 'sentbox': - $saved_sql .= " SET privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . " - WHERE privmsgs_from_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SENT_MAIL; - break; - } - - if (count($mark_list)) - { - $saved_sql_id = ''; - for($i = 0; $i < count($mark_list); $i++) - { - $saved_sql_id .= (($saved_sql_id != '') ? ', ' : '') . $mark_list[$i]; - } - - $saved_sql .= " AND privmsgs_id IN ($saved_sql_id)"; - - $db->sql_query($saved_sql); - } - - } - else if ($submit || $refresh || $mode != '') - { - - if (!$userdata['user_id']) - { - $user_id = (isset($_GET['u'])) ? '&u=' . intval($_GET['u']) : ''; - $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode" . $user_id, true)); - } - - // - // Toggles - // - if (!$config['allow_html']) - { - $html_on = 0; - } - else - { - $html_on = ($submit || $refresh) ? ((!empty($_POST['disable_html'])) ? 0 : TRUE) : $userdata['user_allowhtml']; - } - - if (!$config['allow_bbcode']) - { - $bbcode_on = 0; - } - else - { - $bbcode_on = ($submit || $refresh) ? ((!empty($_POST['disable_bbcode'])) ? 0 : TRUE) : $userdata['user_allowbbcode']; - } - - if (!$config['allow_smilies']) - { - $smilies_on = 0; - } - else - { - $smilies_on = ($submit || $refresh) ? ((!empty($_POST['disable_smilies'])) ? 0 : TRUE) : $userdata['user_allowsmile']; - } - - $attach_sig = ($submit || $refresh) ? ((!empty($_POST['attach_sig'])) ? TRUE : 0) : $userdata['user_attachsig']; - $user_sig = ($userdata['user_sig'] != '' && $config['allow_sig']) ? $userdata['user_sig'] : ""; - - if ($submit && $mode != 'edit') - { - // Flood control - $sql = "SELECT MAX(privmsgs_date) AS last_post_time - FROM " . PRIVMSGS_TABLE . " - WHERE privmsgs_from_userid = " . $userdata['user_id']; - $result = $db->sql_query($sql); - - $db_row = $db->sql_fetchrow($result); - - $last_post_time = $db_row['last_post_time']; - $current_time = time(); - - if (($current_time - $last_post_time) < $config['flood_interval']) - { - message_die(MESSAGE, $lang['Flood_Error']); - } - // End Flood control - } - - if ($submit) - { - if (!empty($_POST['username'])) - { - $to_username = $_POST['username']; - - $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active - FROM " . USERS_TABLE . " - WHERE username = '" . str_replace("\'", "''", $to_username) . "' - AND user_id <> " . ANONYMOUS; - if (!($result = $db->sql_query($sql))) - { - $error = TRUE; - $error_msg = $lang['No_such_user']; - } - - $to_userdata = $db->sql_fetchrow($result); - } - else - { - $error = TRUE; - $error_msg .= ((!empty($error_msg)) ? '<br />' : '') . $lang['No_to_user']; - } - - $privmsg_subject = trim(strip_tags($_POST['subject'])); - if (empty($privmsg_subject)) - { - $error = TRUE; - $error_msg .= ((!empty($error_msg)) ? '<br />' : '') . $lang['Empty_subject']; - } - - if (!empty($_POST['message'])) - { - if (!$error) - { - if ($bbcode_on) - { - $bbcode_uid = make_bbcode_uid(); - } - - $privmsg_message = prepare_message($_POST['message'], $html_on, $bbcode_on, $smilies_on, $bbcode_uid); - - } - } - else - { - $error = TRUE; - $error_msg .= ((!empty($error_msg)) ? '<br />' : '') . $lang['Empty_message']; - } - } - - if ($submit && !$error) - { - // - // Has admin prevented user from sending PM's? - // - if (!$userdata['user_allow_pm']) - { - $message = $lang['Cannot_send_privmsg']; - message_die(MESSAGE, $message); - } - - $msg_time = time(); - - if ($mode != 'edit') - { - // - // See if recipient is at their inbox limit - // - $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time - FROM " . PRIVMSGS_TABLE . " - WHERE (privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " - OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ") - AND privmsgs_to_userid = " . $to_userdata['user_id']; - $result = $db->sql_query($sql); - - $sql_priority = (SQL_LAYER == 'mysql') ? 'LOW_PRIORITY' : ''; - - if ($inbox_info = $db->sql_fetchrow($result)) - { - if ($inbox_info['inbox_items'] >= $config['max_inbox_privmsgs']) - { - $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . " - WHERE (privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " - OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) - AND privmsgs_date = " . $inbox_info['oldest_post_time'] . " - AND privmsgs_to_userid = " . $to_userdata['user_id']; - $db->sql_query($sql); - } - } - - $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) - VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $privmsg_subject) . "', " . $userdata['user_id'] . ", " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', $html_on, $bbcode_on, $smilies_on, $attach_sig)"; - } - else - { - $sql_info = "UPDATE " . PRIVMSGS_TABLE . " - SET privmsgs_type = " . PRIVMSGS_NEW_MAIL . ", privmsgs_subject = '" . str_replace("\'", "''", $privmsg_subject) . "', privmsgs_from_userid = " . $userdata['user_id'] . ", privmsgs_to_userid = " . $to_userdata['user_id'] . ", privmsgs_date = $msg_time, privmsgs_ip = '$user_ip', privmsgs_enable_html = $html_on, privmsgs_enable_bbcode = $bbcode_on, privmsgs_enable_smilies = $smilies_on, privmsgs_attach_sig = $attach_sig - WHERE privmsgs_id = $privmsg_id"; - } - - $db->sql_query($sql_info); - - if ($mode != 'edit') - { - $privmsg_sent_id = $db->sql_nextid(); - - $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) - VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("\'", "''", $privmsg_message) . "')"; - } - else - { - $sql = "UPDATE " . PRIVMSGS_TEXT_TABLE . " - SET privmsgs_text = '" . str_replace("\'", "''", $privmsg_message) . "', privmsgs_bbcode_uid = '$bbcode_uid' - WHERE privmsgs_text_id = $privmsg_id"; - } - - $db->sql_query($sql); - - if ($mode != 'edit') - { - // - // Add to the users new pm counter - // - $sql = "UPDATE " . USERS_TABLE . " - SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . " - WHERE user_id = " . $to_userdata['user_id']; - if (!$status = $db->sql_query($sql)) - { - message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql); - } - - if ($to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active']) - { - $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($config['script_path'])); - $script_name = ($script_name != '') ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx; - $server_name = trim($config['server_name']); - $server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://'; - $server_port = ($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/'; - - include($phpbb_root_path . 'includes/emailer.'.$phpEx); - $emailer = new emailer(); - - $emailer->use_template('privmsg_notify', $to_userdata['user_lang']); - $emailer->from($config['board_email']); - $emailer->to($to_userdata['user_email']); - $emailer->set_subject(); //$lang['Notification_subject'] - - $emailer->assign_vars(array( - 'USERNAME' => $to_username, - 'SITENAME' => $config['sitename'], - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - - 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox') - ); - - $emailer->send(); - $emailer->reset(); - } - } - - $template->assign_vars(array( - 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("privmsg.$phpEx?folder=inbox") . '">') - ); - - $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); - - message_die(GMESSAGE, $msg); - } - else if ($preview || $refresh || $error) - { - - // - // If we're previewing or refreshing then obtain the data - // passed to the script, process it a little, do some checks - // where neccessary, etc. - // - $to_username = (isset($_POST['username'])) ? trim(strip_tags(stripslashes($_POST['username']))) : ''; - $privmsg_subject = (isset($_POST['subject'])) ? trim(strip_tags(stripslashes($_POST['subject']))) : ''; - $privmsg_message = (isset($_POST['message'])) ? trim($_POST['message']) : ''; - $privmsg_message = preg_replace('#<textarea>#si', '<textarea>', $privmsg_message); - if (!$preview) - { - $privmsg_message = stripslashes($privmsg_message); - } - - // - // Do mode specific things - // - if ($mode == 'post') - { - $page_title = $lang['Send_new_privmsg']; - - $user_sig = ($userdata['user_sig'] != '' && $config['allow_sig']) ? $userdata['user_sig'] : ''; - - } - else if ($mode == 'reply') - { - $page_title = $lang['Reply_privmsg']; - - $user_sig = ($userdata['user_sig'] != '' && $config['allow_sig']) ? $userdata['user_sig'] : ''; - - } - else if ($mode == 'edit') - { - $page_title = $lang['Edit_privmsg']; - - $sql = "SELECT u.user_id, u.user_sig - FROM " . PRIVMSGS_TABLE . " pm, " . USERS_TABLE . " u - WHERE pm.privmsgs_id = $privmsg_id - AND u.user_id = pm.privmsgs_from_userid"; - $result = $db->sql_query($sql); - - if ($postrow = $db->sql_fetchrow($result)) - { - if ($userdata['user_id'] != $postrow['user_id']) - { - message_die(MESSAGE, $lang['Sorry_edit_own_posts']); - } - - $user_sig = ($postrow['user_sig'] != '' && $config['allow_sig']) ? $postrow['user_sig'] : ''; - } - } - } - else - { - if (!$privmsg_id && ($mode == 'reply' || $mode == 'edit' || $mode == 'quote')) - { - message_die(GENERAL_ERROR, $lang['No_post_id']); - } - - if (!empty($_GET['u'])) - { - $user_id = intval($_GET['u']); - - $sql = "SELECT username - FROM " . USERS_TABLE . " - WHERE user_id = $user_id - AND user_id <> " . ANONYMOUS; - if (!($result = $db->sql_query($sql))) - { - $error = TRUE; - $error_msg = $lang['No_such_user']; - } - - if ($row = $db->sql_fetchrow($result)) - { - $to_username = $row['username']; - } - } - - if ($mode == 'edit') - { - $sql = "SELECT pm.*, pmt.privmsgs_bbcode_uid, pmt.privmsgs_text, u.username, u.user_id, u.user_sig - FROM " . PRIVMSGS_TABLE . " pm, " . PRIVMSGS_TEXT_TABLE . " pmt, " . USERS_TABLE . " u - WHERE pm.privmsgs_id = $privmsg_id - AND pmt.privmsgs_text_id = pm.privmsgs_id - AND pm.privmsgs_from_userid = " . $userdata['user_id'] . " - AND (pm.privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR pm.privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ") - AND u.user_id = pm.privmsgs_to_userid"; - $result = $db->sql_query($sql); - - if (!($privmsg = $db->sql_fetchrow($result))) - { - $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true)); - } - - $privmsg_subject = $privmsg['privmsgs_subject']; - $privmsg_message = $privmsg['privmsgs_text']; - $privmsg_bbcode_uid = $privmsg['privmsgs_bbcode_uid']; - $privmsg_bbcode_enabled = ($privmsg['privmsgs_enable_bbcode'] == 1); - - if ($privmsg_bbcode_enabled) - { - $privmsg_message = preg_replace("/\:(([a-z0-9]:)?)$privmsg_bbcode_uid/si", '', $privmsg_message); - } - - $privmsg_message = str_replace('<br />', "\n", $privmsg_message); - $privmsg_message = preg_replace('#</textarea>#si', '</textarea>', $privmsg_message); - - $user_sig = ( $config['allow_sig']) ? $privmsg['user_sig'] : ''; - - $to_username = $privmsg['username']; - $to_userid = $privmsg['user_id']; - - } - else if ($mode == 'reply' || $mode == 'quote') - { - - $sql = "SELECT pm.privmsgs_subject, pm.privmsgs_date, pmt.privmsgs_bbcode_uid, pmt.privmsgs_text, u.username, u.user_id - FROM " . PRIVMSGS_TABLE . " pm, " . PRIVMSGS_TEXT_TABLE . " pmt, " . USERS_TABLE . " u - WHERE pm.privmsgs_id = $privmsg_id - AND pmt.privmsgs_text_id = pm.privmsgs_id - AND pm.privmsgs_to_userid = " . $userdata['user_id'] . " - AND u.user_id = pm.privmsgs_from_userid"; - $result = $db->sql_query($sql); - - if (!($privmsg = $db->sql_fetchrow($result))) - { - $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true)); - } - - $privmsg_subject = ((!preg_match('/^Re:/', $privmsg['privmsgs_subject'])) ? 'Re: ' : '') . $privmsg['privmsgs_subject']; - - $to_username = $privmsg['username']; - $to_userid = $privmsg['user_id']; - - if ($mode == 'quote') - { - $privmsg_message = $privmsg['privmsgs_text']; - $privmsg_bbcode_uid = $privmsg['privmsgs_bbcode_uid']; - - $privmsg_message = preg_replace("/\:(([a-z0-9]:)?)$privmsg_bbcode_uid/si", '', $privmsg_message); - $privmsg_message = str_replace('<br />', "\n", $privmsg_message); - $privmsg_message = preg_replace('#</textarea>#si', '</textarea>', $privmsg_message); - - $msg_date = $user->format_date($privmsg['privmsgs_date']); - - $privmsg_message = '[quote="' . $to_username . '"]' . $privmsg_message . '[/quote]'; - - $mode = 'reply'; - } - } - } - - // - // Has admin prevented user from sending PM's? - // - if (!$userdata['user_allow_pm'] && $mode != 'edit') - { - $message = $lang['Cannot_send_privmsg']; - message_die(MESSAGE, $message); - } - - // - // Start output, first preview, then errors then post form - // - $page_title = $lang['Send_private_message']; - include($phpbb_root_path . 'includes/page_header.'.$phpEx); - - if ($preview && !$error) - { - $censors = array(); - obtain_word_list($censors); - - if ($bbcode_on) - { - $bbcode_uid = make_bbcode_uid(); - } - - $preview_message = stripslashes(prepare_message($privmsg_message, $html_on, $bbcode_on, $smilies_on, $bbcode_uid)); - $privmsg_message = stripslashes(preg_replace($html_entities_match, $html_entities_replace, $privmsg_message)); - - // - // Finalise processing as per viewtopic - // - if (!$html_on) - { - if ($user_sig != '' || !$userdata['user_allowhtml']) - { - $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig); - } - } - - if ($attach_sig && $user_sig != '' && $userdata['user_sig_bbcode_uid']) - { - $user_sig = bbencode_second_pass($user_sig, $userdata['user_sig_bbcode_uid']); - } - - if ($bbcode_on) - { - $preview_message = bbencode_second_pass($preview_message, $bbcode_uid); - } - - if ($attach_sig && $user_sig != '') - { - $preview_message = $preview_message . '<br /><br />_________________<br />' . $user_sig; - } - - if (count($censors['match'])) - { - $preview_subject = preg_replace($censors['match'], $censors['replace'], $privmsg_subject); - $preview_message = preg_replace($censors['match'], $censors['replace'], $preview_message); - } - else - { - $preview_subject = $privmsg_subject; - } - - if ($smilies_on) - { - $preview_message = smilies_pass($preview_message); - } - - $preview_message = make_clickable($preview_message); - $preview_message = nl2br($preview_message); - - $s_hidden_fields = '<input type="hidden" name="folder" value="' . $folder . '" />'; - $s_hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />'; - - if (isset($privmsg_id)) - { - $s_hidden_fields .= '<input type="hidden" name="p" value="' . $privmsg_id . '" />'; - } - - $template->set_filenames(array( - "preview" => 'privmsgs_preview.tpl') - ); - - $template->assign_vars(array( - 'TOPIC_TITLE' => $preview_subject, - 'POST_SUBJECT' => $preview_subject, - 'MESSAGE_TO' => $to_username, - 'MESSAGE_FROM' => $userdata['username'], - 'POST_DATE' => $user->date_format(time()), - 'MESSAGE' => $preview_message, - - 'S_HIDDEN_FIELDS' => $s_hidden_fields, - - 'L_SUBJECT' => $lang['Subject'], - 'L_DATE' => $lang['Date'], - 'L_FROM' => $lang['From'], - 'L_TO' => $lang['To'], - 'L_PREVIEW' => $lang['Preview'], - 'L_POSTED' => $lang['Posted']) - ); - - $template->assign_var_from_handle('POST_PREVIEW_BOX', 'preview'); - } - - // - // Start error handling - // - if ($error) - { - $template->set_filenames(array( - 'reg_header' => 'error_body.tpl') - ); - $template->assign_vars(array( - 'ERROR_MESSAGE' => $error_msg) - ); - $template->assign_var_from_handle('ERROR_BOX', 'reg_header'); - } - - // - // Load templates - // - $template->set_filenames(array( - 'body' => 'posting_body.tpl') - ); - make_jumpbox('viewforum.'.$phpEx); - - // - // Enable extensions in posting_body - // - $template->assign_block_vars('switch_privmsg', array()); - - // - // HTML toggle selection - // - if ($config['allow_html']) - { - $html_status = $lang['HTML_is_ON']; - $template->assign_block_vars('switch_html_checkbox', array()); - } - else - { - $html_status = $lang['HTML_is_OFF']; - } - - // - // BBCode toggle selection - // - if ($config['allow_bbcode']) - { - $bbcode_status = $lang['BBCode_is_ON']; - $template->assign_block_vars('switch_bbcode_checkbox', array()); - } - else - { - $bbcode_status = $lang['BBCode_is_OFF']; - } - - // - // Smilies toggle selection - // - if ($config['allow_smilies']) - { - $smilies_status = $lang['Smilies_are_ON']; - $template->assign_block_vars('switch_smilies_checkbox', array()); - } - else - { - $smilies_status = $lang['Smilies_are_OFF']; - } - - // - // Signature toggle selection - only show if - // the user has a signature - // - if ($user_sig != '') - { - $template->assign_block_vars('switch_signature_checkbox', array()); - } - - if ($mode == 'post') - { - $post_a = $lang['Send_a_new_message']; - } - else if ($mode == 'reply') - { - $post_a = $lang['Send_a_reply']; - $mode = 'post'; - } - else if ($mode == 'edit') - { - $post_a = $lang['Edit_message']; - } - - $s_hidden_fields = '<input type="hidden" name="folder" value="' . $folder . '" />'; - $s_hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />'; - if ($mode == 'edit') - { - $s_hidden_fields .= '<input type="hidden" name="' . POST_POST_URL . '" value="' . $privmsg_id . '" />'; - } - - // - // Send smilies to template - // - generate_smilies('inline', PAGE_PRIVMSGS); - - $template->assign_vars(array( - 'SUBJECT' => preg_replace($html_entities_match, $html_entities_replace, $privmsg_subject), - 'USERNAME' => preg_replace($html_entities_match, $html_entities_replace, $to_username), - 'MESSAGE' => $privmsg_message, - 'HTML_STATUS' => $html_status, - 'SMILIES_STATUS' => $smilies_status, - 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'), - 'FORUM_NAME' => $lang['Private_message'], - - 'BOX_NAME' => $l_box_name, - 'INBOX_IMG' => $inbox_img, - 'SENTBOX_IMG' => $sentbox_img, - 'OUTBOX_IMG' => $outbox_img, - 'SAVEBOX_IMG' => $savebox_img, - 'INBOX' => $inbox_url, - 'SENTBOX' => $sentbox_url, - 'OUTBOX' => $outbox_url, - 'SAVEBOX' => $savebox_url, - - 'L_SUBJECT' => $lang['Subject'], - 'L_MESSAGE_BODY' => $lang['Message_body'], - 'L_OPTIONS' => $lang['Options'], - 'L_SPELLCHECK' => $lang['Spellcheck'], - 'L_PREVIEW' => $lang['Preview'], - 'L_SUBMIT' => $lang['Submit'], - 'L_CANCEL' => $lang['Cancel'], - 'L_POST_A' => $post_a, - 'L_FIND_USERNAME' => $lang['Find_username'], - 'L_FIND' => $lang['Find'], - 'L_DISABLE_HTML' => $lang['Disable_HTML_pm'], - 'L_DISABLE_BBCODE' => $lang['Disable_BBCode_pm'], - 'L_DISABLE_SMILIES' => $lang['Disable_Smilies_pm'], - 'L_ATTACH_SIGNATURE' => $lang['Attach_signature'], - - 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], - 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'], - 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'], - 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'], - 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'], - 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'], - 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'], - 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'], - 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'], - 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'], - 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'], - 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'], - 'L_EMPTY_MESSAGE' => $lang['Empty_message'], - - 'L_FONT_SIZE' => $lang['Font_size'], - 'L_FONT_TINY' => $lang['font_tiny'], - 'L_FONT_SMALL' => $lang['font_small'], - 'L_FONT_NORMAL' => $lang['font_normal'], - 'L_FONT_LARGE' => $lang['font_large'], - 'L_FONT_HUGE' => $lang['font_huge'], - - 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], - 'L_STYLES_TIP' => $lang['Styles_tip'], - - 'S_HTML_CHECKED' => (!$html_on) ? ' checked="checked"' : '', - 'S_BBCODE_CHECKED' => (!$bbcode_on) ? ' checked="checked"' : '', - 'S_SMILIES_CHECKED' => (!$smilies_on) ? ' checked="checked"' : '', - 'S_SIGNATURE_CHECKED' => ($attach_sig) ? ' checked="checked"' : '', - 'S_NAMES_SELECT' => $user_names_select, - 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields, - 'S_POST_ACTION' => append_sid("privmsg.$phpEx"), - - 'U_SEARCH_USER' => append_sid("search.$phpEx?mode=searchuser"), - 'U_VIEW_FORUM' => append_sid("privmsg.$phpEx")) - ); - - $template->display('body'); - - include($phpbb_root_path . 'includes/page_tail.'.$phpEx); - } - - // - // Default page - // - if (!$userdata['user_id']) - { - $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true)); - } - - // Update unread status - $sql = "UPDATE " . USERS_TABLE . " - SET user_unread_privmsg = user_unread_privmsg + user_new_privmsg, user_new_privmsg = 0, user_last_privmsg = " . $userdata['session_start'] . " - WHERE user_id = " . $userdata['user_id']; - $db->sql_query($sql); - - $sql = "UPDATE " . PRIVMSGS_TABLE . " - SET privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " - WHERE privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - AND privmsgs_to_userid = " . $userdata['user_id']; - $db->sql_query($sql); - - // Reset PM counters - $userdata['user_new_privmsg'] = 0; - $userdata['user_unread_privmsg'] = ($userdata['user_new_privmsg'] + $userdata['user_unread_privmsg']); - - // Generate page - $page_title = $lang['Private_Messaging']; - include($phpbb_root_path . 'includes/page_header.'.$phpEx); - - // Load templates - $template->set_filenames(array( - 'body' => 'privmsgs_body.tpl') - ); - make_jumpbox('viewforum.'.$phpEx); - - // - // New message - // - $post_new_mesg_url = '<a href="' . append_sid("privmsg.$phpEx?mode=post") . '"><img src="' . $images['post_new'] . '" alt="' . $lang['Post_new_message'] . '" border="0" /></a>'; - - // - // General SQL to obtain messages - // - $sql_tot = "SELECT COUNT(privmsgs_id) AS total - FROM " . PRIVMSGS_TABLE . " "; - $sql = "SELECT pm.privmsgs_type, pm.privmsgs_id, pm.privmsgs_date, pm.privmsgs_subject, u.user_id, u.username - FROM " . PRIVMSGS_TABLE . " pm, " . USERS_TABLE . " u "; - switch($folder) - { - case 'inbox': - $sql_tot .= "WHERE privmsgs_to_userid = " . $userdata['user_id'] . " - AND (privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " - OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ")"; - - $sql .= "WHERE pm.privmsgs_to_userid = " . $userdata['user_id'] . " - AND u.user_id = pm.privmsgs_from_userid - AND (pm.privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR pm.privmsgs_type = " . PRIVMSGS_READ_MAIL . " - OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ")"; - break; - - case 'outbox': - $sql_tot .= "WHERE privmsgs_from_userid = " . $userdata['user_id'] . " - AND (privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ")"; - - $sql .= "WHERE pm.privmsgs_from_userid = " . $userdata['user_id'] . " - AND u.user_id = pm.privmsgs_to_userid - AND (pm.privmsgs_type = " . PRIVMSGS_NEW_MAIL . " - OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . ")"; - break; - - case 'sentbox': - $sql_tot .= "WHERE privmsgs_from_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SENT_MAIL; - - $sql .= "WHERE pm.privmsgs_from_userid = " . $userdata['user_id'] . " - AND u.user_id = pm.privmsgs_to_userid - AND pm.privmsgs_type = " . PRIVMSGS_SENT_MAIL; - break; - - case 'savebox': - $sql_tot .= "WHERE ((privmsgs_to_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . ") - OR (privmsgs_from_userid = " . $userdata['user_id'] . " - AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . "))"; - - $sql .= "WHERE ((pm.privmsgs_to_userid = " . $userdata['user_id'] . " - AND pm.privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . " - AND u.user_id = pm.privmsgs_from_userid) - OR (pm.privmsgs_from_userid = " . $userdata['user_id'] . " - AND pm.privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . " - AND u.user_id = pm.privmsgs_from_userid))"; - break; - - default: - message_die(MESSAGE, $lang['No_such_folder']); - break; - } - - // - // Show messages over previous x days/months - // - if ($submit_msgdays && (!empty($_POST['msgdays']) || !empty($_GET['msgdays']))) - { - $msg_days = (!empty($_POST['msgdays'])) ? intval($_POST['msgdays']) : intval($_GET['msgdays']); - $min_msg_time = time() - ($msg_days * 86400); - - $limit_msg_time_total = " AND privmsgs_date > $min_msg_time"; - $limit_msg_time = " AND pm.privmsgs_date > $min_msg_time "; - - if (!empty($_POST['msgdays'])) - { - $start = 0; - } - } - else - { - $limit_msg_time = ''; - $post_days = 0; - } - - $sql .= $limit_msg_time . " ORDER BY pm.privmsgs_date DESC LIMIT $start, " . $config['topics_per_page']; - $sql_all_tot = $sql_tot; - $sql_tot .= $limit_msg_time_total; - - // - // Get messages - // - $result = $db->sql_query($sql_tot); - $pm_total = ($row = $db->sql_fetchrow($result)) ? $row['total'] : 0; - - $result = $db->sql_query($sql_all_tot); - $pm_all_total = ($row = $db->sql_fetchrow($result)) ? $row['total'] : 0; - - // - // Build select box - // - $previous_days = array(0, 1, 7, 14, 30, 90, 180, 364); - $previous_days_text = array($lang['All_Posts'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']); - - $select_msg_days = ''; - for($i = 0; $i < count($previous_days); $i++) - { - $selected = ($msg_days == $previous_days[$i]) ? ' selected="selected"' : ''; - $select_msg_days .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>'; - } - - // - // Define correct icons - // - if ($folder == 'inbox') - { - $post_pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=post") . '"><img src="' . $images['pm_postmsg'] . '" alt="' . $lang['Post_new_pm'] . '" border="0"></a>'; - $reply_pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=reply&p=$privmsg_id") . '"><img src="' . $images['pm_replymsg'] . '" alt="' . $lang['Post_reply_pm'] . '" border="0"></a>'; - $quote_pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=quote&p=$privmsg_id") . '"><img src="' . $images['pm_quotemsg'] . '" alt="' . $lang['Post_quote_pm'] . '" border="0"></a>'; - $edit_pm_img = ''; - - $l_box_name = $lang['Inbox']; - } - else if ($folder == 'outbox') - { - $post_pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=post") . '"><img src="' . $images['pm_postmsg'] . '" alt="' . $lang['Post_new_pm'] . '" border="0"></a>'; - $reply_pm_img = ''; - $quote_pm_img = ''; - $edit_pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=edit&p=$privmsg_id") . '"><img src="' . $images['pm_editmsg'] . '" alt="' . $lang['Edit_pm'] . '" border="0"></a>'; - - $l_box_name = $lang['Outbox']; - } - else if ($folder == 'savebox') - { - $post_pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=post") . '"><img src="' . $images['pm_postmsg'] . '" alt="' . $lang['Post_new_pm'] . '" border="0"></a>'; - $reply_pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=reply&p=$privmsg_id") . '"><img src="' . $images['pm_replymsg'] . '" alt="' . $lang['Post_reply_pm'] . '" border="0"></a>'; - $quote_pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=quote&p=$privmsg_id") . '"><img src="' . $images['pm_quotemsg'] . '" alt="' . $lang['Post_quote_pm'] . '" border="0"></a>'; - $edit_pm_img = ''; - - $l_box_name = $lang['Savedbox']; - } - else if ($folder == 'sentbox') + global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $SID, $config; + + if ($user->data['user_id'] == ANONYMOUS) { - $post_pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=post") . '"><img src="' . $images['pm_postmsg'] . '" alt="' . $lang['Post_new_pm'] . '" border="0"></a>'; - $reply_pm_img = ''; - $quote_pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=quote&p=$privmsg_id") . '"><img src="' . $images['pm_quotemsg'] . '" alt="' . $lang['Post_quote_pm'] . '" border="0"></a>'; - $edit_pm_img = ''; - - $l_box_name = $lang['Sentbox']; + trigger_error('NO_PM'); } - // - // Output data for inbox status - // - if ($folder != 'outbox') + // Is PM disabled? + if (!$config['allow_privmsg']) { - if ($config['max_' . $folder . '_privmsgs'] > 0) - { - $inbox_limit_pct = round(($pm_all_total / $config['max_' . $folder . '_privmsgs']) * 100); - } - else - { - $inbox_limit_pct = 100; - } - if ($config['max_' . $folder . '_privmsgs'] > 0) - { - $inbox_limit_img_length = round(($pm_all_total / $config['max_' . $folder . '_privmsgs']) * $config['privmsg_graphic_length']); - } - else - { - $inbox_limit_img_length = $config['privmsg_graphic_length']; - } - if ($config['max_' . $folder . '_privmsgs'] > 0) - { - $inbox_limit_remain = $config['max_' . $folder . '_privmsgs'] - $pm_all_total; - } - else - { - $inbox_limit_remain = 0; - } - - $template->assign_block_vars('switch_box_size_notice', array()); - - switch($folder) - { - case 'inbox': - $l_box_size_status = sprintf($lang['Inbox_size'], $inbox_limit_pct); - break; - case 'sentbox': - $l_box_size_status = sprintf($lang['Sentbox_size'], $inbox_limit_pct); - break; - case 'savebox': - $l_box_size_status = sprintf($lang['Savebox_size'], $inbox_limit_pct); - break; - default: - $l_box_size_status = ''; - break; - } + trigger_error('PM_DISABLED'); } - // - // Dump vars to template - // - $template->assign_vars(array( - 'BOX_NAME' => $l_box_name, - 'INBOX_IMG' => $inbox_img, - 'SENTBOX_IMG' => $sentbox_img, - 'OUTBOX_IMG' => $outbox_img, - 'SAVEBOX_IMG' => $savebox_img, - 'INBOX' => $inbox_url, - 'SENTBOX' => $sentbox_url, - 'OUTBOX' => $outbox_url, - 'SAVEBOX' => $savebox_url, - - 'POST_PM_IMG' => $post_pm_img, - - 'INBOX_LIMIT_IMG_WIDTH' => $inbox_limit_img_length, - 'INBOX_LIMIT_PERCENT' => $inbox_limit_pct, - - 'BOX_SIZE_STATUS' => $l_box_size_status, + $user->add_lang('posting'); + $template->assign_var('S_PRIVMSGS', true); - 'L_INBOX' => $lang['Inbox'], - 'L_OUTBOX' => $lang['Outbox'], - 'L_SENTBOX' => $lang['Sent'], - 'L_SAVEBOX' => $lang['Saved'], - 'L_MARK' => $lang['Mark'], - 'L_FLAG' => $lang['Flag'], - 'L_SUBJECT' => $lang['Subject'], - 'L_DATE' => $lang['Date'], - 'L_DISPLAY_MESSAGES' => $lang['Display_messages'], - 'L_FROM_OR_TO' => ($folder == 'inbox' || $folder == 'savebox') ? $lang['From'] : $lang['To'], - 'L_MARK_ALL' => $lang['Mark_all'], - 'L_UNMARK_ALL' => $lang['Unmark_all'], - 'L_DELETE_MARKED' => $lang['Delete_marked'], - 'L_DELETE_ALL' => $lang['Delete_all'], - 'L_SAVE_MARKED' => $lang['Save_marked'], - - 'S_PRIVMSGS_ACTION' => append_sid("privmsg.$phpEx?folder=$folder"), - 'S_HIDDEN_FIELDS' => '', - 'S_POST_NEW_MSG' => $post_new_mesg_url, - 'S_SELECT_MSG_DAYS' => $select_msg_days, - - 'U_POST_NEW_TOPIC' => $post_new_topic_url) + trigger_error('No, not yet. :P'); + + $template->assign_vars(array( + 'L_TITLE' => $user->lang['UCP_PM_' . strtoupper($mode)], + 'S_UCP_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=$mode&action=$action") ); - // Okay, let's build the correct folder - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - do - { - $privmsg_id = $row['privmsgs_id']; - - $flag = $row['privmsgs_type']; - - $icon_flag = ($flag == PRIVMSGS_NEW_MAIL || $flag == PRIVMSGS_UNREAD_MAIL) ? $images['pm_unreadmsg'] : $images['pm_readmsg']; - $icon_flag_alt = ($flag == PRIVMSGS_NEW_MAIL || $flag == PRIVMSGS_UNREAD_MAIL) ? $lang['Unread_message'] : $lang['Read_message']; - - $msg_userid = $row['user_id']; - $msg_username = $row['username']; - - $u_from_user_profile = append_sid("ucp.$phpEx?mode=viewprofile&u=$msg_userid"); - - $msg_subject = $row['privmsgs_subject']; - - if (count($censors['match'])) - { - $msg_subject = preg_replace($censors['match'], $censors['replace'], $msg_subject); - } - - $u_subject = append_sid("privmsg.$phpEx?folder=$folder&mode=read&p=$privmsg_id"); - - $msg_date = $user_format_date($row['privmsgs_date']); - - if ($flag == PRIVMSGS_NEW_MAIL && $folder == 'inbox') - { - $msg_subject = '<b>' . $msg_subject . '</b>'; - $msg_date = '<b>' . $msg_date . '</b>'; - $msg_username = '<b>' . $msg_username . '</b>'; - } - - $row_color = (!($i % 2)) ? $theme['td_color1'] : $theme['td_color2']; - $row_class = (!($i % 2)) ? $theme['td_class1'] : $theme['td_class2']; - - $template->assign_block_vars('listrow', array( - 'ROW_COLOR' => '#' . $row_color, - 'ROW_CLASS' => $row_class, - 'FROM' => $msg_username, - 'SUBJECT' => $msg_subject, - 'DATE' => $msg_date, - 'PRIVMSG_FOLDER_IMG' => $icon_flag, - - 'L_PRIVMSG_FOLDER_ALT' => $icon_flag_alt, - - 'S_MARK_ID' => $privmsg_id, - - 'U_READ' => $u_subject, - 'U_FROM_USER_PROFILE' => $u_from_user_profile) - ); - } - while($row = $db->sql_fetchrow($result)); - - $template->assign_vars(array( - 'PAGINATION' => generate_pagination("privmsg.$phpEx?folder=$folder", $pm_total, $config['topics_per_page'], $start), - 'PAGE_NUMBER' => sprintf($lang['Page_of'], (floor($start / $config['topics_per_page']) + 1), ceil($pm_total / $config['topics_per_page'])), - - 'L_GOTO_PAGE' => $lang['Goto_page']) - ); - - } - else - { - $template->assign_vars(array( - 'L_NO_MESSAGES' => $lang['No_messages_folder']) - ); - - $template->assign_block_vars("switch_no_messages", array()); - } - - $template->pparse('body'); - - include($phpbb_root_path . 'includes/page_tail.'.$phpEx); - - - + $this->display($user->lang['UCP_PM'], $tpl_file); } } diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index dcf0fdbb8f..f404536b42 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -125,7 +125,7 @@ class ucp_profile extends module if ($config['require_activation'] == USER_ACTIVATION_ADMIN) { // Grab an array of user_id's with a_user permissions - $admin_ary = auth::acl_get_list(false, 'a_user', false); + $admin_ary = $auth->acl_get_list(false, 'a_user', false); $sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type FROM ' . USERS_TABLE . ' diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 38574f5cdc..70be8ffb8a 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -200,7 +200,7 @@ class ucp_register extends module if (sizeof($cp_data)) { $cp_data['user_id'] = (int) $user_id; - $sql = 'INSERT INTO ' CUSTOM_PROFILE_DATA . ' ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data)); + $sql = 'INSERT INTO ' . CUSTOM_PROFILE_DATA . ' ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data)); $db->sql_query($sql); } @@ -281,7 +281,7 @@ class ucp_register extends module { // Grab an array of user_id's with a_user permissions ... these users // can activate a user - $admin_ary = auth::acl_get_list(false, 'a_user', false); + $admin_ary = $auth->acl_get_list(false, 'a_user', false); $sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type FROM ' . USERS_TABLE . ' diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index c599effe38..d71527b579 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -93,7 +93,7 @@ class ucp_zebra extends module if ($mode == 'foes') { $perms = array(); - foreach (auth::acl_get_list($user_id_ary, array('a_', 'm_')) as $forum_id => $forum_ary) + foreach ($auth->acl_get_list($user_id_ary, array('a_', 'm_')) as $forum_id => $forum_ary) { foreach ($forum_ary as $auth_option => $user_ary) { diff --git a/phpBB/index.php b/phpBB/index.php index a407792e50..a4c2f57bd6 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -85,7 +85,7 @@ $template->assign_vars(array( 'FORUM_NEW_IMG' => $user->img('forum_new', 'NEW_POSTS'), 'FORUM_LOCKED_IMG' => $user->img('forum_locked', 'NO_NEW_POSTS_LOCKED'), - 'S_LOGIN_ACTION' => "ucp.php?$SID&mode=login", + 'S_LOGIN_ACTION' => "ucp.$phpEx$SID&mode=login", 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, 'U_MARK_FORUMS' => "index.$phpEx$SID&mark=forums") diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 980d1263c2..175df87886 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -7,8 +7,9 @@ # Table: phpbb_attachments CREATE TABLE phpbb_attachments ( attach_id mediumint(8) UNSIGNED NOT NULL auto_increment, - post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, physical_filename varchar(255) NOT NULL, real_filename varchar(255) NOT NULL, @@ -172,6 +173,7 @@ CREATE TABLE phpbb_extension_groups ( upload_icon varchar(100) DEFAULT '' NOT NULL, max_filesize int(20) DEFAULT '0' NOT NULL, allowed_forums text NOT NULL, + allow_in_pm tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (group_id) ); @@ -251,7 +253,8 @@ CREATE TABLE phpbb_groups ( group_rank smallint(5) DEFAULT '-1' NOT NULL, group_colour varchar(6) DEFAULT '' NOT NULL, group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - group_pm_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + group_receive_pm tinyint(1) DEFAULT '0' NOT NULL, + group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, group_chgpass smallint(6) DEFAULT '0' NOT NULL, group_description varchar(255) DEFAULT '' NOT NULL, group_legend tinyint(1) DEFAULT '1' NOT NULL, @@ -387,25 +390,6 @@ CREATE TABLE phpbb_posts ( ); # Table: 'phpbb_privmsgs' -CREATE TABLE phpbb_privmsgs ( - privmsgs_id mediumint(8) UNSIGNED NOT NULL auto_increment, - privmsgs_attachment tinyint(1) DEFAULT '0' NOT NULL, - privmsgs_type tinyint(4) DEFAULT '0' NOT NULL, - privmsgs_subject varchar(60) DEFAULT '0' NOT NULL, - privmsgs_from_userid mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - privmsgs_to_userid mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - privmsgs_date int(11) DEFAULT '0' NOT NULL, - privmsgs_ip varchar(40) NOT NULL, - privmsgs_enable_bbcode tinyint(1) DEFAULT '1' NOT NULL, - privmsgs_enable_html tinyint(1) DEFAULT '0' NOT NULL, - privmsgs_enable_smilies tinyint(1) DEFAULT '1' NOT NULL, - privmsgs_attach_sig tinyint(1) DEFAULT '1' NOT NULL, - privmsgs_text text, - privmsgs_bbcode_uid varchar(10) DEFAULT '0' NOT NULL, - PRIMARY KEY (privmsgs_id), - KEY privmsgs_from_userid (privmsgs_from_userid), - KEY privmsgs_to_userid (privmsgs_to_userid) -); # Table: 'phpbb_profile_fields' CREATE TABLE phpbb_profile_fields ( @@ -489,6 +473,7 @@ CREATE TABLE phpbb_reports ( report_id smallint(5) UNSIGNED NOT NULL auto_increment, reason_id smallint(5) UNSIGNED DEFAULT '0' NOT NULL, post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_notify tinyint(1) DEFAULT '0' NOT NULL, report_time int(10) UNSIGNED DEFAULT '0' NOT NULL, @@ -758,16 +743,6 @@ CREATE TABLE phpbb_topics_watch ( KEY notify_status (notify_status) ); -# Table: 'phpbb_ucp_modules' -CREATE TABLE phpbb_ucp_modules ( - module_id mediumint(8) DEFAULT '0' AUTO_INCREMENT NOT NULL, - module_title varchar(50) NOT NULL, - module_filename varchar(50) NOT NULL, - module_order mediumint(4) DEFAULT '0' NOT NULL, - KEY module_order (module_order), - PRIMARY KEY (module_id) -); - # Table: 'phpbb_user_group' CREATE TABLE phpbb_user_group ( group_id mediumint(8) DEFAULT '0' NOT NULL, @@ -810,6 +785,8 @@ CREATE TABLE phpbb_users ( user_new_privmsg tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, user_unread_privmsg tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, user_last_privmsg int(11) DEFAULT '0' NOT NULL, + user_message_rules tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + user_full_folder int(11) DEFAULT '-3' NOT NULL, user_emailtime int(11) DEFAULT '0' NOT NULL, user_sortby_type varchar(1) DEFAULT '' NOT NULL, user_sortby_dir varchar(1) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index ab10f9eacd..9a951e061f 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -53,7 +53,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('icons_path','image INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path','images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path','images/ranks'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable','1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('privmsg_disable','0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_privmsg','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', ''); @@ -87,8 +87,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_chars','25 INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_poll_options','10'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_chars','3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_search_chars','10'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_boxes','4'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs','50'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_sig','Thanks, The Management'); @@ -145,6 +143,25 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_link_height',' INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_create_thumbnail','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_min_thumb_filesize','12000'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_imagick', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_boxes', '4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs', '50'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_html_pm', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_bbcode_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_smilies_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_download_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_karma_pm', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_report_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_quote_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('forward_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_img_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_flash_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_edit_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_mass_pm', '1'); + INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_user_id', '2', 1); @@ -263,6 +280,20 @@ INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_savedrafts', INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_download', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_attach', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_attach', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_html', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_bbcode', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_smilies', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_download', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_sig', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_report', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_edit', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_printpm', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_emailpm', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_forward', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_delete', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_img', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_pm_flash', 1); # MSSQL IDENTITY phpbb_styles ON # @@ -377,12 +408,13 @@ INSERT INTO phpbb_bots (bot_id, bot_active, bot_name, user_id, bot_agent, bot_ip # MSSQL IDENTITY phpbb_modules OFF # # -- Modules -INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('mcp', 'MAIN', 'main', 1, 1, 'front\r\nforum_view\r\ntopic_view\r\npost_details', ''); INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'MAIN', 'main', 1, 1, 'front\r\nsubscribed\r\ndrafts', ''); -INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PROFILE', 'profile', 2, 1, 'profile_info\r\nreg_details\r\nsignature\r\navatar', ''); -INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PREFS', 'prefs', 3, 1, 'personal\r\nview\r\npost', ''); -INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'ZEBRA', 'zebra', 4, 1, 'friends\r\nfoes', ''); -INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'ATTACHMENTS', 'attachments', 5, 1, '', 'acl_u_attach && cfg_allow_attachments'); +INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PM', 'pm', 2, 1, 'view_messages\r\ncompose\r\nunread\r\ndrafts\r\noptions', 'cfg_allow_privmsg'); +INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PROFILE', 'profile', 3, 1, 'profile_info\r\nreg_details\r\nsignature\r\navatar', ''); +INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PREFS', 'prefs', 4, 1, 'personal\r\nview\r\npost', ''); +INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'ZEBRA', 'zebra', 5, 1, 'friends\r\nfoes', ''); +INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'ATTACHMENTS', 'attachments', 6, 1, '', 'acl_u_attach && cfg_allow_attachments'); +INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('mcp', 'MAIN', 'main', 1, 1, 'front\r\nforum_view\r\ntopic_view\r\npost_details', ''); INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('mcp', 'QUEUE', 'queue', 2, 1, 'unapproved_topics\r\nunapproved_posts', 'acl_m_approve'); # MSSQL IDENTITY phpbb_modules OFF # diff --git a/phpBB/language/en/admin.php b/phpBB/language/en/admin.php index 6871b738c4..ae6683d754 100644 --- a/phpBB/language/en/admin.php +++ b/phpBB/language/en/admin.php @@ -55,6 +55,7 @@ $lang += array( 'BOARD_DEFAULTS' => 'Board Defaults', 'BOARD_SETTINGS' => 'Board Settings', 'COOKIE_SETTINGS' => 'Cookie Settings', + 'MESSAGE_SETTINGS' => 'Message Settings', 'EMAIL_SETTINGS' => 'Email Settings', 'MASS_EMAIL' => 'Mass Email', 'SERVER_SETTINGS' => 'Server Settings', @@ -500,7 +501,22 @@ $lang += array( 'acl_u_search' => 'Can search board', 'acl_u_savedrafts' => 'Can save drafts', 'acl_u_download' => 'Can download files', - 'acl_u_attach' => 'Can attach files' + 'acl_u_attach' => 'Can attach files', + + 'acl_u_pm_attach' => 'Can attach files in private messages', + 'acl_u_pm_html' => 'Can post HTML in private messages', + 'acl_u_pm_bbcode' => 'Can post BBCode in private messages', + 'acl_u_pm_smilies' => 'Can post smilies in private messages', + 'acl_u_pm_download' => 'Can download files in private messages', + 'acl_u_pm_sig' => 'Can use signature in private messages', + 'acl_u_pm_report' => 'Can report private messages', + 'acl_u_pm_edit' => 'Can edit own private messages', + 'acl_u_pm_printpm' => 'Can print private messages', + 'acl_u_pm_emailpm' => 'Can email private messages', + 'acl_u_pm_forward' => 'Can forward private messages', + 'acl_u_pm_delete' => 'Can remove private messages from own folder', + 'acl_u_pm_img' => 'Can post images in private messages', + 'acl_u_pm_flash' => 'Can post Flash in private messages' ); // User pruning @@ -584,6 +600,14 @@ $lang += array( 'ERR_JAB_PASSFAIL' => 'Password update failed, %s', ); +// Message Settings +$lang += array( + 'BOXES_MAX' => 'Max private message folders', + 'BOXES_MAX_EXPLAIN' => 'By default users may create this many personal folders for private messages..', + 'BOXES_LIMIT' => 'Max private messages per box', + 'BOXES_LIMIT_EXPLAIN' => 'Users may receive no more than this many messages in each of their private message boxes or zero for unlimited messages.', +); + // Cookie settings $lang += array( 'COOKIE_SETTINGS_EXPLAIN' => 'These details define the data used to send cookies to your users browsers. In most cases the default values for the cookie settings should be sufficient. If you do need to change any do so with care, incorrect settings can prevent users logging in.', @@ -803,10 +827,6 @@ $lang += array( 'DEFAULT_DATE_FORMAT_EXPLAIN'=> 'The date format is the same as the PHP date function.', 'SYSTEM_TIMEZONE' => 'System Timezone', 'SYSTEM_DST' => 'Enable Daylight Savings Time', - 'BOXES_MAX' => 'Max private message folders', - 'BOXES_MAX_EXPLAIN' => 'By default users may create this many personal folders for private messages..', - 'BOXES_LIMIT' => 'Max private messages per box', - 'BOXES_LIMIT_EXPLAIN' => 'Users may receive no more than this many messages in each of their private message boxes or zero for unlimited messages.', 'ALLOW_TOPIC_NOTIFY' => 'Allow Topic Watching', 'ALLOW_FORUM_NOTIFY' => 'Allow Forum Watching', 'ALLOW_NAME_CHANGE' => 'Allow Username changes', @@ -824,7 +844,7 @@ $lang += array( 'MAX_SIG_LENGTH' => 'Maximum signature length', 'MAX_SIG_LENGTH_EXPLAIN' => 'Maximum number of characters in user signatures.', 'ALLOW_NO_CENSORS' => 'Allow Disable of Censors', - 'ALLOW_NO_CENSORS_EXPLAINS' => 'User can disable word censoring.', + 'ALLOW_NO_CENSORS_EXPLAIN' => 'User can disable word censoring.', ); // Karma settings @@ -854,6 +874,7 @@ $lang += array( // Forum admin $lang += array( + 'FORUM_ADMIN' => 'Forum Administration', 'FORUM_ADMIN_EXPLAIN' => 'In phpBB 2.2 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum.', 'FORUM_EDIT_EXPLAIN' => 'The form below will allow you to customise this forum. Please note that moderation and post count controls are set via forum permissions for each user or usergroup.', 'FORUM_DELETE' => 'Delete Forum', @@ -1759,6 +1780,7 @@ $lang += array( 'EXTENSION_GROUP_DELETED' => 'Extension Group successfully deleted', 'ALLOWED_FORUMS' => 'Allowed Forums', 'ALLOWED_FORUMS_EXPLAIN' => 'Able to post the assigned extensions at the following forums', + 'ALLOW_IN_PM' => 'Allowed in private messaging', 'ALLOW_ALL_FORUMS' => 'Allow All Forums', 'ALLOW_SELECTED_FORUMS' => 'Only Forums selected below', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index a2483ec7a3..21923710f0 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -46,9 +46,11 @@ $lang += array( 'ACP' => 'Administration Control Panel', 'ACTIVE_ERROR' => 'You have specified an inactive username. Please activate your account and try again. If you continue to have problems please contact a board administrator.', 'ALLOWED' => 'Allowed', + 'ALL_MESSAGES' => 'All Messages', 'ALL_POSTS' => 'All Posts', 'ALL_TIMES' => 'All times are %s %s', 'ALL_TOPICS' => 'All Topics', + 'AND' => 'And', 'ARE_WATCHING_FORUM' => 'You have subscribed to receive updates on this forum', 'ARE_WATCHING_TOPIC' => 'You have subscribed to receive updates on this topic.', 'ASCENDING' => 'Ascending', @@ -72,13 +74,17 @@ $lang += array( 'BYTES' => 'Bytes', 'CANCEL' => 'Cancel', + 'CLICK_VIEW_PRIVMSG' => 'Click %sHere%s to visit your Inbox', 'CONFIRM' => 'Confirm', 'CONGRATULATIONS' => 'Congratulations to', 'CURRENT_TIME' => 'The time is %s', 'DAY' => 'Day', + 'DAYS' => 'Days', 'DELETE' => 'Delete', 'DESCENDING' => 'Descending', + 'DISABLED' => 'Disabled', + 'DISPLAY_MESSAGES' => 'Display messages from previous', 'DISPLAY_POSTS' => 'Display posts from previous', 'DISPLAY_TOPICS' => 'Display topics from previous', 'DOWNLOADED' => 'Downloaded', @@ -89,6 +95,8 @@ $lang += array( 'EMAIL' => 'Email', 'EMAIL_ADDRESS' => 'Email address', 'EMPTY_SUBJECT' => 'You must specify a subject when posting a new topic.', + 'ENABLED' => 'Enabled', + 'EXTENSION' => 'Extension', 'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <b>%s</b> has been deactivated and can no longer be displayed', 'FAQ' => 'FAQ', @@ -96,6 +104,7 @@ $lang += array( 'FILESIZE' => 'Filesize', 'FILE_COMMENT' => 'File comment', 'FIND_USERNAME' => 'Find a member', + 'FOLDER' => 'Folder', 'FORGOT_PASS' => 'I forgot my password', 'FORUM' => 'Forum', 'FORUMS_MARKED' => 'All forums have been marked read', @@ -136,7 +145,9 @@ $lang += array( 'HOURS' => 'Hours', 'ICQ_STATUS' => 'ICQ Status', + 'IF' => 'If', 'INDEX' => 'Index page', + 'INFORMATION' => 'Information', 'INTERESTS' => 'Interests', 'INVALID_EMAIL_LOG' => '<b>%s</b> possibly an invalid email address?', 'IP' => 'IP', @@ -174,6 +185,7 @@ $lang += array( 'LOCK_POST_EXPLAIN' => 'Prevent editing', 'LOCK_TOPIC' => 'Lock Topic', 'LOGIN' => 'Login', + 'LOGIN_CHECK_PM' => 'Log in to check your private messages', 'LOGIN_ERROR' => 'You have specified an incorrect username or password. Please check them both and try again. If you continue to have problems please contact a board administrator.', 'LOGIN_FORUM' => 'To view or post in this forum you must enter a password.', 'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few seconds but gives you increased capabilies. The board administrator may also grant additional permissions to registered users. Before you login please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.', @@ -199,6 +211,8 @@ $lang += array( 'MOVE' => 'Move', 'NEWEST_USER' => 'Our newest member <b>%s%s%s</b>', + 'NEW_MESSAGE' => 'New Message', + 'NEW_MESSAGES' => 'New Messages', 'NEW_PM' => '<b>%d</b> new message', 'NEW_PMS' => '<b>%d</b> new messages', 'NEW_POST' => 'New post', @@ -213,6 +227,8 @@ $lang += array( 'NO_FORUMS' => 'This board has no forums', 'NO_GROUP' => 'The requested usergroup does not exist.', 'NO_MEMBERS' => 'No members found for this search criteria', + 'NO_MESSAGES' => 'No Messages', + 'NO_NEW_MESSAGES' => 'No new messages', 'NO_NEW_PM' => '<b>0</b> new messages', 'NO_NEW_POSTS' => 'No new posts', 'NO_POSTS' => 'No Posts', @@ -245,6 +261,9 @@ $lang += array( 'PREVIEW' => 'Preview', 'PREVIOUS' => 'Previous', 'PRIVACY' => 'Privacy Policy', + 'PRIVATE_MESSAGE' => 'Private Message', + 'PRIVATE_MESSAGES' => 'Private Messages', + 'PRIVATE_MESSAGING' => 'Private Messaging', 'PROFILE' => 'User Control Panel', 'READING_FORUM' => 'Viewing topics in %s', @@ -311,6 +330,7 @@ $lang += array( 'SUBMIT' => 'Submit', 'TERMS_USE' => 'Terms of Use', + 'TIME' => 'Time', 'TOO_LONG_USER_PASSWORD' => 'The password you entered is too long.', 'TOO_MANY_VOTE_OPTIONS' => 'You have tried to vote for too many options.', 'TOO_SHORT_NEW_PASSWORD' => 'The password you entered is too short.', @@ -334,12 +354,15 @@ $lang += array( 'TOTAL_USERS_OTHER' => 'Total members <b>%d</b>', 'TOTAL_USERS_ZERO' => 'Total members <b>0</b>', + 'UNKNOWN_BROWSER' => 'Unknown Browser', 'UNMARK_ALL' => 'Unmark all', + 'UNREAD_MESSAGES' => 'Unread Messages', 'UNREAD_PM' => '<b>%d</b> unread message', 'UNREAD_PMS' => '<b>%d</b> unread messages', 'URL_REDIRECT' => 'If your browser does not support meta redirection please click %sHERE%s to be redirected.', 'USERGROUPS' => 'Groups', 'USERNAME' => 'Username', + 'USERNAMES' => 'Usernames', 'USER_POST' => '%d Post', 'USER_POSTS' => '%d Posts', @@ -368,6 +391,9 @@ $lang += array( 'YEAR' => 'Year', 'YES' => 'Yes', 'YOU_LAST_VISIT' => 'Last visit on %s', + 'YOU_NEW_PM' => 'A new private message is waiting for you in your Inbox', + 'YOU_NEW_PMS' => 'New private messages are waiting for you in your Inbox', + 'YOU_NO_NEW_PM' => 'No new private messages are waiting for you', 'datetime' => array( 'Sunday' => 'Sunday', @@ -467,8 +493,6 @@ $unused = array( 'CANNOT_SPLIT_FIRST_POST' => 'You cannot split the first post of a topic', 'CONTACT' => 'Contact', 'Cannot_send_privmsg' => 'Sorry but the administrator has prevented you from sending private messages', - 'Click_return_inbox' => 'Click %sHere%s to return to your Inbox', - 'Click_view_privmsg' => 'Click %sHere%s to visit your Inbox', 'Confirm_delete_pm' => 'Are you sure you want to delete this message?', 'Confirm_delete_pms' => 'Are you sure you want to delete these messages?', 'Confirm_unsub' => 'Are you sure you want to unsubscribe from this group?', @@ -477,7 +501,6 @@ $unused = array( 'Could_not_anon_user' => 'You cannot make Anonymous a group member', 'Current_memberships' => 'Current memberships', 'DESCRIPTION' => 'Description', - 'DISABLED' => 'Disabled', 'DOWNLOAD' => 'Download', 'Date' => 'Date', 'Delete_all' => 'Delete All', @@ -488,11 +511,8 @@ $unused = array( 'Display_messages' => 'Display messages from previous', 'EDIT_OWN_POSTS' => 'Sorry but you can only edit your own posts.', 'EMAIL_TAKEN_EMAIL' => 'The email address you specified is already in use, please select an alternative.', - 'ENABLED' => 'Enabled', 'ERROR' => 'Error', - 'EXTENSION' => 'Extension', 'Edit_message' => 'Edit private message', - 'Edit_pm' => 'Edit message', 'Find' => 'Find', 'Flag' => 'Flag', 'From' => 'From', @@ -549,12 +569,6 @@ $unused = array( 'POST_TOPIC_LOCKED' => 'Topic is locked', 'Pending_members' => 'Pending Members', 'Pending_this_group' => 'Your membership of this group is pending', - 'Post_new_pm' => 'Post message', - 'Post_quote_pm' => 'Quote message', - 'Post_reply_pm' => 'Reply to message', - 'Private_Message' => 'Private Message', - 'Private_Messages' => 'Private Messages', - 'Private_Messaging' => 'Private Messaging', 'RATING' => 'Rating', 'READING_GLOBAL_ANNOUNCE' => 'Reading global announcement', 'REPLYING_GLOBAL_ANNOUNCE' => 'Replying to global announcement', @@ -580,13 +594,10 @@ $unused = array( 'Send_a_new_message' => 'Send a new private message', 'Send_a_reply' => 'Reply to a private message', 'Sent' => 'Sent', - 'Sentbox' => 'Sentbox', 'Sentbox_size' => 'Your Sentbox is %d%% full', - 'Subscribe' => 'Subscribe', 'This_closed_group' => 'This is a closed group, no more users accepted', 'This_hidden_group' => 'This is a hidden group, automatic user addition is not allowed', 'This_open_group' => 'This is an open group, click to request membership', - 'To' => 'To', 'To_long_subject' => 'The subject is too long it must be 60 characters or less.', 'UNREAD_NO_PM' => 'You have no unread private messages', 'UNWATCHED_FORUMS' => 'You are no longer watching the selected forums.', @@ -595,16 +606,10 @@ $unused = array( 'UPDATE' => 'Update', 'USERS' => 'Users', 'USER_OFFLINE' => 'Offline', - 'Unread_message' => 'Unread message', 'Unsub_success' => 'You have been un-subscribed from this group.', - 'Unsubscribe' => 'Unsubscribe', 'User_is_member_group' => 'User is already a member of this group', 'VIEWING_MESSAGES' => 'Viewing Private Messages', - 'View_Information' => 'View Information', - 'View_forum' => 'View Forum', - 'YOU_NEW_PM' => 'A new private message is waiting for you in your Inbox', - 'YOU_NEW_PMS' => 'New private messages are waiting for you in your Inbox', - 'YOU_NO_NEW_PM' => 'No new private messages are waiting for you', + 'View_Information' => 'View Information' ); diff --git a/phpBB/language/en/email/privmsg_notify.txt b/phpBB/language/en/email/privmsg_notify.txt index 2a96ee8c61..7dae75ecc9 100644 --- a/phpBB/language/en/email/privmsg_notify.txt +++ b/phpBB/language/en/email/privmsg_notify.txt @@ -3,10 +3,14 @@ Charset: iso-8859-1 Hello {USERNAME}, -You have received a new private message to your account on "{SITENAME}" and you have requested that you be notified on this event. You can view your new message by clicking on the following link: +You have received a new private message from "{AUTHOR_NAME}" to your account on "{SITENAME}" with the following subject: + +{SUBJECT} + +You can view your new message by clicking on the following link: {U_INBOX} -Remember that you can always choose not to be notified of new messages by changing the appropriate setting in your profile. +You have requested that you be notified on this event, remember that you can always choose not to be notified of new messages by changing the appropriate setting in your profile. {EMAIL_SIG}
\ No newline at end of file diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index b694d1b39e..5f1bcabdbc 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -148,7 +148,6 @@ $lang += array( 'SPLIT_TOPIC_EXPLAIN' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post', 'THIS_POST_IP' => 'IP for this post', - 'TIME' => 'Time', 'TOPICS_APPROVED_SUCCESS' => 'The selected topics have been approved', 'TOPICS_DELETED_SUCCESS'=> 'The selected topics have been successfully removed from the database', 'TOPICS_FORKED_SUCCESS' => 'The selected topics have been copied successfully', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 1d673cf4f6..d0f55185e8 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -71,8 +71,10 @@ $lang += array( 'DAYS' => 'Days', 'DELETE_FILE' => 'Delete File', 'DELETE_MESSAGE' => 'Delete Message', + 'DELETE_MESSAGE_CONFIRM' => 'Are you sure you want to delete this message?', 'DELETE_OWN_POSTS' => 'Sorry but you can only delete your own posts.', 'DELETE_POST' => 'Delete', + 'DELETE_POST_CONFIRM' => 'Are you sure you want to delete this message?', 'DELETE_POST_WARN' => 'Once deleted the post cannot be recovered', 'DISABLE_BBCODE' => 'Disable BBCode', 'DISABLE_HTML' => 'Disable HTML', @@ -107,7 +109,6 @@ $lang += array( 'IMAGES_ARE_OFF' => '[img] is <u>OFF</u>', 'IMAGES_ARE_ON' => '[img] is <u>ON</u>', - 'INFORMATION' => 'Information', 'INVALID_FILENAME' => '%s is an invalid filename', 'KARMA_LEVEL' => 'Karma Level', @@ -117,6 +118,7 @@ $lang += array( 'LOAD_DRAFT_EXPLAIN' => 'Here you are able to select the draft you want to continue writing. Your current post will be canceled, all current post contents will be deleted. View, edit and delete drafts within your User Control Panel.', 'MESSAGE_BODY_EXPLAIN' => 'Enter your message here, it may contain no more than <b>%d</b> characters.', + 'MESSAGE_DELETED' => 'Your message has been deleted successfully', 'MORE_EMOTICONS' => 'View more Emoticons', 'NOTIFY_REPLY' => 'Send me an email when a reply is posted', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 8925bfc5ab..5f33ca3efe 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -33,10 +33,15 @@ $lang += array( 'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.', 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Please check your email for further information', 'ACCOUNT_INACTIVE_ADMIN' => 'Your account has been created. However, this forum requires account activation by the administrator. An email has been sent to them and you will be informed when your account has been activated', + 'ADD' => 'Add', + 'ADD_BCC' => 'Add [Bcc]', 'ADD_FOES' => 'Add new foes', 'ADD_FOES_EXPLAIN' => 'You may enter several usernames each on a different line', + 'ADD_FOLDER' => 'Add Folder', 'ADD_FRIENDS' => 'Add new friends', 'ADD_FRIENDS_EXPLAIN' => 'You may enter several usernames each on a different line', + 'ADD_NEW_RULE' => 'Add new Rule', + 'ADD_TO' => 'Add [To]', 'ADMIN_EMAIL' => 'Administrators can email me information', 'AGREE' => 'I agree to these terms', 'ALLOW_PM' => 'Allow users to send you private messages', @@ -61,6 +66,7 @@ $lang += array( 'CHANGE_PASSWORD' => 'Change password', 'CHANGE_PASSWORD_EXPLAIN' => 'Must be between %1$d and %2$d characters.', + 'CLICK_RETURN_FOLDER' => 'Click %1$sHere%2$s to return to your "%3$s" Folder', 'CONFIRMATION' => 'Confirmation of registration', 'CONFIRM_CODE' => 'Confirmation code', 'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as you see it in the image, it is case sensitive, zero has a diagonal line through it.', @@ -75,6 +81,7 @@ $lang += array( 'COPPA_BIRTHDAY' => 'To continue with the registration procedure please tell us when you were born.', 'COPPA_COMPLIANCE' => 'COPPA Compliance', 'COPPA_EXPLAIN' => 'Please note that clicking submit will create your account. However it cannot be activated until a parent or guardian approves your registration. You will be emailed a copy of the necessary form with details of where to send it.', + 'CREATE_FOLDER' => 'Add Folder...', 'CURRENT_IMAGE' => 'Current Image', 'CURRENT_PASSWORD' => 'Current password', 'CURRENT_PASSWORD_EXPLAIN' => 'You must confirm your current password if you wish to change it, alter your email address or username.', @@ -85,9 +92,12 @@ $lang += array( 'DEFAULT_HTML' => 'Enable HTML by default', 'DEFAULT_NOTIFY' => 'Notify me upon replies by default', 'DEFAULT_SMILE' => 'Enable smilies by default', + 'DEFINED_RULES' => 'Defined Rules', 'DELETE_ALL' => 'Delete all', 'DELETE_AVATAR' => 'Delete Image', 'DELETE_MARKED' => 'Delete Marked', + 'DELETE_RULE' => 'Delete Rule', + 'DELETE_RULE_CONFIRM' => 'Are you sure you want to delete this rule?', 'DISABLE_CENSORS' => 'Enable Word censoring', 'DISPLAY_GALLERY' => 'Display gallery', 'DOWNLOADS' => 'Downloads', @@ -99,9 +109,16 @@ $lang += array( 'EMAIL_REMIND' => 'This must be the email address you supplied when registering.', 'EMPTY_DRAFT' => 'You must enter a message to submit your changes', 'EMPTY_DRAFT_TITLE' => 'You must enter a draft title', + 'EXPORT_AS_XML' => 'Export as XML', + 'EXPORT_AS_CSV' => 'Export as CSV', + 'EXPORT_AS_TXT' => 'Export as TXT', + 'EXPORT_AS_MSG' => 'Export as MSG', 'FOES_EXPLAIN' => 'Foes are users which will be ignored by default. Posts by these users will not be fully visible and personal messages will not be permitted. Please note that you cannot ignore moderators or administrators.', 'FOES_UPDATED' => 'Your foes list has been updated successfully', + 'FOLDER_MESSAGE_STATUS' => '%1$d from %2$d messages stored', + 'FOLDER_STATUS_MSG' => 'Folder is %1$d%% full (%2$d from %3$d messages stored)', + 'FORWARD_PM' => 'Forward PM', 'FRIENDS' => 'Friends', 'FRIENDS_EXPLAIN' => 'Friends enable you quick access to members you communicate with frequently. If the template has relevant support any posts made by a friend may be highlighted.', 'FRIENDS_OFFLINE' => 'Offline', @@ -120,6 +137,12 @@ $lang += array( 'LOGIN_REDIRECT' => 'You have been successfully logged in.', 'LOGOUT_REDIRECT' => 'You have been successfully logged out.', + 'MARK_IMPORTANT' => 'Mark as Important', + 'MARKED_MESSAGE' => 'Marked Message', + 'MESSAGE_COLOURS' => 'Message Colours', + 'MESSAGE_FROM_FOE' => 'Message from foe', + 'MESSAGE_FROM_FRIEND' => 'Message from friend', + 'MESSAGE_HISTORY' => 'Message History', 'MINIMUM_KARMA' => 'Minimum User Karma', 'MINIMUM_KARMA_EXPLAIN' => 'Posts by users with Karma less than this will be ignored.', @@ -134,27 +157,56 @@ $lang += array( 'NOTIFY_METHOD_IM' => 'Jabber only', 'NOTIFY_ON_PM' => 'Email me on new private messages', 'NOT_AGREE' => 'I do not agree to these terms', + 'NOT_ENOUGH_SPACE_FOLDER' => 'The Destination Folder "%s" seems to be full. The requested action has not been taken.', + 'NOT_MOVED_MESSAGE' => 'You have 1 private message currently on hold because of full folder.', + 'NOT_MOVED_MESSAGES' => 'You have %d private messages currently on hold because of full folder.', 'NO_FOES' => 'No foes currently defined', 'NO_FRIENDS' => 'No friends currently defined', 'NO_FRIENDS_OFFLINE' => 'No friends offline', 'NO_FRIENDS_ONLINE' => 'No friends online', + 'NO_NEWER_PM' => 'No newer messages', + 'NO_OLDER_PM' => 'No older messages', + 'NO_RECIPIENT' => 'No recipient defined', + 'NO_RULES_DEFINED' => 'No rules defined', + 'NO_SAVED_DRAFTS' => 'No drafts saved', 'NO_WATCHED_FORUMS' => 'You are not watching any forums.', 'NO_WATCHED_TOPICS' => 'You are not watching any topics.', 'PASSWORD_ACTIVATED' => 'Your new password has been activated', 'PASSWORD_UPDATED' => 'Your password has been sent successfully to your original email address.', 'PM_DISABLED' => 'Private messaging has been disabled on this board', + 'PM_ICON' => 'PM Icon', + 'PM_INBOX' => 'Inbox', + 'PM_OUTBOX' => 'Outbox', + 'PM_SENTBOX' => 'Sentbox', + 'PM_TO' => 'Send To', 'POPUP_ON_PM' => 'Pop up window on new private message', + 'POST_EDIT_PM' => 'Edit message', + 'POST_FORWARD_PM' => 'Forward message', + 'POST_NEW_PM' => 'Post message', + 'POST_PM_LOCKED' => 'Private Messaging is locked', + 'POST_QUOTE_PM' => 'Quote message', + 'POST_REPLY_PM' => 'Reply to message', + 'PRINT_PM' => 'Print View', 'PREFERENCES_UPDATED' => 'Your preferences have been updated.', 'PROFILE_INFO_NOTICE' => 'Please note that this information will be viewable to other members. Be careful when including any personal details. Any fields marked with a * must be completed.', 'PROFILE_UPDATED' => 'Your profile has been updated.', + 'RECIPIENT' => 'Recipient', + 'RECIPIENTS' => 'Recipients', 'REGISTRATION' => 'Registration', + 'RELEASE_MESSAGES' => 'Click %sHere%s to release the on-hold messages, they will be re-sorted into the appropiate folder if enough space is made available.', + 'REMOVE_ADDRESS' => 'Remove address', + 'REMOVE_FOLDER' => 'Remove folder', + 'REPLIED_MESSAGE' => 'Replied to Message', + 'REPORTED_MESSAGE' => 'Reported Message', 'RETURN_PAGE' => 'Click %sHere%s to return to the previous page', 'RETURN_UCP' => 'Click %sHere%s to return to the User Control Panel', + 'RULE_DELETED' => 'Rule successfully removed', 'SEARCH_YOUR_POSTS' => 'Show your posts', 'SEND_PASSWORD' => 'Send password', + 'SENT_AT' => 'Sent At', 'SHOW_EMAIL' => 'Users can contact me by email', 'SIGNATURE_EXPLAIN' => 'This is a block of text that can be added to posts you make. There is a %d character limit', 'SIGNATURE_PREVIEW' => 'Your signature will appear like this in posts', @@ -168,38 +220,48 @@ $lang += array( 'SORT_SIZE' => 'Filesize', 'TIMEZONE' => 'Timezone', + 'TO' => 'To', + 'TOO_MANY_RECIPIENTS' => 'Too many recipients', 'TOO_MANY_REGISTERS' => 'You have exceeded the maximum number of registration attempts for this session. Please try again later.', 'UCP' => 'User Control Panel', 'UCP_ADMIN_ACTIVATE' => 'Please note that you will need to enter a valid email address before your account is activated. The administrator will review your account and if approved you will an email at the address you specified.', 'UCP_AGREEMENT' => 'While the administrators and moderators of this forum will attempt to remove or edit any generally objectionable material as quickly as possible, it is impossible to review every message. Therefore you acknowledge that all posts made to these forums express the views and opinions of the author and not the administrators, moderators or webmaster (except for posts by these people) and hence will not be held liable.<br /><br />You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate any applicable laws. Doing so may lead to you being immediately and permanently banned (and your service provider being informed). The IP address of all posts is recorded to aid in enforcing these conditions. You agree that the webmaster, administrator and moderators of this forum have the right to remove, edit, move or close any topic at any time should they see fit. As a user you agree to any information you have entered above being stored in a database. While this information will not be disclosed to any third party without your consent the webmaster, administrator and moderators cannot be held responsible for any hacking attempt that may lead to the data being compromised.<br /><br />This forum system uses cookies to store information on your local computer. These cookies do not contain any of the information you have entered above, they serve only to improve your viewing pleasure. The email address is used only for confirming your registration details and password (and for sending new passwords should you forget your current one).<br /><br />By clicking Register below you agree to be bound by these conditions.', 'UCP_AIM' => 'AOL Instant Messenger', - 'UCP_AVATAR' => 'Your avatar', 'UCP_COPPA_BEFORE' => 'Before %s', 'UCP_COPPA_ON_AFTER' => 'On or After %s', - 'UCP_DRAFTS' => 'Saved drafts', 'UCP_EMAIL_ACTIVATE' => 'Please note that you will need to enter a valid email address before your account is activated. You will recieve an email at the address you provide that contains an account activation link.', - 'UCP_FOES' => 'Foes', - 'UCP_FRIENDS' => 'Friends', - 'UCP_FRONT' => 'Front page', 'UCP_ICQ' => 'ICQ Number', 'UCP_JABBER' => 'Jabber Address', 'UCP_MAIN' => 'Overview', + 'UCP_MAIN_DRAFTS' => 'Saved drafts', + 'UCP_MAIN_FRONT' => 'Front page', + 'UCP_MAIN_SUBSCRIBED' => 'Subscribed', 'UCP_MSNM' => 'MSN Messenger', 'UCP_NO_ATTACHMENTS' => 'You have posted no files', - 'UCP_OPTIONS' => 'Options', - 'UCP_PERSONAL' => 'Personal Settings', - 'UCP_POST' => 'Posting Messages', 'UCP_PREFS' => 'Preferences', + 'UCP_PREFS_PERSONAL' => 'Personal Settings', + 'UCP_PREFS_POST' => 'Posting Messages', + 'UCP_PREFS_VIEW' => 'Viewing Posts', + 'UCP_PM' => 'Private Messages', + 'UCP_PM_COMPOSE' => 'Compose Message', + 'UCP_PM_DRAFTS' => 'PM Drafts', + 'UCP_PM_OPTIONS' => 'Options', + 'UCP_PM_UNREAD' => 'Unread Messages', + 'UCP_PM_VIEW_MESSAGES' => 'View Messages', 'UCP_PROFILE' => 'Profile', - 'UCP_PROFILE_INFO' => 'Your Profile', - 'UCP_REG_DETAILS' => 'Registration details', - 'UCP_SIGNATURE' => 'Your signature', - 'UCP_VIEW' => 'Viewing Posts', + 'UCP_PROFILE_AVATAR' => 'Your avatar', + 'UCP_PROFILE_PROFILE_INFO' => 'Your Profile', + 'UCP_PROFILE_REG_DETAILS' => 'Registration details', + 'UCP_PROFILE_SIGNATURE' => 'Your signature', 'UCP_WATCHED' => 'Watched items', 'UCP_WELCOME' => 'Welcome to the User Control Panel. From here you can monitor, view and update your profile, preferences, subscribed forums and topics. You can also send messages to other users (if permitted). Please ensure you read any announcements before continuing.', 'UCP_YIM' => 'Yahoo Messenger', 'UCP_ZEBRA' => 'Friends and Foes', + 'UCP_ZEBRA_FOES' => 'Foes', + 'UCP_ZEBRA_FRIENDS' => 'Friends', + 'UNKNOWN_FOLDER' => 'Unknown Folder', + 'UNREAD_MESSAGES' => 'Unread Messages', 'UNWATCH_MARKED' => 'Unwatch marked', 'UPLOAD_AVATAR_FILE' => 'Upload from your machine', 'UPLOAD_AVATAR_URL' => 'Upload from a URL', @@ -213,6 +275,13 @@ $lang += array( 'VIEW_EDIT' => 'View/Edit', 'VIEW_FLASH' => 'Display Flash animations', 'VIEW_IMAGES' => 'Display Images within posts', + 'VIEW_NEXT_HISTORY' => 'Next PM in history', + 'VIEW_NEXT_PM' => 'Next PM', + 'VIEW_PM' => 'View Message', + 'VIEW_PM_MESSAGE' => '1 Message', + 'VIEW_PM_MESSAGES' => '%d Messages', + 'VIEW_PREVIOUS_HISTORY' => 'Previous PM in history', + 'VIEW_PREVIOUS_PM' => 'Previous PM', 'VIEW_SIGS' => 'Display Signatures', 'VIEW_SMILIES' => 'Display Smileys as images', 'VIEW_TOPICS_DAYS' => 'Display topics from previous days', @@ -230,6 +299,38 @@ $lang += array( 'YOUR_FRIENDS_EXPLAIN' => 'To remove usernames select them and click submit', 'YOUR_KARMA' => 'Your Karma level', 'YOUR_WARNINGS' => 'Your Warning level', + + 'PM_ACTION' => array( + 'PLACE_INTO_FOLDER' => 'Place into folder', + 'MARK_AS_READ' => 'Mark as read', + 'MARK_AS_IMPORTANT' => 'Mark Message', + 'DELETE_MESSAGE' => 'Delete Message' + ), + 'PM_CHECK' => array( + 'SUBJECT' => 'Subject', + 'SENDER' => 'Sender', + 'MESSAGE' => 'Message', + 'STATUS' => 'Message Status', + 'TO' => 'Sent To' + ), + 'PM_RULE' => array( + 'IS_LIKE' => 'Is Like', + 'IS_NOT_LIKE' => 'Is Not Like', + 'IS' => 'Is', + 'IS_NOT' => 'Is Not', + 'BEGINS_WITH' => 'Begins with', + 'ENDS_WITH' => 'Ends with', + 'IS_FRIEND' => 'Is Friend', + 'IS_FOE' => 'Is Foe', + 'IS_USER' => 'Is User', + 'IS_GROUP' => 'Is In Usergroup', + 'ANSWERED' => 'Answered', + 'FORWARDED' => 'Forwarded', + 'REPORTED' => 'Reported', + 'TO_GROUP' => 'Usergroup', + 'TO_ME' => 'Me' + ) + ); ?>
\ No newline at end of file diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php index 26eb392ebf..aee06fd249 100644 --- a/phpBB/language/en/viewforum.php +++ b/phpBB/language/en/viewforum.php @@ -28,8 +28,9 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang += array( + 'ACTIVE_TOPICS' => 'Active Topics', 'ANNOUNCEMENTS' => 'Announcements', - + 'LOGIN_NOTIFY_FORUM' => 'You have been notified about this forum, please login to view it.', 'MARK_TOPICS_READ' => 'Mark Topics Read', @@ -44,6 +45,7 @@ $lang += array( 'TOPICS_MARKED' => 'The topics for this forum have now been marked read', + 'VIEW_FORUM' => 'View Forum', 'VIEW_FORUM_TOPIC' => '1 Topic', 'VIEW_FORUM_TOPICS' => '%d Topics', ); diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index d95222fbbb..12497a4edf 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -24,7 +24,7 @@ include($phpbb_root_path . 'common.'.$phpEx); // Start session management $user->start(); $auth->acl($user->data); -$user->setup(); +$user->setup('memberlist'); // Grab data $mode = request_var('mode', ''); @@ -38,7 +38,7 @@ switch ($mode) break; default: - // Can this user view profiles/memberslist? + // Can this user view profiles/memberlist? if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) { if ($user->data['user_id'] != ANONYMOUS) @@ -69,7 +69,7 @@ switch ($mode) { case 'leaders': // Display a listing of board admins, moderators? - $user_ary = auth::acl_get_list(false, array('a_', 'm_'), false); + $user_ary = $auth->acl_get_list(false, array('a_', 'm_'), false); $user_id_ary = array(); foreach ($user_ary as $forum_id => $forum_ary) @@ -127,6 +127,10 @@ switch ($mode) $s_select = (@extension_loaded('xml')) ? 'S_SEND_JABBER' : 'S_NO_SEND_JABBER'; $s_action = "memberlist.$phpEx$SID&mode=contact&action=$action&u=$user_id"; break; + + default: + $sql_field = ''; + break; } // Grab relevant data @@ -746,7 +750,7 @@ switch ($mode) 'S_USERNAME_OPTIONS' => $username_list, 'S_JOINED_TIME_OPTIONS' => $s_find_join_time, 'S_ACTIVE_TIME_OPTIONS' => $s_find_active_time, - 'S_SEARCH_ACTION' => "memberslist.$phpEx$SID&mode=searchuser&field=$field") + 'S_SEARCH_ACTION' => "memberlist.$phpEx$SID&mode=searchuser&form=$form&field=$field") ); } diff --git a/phpBB/posting.php b/phpBB/posting.php index 10c3cf61ae..9965a19f21 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -49,7 +49,7 @@ $current_time = time(); // Was cancel pressed? If so then redirect to the appropriate page -if ($cancel || $current_time - $lastclick < 2) +if ($cancel || ($current_time - $lastclick < 2 && !$refresh)) { $redirect = ($post_id) ? "viewtopic.$phpEx$SID&p=$post_id#$post_id" : (($topic_id) ? "viewtopic.$phpEx$SID&t=$topic_id" : (($forum_id) ? "viewforum.$phpEx$SID&f=$forum_id" : "index.$phpEx$SID")); redirect($redirect); @@ -102,9 +102,16 @@ switch ($mode) break; case 'smilies': + $sql = ''; generate_smilies('window', $forum_id); break; + case 'popup': + $sql = 'SELECT forum_style + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $forum_id; + break; + default: $sql = ''; trigger_error('NO_POST_MODE'); @@ -117,13 +124,20 @@ if ($sql) extract($db->sql_fetchrow($result)); $db->sql_freeresult($result); - $quote_username = ($username) ? $username : ((isset($post_username)) ? $post_username : ''); + if ($mode == 'popup') + { + upload_popup($forum_style); + exit; + } + + $quote_username = (isset($username)) ? $username : ((isset($post_username)) ? $post_username : ''); $forum_id = (int) $forum_id; $topic_id = (int) $topic_id; $post_id = (int) $post_id; + $icon_id = 0; - $post_edit_locked = (int) $post_edit_locked; + $post_edit_locked = (isset($post_edit_locked)) ? (int) $post_edit_locked : 0; $user->setup(array('posting', 'mcp'), $forum_style); @@ -138,10 +152,11 @@ if ($sql) unset($forum_info); } - $post_subject = (in_array($mode, array('quote', 'edit', 'delete'))) ? $post_subject : $topic_title; + $post_subject = (in_array($mode, array('quote', 'edit', 'delete'))) ? $post_subject : ((isset($topic_title)) ? $topic_title : ''); - $topic_time_limit = ($topic_time_limit) ? $topic_time_limit / 86400 : $topic_time_limit; - $poll_length = ($poll_length) ? $poll_length / 86400 : $poll_length; + $topic_time_limit = (isset($topic_time_limit)) ? (($topic_time_limit) ? (int) $topic_time_limit / 86400 : (int) $topic_time_limit) : 0; + $poll_length = (isset($poll_length)) ? (($poll_length) ? (int) $poll_length / 86400 : (int) $poll_length) : 0; + $poll_start = (isset($poll_start)) ? (int) $poll_start : 0; $poll_options = array(); // Get Poll Data @@ -162,33 +177,14 @@ if ($sql) $message_parser = new parse_message(); - - $message_parser->filename_data['filecomment'] = preg_replace('#&(\#[0-9]+;)#', '&\1', request_var('filecomment', '')); - $message_parser->filename_data['filename'] = ($_FILES['fileupload']['name'] != 'none') ? trim($_FILES['fileupload']['name']) : ''; - - // Get Attachment Data - $message_parser->attachment_data = (isset($_POST['attachment_data'])) ? $_POST['attachment_data'] : array(); - - // - foreach ($message_parser->attachment_data as $pos => $var_ary) - { - prepare_data($message_parser->attachment_data[$pos]['physical_filename'], true); - prepare_data($message_parser->attachment_data[$pos]['comment'], true); - prepare_data($message_parser->attachment_data[$pos]['real_filename'], true); - prepare_data($message_parser->attachment_data[$pos]['extension'], true); - prepare_data($message_parser->attachment_data[$pos]['mimetype'], true); - - $message_parser->attachment_data[$pos]['filesize'] = (int) $message_parser->attachment_data[$pos]['filesize']; - $message_parser->attachment_data[$pos]['filetime'] = (int) $message_parser->attachment_data[$pos]['filetime']; - $message_parser->attachment_data[$pos]['attach_id'] = (int) $message_parser->attachment_data[$pos]['attach_id']; - $message_parser->attachment_data[$pos]['thumbnail'] = (int) $message_parser->attachment_data[$pos]['thumbnail']; - } + $message_parser->get_submitted_attachment_data(); if ($post_attachment && !$submit && !$refresh && !$preview && $mode == 'edit') { $sql = 'SELECT attach_id, physical_filename, comment, real_filename, extension, mimetype, filesize, filetime, thumbnail FROM ' . ATTACHMENTS_TABLE . " - WHERE post_id = $post_id + WHERE post_msg_id = $post_id + AND in_message = 0 ORDER BY filetime " . ((!$config['display_order']) ? 'DESC' : 'ASC'); $result = $db->sql_query($sql); @@ -233,6 +229,7 @@ if ($sql) { $drafts = true; } + $db->sql_freeresult($result); } } @@ -271,26 +268,25 @@ if (($forum_status == ITEM_LOCKED || $topic_status == ITEM_LOCKED) && !$auth->ac } // Can we edit this post? -if (($mode == 'edit' || $mode == 'delete') && !$auth->acl_get('m_edit', $forum_id) && $config['edit_time'] && $post_time < $current_time - $config['edit_time']) +if ($mode == 'edit' && !$preview && !$refresh && !$submit) { - trigger_error('CANNOT_EDIT_TIME'); + if (!($post_time > time() - $config['edit_time'] || !$config['edit_time'])) + { + trigger_error('CANNOT_EDIT_TIME'); + } } - // Do we want to edit our post ? -if ($mode == 'edit' && !$auth->acl_get('m_edit', $forum_id) && $user->data['user_id'] != $poster_id) +if ($mode == 'edit' && !$auth->acl_get('m_edit', $forum_id) && ($user->data['user_id'] != $poster_id || $post_edit_locked)) { + if ($post_edit_locked) + { + trigger_error('CANNOT_EDIT_POST_LOCKED'); + } + trigger_error('USER_CANNOT_EDIT'); } - -// Is edit posting locked ? -if ($mode == 'edit' && $post_edit_locked && !$auth->acl_get('m_', $forum_id)) -{ - trigger_error('CANNOT_EDIT_POST_LOCKED'); -} - - if ($mode == 'edit') { $message_parser->bbcode_uid = $bbcode_uid; @@ -597,6 +593,7 @@ if ($submit || $preview || $refresh) { $last_post_time = $row['last_post_time']; } + $db->sql_freeresult($result); } if ($last_post_time) @@ -606,7 +603,6 @@ if ($submit || $preview || $refresh) $error[] = $user->lang['FLOOD_ERROR']; } } - $db->sql_freeresult($result); } // Validate username @@ -788,7 +784,7 @@ if (!sizeof($error) && $preview) { $post_time = ($mode == 'edit') ? $post_time : $current_time; - $preview_subject = censor_text($preview_subject); + $preview_subject = censor_text($subject); $preview_signature = ($mode == 'edit') ? $user_sig : $user->data['user_sig']; $preview_signature_uid = ($mode == 'edit') ? $user_sig_bbcode_uid : $user->data['user_sig_bbcode_uid']; @@ -877,95 +873,20 @@ generate_smilies('inline', $forum_id); $s_topic_icons = false; if ($enable_icons) { - // Grab icons - $icons = array(); - obtain_icons($icons); - - if (sizeof($icons)) - { - foreach ($icons as $id => $data) - { - if ($data['display']) - { - $template->assign_block_vars('topic_icon', array( - 'ICON_ID' => $id, - 'ICON_IMG' => $phpbb_root_path . $config['icons_path'] . '/' . $data['img'], - 'ICON_WIDTH' => $data['width'], - 'ICON_HEIGHT' => $data['height'], - - 'S_ICON_CHECKED' => ($id == $icon_id && $mode != 'reply') ? ' checked="checked"' : '') - ); - } - } - - $s_topic_icons = true; - } + $s_topic_icons = posting_gen_topic_icons($mode, $icon_id); } // Generate inline attachment select box -if (sizeof($message_parser->attachment_data)) -{ - $s_inline_attachment_options = ''; - foreach ($message_parser->attachment_data as $i => $attachment) - { - - $s_inline_attachment_options .= '<option value="' . $i . '">' . $attachment['real_filename'] . '</option>'; - } - - $template->assign_var('S_INLINE_ATTACHMENT_OPTIONS', $s_inline_attachment_options); -} +posting_gen_inline_attachments($message_parser); // Topic type selection ... only for first post in topic. $topic_type_toggle = false; if ($mode == 'post' || ($mode == 'edit' && $post_id == $topic_first_post_id)) { - $topic_types = array( - 'sticky' => array('const' => POST_STICKY, 'lang' => 'POST_STICKY'), - 'announce' => array('const' => POST_ANNOUNCE, 'lang' => 'POST_ANNOUNCEMENT'), - 'global' => array('const' => POST_GLOBAL, 'lang' => 'POST_GLOBAL') - ); - - $topic_type_array = array(); - - foreach ($topic_types as $auth_key => $topic_value) - { - // Temp - we do not have a special post global announcement permission - $auth_key = ($auth_key == 'global') ? 'announce' : $auth_key; - - if ($auth->acl_get('f_' . $auth_key, $forum_id)) - { - $topic_type_toggle = true; - - $topic_type_array[] = array( - 'VALUE' => $topic_value['const'], - 'S_CHECKED' => ($topic_type == $topic_value['const'] || ($forum_id == 0 && $topic_value['const'] == POST_GLOBAL)) ? ' checked="checked"' : '', - 'L_TOPIC_TYPE' => $user->lang[$topic_value['lang']] - ); - } - } - - if ($topic_type_toggle) - { - $topic_type_array = array_merge(array(0 => array( - 'VALUE' => POST_NORMAL, - 'S_CHECKED' => ($topic_type == POST_NORMAL) ? ' checked="checked"' : '', - 'L_TOPIC_TYPE' => $user->lang['POST_NORMAL'])), - - $topic_type_array - ); - - foreach ($topic_type_array as $array) - { - $template->assign_block_vars('topic_type', $array); - } - - $template->assign_vars(array( - 'S_TOPIC_TYPE_STICKY' => ($auth->acl_get('f_sticky', $forum_id)), - 'S_TOPIC_TYPE_ANNOUNCE' => ($auth->acl_get('f_announce', $forum_id))) - ); - } + $topic_type_toggle = posting_gen_topic_types($forum_id, $topic_type); } + $html_checked = (isset($enable_html)) ? !$enable_html : (($config['allow_html']) ? !$user->optionget('html') : 1); $bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_bbcode']) ? !$user->optionget('bbcode') : 1); $smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies']) ? !$user->optionget('smile') : 1); @@ -1012,7 +933,7 @@ $s_hidden_fields .= '<input type="hidden" name="lastclick" value="' . $current_t $s_hidden_fields .= (isset($check_value)) ? '<input type="hidden" name="status_switch" value="' . $check_value . '" />' : ''; $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . ((isset($_REQUEST['draft_loaded'])) ? intval($_REQUEST['draft_loaded']) : $draft_id) . '" />' : ''; -$form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || @ini_get('file_uploads') == '0' || !$config['allow_attachments'] || !$auth->acl_gets('f_attach', 'u_attach', $forum_id)) ? '' : 'enctype="multipart/form-data"'; +$form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || @ini_get('file_uploads') == '0' || !$config['allow_attachments'] || !$auth->acl_gets('f_attach', 'u_attach', $forum_id)) ? '' : ' enctype="multipart/form-data"'; // Start assigning vars for main posting page ... $template->assign_vars(array( @@ -1043,7 +964,9 @@ $template->assign_vars(array( 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=" . $forum_id, 'U_VIEWTOPIC' => ($mode != 'post') ? "viewtopic.$phpEx$SID&$forum_id&t=$topic_id" : '', + 'U_PROGRESS_BAR' => "posting.$phpEx$SID&mode=popup", + 'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']), 'S_DISPLAY_PREVIEW' => ($preview && !sizeof($error)), 'S_EDIT_POST' => ($mode == 'edit'), 'S_EDIT_REASON' => ($mode == 'edit' && $user->data['user_id'] != $poster_id), @@ -1099,49 +1022,7 @@ else if ($mode == 'edit' && $poll_last_vote && ($auth->acl_get('f_poll', $forum_ // Attachment entry if ($auth->acl_gets('f_attach', 'u_attach', $forum_id) && $config['allow_attachments'] && $form_enctype) { - $template->assign_vars(array( - 'S_SHOW_ATTACH_BOX' => true) - ); - - if (sizeof($message_parser->attachment_data)) - { - $template->assign_vars(array( - 'S_HAS_ATTACHMENTS' => true) - ); - - $count = 0; - foreach ($message_parser->attachment_data as $attach_row) - { - $hidden = ''; - $attach_row['real_filename'] = stripslashes($attach_row['real_filename']); - - foreach ($attach_row as $key => $value) - { - $hidden .= '<input type="hidden" name="attachment_data[' . $count . '][' . $key . ']" value="' . $value . '" />'; - } - - $download_link = (!$attach_row['attach_id']) ? $config['upload_dir'] . '/' . $attach_row['physical_filename'] : $phpbb_root_path . "download.$phpEx$SID&id=" . intval($attach_row['attach_id']); - - $template->assign_block_vars('attach_row', array( - 'FILENAME' => $attach_row['real_filename'], - 'ATTACH_FILENAME' => $attach_row['physical_filename'], - 'FILE_COMMENT' => $attach_row['comment'], - 'ATTACH_ID' => $attach_row['attach_id'], - 'ASSOC_INDEX' => $count, - - 'U_VIEW_ATTACHMENT' => $download_link, - 'S_HIDDEN' => $hidden) - ); - - $count++; - } - } - - $template->assign_vars(array( - 'FILE_COMMENT' => $message_parser->filename_data['filecomment'], - 'FILESIZE' => $config['max_filesize'], - 'FILENAME' => $message_parser->filename_data['filename']) - ); + posting_gen_attachment_entry($message_parser); } // Output page ... @@ -1280,7 +1161,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id // Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;) - $email_users = $delete_ids = $update_notification = array(); + $msg_users = $delete_ids = $update_notification = array(); foreach ($notify_rows as $user_id => $row) { if (!$row['allowed'] || !trim($row['user_email'])) @@ -1314,7 +1195,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $msg_list_ary[$row['template']][$pos]['name'] = $row['username']; $msg_list_ary[$row['template']][$pos]['lang'] = $row['user_lang']; } - unset($email_users); + unset($msg_users); foreach ($msg_list_ary as $email_template => $email_list) { @@ -1343,7 +1224,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $messenger->reset(); } } - unset($email_list_ary); + unset($msg_list_ary); if ($messenger->queue) { @@ -1452,7 +1333,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id $message = censor_text($message); $template->assign_block_vars($mode . '_row', array( - 'KARMA_IMG' => '<img src="images/karma' . $row['user_karma'] . '.gif" alt="' . $user->lang['KARMA_LEVEL'] . ': ' . $user->lang['KARMA'][$row['user_karma']] . '" title="' . $user->lang['KARMA_LEVEL'] . ': ' . $user->lang['KARMA'][$row['user_karma']] . '" />', + 'KARMA_IMG' => ($config['enable_karma']) ? $user->img('karma_center', $user->lang['KARMA'][$row['user_karma']], false, (int) $row['user_karma']) : '', 'POSTER_NAME' => $poster, 'POST_SUBJECT' => $post_subject, 'MINI_POST_IMG' => $user->img('icon_post', $user->lang['POST']), @@ -1477,27 +1358,6 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id } -// Temp Function - strtolower - borrowed from php.net -function phpbb_strtolower($string) -{ - $new_string = ''; - - for ($i = 0; $i < strlen($string); $i++) - { - if (ord(substr($string, $i, 1)) > 0xa0) - { - $new_string .= strtolower(substr($string, $i, 2)); - $i++; - } - else - { - $new_string .= strtolower($string{$i}); - } - } - - return $new_string; -} - // Delete Post function delete_post($mode, $post_id, $topic_id, $forum_id, $data) { @@ -1966,8 +1826,9 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_ { // insert attachment into db $attach_sql = array( - 'post_id' => $data['post_id'], + 'post_msg_id' => $data['post_id'], 'topic_id' => $data['topic_id'], + 'in_message' => 0, 'poster_id' => $poster_id, 'physical_filename' => $attach_row['physical_filename'], 'real_filename' => $attach_row['real_filename'], @@ -2130,106 +1991,21 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_ trigger_error($message); } -// Load Drafts -function load_drafts($topic_id = 0, $forum_id = 0) +function upload_popup($forum_style) { - global $user, $db, $template, $phpEx, $SID, $auth; - - // Only those fitting into this forum... - $sql = 'SELECT d.draft_id, d.topic_id, d.forum_id, d.draft_subject, d.save_time, f.forum_name - FROM ' . DRAFTS_TABLE . ' d, ' . FORUMS_TABLE . ' f - WHERE d.user_id = ' . $user->data['user_id'] . ' - AND f.forum_id = d.forum_id ' . - (($forum_id) ? " AND f.forum_id = $forum_id" : '') . ' - ORDER BY save_time DESC'; - $result = $db->sql_query($sql); + global $template, $user; - $draftrows = $topic_ids = array(); + $user->setup('posting', $forum_style); - while ($row = $db->sql_fetchrow($result)) - { - if ($row['topic_id']) - { - $topic_ids[] = (int) $row['topic_id']; - } - $draftrows[] = $row; - } - $db->sql_freeresult($result); - - if (sizeof($topic_ids)) - { - $sql = 'SELECT topic_id, forum_id, topic_title - FROM ' . TOPICS_TABLE . ' - WHERE topic_id IN (' . implode(',', array_unique($topic_ids)) . ')'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $topic_rows[$row['topic_id']] = $row; - } - $db->sql_freeresult($result); - } - unset($topic_ids); - - if (sizeof($draftrows)) - { - $row_count = 0; - $template->assign_var('S_SHOW_DRAFTS', true); - - foreach ($draftrows as $draft) - { - $link_topic = $link_forum = 0; - $insert_url = $view_url = $title = ''; - - if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) - { - $link_topic = true; - $view_url = "viewtopic.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . "&t=" . $draft['topic_id']; - $title = ($draft['topic_id'] == $topic_id && $topic_id) ? $user->lang['CURRENT_TOPIC'] : $topic_rows[$draft['topic_id']]['topic_title']; + page_header('PROGRESS_BAR'); - $insert_url = "posting.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']; - } - else if ($auth->acl_get('f_read', $draft['forum_id'])) - { - $link_forum = true; - $view_url = "viewforum.$phpEx$SID&f=" . $draft['forum_id']; - $title = $draft['forum_name']; - - $insert_url = "posting.$phpEx$SID&f=" . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']; - } - - $template->assign_block_vars('draftrow', array( - 'DRAFT_ID' => $draft['draft_id'], - 'DATE' => $user->format_date($draft['save_time']), - 'DRAFT_SUBJECT' => $draft['draft_subject'], - - 'TITLE' => $title, - 'U_VIEW' => $view_url, - 'U_INSERT' => $insert_url, - - 'S_ROW_COUNT' => $row_count++, - 'S_LINK_TOPIC' => $link_topic, - 'S_LINK_FORUM' => $link_forum) - ); - } - } -} - -function prepare_data(&$variable, $change = false) -{ - if (!$change) - { -// return htmlspecialchars(trim(str_replace(array('\\\'', '\\"', '\\0', '\\\\'), array('\'', '"', '\0', '\\'), $variable))); - return htmlspecialchars(trim(stripslashes(preg_replace(array("#[ \xFF]{2,}#s", "#[\r\n]{2,}#s"), array(' ', "\n"), $variable)))); - - } - -// $variable = htmlspecialchars(trim(str_replace(array('\\\'', '\\"', '\\0', '\\\\'), array('\'', '"', '\0', '\\'), $variable))); - $variable = htmlspecialchars(trim(stripslashes(preg_replace(array("#[ \xFF]{2,}#s", "#[\r\n]{2,}#s"), array(' ', "\n"), $variable)))); + $template->set_filenames(array( + 'popup' => 'posting_progress_bar.html') + ); + $template->display('popup'); } - // // FUNCTIONS // --------- diff --git a/phpBB/report.php b/phpBB/report.php index ab1680968d..47813fd07e 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -22,50 +22,79 @@ $auth->acl($user->data); $user->setup('mcp'); // var definitions -$post_id = (!empty($_REQUEST['p'])) ? intval($_REQUEST['p']) : 0; -$reason_id = (!empty($_REQUEST['reason_id'])) ? intval($_REQUEST['reason_id']) : 0; -$user_notify = (!empty($_REQUEST['notify']) && $user->data['user_id'] != ANONYMOUS) ? TRUE : FALSE; -$report_text = (!empty($_REQUEST['report_text'])) ? htmlspecialchars(stripslashes($_REQUEST['report_text'])) : ''; +$post_id = request_var('p', 0); +$msg_id = request_var('pm', 0); +$reason_id = request_var('reason_id', 0); +$user_notify= (!empty($_REQUEST['notify']) && $user->data['user_id'] != ANONYMOUS) ? true : false; +$report_text= request_var('report_text', ''); + +if (!$post_id && !$msg_id) +{ + trigger_error('NO_MODE'); +} + +$redirect_url = ($post_id) ? "{$phpbb_root_path}viewtopic.$phpEx$SID&p=$post_id#$post_id" : "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=view_messages&action=view_message&p=$msg_id"; // Has the report been cancelled? if (isset($_POST['cancel'])) { - redirect("viewtopic.$phpEx$SID&p=$post_id#$post_id"); + redirect($redirect_url); } // Grab all relevant data -$sql = 'SELECT f.*, t.*, p.* - FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f - WHERE p.post_id = $post_id - AND p.topic_id = t.topic_id - AND p.forum_id = f.forum_id"; +if ($post_id) +{ + $sql = 'SELECT f.*, t.*, p.* + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f + WHERE p.post_id = $post_id + AND p.topic_id = t.topic_id + AND p.forum_id = f.forum_id"; +} +else +{ + // Only the user itself is able to report his Private Messages + $sql = 'SELECT p.*, t.* + FROM ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TO_TABLE . " t + WHERE t.msg_id = $msg_id + AND t.user_id = " . $user->data['user_id'] . ' + AND t.msg_id = p.msg_id'; +} $result = $db->sql_query($sql); -if (!($forum_data = $db->sql_fetchrow($result))) +if (!($report_data = $db->sql_fetchrow($result))) { trigger_error($user->lang['POST_NOT_EXIST']); } -$forum_id = $forum_data['forum_id']; -$topic_id = $forum_data['topic_id']; - +if ($post_id) +{ + $forum_id = $report_data['forum_id']; + $topic_id = $report_data['topic_id']; -// Check required permissions -$acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT'); -foreach ($acl_check_ary as $acl => $error) + // Check required permissions + $acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT'); + foreach ($acl_check_ary as $acl => $error) + { + if (!$auth->acl_get($acl, $forum_id)) + { + trigger_error($error); + } + } + unset($acl_check_ary); +} +else { - if (!$auth->acl_get($acl, $forum_id)) + if (!$config['auth_report_pm'] || !$auth->acl_get('u_pm_report')) { - trigger_error($error); + trigger_error('USER_CANNOT_REPORT'); } } -unset($acl_check_ary); // Check if the post has already been reported by this user $sql = 'SELECT * - FROM ' . REPORTS_TABLE . " - WHERE post_id = $post_id - AND user_id = " . $user->data['user_id']; + FROM ' . REPORTS_TABLE . ' + WHERE ' . (($post_id) ? "post_id = $post_id" : "msg_id = $msg_id") . ' + AND user_id = ' . $user->data['user_id']; $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) @@ -86,9 +115,7 @@ if ($row = $db->sql_fetchrow($result)) } else { - $return_topic = '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&p=$post_id#$post_id\">", '</a>'); - - trigger_error($user->lang['ALREADY_REPORTED'] . $return_topic); + trigger_error($user->lang['ALREADY_REPORTED'] . '<br /><br />' . sprintf($user->lang[(($post_id) ? 'RETURN_TOPIC' : 'RETURN_MESSAGE')], '<a href="' . $redirect_url . '">', '</a>')); } } else @@ -99,24 +126,25 @@ else // Has the report been confirmed? if (!empty($_POST['reason_id'])) { - $sql = 'SELECT reason_title + $sql = 'SELECT reason_name FROM ' . REASONS_TABLE . " WHERE reason_id = $reason_id"; $result = $db->sql_query($sql); - if (!($row = $db->sql_fetchrow($result)) || (!$report_text && $row['reason_title'] == 'other')) + if (!($row = $db->sql_fetchrow($result)) || (!$report_text && $row['reason_name'] == 'other')) { trigger_error('EMPTY_REPORT'); } $db->sql_freeresult($result); $sql_ary = array( - 'reason_id' => (int) $reason_id, - 'post_id' => (int) $post_id, - 'user_id' => (int) $user->data['user_id'], - 'user_notify' => (int) $user_notify, - 'report_time' => (int) time(), - 'report_text' => (string) $report_text + 'reason_id' => (int) $reason_id, + 'post_id' => (int) $post_id, + 'msg_id' => (int) $msg_id, + 'user_id' => (int) $user->data['user_id'], + 'user_notify' => (int) $user_notify, + 'report_time' => (int) time(), + 'report_text' => (string) $report_text ); if ($report_id) @@ -133,27 +161,54 @@ if (!empty($_POST['reason_id'])) $db->sql_query($sql); } - if (!$row['post_reported']) + if ($post_id) { - $sql = 'UPDATE ' . POSTS_TABLE . ' - SET post_reported = 1 - WHERE post_id = ' . $post_id; - $db->sql_query($sql); - } + if (!$row['post_reported']) + { + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_reported = 1 + WHERE post_id = ' . $post_id; + $db->sql_query($sql); + } - if (!$row['topic_reported']) + if (!$row['topic_reported']) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_reported = 1 + WHERE topic_id = ' . $topic_id; + $db->sql_query($sql); + } + } + else { - $sql = 'UPDATE ' . TOPICS_TABLE . ' - SET topic_reported = 1 - WHERE topic_id = ' . $topic_id; - $db->sql_query($sql); + if (!$row['message_reported']) + { + $sql = 'UPDATE ' . PRIVMSGS_TABLE . " + SET message_reported = 1 + WHERE msg_id = $msg_id"; + $db->sql_query($sql); + } } - meta_refresh(3, "viewtopic.$phpEx$SID&p=$post_id#$post_id"); + meta_refresh(3, $redirect_url); - $message = $user->lang['POST_REPORTED_SUCCESS'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&p=$post_id#$post_id\">", '</a>'); + $message = $user->lang[(($post_id) ? 'POST' : 'MESSAGE') . '_REPORTED_SUCCESS'] . '<br /><br />' . sprintf($user->lang[(($post_id) ? 'RETURN_TOPIC' : 'RETURN_MESSAGE')], '<a href="' . $redirect_url . '">', '</a>'); trigger_error($message); + // Which moderators are responsible for private messages? ;) + /* + $db->sql_query('INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'msg_id' => (int) $msg_id, + 'user_id' => (int) $moderator_id, + 'author_id' => (int) $row['author_id'], + 'folder_id' => PRIVMSGS_NO_BOX, + 'new' => 1, + 'unread' => 1, + 'forwarded' => 0, + 'reported' => 1) + ); + */ + // TODO: warn moderators or something ;) } @@ -166,11 +221,11 @@ $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $row['reason_title'] = strtoupper($row['reason_title']); + $row['reason_name'] = strtoupper($row['reason_name']); - $reason_title = (!empty($user->lang['report_reasons']['TITLE'][$row['reason_title']])) ? $user->lang['report_reasons']['TITLE'][$row['reason_title']] : ucwords(str_replace('_', ' ', $row['reason_title'])); + $reason_title = (!empty($user->lang['report_reasons']['TITLE'][$row['reason_name']])) ? $user->lang['report_reasons']['TITLE'][$row['reason_name']] : ucwords(str_replace('_', ' ', $row['reason_name'])); - $reason_desc = (!empty($user->lang['report_reasons']['DESCRIPTION'][$row['reason_title']])) ? $user->lang['report_reasons']['DESCRIPTION'][$row['reason_title']] : $row['reason_desc']; + $reason_desc = (!empty($user->lang['report_reasons']['DESCRIPTION'][$row['reason_name']])) ? $user->lang['report_reasons']['DESCRIPTION'][$row['reason_name']] : $row['reason_desc']; $template->assign_block_vars('reason', array( 'ID' => $row['reason_id'], @@ -180,17 +235,20 @@ while ($row = $db->sql_fetchrow($result)) )); } +$u_report = ($post_id) ? "p=$post_id" : "pm=$msg_id"; + $template->assign_vars(array( 'REPORT_TEXT' => $report_text, - 'S_REPORT_ACTION' => "report.$phpEx$SID&p=$post_id" . (($report_id) ? "&report_id=$report_id" : ''), - - 'S_NOTIFY' => (!empty($user_notify)) ? TRUE : FALSE, - 'S_CAN_NOTIFY' => ($user->data['user_id'] == ANONYMOUS) ? FALSE : TRUE -)); + 'S_REPORT_ACTION' => "report.$phpEx$SID&$u_report" . (($report_id) ? "&report_id=$report_id" : ''), + 'S_NOTIFY' => (!empty($user_notify)) ? TRUE : FALSE, + 'S_CAN_NOTIFY' => ($user->data['user_id'] == ANONYMOUS) ? FALSE : TRUE) +); -generate_forum_nav($forum_data); - +if ($post_id) +{ + generate_forum_nav($report_data); +} // Start output of page page_header($user->lang['REPORT_TO_ADMIN']); diff --git a/phpBB/styles/subSilver/template/editor.js b/phpBB/styles/subSilver/template/editor.js index 2ae7a75ed2..b2279c6d02 100644 --- a/phpBB/styles/subSilver/template/editor.js +++ b/phpBB/styles/subSilver/template/editor.js @@ -357,4 +357,5 @@ function colorPalette(dir, width, height) } } document.writeln('</table>'); -}
\ No newline at end of file +} + diff --git a/phpBB/styles/subSilver/template/index_body.html b/phpBB/styles/subSilver/template/index_body.html index 78726545ef..a32a1fab69 100644 --- a/phpBB/styles/subSilver/template/index_body.html +++ b/phpBB/styles/subSilver/template/index_body.html @@ -2,7 +2,7 @@ <!-- $Id$ --> - <table class="tablebg" cellspacing="1"> + <table class="tablebg" cellspacing="1" width="100%"> <tr> <td class="cat" colspan="5" align="right"><a class="nav" href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a> </td> </tr> diff --git a/phpBB/styles/subSilver/template/memberlist_search.html b/phpBB/styles/subSilver/template/memberlist_search.html index 44ac8139c7..2243672dc9 100644 --- a/phpBB/styles/subSilver/template/memberlist_search.html +++ b/phpBB/styles/subSilver/template/memberlist_search.html @@ -15,6 +15,7 @@ function insert_marked(users) insert_user(users[i].value); } } + self.close(); } function marklist(status) diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html index c4be311a5c..26e59fa712 100644 --- a/phpBB/styles/subSilver/template/overall_header.html +++ b/phpBB/styles/subSilver/template/overall_header.html @@ -7,23 +7,25 @@ <meta http-equiv="Content-Style-Type" content="text/css" /> {META} <title>{SITENAME} :: {PAGE_TITLE}</title> + <!-- IF T_STYLESHEET_LINK --> -<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" /> + <link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" /> <!-- ELSE --> -<style type="text/css"> -<!-- -{T_THEME_DATA} -//--> -</style> + <style type="text/css"> + <!-- + {T_THEME_DATA} + //--> + </style> <!-- ENDIF --> + <script language="Javascript" type="text/javascript"> <!-- <!-- IF S_USER_PM_POPUP --> -if ({S_NEW_PM}) -{ - window.open('{U_PRIVATEMSGS}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400'); -} + if ({S_NEW_PM}) + { + window.open('{U_POPUP_PM}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400'); + } <!-- ENDIF --> function popup(url, width, height) @@ -61,7 +63,7 @@ function jumpto() <div id="menubar"><table width="100%" cellspacing="0"> <tr> - <td class="genmed"><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" /> {L_LOGIN_LOGOUT}</a> <!-- IF S_USER_LOGGED_IN --><!-- IF S_DISPLAY_PM --> <a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" /> {PRIVATE_MESSAGE_INFO}</a><!-- ENDIF --><!-- ELSE --> <a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" /> {L_REGISTER}</a><!-- ENDIF --></td> + <td class="genmed"><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" /> {L_LOGIN_LOGOUT}</a> <!-- IF S_USER_LOGGED_IN --><!-- IF S_DISPLAY_PM --> <a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF --><!-- ELSE --> <a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" /> {L_REGISTER}</a><!-- ENDIF --></td> <td class="genmed" align="right"><a href="{U_FAQ}"><img src="{T_THEME_PATH}/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" /> {L_FAQ}</a><!-- IF S_DISPLAY_SEARCH --> <a href="{U_SEARCH}"><img src="{T_THEME_PATH}/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" /> {L_SEARCH}</a><!-- ENDIF --><!-- IF S_DISPLAY_MEMBERLIST --> <a href="{U_MEMBERLIST}"><img src="{T_THEME_PATH}/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" /> {L_MEMBERLIST}</a><!-- ENDIF --> <a href="{U_GROUP_CP}"><img src="{T_THEME_PATH}/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" /> {L_USERGROUPS}</a><!-- IF S_USER_LOGGED_IN --> <a href="{U_PROFILE}"><img src="{T_THEME_PATH}/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" /> {L_PROFILE}</a><!-- ENDIF --></td> </tr> </table></div> diff --git a/phpBB/styles/subSilver/template/posting_attach_body.html b/phpBB/styles/subSilver/template/posting_attach_body.html index 707570953a..e50500d946 100644 --- a/phpBB/styles/subSilver/template/posting_attach_body.html +++ b/phpBB/styles/subSilver/template/posting_attach_body.html @@ -1,5 +1,23 @@ <!-- $Id$ --> +<script language="javascript" type="text/javascript"> +<!-- + function popup_progress_bar() + { + close_waitscreen = 0; + window.open('{U_PROGRESS_BAR}', '_upload', 'HEIGHT=200,resizable=yes,scrollbars=no,WIDTH=400'); + } +//--> +</script> + +<!-- IF S_CLOSE_PROGRESS_WINDOW --> +<script language="javascript" type="text/javascript"> +<!-- + close_waitscreen = 1; +//--> +</script> +<!-- ENDIF --> + <tr> <th colspan="2" height="28">{L_ADD_ATTACHMENT}</th> </tr> @@ -9,7 +27,7 @@ <tr> <td class="row1"><b class="genmed">{L_FILENAME}</b></td> - <td class="row2"><input class="post" type="file" name="fileupload" size="40" maxlength="{FILESIZE}" value="{FILENAME}" class="btnlite" /></td> + <td class="row2"><input type="file" name="fileupload" size="40" maxlength="{FILESIZE}" value="{FILENAME}" class="btnlite" /></td> </tr> <tr> <td class="row1"><b class="genmed">{L_FILE_COMMENT}</b></td> @@ -18,7 +36,7 @@ <td><textarea class="post" name="filecomment" rows="3" cols="35" wrap="virtual" size=40>{FILE_COMMENT}</textarea> </td> <td valign="top"><table border="0" cellspacing="4" cellpadding="0"> <tr> - <td><input class="btnlite" type="submit" style="width:150px" name="add_file" value="{L_ADD_FILE}" /></td> + <td><input class="btnlite" type="submit" style="width:150px" name="add_file" value="{L_ADD_FILE}" onclick="javascript:popup_progress_bar();" /></td> </tr></table> </td> </tr></table> diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index d9e789eea0..05d6898e75 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -1,4 +1,8 @@ -<!-- INCLUDE overall_header.html --> +<!-- IF S_PRIVMSGS --> + <!-- INCLUDE ucp_header.html --> +<!-- ELSE --> + <!-- INCLUDE overall_header.html --> +<!-- ENDIF --> <!-- $Id$ --> @@ -43,18 +47,19 @@ function checkForm() </script> <script language="javascript" type="text/javascript" src="styles/subSilver/template/editor.js"></script> - <!-- IF S_FORUM_RULES --> +<!-- IF S_FORUM_RULES --> <p class="forumrules"> - <!-- IF U_FORUM_RULES --> + <!-- IF U_FORUM_RULES --> <a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a> - <!-- ELSE --> + <!-- ELSE --> {L_FORUM_RULES} - <!-- ENDIF --> + <!-- ENDIF --> </p> <br clear="all" /> - <!-- ENDIF --> +<!-- ENDIF --> +<!-- IF not S_PRIVMSGS --> <div id="pageheader"> <h2><!-- IF TOPIC_TITLE --><a class="titles" href="{U_VIEWTOPIC}">{TOPIC_TITLE}</a><!-- ELSE --><a class="titles" href="{U_VIEW_FORUM}" title="{FORUM_DESC}">{FORUM_NAME}</a><!-- ENDIF --></h2> @@ -67,109 +72,138 @@ function checkForm() </div> <br clear="all" /><br /> +<!-- ENDIF --> - <form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)"{S_FORM_ENCTYPE}> +<!-- IF not S_SHOW_PM_BOX --> + <form action="{S_POST_ACTION}" method="post" name="post"{S_FORM_ENCTYPE}> +<!-- ENDIF --> <!-- IF S_DRAFT_LOADED --> -<table class="tablebg" width="100%" cellspacing="1"> - <tr> - <th align="center">{L_INFORMATION}</th> - </tr> - <tr> - <td class="row1" align="center"><span class="gen">{L_DRAFT_LOADED}</span></td> - </tr> -</table> + <table class="tablebg" width="100%" cellspacing="1"> + <tr> + <th align="center">{L_INFORMATION}</th> + </tr> + <tr> + <td class="row1" align="center"><span class="gen">{L_DRAFT_LOADED}</span></td> + </tr> + </table> -<br clear="all" /> + <br clear="all" /> <!-- ENDIF --> <!-- IF S_SHOW_DRAFTS --> -<table class="tablebg" width="100%" cellspacing="1"> - <tr> - <th colspan="3" align="center">{L_LOAD_DRAFT}</th> - </tr> - <tr> - <td class="row1" colspan="3" align="center"><span class="gen">{L_LOAD_DRAFT_EXPLAIN}</span></td> - </tr> - <tr> - <th>{L_SAVE_DATE}</th> - <th>{L_DRAFT_TITLE}</th> - <th>{L_OPTIONS}</th> - </tr> - <!-- BEGIN draftrow --> - - <!-- IF draftrow.S_ROW_COUNT is even --> - <tr class="row1"> - <!-- ELSE --> - <tr class="row2"> - <!-- ENDIF --> - - <td class="postdetails">{draftrow.DATE}</td> - <td><b class="gen">{draftrow.DRAFT_SUBJECT}</b><!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span><!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span><!-- ELSE --><br /><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF --></td> - <td align="center"><span class="gen"><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a></td> - </tr> - <!-- END draftrow --> -</table> + <table class="tablebg" width="100%" cellspacing="1"> + <tr> + <th colspan="3" align="center">{L_LOAD_DRAFT}</th> + </tr> + <tr> + <td class="row1" colspan="3" align="center"><span class="gen">{L_LOAD_DRAFT_EXPLAIN}</span></td> + </tr> + <tr> + <th>{L_SAVE_DATE}</th> + <th>{L_DRAFT_TITLE}</th> + <th>{L_OPTIONS}</th> + </tr> + <!-- BEGIN draftrow --> + + <!-- IF draftrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> + + <td class="postdetails" style="padding: 4px;">{draftrow.DATE}</td> + <td style="padding: 4px;"><b class="gen">{draftrow.DRAFT_SUBJECT}</b> + <!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> + <!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> + <!-- ELSEIF draftrow.S_LINK_PM --><br /><span class="gensmall">{L_PRIVATE_MESSAGE}</span> + <!-- ELSE --><br /><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF --> + </td> + <td style="padding: 4px;" align="center"><span class="gen"><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a></td> + </tr> + <!-- END draftrow --> + </table> -<br clear="all" /> + <br clear="all" /> <!-- ENDIF --> <!-- IF S_POST_REVIEW --><!-- INCLUDE posting_review.html --><!-- ENDIF --> +<!-- IF S_DISPLAY_PREVIEW --><!-- INCLUDE posting_preview.html --><!-- ENDIF --> -<!-- IF S_UNGLOBALISE --> -<table class="tablebg" width="100%" cellspacing="1"> - <tr> - <th>{L_MOVE}</th> - </tr> - <tr> - <td class="spacer" colspan="2"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> - </tr> - <tr> - <td class="row2" align="center"><span class="gen">{L_UNGLOBALISE_EXPLAIN}<br /><br />{L_SELECT_DESTINATION_FORUM} </span><select name="to_forum_id">{S_FORUM_SELECT}</select><br /><br /><input class="btnmain" type="submit" name="post" value="{L_CONFIRM}" /> <input class="btnlite" type="submit" name="cancel_unglobalise" value="{L_CANCEL}" /></td> - </tr> -</table> +<!-- IF not S_PRIVMSGS and S_UNGLOBALISE --> + <table class="tablebg" width="100%" cellspacing="1"> + <tr> + <th>{L_MOVE}</th> + </tr> + <tr> + <td class="spacer" colspan="2"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> + </tr> + <tr> + <td class="row2" align="center"><span class="gen">{L_UNGLOBALISE_EXPLAIN}<br /><br />{L_SELECT_DESTINATION_FORUM} </span><select name="to_forum_id">{S_FORUM_SELECT}</select><br /><br /><input class="btnmain" type="submit" name="post" value="{L_CONFIRM}" /> <input class="btnlite" type="submit" name="cancel_unglobalise" value="{L_CANCEL}" /></td> + </tr> + </table> -<br clear="all" /> + <br clear="all" /> <!-- ENDIF --> -<!-- IF S_DISPLAY_PREVIEW --><!-- INCLUDE posting_preview.html --><!-- ENDIF --> - <table class="tablebg" width="100%" cellspacing="1"> <tr> <th colspan="2"><b>{L_POST_A}</b></th> </tr> <!-- IF ERROR --> - <tr> - <td class="row2" colspan="2" align="center"><span class="genmed" style="color:red">{ERROR}</span></td> - </tr> + <tr> + <td class="row2" colspan="2" align="center"><span class="genmed" style="color:red">{ERROR}</span></td> + </tr> <!-- ENDIF --> <!-- IF S_DELETE_ALLOWED --> - <tr> - <td class="row1"><b class="genmed">{L_DELETE_POST}:</b></td> - <td class="row2"><input type="checkbox" name="delete" /> <span class="gensmall">[ {L_DELETE_POST_WARN} ]</span></td> - </tr> + <tr> + <td class="row1"><b class="genmed">{L_DELETE_POST}:</b></td> + <td class="row2"><input type="checkbox" name="delete" /> <span class="gensmall">[ {L_DELETE_POST_WARN} ]</span></td> + </tr> <!-- ENDIF --> <!-- IF S_SHOW_TOPIC_ICONS --> - <tr> - <td class="row1"><b class="genmed">{L_ICON}:</b></td> - <td class="row2"><table width="100%" cellspacing="0" cellpadding="0" border="0"> - <tr> - <td><input type="radio" name="icon" value="1" checked="checked" /><span class="genmed">{L_NONE}</span> <!-- BEGIN topic_icon --><input type="radio" name="icon" value="{topic_icon.ICON_ID}"{topic_icon.S_ICON_CHECKED} /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="" title="" hspace="2" vspace="2" /> <!-- END topic_icon --></td> - </tr> - </table></td> - </tr> + <tr> + <td class="row1"><b class="genmed">{L_ICON}:</b></td> + <td class="row2"><table width="100%" cellspacing="0" cellpadding="0" border="0"> + <tr> + <td><input type="radio" name="icon" value="0" checked="checked" /><span class="genmed">{L_NONE}</span> <!-- BEGIN topic_icon --><input type="radio" name="icon" value="{topic_icon.ICON_ID}"{topic_icon.S_ICON_CHECKED} /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="" title="" hspace="2" vspace="2" /> <!-- END topic_icon --></td> + </tr> + </table></td> + </tr> <!-- ENDIF --> - <!-- IF S_DISPLAY_USERNAME --> - <tr> - <td class="row1"><b class="genmed">{L_USERNAME}:</b></td> - <td class="row2"><input class="post" type="text" tabindex="1" name="username" size="25" maxlength="25" value="{USERNAME}" /></td> - </tr> + <!-- IF not S_PRIVMSGS and S_DISPLAY_USERNAME --> + <tr> + <td class="row1"><b class="genmed">{L_USERNAME}:</b></td> + <td class="row2"><input class="post" type="text" tabindex="1" name="username" size="25" maxlength="25" value="{USERNAME}" /></td> + </tr> + <!-- ENDIF --> + + <!-- IF S_PRIVMSGS --> + <tr> + <td class="row1"><b class="genmed">{L_TO}:</b></td> + <td class="row2"> + <!-- BEGIN to_recipient --> + <span class="genmed"> + <a href="{to_recipient.U_VIEW}"><!-- IF to_recipient.COLOUR --><b style="color:#{to_recipient.COLOUR}"><!-- ELSE --><b<!-- IF to_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->><!-- ENDIF -->{to_recipient.NAME}</b></a> </span><!-- IF not S_EDIT_POST --><input class="post" type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="Remove" /> <!-- ENDIF --> + <!-- BEGINELSE --> + <span class="genmed">{L_NONE}</span> + <!-- END to_recipient --> + </td> + </tr> + <tr> + <td class="row1"><b class="genmed">{L_BCC}:</b></td> + <td class="row2"> + <!-- BEGIN bcc_recipient --> + <span class="genmed"> + <a href="{bcc_recipient.U_VIEW}"><!-- IF bcc_recipient.COLOUR --><b style="color:#{bcc_recipient.COLOUR}"><!-- ELSE --><b<!-- IF bcc_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->><!-- ENDIF -->{bcc_recipient.NAME}</b></a> </span><!-- IF not S_EDIT_POST --><input class="post" type="submit" name="remove_{bcc_recipient.TYPE}[{bcc_recipient.UG_ID}]" value="Remove" /> <!-- ENDIF --> + <!-- BEGINELSE --> + <span class="genmed">{L_NONE}</span> + <!-- END bcc_recipient --> + </td> + </tr> + {S_HIDDEN_ADDRESS_FIELD} <!-- ENDIF --> <tr> @@ -186,9 +220,9 @@ function checkForm() </tr> <!-- IF S_SHOW_EMOTICON_LINK --> - <tr> - <td align="center"><a class="nav" href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=350,resizable=yes,scrollbars=yes,WIDTH=300');return false;" target="_phpbbsmilies">{L_MORE_EMOTICONS}</a></td> - </tr> + <tr> + <td align="center"><a class="nav" href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=350,resizable=yes,scrollbars=yes,WIDTH=300');return false;" target="_phpbbsmilies">{L_MORE_EMOTICONS}</a></td> + </tr> <!-- ENDIF --> </table></td> @@ -236,13 +270,15 @@ function checkForm() </tr> </table></td> </tr> + <!-- IF S_INLINE_ATTACHMENT_OPTIONS --> - <tr> - <td class="row1"><b class="genmed">{L_ATTACHMENTS}:</b></td> - <td class="row2"><select name="attachments">{S_INLINE_ATTACHMENT_OPTIONS}</select> <input type="button" class="btnbbcode" accesskey="a" value="{L_PLACE_INLINE}" name="attachinline" onclick="attach_inline();" /> - </td> - </tr> + <tr> + <td class="row1"><b class="genmed">{L_ATTACHMENTS}:</b></td> + <td class="row2"><select name="attachments">{S_INLINE_ATTACHMENT_OPTIONS}</select> <input type="button" class="btnbbcode" accesskey="a" value="{L_PLACE_INLINE}" name="attachinline" onclick="attach_inline();" /> + </td> + </tr> <!-- ENDIF --> + <tr> <td class="row1" valign="top"><b class="genmed">{L_OPTIONS}:</b><br /><table cellspacing="2" cellpadding="0" border="0"> <tr> @@ -263,24 +299,24 @@ function checkForm() </table></td> <td class="row2"><table cellpadding="1"> <!-- IF S_HTML_ALLOWED --> - <tr> - <td><input type="checkbox" name="disable_html"{S_HTML_CHECKED} /></td> - <td class="gen">{L_DISABLE_HTML}</td> - </tr> + <tr> + <td><input type="checkbox" name="disable_html"{S_HTML_CHECKED} /></td> + <td class="gen">{L_DISABLE_HTML}</td> + </tr> <!-- ENDIF --> <!-- IF S_BBCODE_ALLOWED --> - <tr> - <td><input type="checkbox" name="disable_bbcode"{S_BBCODE_CHECKED} /></td> - <td class="gen">{L_DISABLE_BBCODE}</td> - </tr> + <tr> + <td><input type="checkbox" name="disable_bbcode"{S_BBCODE_CHECKED} /></td> + <td class="gen">{L_DISABLE_BBCODE}</td> + </tr> <!-- ENDIF --> <!-- IF S_SMILIES_ALLOWED --> - <tr> - <td><input type="checkbox" name="disable_smilies"{S_SMILIES_CHECKED} /></td> - <td class="gen">{L_DISABLE_SMILIES}</td> - </tr> + <tr> + <td><input type="checkbox" name="disable_smilies"{S_SMILIES_CHECKED} /></td> + <td class="gen">{L_DISABLE_SMILIES}</td> + </tr> <!-- ENDIF --> <tr> @@ -289,37 +325,40 @@ function checkForm() </tr> <!-- IF S_SIG_ALLOWED --> - <tr> - <td><input type="checkbox" name="attach_sig"{S_SIGNATURE_CHECKED} /></td> - <td class="gen">{L_ATTACH_SIG}</td> - </tr> + <tr> + <td><input type="checkbox" name="attach_sig"{S_SIGNATURE_CHECKED} /></td> + <td class="gen">{L_ATTACH_SIG}</td> + </tr> <!-- ENDIF --> <!-- IF S_NOTIFY_ALLOWED --> - <tr> - <td><input type="checkbox" name="notify"{S_NOTIFY_CHECKED} /></td> - <td class="gen">{L_NOTIFY_REPLY}</td> - </tr> + <tr> + <td><input type="checkbox" name="notify"{S_NOTIFY_CHECKED} /></td> + <td class="gen">{L_NOTIFY_REPLY}</td> + </tr> <!-- ENDIF --> - <!-- IF S_LOCK_TOPIC_ALLOWED --> - <tr> - <td><input type="checkbox" name="lock_topic"{S_LOCK_TOPIC_CHECKED} /></td> - <td class="gen">{L_LOCK_TOPIC}</td> - </tr> - <!-- ENDIF --> - <!-- IF S_LOCK_POST_ALLOWED --> - <tr> - <td><input type="checkbox" name="lock_post"{S_LOCK_POST_CHECKED} /></td> - <td class="gen">{L_LOCK_POST} [{L_LOCK_POST_EXPLAIN}]</td> - </tr> - <!-- ENDIF --> + <!-- IF not S_PRIVMSGS --> + <!-- IF S_LOCK_TOPIC_ALLOWED --> + <tr> + <td><input type="checkbox" name="lock_topic"{S_LOCK_TOPIC_CHECKED} /></td> + <td class="gen">{L_LOCK_TOPIC}</td> + </tr> + <!-- ENDIF --> + + <!-- IF S_LOCK_POST_ALLOWED --> + <tr> + <td><input type="checkbox" name="lock_post"{S_LOCK_POST_CHECKED} /></td> + <td class="gen">{L_LOCK_POST} [{L_LOCK_POST_EXPLAIN}]</td> + </tr> + <!-- ENDIF --> - <!-- IF S_TYPE_TOGGLE --> - <tr> - <td> </td> - <td class="gen"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->: <!-- BEGIN topic_type --><input type="radio" name="topic_type" value="{topic_type.VALUE}"{topic_type.S_CHECKED} />{topic_type.L_TOPIC_TYPE} <!-- END topic_type --></td> - </tr> + <!-- IF S_TYPE_TOGGLE --> + <tr> + <td> </td> + <td class="gen"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->: <!-- BEGIN topic_type --><input type="radio" name="topic_type" value="{topic_type.VALUE}"{topic_type.S_CHECKED} />{topic_type.L_TOPIC_TYPE} <!-- END topic_type --></td> + </tr> + <!-- ENDIF --> <!-- ENDIF --> </table></td> </tr> @@ -332,10 +371,10 @@ function checkForm() <!-- ENDIF --> <!-- IF S_EDIT_REASON --> - <tr> - <td class="row1" valign="top"><b class="genmed">{L_EDIT_REASON}:</b></td> - <td class="row2"><input class="post" type="text" name="edit_reason" size="50" maxlength="100" value="{EDIT_REASON}" /></td> - </tr> + <tr> + <td class="row1" valign="top"><b class="genmed">{L_EDIT_REASON}:</b></td> + <td class="row2"><input class="post" type="text" name="edit_reason" size="50" maxlength="100" value="{EDIT_REASON}" /></td> + </tr> <!-- ENDIF --> <!-- IF S_SHOW_ATTACH_BOX or S_SHOW_POLL_BOX --> @@ -347,13 +386,14 @@ function checkForm() <!-- IF S_SHOW_ATTACH_BOX --><!-- INCLUDE posting_attach_body.html --><!-- ENDIF --> <!-- IF S_SHOW_POLL_BOX --> - <!-- INCLUDE posting_poll_body.html --> + <!-- INCLUDE posting_poll_body.html --> <!-- ELSEIF S_POLL_DELETE --> - <tr> - <td class="row1"><span class="genmed"><b>{L_POLL_DELETE}:</b></span></td> - <td class="row2"><input type="checkbox" name="poll_delete" /></td> - </tr> + <tr> + <td class="row1"><span class="genmed"><b>{L_POLL_DELETE}:</b></span></td> + <td class="row2"><input type="checkbox" name="poll_delete" /></td> + </tr> <!-- ENDIF --> + <tr> <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnlite" type="submit" tabindex="5" name="preview" value="{L_PREVIEW}" /> <input class="btnmain" type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" /><!-- IF S_SAVE_ALLOWED --> <input class="btnlite" type="submit" accesskey="k" tabindex="8" name="save" value="{L_SAVE}" /><!-- ENDIF --><!-- IF S_HAS_DRAFTS --> <input class="btnlite" type="submit" accesskey="d" tabindex="9" name="load" value="{L_LOAD}" /><!-- ENDIF --> <input class="btnlite" type="submit" accesskey="c" tabindex="7" name="cancel" value="{L_CANCEL}" /></td> </tr> @@ -363,34 +403,41 @@ function checkForm() <!-- IF S_DISPLAY_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF --> -<table class="tablebg" width="100%" cellspacing="1"> - <tr> - <td class="row1"><div class="nav" style="float:left"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></div><div class="gensmall" style="float:right">{S_TIMEZONE}</div></td> - </tr> -</table> +<!-- IF S_PRIVMSGS --> + </form> -</form> + <br clear="all" /> -<!-- IF S_DISPLAY_ONLINE_LIST --> -<br clear="all" /> + <!-- INCLUDE ucp_footer.html --> +<!-- ELSE --> + <table class="tablebg" width="100%" cellspacing="1"> + <tr> + <td class="row1"><div class="nav" style="float:left"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></div><div class="gensmall" style="float:right">{S_TIMEZONE}</div></td> + </tr> + </table> -<table class="tablebg" width="100%" cellspacing="1"> - <tr> - <td class="cat"><span class="cattitle">{L_WHO_IS_ONLINE}</span></td> - </tr> - <tr> - <td class="row1"><span class="gensmall">{LOGGED_IN_USER_LIST}</span></td> - </tr> -</table> -<!-- ENDIF --> + </form> -<br clear="all" /> + <!-- IF S_DISPLAY_ONLINE_LIST --> + <br clear="all" /> -<table width="100%" cellspacing="1"> - <tr> - <td align="right"><!-- INCLUDE jumpbox.html --></td> - </tr> -</table> + <table class="tablebg" width="100%" cellspacing="1"> + <tr> + <td class="cat"><span class="cattitle">{L_WHO_IS_ONLINE}</span></td> + </tr> + <tr> + <td class="row1"><span class="gensmall">{LOGGED_IN_USER_LIST}</span></td> + </tr> + </table> + <!-- ENDIF --> + + <br clear="all" /> + <table width="100%" cellspacing="1"> + <tr> + <td align="right"><!-- INCLUDE jumpbox.html --></td> + </tr> + </table> -<!-- INCLUDE overall_footer.html -->
\ No newline at end of file + <!-- INCLUDE overall_footer.html --> +<!-- ENDIF -->
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/posting_progress_bar.html b/phpBB/styles/subSilver/template/posting_progress_bar.html new file mode 100644 index 0000000000..607ff15b35 --- /dev/null +++ b/phpBB/styles/subSilver/template/posting_progress_bar.html @@ -0,0 +1,43 @@ +<script language="javascript" type="text/javascript"> +<!-- + function close_popup() + { + if (opener != null) + { + if (opener.close_waitscreen != null) + { + if (opener.close_waitscreen == 1) + { + opener.close_waitscreen = 0; + self.close(); + return 0; + } + } + } + setTimeout("close_popup()", 1000); + return 0; + } +//--> +</script> + +<!-- INCLUDE simple_header.html --> + +<table width="100%" border="0" cellspacing="0" cellpadding="10"> +<tr> + <td> + <table width="100%" border="0" cellspacing="1" cellpadding="4"> + <tr> + <td valign="top" class="row1" align="center"><br /><span class="gen">{L_UPLOAD_IN_PROGRESS}</span><br /><br /><img src="./images/upload.gif" width="280" height="16" align="center" /><br /><br /><span class="genmed"><a href="javascript:window.close();">{L_CLOSE_WINDOW}</a></span><br /><br /></td> + </tr> + </table> + </td> +</tr> +</table> + +<!-- INCLUDE simple_footer.html --> + +<script language="javascript" type="text/javascript"> +<!-- + close_popup(); +//--> +</script> diff --git a/phpBB/styles/subSilver/template/report_body.html b/phpBB/styles/subSilver/template/report_body.html index 40b4a5f56a..0df62ad1fe 100644 --- a/phpBB/styles/subSilver/template/report_body.html +++ b/phpBB/styles/subSilver/template/report_body.html @@ -2,6 +2,7 @@ <!-- $Id$ --> +<form method="post" action="{S_REPORT_ACTION}" name="report"> <table class="tablebg" width="100%" cellspacing="1"> <tr> <th colspan="2">{L_REPORT_POST}</th> @@ -27,6 +28,7 @@ <td class="cat" colspan="2" align="center"><input type="submit" name="submit" class="btnmain" value="{L_SUBMIT}" /> <input type="submit" name="cancel" class="btnlite" value="{L_CANCEL}"></td> </tr> </table> +</form> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/ucp_attachments.html b/phpBB/styles/subSilver/template/ucp_attachments.html index ab98fba832..c6d42d8bfa 100644 --- a/phpBB/styles/subSilver/template/ucp_attachments.html +++ b/phpBB/styles/subSilver/template/ucp_attachments.html @@ -41,12 +41,7 @@ <!-- END attachrow --> <tr> - <td class="cat" colspan="6"><table width="100%" cellspacing="0" cellpadding="0" border="0"> - <tr> - <td width="100%" align="center"><span class="gensmall">{L_SORT_BY}: </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select> <input class="btnlite" type="submit" name="sort" value="{L_SORT}" /></td> - <td align="right"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" /> </td> - </tr> - </table></td> + <td class="cat" colspan="6"><div style="float:left"><span class="gensmall">{L_SORT_BY}: </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select> <input class="btnlite" type="submit" name="sort" value="{L_SORT}" /></div><div style="float:right"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" /> </div></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/ucp_main_drafts.html b/phpBB/styles/subSilver/template/ucp_main_drafts.html index 579f737d5a..3d844bf2fb 100644 --- a/phpBB/styles/subSilver/template/ucp_main_drafts.html +++ b/phpBB/styles/subSilver/template/ucp_main_drafts.html @@ -32,7 +32,12 @@ <!-- IF draftrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td class="postdetails" style="padding: 4px;">{draftrow.DATE}</td> - <td style="padding: 4px;"><b class="gen">{draftrow.DRAFT_SUBJECT}</b><!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span><!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span><!-- ELSE --><br /><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF --></td> + <td style="padding: 4px;"><b class="gen">{draftrow.DRAFT_SUBJECT}</b> + <!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> + <!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> + <!-- ELSEIF draftrow.S_LINK_PM --><br /><span class="gensmall">{L_PRIVATE_MESSAGE}</span> + <!-- ELSE --><br /><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF --> + </td> <td style="padding: 4px;" align="center"><span class="gen"><!-- IF draftrow.U_INSERT --><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a><br /><!-- ENDIF --><a href="{draftrow.U_VIEW_EDIT}">{L_VIEW_EDIT}</a></td> <td style="padding: 4px;" align="center"><input type="checkbox" name="d[{draftrow.DRAFT_ID}]" /></td> </tr> diff --git a/phpBB/styles/subSilver/template/ucp_pm_body.html b/phpBB/styles/subSilver/template/ucp_pm_body.html deleted file mode 100644 index 4644bdb768..0000000000 --- a/phpBB/styles/subSilver/template/ucp_pm_body.html +++ /dev/null @@ -1,120 +0,0 @@ - -<script language="Javascript" type="text/javascript"> - // - // Should really check the browser to stop this whining ... - // - function select_switch(status) - { - for (i = 0; i < document.privmsg_list.length; i++) - { - document.privmsg_list.elements[i].checked = status; - } - } -</script> - -<table border="0" cellspacing="0" cellpadding="0" align="center" width="100%"> - <tr> - <td valign="top" align="center" width="100%"> - <table height="40" cellspacing="2" cellpadding="2" border="0"> - <tr valign="middle"> - <td>{INBOX_IMG}</td> - <td><span class="cattitle">{INBOX} </span></td> - <td>{SENTBOX_IMG}</td> - <td><span class="cattitle">{SENTBOX} </span></td> - <td>{OUTBOX_IMG}</td> - <td><span class="cattitle">{OUTBOX} </span></td> - <td>{SAVEBOX_IMG}</td> - <td><span class="cattitle">{SAVEBOX} </span></td> - </tr> - </table> - </td> - <td align="right"> - <!-- BEGIN switch_box_size_notice --> - <table width="175" cellspacing="1" cellpadding="2" border="0" class="bodyline"> - <tr> - <td colspan="3" width="100%" class="row1" nowrap="nowrap"><span class="gensmall">{BOX_SIZE_STATUS}</span></td> - </tr> - <tr> - <td colspan="3" width="100%" class="row2"> - <table cellspacing="0" cellpadding="1" border="0"> - <tr> - <td bgcolor="{T_TD_COLOR2}"><img src="templates/subSilver/images/spacer.gif" width="{INBOX_LIMIT_IMG_WIDTH}" height="8" alt="{INBOX_LIMIT_PERCENT}" /></td> - </tr> - </table> - </td> - </tr> - <tr> - <td width="33%" class="row1"><span class="gensmall">0%</span></td> - <td width="34%" align="center" class="row1"><span class="gensmall">50%</span></td> - <td width="33%" align="right" class="row1"><span class="gensmall">100%</span></td> - </tr> - </table> - <!-- END switch_box_size_notice --> - </td> - </tr> -</table> - -<br clear="all" /> - -<form method="post" name="privmsg_list" action="{S_PRIVMSGS_ACTION}"> - <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> - <tr> - <td align="left" valign="middle">{POST_PM_IMG}</td> - <td align="left" width="100%"> <span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td> - <td align="right" nowrap="nowrap"><span class="gensmall">{L_DISPLAY_MESSAGES}: - <select name="msgdays">{S_SELECT_MSG_DAYS} - </select> - <input type="submit" value="{L_GO}" name="submit_msgdays" class="btnlite" /> - </span></td> - </tr> - </table> - - <table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline"> - <tr> - <th width="5%" height="25" class="thCornerL" nowrap="nowrap"> {L_FLAG} </th> - <th width="55%" class="thTop" nowrap="nowrap"> {L_SUBJECT} </th> - <th width="20%" class="thTop" nowrap="nowrap"> {L_FROM_OR_TO} </th> - <th width="15%" class="thTop" nowrap="nowrap"> {L_DATE} </th> - <th width="5%" class="thCornerR" nowrap="nowrap"> {L_MARK} </th> - </tr> - <!-- BEGIN listrow --> - <tr> - <td class="{listrow.ROW_CLASS}" width="5%" align="center" valign="middle"><img src="{listrow.PRIVMSG_FOLDER_IMG}" width="19" height="18" alt="{listrow.L_PRIVMSG_FOLDER_ALT}" title="{listrow.L_PRIVMSG_FOLDER_ALT}" /></td> - <td width="55%" valign="middle" class="{listrow.ROW_CLASS}"><span class="topictitle"> <a href="{listrow.U_READ}" class="topictitle">{listrow.SUBJECT}</a></span></td> - <td width="20%" valign="middle" align="center" class="{listrow.ROW_CLASS}"><span class="name"> <a href="{listrow.U_FROM_USER_PROFILE}" class="name">{listrow.FROM}</a></span></td> - <td width="15%" align="center" valign="middle" class="{listrow.ROW_CLASS}"><span class="postdetails">{listrow.DATE}</span></td> - <td width="5%" align="center" valign="middle" class="{listrow.ROW_CLASS}"><span class="postdetails"> - <input type="checkbox" name="mark[]2" value="{listrow.S_MARK_ID}" /> - </span></td> - </tr> - <!-- END listrow --> - <!-- BEGIN switch_no_messages --> - <tr> - <td class="row1" colspan="5" align="center" valign="middle"><span class="gen">{L_NO_MESSAGES}</span></td> - </tr> - <!-- END switch_no_messages --> - <tr> - <td class="catBottom" colspan="5" height="28" align="right"> {S_HIDDEN_FIELDS} - <input type="submit" name="save" value="{L_SAVE_MARKED}" class="btnmain" /> - - <input type="submit" name="delete" value="{L_DELETE_MARKED}" class="btnlite" /> - - <input type="submit" name="deleteall" value="{L_DELETE_ALL}" class="btnlite" /> - </td> - </tr> - </table> - - <table width="100%" cellspacing="2" border="0" align="center" cellpadding="2"> - <tr> - <td align="left" valign="middle"><span class="nav">{POST_PM_IMG}</span></td> - <td align="left" valign="middle" width="100%"><span class="nav">{PAGE_NUMBER}</span></td> - <td align="right" valign="top" nowrap="nowrap"><b><span class="gensmall"><a href="javascript:select_switch(true);" class="gensmall">{L_MARK_ALL}</a> :: <a href="javascript:select_switch(false);" class="gensmall">{L_UNMARK_ALL}</a></span></b><br /><span class="nav">{PAGINATION}<br /></span><span class="gensmall">{S_TIMEZONE}</span></td> - </tr> - </table> -</form> - -<table width="100%" border="0"> - <tr> - <td align="right" valign="top">{JUMPBOX}</td> - </tr> -</table> diff --git a/phpBB/styles/subSilver/template/ucp_pm_popup.html b/phpBB/styles/subSilver/template/ucp_pm_popup.html index e48205b338..08314acf87 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_popup.html +++ b/phpBB/styles/subSilver/template/ucp_pm_popup.html @@ -1,22 +1,25 @@ +<!-- INCLUDE simple_header.html --> <script language="javascript" type="text/javascript"> <!-- function jump_to_inbox() { - opener.document.location.href = "{U_PRIVATEMSGS}"; + opener.document.location.href = "{U_RETURN_INBOX}"; window.close(); } //--> </script> - <table width="100%" border="0" cellspacing="0" cellpadding="10"> - <tr> - <td> - <table width="100%" border="0" cellspacing="1" cellpadding="4" class="forumline"> - <tr> - <td valign="top" class="row1" align="center"><br /><span class="gen">{L_MESSAGE}</span><br /><br /><span class="genmed"><a href="javascript:window.close();" class="genmed">{L_CLOSE_WINDOW}</a></span><br /><br /></td> - </tr> +<table width="100%" border="0" cellspacing="0" cellpadding="10"> +<tr> + <td> + <table width="100%" border="0" cellspacing="1" cellpadding="4"> + <tr> + <td valign="top" class="row1" align="center"><br /><span class="gen">{MESSAGE}</span><br /><br /><span class="genmed"><a href="javascript:window.close();">{L_CLOSE_WINDOW}</a></span><br /><br /></td> + </tr> </table> - </td> - </tr> - </table> + </td> +</tr> +</table> + +<!-- INCLUDE simple_footer.html -->
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/ucp_pm_preview.html b/phpBB/styles/subSilver/template/ucp_pm_preview.html deleted file mode 100644 index ba2ed932fd..0000000000 --- a/phpBB/styles/subSilver/template/ucp_pm_preview.html +++ /dev/null @@ -1,27 +0,0 @@ - -<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline"> - <tr> - <th height="25" class="thHead" colspan="2">{L_PREVIEW}</th> - </tr> - <tr> - <td class="row2"><span class="genmed">{L_FROM}:</span></td> - <td width="100%" class="row2"><span class="genmed">{MESSAGE_FROM}</span></td> - </tr> - <tr> - <td class="row2"><span class="genmed">{L_TO}:</span></td> - <td width="100%" class="row2"><span class="genmed">{MESSAGE_TO}</span></td> - </tr> - <tr> - <td class="row2"><span class="genmed">{L_POSTED}:</span></td> - <td width="100%" class="row2"><span class="genmed">{POST_DATE}</span></td> - </tr> - <tr> - <td class="row2"><span class="genmed">{L_SUBJECT}:</span></td> - <td width="100%" class="row2"><span class="genmed">{POST_SUBJECT}</span></td> - </tr> - <tr> - <td valign="top" colspan="2" class="row1"><span class="postbody">{MESSAGE}</span></td> - </tr> -</table> - -<br clear="all" /> diff --git a/phpBB/styles/subSilver/template/ucp_pm_read.html b/phpBB/styles/subSilver/template/ucp_pm_read.html deleted file mode 100644 index e38019f738..0000000000 --- a/phpBB/styles/subSilver/template/ucp_pm_read.html +++ /dev/null @@ -1,86 +0,0 @@ - -<table cellspacing="2" cellpadding="2" border="0" align="center"> - <tr> - <td valign="middle">{INBOX_IMG}</td> - <td valign="middle"><span class="cattitle">{INBOX} </span></td> - <td valign="middle">{SENTBOX_IMG}</td> - <td valign="middle"><span class="cattitle">{SENTBOX} </span></td> - <td valign="middle">{OUTBOX_IMG}</td> - <td valign="middle"><span class="cattitle">{OUTBOX} </span></td> - <td valign="middle">{SAVEBOX_IMG}</td> - <td valign="middle"><span class="cattitle">{SAVEBOX}</span></td> - </tr> -</table> - -<br clear="all" /> - -<form method="post" action="{S_PRIVMSGS_ACTION}"> -<table width="100%" cellspacing="2" cellpadding="2" border="0"> - <tr> - <td valign="middle">{REPLY_PM_IMG}</td> - <td width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td> - </tr> -</table> - -<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline"> - <tr> - <th colspan="3" class="thHead" nowrap="nowrap">{BOX_NAME} :: {L_MESSAGE}</th> - </tr> - <tr> - <td class="row2"><span class="genmed">{L_FROM}:</span></td> - <td width="100%" class="row2" colspan="2"><span class="genmed">{MESSAGE_FROM}</span></td> - </tr> - <tr> - <td class="row2"><span class="genmed">{L_TO}:</span></td> - <td width="100%" class="row2" colspan="2"><span class="genmed">{MESSAGE_TO}</span></td> - </tr> - <tr> - <td class="row2"><span class="genmed">{L_POSTED}:</span></td> - <td width="100%" class="row2" colspan="2"><span class="genmed">{POST_DATE}</span></td> - </tr> - <tr> - <td class="row2"><span class="genmed">{L_SUBJECT}:</span></td> - <td width="100%" class="row2"><span class="genmed">{POST_SUBJECT}</span></td> - <td nowrap="nowrap" class="row2" align="right"> {QUOTE_PM_IMG} {EDIT_PM_IMG}</td> - </tr> - <tr> - <td valign="top" colspan="3" class="row1"><span class="postbody">{MESSAGE}</span></td> - </tr> - <tr> - <td width="78%" height="28" valign="bottom" colspan="3" class="row1"> - <table cellspacing="0" cellpadding="0" border="0" height="18"> - <tr> - <td valign="middle" nowrap="nowrap">{PROFILE_IMG} {PM_IMG} {EMAIL_IMG} - {WWW_IMG} {AIM_IMG} {YIM_IMG} {MSN_IMG}</td><td> </td><td valign="top" nowrap="nowrap"><script language="JavaScript" type="text/javascript"><!-- - - if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 ) - document.write('{ICQ_IMG}'); - else - document.write('<div style="position:relative"><div style="position:absolute">{ICQ_IMG}</div><div style="position:absolute;left:3px">{ICQ_STATUS_IMG}</div></div>'); - - //--></script><noscript>{ICQ_IMG}</noscript></td> - </tr> - </table> - </td> - </tr> - <tr> - <td class="catBottom" colspan="3" height="28" align="right"> {S_HIDDEN_FIELDS} - <input type="submit" name="save" value="{L_SAVE_MSG}" class="btnlite" /> - - <input type="submit" name="delete" value="{L_DELETE_MSG}" class="btnlite" /> - </td> - </tr> - </table> - <table width="100%" cellspacing="2" border="0" align="center" cellpadding="2"> - <tr> - <td>{REPLY_PM_IMG}</td> - <td align="right" valign="top"><span class="gensmall">{S_TIMEZONE}</span></td> - </tr> - </table> -</form> - -<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2"> - <tr> - <td valign="top" align="right"><span class="gensmall">{JUMPBOX}</span></td> - </tr> -</table> diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html index 63d896c1d5..84c05981b7 100644 --- a/phpBB/styles/subSilver/template/viewforum_body.html +++ b/phpBB/styles/subSilver/template/viewforum_body.html @@ -17,7 +17,7 @@ <!-- IF S_DISPLAY_ACTIVE --> <table class="tablebg" width="100%" cellspacing="1"> <tr> - <td class="cat" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><span class="nav">Active Topics</span></td> + <td class="cat" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><span class="nav">{L_ACTIVE_TOPICS}</span></td> </tr> <tr> diff --git a/phpBB/ucp.php b/phpBB/ucp.php index 0f6b72bff1..74d5956905 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -59,14 +59,14 @@ class module ORDER BY module_order ASC"; $result = $db->sql_query($sql); + $i = 0; while ($row = $db->sql_fetchrow($result)) { // Authorisation is required for the basic module if ($row['module_acl']) { $is_auth = false; - - eval('$is_auth = (' . preg_replace(array('#acl_([a-z_]+)#e', '#cfg_([a-z_]+)#e'), array('$auth->acl_get("\\1")', '$config["\\1"]'), $row['module_acl']) . ');'); + eval('$is_auth = (' . preg_replace(array('#acl_([a-z_]+)#e', '#cfg_([a-z_]+)#e'), array('(int) $auth->acl_get("\\1")', '(int) $config["\\1"]'), trim($row['module_acl'])) . ');'); // The user is not authorised to use this module, skip it if (!$is_auth) @@ -78,8 +78,9 @@ class module $selected = ($row['module_filename'] == $selected_mod || $row['module_id'] == $selected_mod || (!$selected_mod && !$i)) ? true : false; // Get the localised lang string if available, or make up our own otherwise + $module_lang = strtoupper($module_type) . '_' . $row['module_title']; $template->assign_block_vars($module_type . '_section', array( - 'L_TITLE' => (isset($user->lang[strtoupper($module_type) . '_' . $row['module_title']])) ? $user->lang[strtoupper($module_type) . '_' . $row['module_title']] : ucfirst(str_replace('_', ' ', strtolower($row['module_title']))), + 'L_TITLE' => (isset($user->lang[$module_lang])) ? $user->lang[$module_lang] : ucfirst(str_replace('_', ' ', strtolower($row['module_title']))), 'S_SELECTED' => $selected, 'U_TITLE' => $module_url . '&i=' . $row['module_id']) ); @@ -115,8 +116,10 @@ class module $selected = ($submodule_title == $selected_submod || (!$selected_submod && !$j)) ? true : false; // Get the localised lang string if available, or make up our own otherwise + $module_lang = strtoupper($module_type . '_' . $module_name . '_' . $submodule_title); + $template->assign_block_vars("{$module_type}_section.{$module_type}_subsection", array( - 'L_TITLE' => (isset($user->lang[strtoupper($module_type) . '_' . strtoupper($submodule_title)])) ? $user->lang[strtoupper($module_type) . '_' . strtoupper($submodule_title)] : ucfirst(str_replace('_', ' ', strtolower($submodule_title))), + 'L_TITLE' => (isset($user->lang[$module_lang])) ? $user->lang[$module_lang] : ucfirst(str_replace('_', ' ', strtolower($module_lang))), 'S_SELECTED' => $selected, 'U_TITLE' => $module_url . '&i=' . $module_id . '&mode=' . $submodule_title )); @@ -316,12 +319,40 @@ while ($row = $db->sql_fetchrow($result)) $template->assign_block_vars("friends_{$which}", array( 'U_PROFILE' => "memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'], - + + 'USER_ID' => $row['user_id'], 'USERNAME' => $row['username']) ); } $db->sql_freeresult($result); +// Output PM_TO box if message composing +if ($mode == 'compose' && $_REQUEST['action'] != 'edit') +{ + if ($config['allow_mass_pm']) + { + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE . ' + WHERE group_type NOT IN (' . GROUP_HIDDEN . ', ' . GROUP_CLOSED . ') + AND group_receive_pm = 1 + ORDER BY group_type DESC'; + $result = $db->sql_query($sql); + + $group_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="blue"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; + } + $db->sql_freeresult($result); + } + + $template->assign_vars(array( + 'S_SHOW_PM_BOX' => true, + 'S_ALLOW_MASS_PM' => ($config['allow_mass_pm']), + 'S_GROUP_OPTIONS' => ($config['allow_mass_pm']) ? $group_options : '', + 'U_SEARCH_USER' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=searchuser&form=post&field=username_list") + ); +} // Instantiate module system and generate list of available modules $ucp->create('ucp', "ucp.$phpEx$SID", $module, $mode); diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index afaabbef8e..6ceac6f126 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -200,8 +200,8 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views'); - $s_limit_days = $s_sort_key = $s_sort_dir = ''; - gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir); + $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; + gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); // Limit topics to certain time frame, obtain correct topic count if ($sort_days) @@ -241,7 +241,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) $post_alt = ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['FORUM_LOCKED'] : $user->lang['POST_NEW_TOPIC']; $template->assign_vars(array( - 'PAGINATION' => generate_pagination("viewforum.$phpEx$SID&f=$forum_id&st=$sort_days&sk=$sort_key&sd=$sort_dir", $topics_count, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination("viewforum.$phpEx$SID&f=$forum_id&$u_sort_param", $topics_count, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), 'TOTAL_TOPICS' => ($forum_data['forum_flags'] & 16) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)), 'MODERATORS' => (!empty($moderators[$forum_id])) ? implode(', ', $moderators[$forum_id]) : '', @@ -270,13 +270,13 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) 'S_SELECT_SORT_DAYS' => $s_limit_days, 'S_TOPIC_ICONS' => ($forum_data['forum_type'] == FORUM_CAT && $forum_data['forum_flags'] & 16) ? max($active_forum_ary['enable_icons']) : (($forum_data['enable_icons']) ? true : false), 'S_WATCH_FORUM' => $s_watching_forum, - 'S_FORUM_ACTION' => "viewforum.$phpExx$SIDx&f=$forum_id&start=$start", + 'S_FORUM_ACTION' => "viewforum.$phpEx$SID&f=$forum_id&start=$start", 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false, 'S_SEARCHBOX_ACTION' => "search.$phpEx$SID&f[]=$forum_id", 'U_MCP' => ($auth->acl_gets('m_', $forum_id)) ? "mcp.$phpEx?sid=$user->session_id&f=$forum_id&mode=forum_view" : '', 'U_POST_NEW_TOPIC' => "posting.$phpEx$SID&mode=post&f=$forum_id", - 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=$forum_id&sk=$sort_key&sd=$sort_dir&st=$sort_days&start=$start", + 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=$forum_id&$u_sort_param&start=$start", 'U_MARK_TOPICS' => "viewforum.$phpEx$SID&f=$forum_id&mark=topics") ); @@ -342,6 +342,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) // Obtain other topics // $sql_rownum = (SQL_LAYER != 'oracle') ? '' : ', ROWNUM rnum '; + $sql_rownum = ''; $sql_where = ($forum_data['forum_type'] == FORUM_POST) ? "= $forum_id" : 'IN (' . implode(', ', $active_forum_ary['forum_id']) . ')'; $sql = "SELECT t.* $sql_select$sql_rownum FROM $sql_from @@ -576,7 +577,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) } } - unset($rowset[$key]); + unset($rowset[$topic_id]); } } diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 9a899e75d5..4fd31b1786 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -553,7 +553,7 @@ if (!empty($poll_start)) (($poll_length != 0 && $poll_start + $poll_length > time()) || $poll_length == 0) && $topic_status != ITEM_LOCKED && $forum_status != ITEM_LOCKED) ? true : false; - $s_display_results = (!$s_can_vote || ($s_can_vote && $voted_id) || $view = 'viewpoll') ? true : false; + $s_display_results = (!$s_can_vote || ($s_can_vote && $voted_id) || $view == 'viewpoll') ? true : false; if ($update && $s_can_vote) { @@ -861,7 +861,6 @@ while ($row = $db->sql_fetchrow($result)) 'avatar' => '', 'profile' => "memberlist.$phpEx$SID&mode=viewprofile&u=$poster_id", - 'pm' => "ucp.$phpEx$SID&i=pm&action=send&u=$poster_id", 'www' => $row['user_website'], 'aim' => ($row['user_aim']) ? "memberlist.$phpEx$SID&mode=contact&action=aim&u=$poster_id" : '', 'msn' => ($row['user_msnm']) ? "memberlist.$phpEx$SID&mode=contact&action=msnm&u=$poster_id" : '', @@ -957,13 +956,14 @@ if (count($attach_list)) $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . ' - WHERE post_id IN (' . implode(', ', $attach_list) . ') - ORDER BY filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_id ASC'; + WHERE post_msg_id IN (' . implode(', ', $attach_list) . ') + AND in_message = 0 + ORDER BY filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $attachments[$row['post_id']][] = $row; + $attachments[$row['post_msg_id']][] = $row; } $db->sql_freeresult($result); @@ -979,11 +979,11 @@ if (count($attach_list)) if (count($rowset) != $total_posts) { // Not all posts are displayed so we query the db to find if there's any attachment for this topic - $sql = 'SELECT a.post_id + $sql = 'SELECT a.post_msg_id as post_id FROM ' . ATTACHMENTS_TABLE . ' a, ' . POSTS_TABLE . " p WHERE p.topic_id = $topic_id AND p.post_approved = 1 - AND p.post_id = a.post_id"; + AND p.topic_id = a.topic_id"; $result = $db->sql_query_limit($sql, 1); if (!$db->sql_fetchrow($result)) @@ -1240,7 +1240,7 @@ for ($i = 0; $i < count($post_list); ++$i) 'U_PROFILE' => $user_cache[$poster_id]['profile'], 'U_SEARCH' => $user_cache[$poster_id]['search'], - 'U_PM' => $user_cache[$poster_id]['pm'], + 'U_PM' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose&action=quote&q=1&p=" . $row['post_id'], 'U_EMAIL' => $user_cache[$poster_id]['email'], 'U_WWW' => $user_cache[$poster_id]['www'], 'U_ICQ' => $user_cache[$poster_id]['icq'], |