From 2c470e4b27f4e5df4c996d6755ebbb1f7306d86a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 31 May 2004 18:00:10 +0000 Subject: [PATCH] - added delete cookies link - fixed global announcement links in viewforum - do not display redirects in link forums as posts in forum overview git-svn-id: file:///svn/phpbb/trunk@4904 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_board.php | 32 ++++++++++------- phpBB/adm/admin_forums.php | 4 +-- phpBB/adm/admin_users.php | 4 +-- phpBB/common.php | 10 +++++- phpBB/includes/functions.php | 5 +-- phpBB/includes/functions_display.php | 7 +++- phpBB/includes/functions_messenger.php | 9 ++++- phpBB/includes/session.php | 8 +++-- phpBB/includes/ucp/ucp_profile.php | 4 +-- phpBB/includes/ucp/ucp_register.php | 2 +- phpBB/language/en/admin.php | 22 ++++++++++++ phpBB/language/en/common.php | 2 ++ phpBB/language/en/ucp.php | 2 ++ phpBB/posting.php | 6 ++-- .../styles/subSilver/template/index_body.html | 1 + phpBB/styles/subSilver/theme/stylesheet.css | 12 ++++++- phpBB/ucp.php | 24 +++++++++++++ phpBB/viewforum.php | 15 +++++--- phpBB/viewtopic.php | 34 ++++++++++++++----- 19 files changed, 158 insertions(+), 45 deletions(-) diff --git a/phpBB/adm/admin_board.php b/phpBB/adm/admin_board.php index bf6884d3a7..f54ece61b7 100644 --- a/phpBB/adm/admin_board.php +++ b/phpBB/adm/admin_board.php @@ -123,7 +123,6 @@ $display_vars = array( 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false), 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'type' => 'radio:yes_no', 'explain' => false), 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), 'allow_html' => array('lang' => 'ALLOW_HTML', 'type' => 'radio:yes_no', 'explain' => false), 'allow_html_tags' => array('lang' => 'ALLOWED_TAGS', 'type' => 'text:30:255', 'explain' => true), 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false), @@ -136,25 +135,27 @@ $display_vars = array( 'message' => array( 'auth' => 'a_defaults', 'title' => 'MESSAGE_SETTINGS', + 'lang' => 'ucp', 'vars' => array( 'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'type' => 'text:4:4', 'explain' => true), 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'type' => 'text:4:4', 'explain' => true), 'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'type' => 'select', 'options' => 'full_folder_select(\'{VALUE}\')', 'explain' => true), 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'type' => 'text:3:3', 'explain' => true), 'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_html_pm' => array('lang' => 'ALLOW_HTML_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_download_pm' => array('lang' => 'AUTH_DOWNLOAD_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_html_pm' => array('lang' => 'ALLOW_HTML_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_download_pm' => array('lang' => 'ALLOW_DOWNLOAD_PM', 'type' => 'radio:yes_no', 'explain' => false), 'allow_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'type' => 'radio:yes_no', 'explain' => false), // 'enable_karma_pm' => array('lang' => 'ENABLE_KARMA_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_report_pm' => array('lang' => 'AUTH_REPORT_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_quote_pm' => array('lang' => 'AUTH_QUOTE_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'print_pm' => array('lang' => 'PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'email_pm' => array('lang' => 'EMAIL_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'forward_pm' => array('lang' => 'FORWARD_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_img_pm' => array('lang' => 'AUTH_IMG_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_flash_pm' => array('lang' => 'AUTH_FLASH_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_report_pm' => array('lang' => 'ALLOW_REPORT_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_quote_pm' => array('lang' => 'ALLOW_QUOTE_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'email_pm' => array('lang' => 'ALLOW_EMAIL_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'type' => 'radio:yes_no', 'explain' => false), 'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'type' => 'radio:yes_no', 'explain' => false) ) ), @@ -231,6 +232,11 @@ if (!$auth->acl_get($display_vars['auth'])) trigger_error($user->lang['NO_ADMIN']); } +if (isset($display_vars['lang'])) +{ + $user->add_lang($display_vars['lang']); +} + $new = $config; $cfg_array = (isset($_REQUEST['config'])) ? request_var('config', '') : $new; @@ -396,7 +402,7 @@ function full_folder_select($value) { global $user; - return ''; + return ''; } function select_ip_check($value) diff --git a/phpBB/adm/admin_forums.php b/phpBB/adm/admin_forums.php index 712c87ca45..2716e15584 100644 --- a/phpBB/adm/admin_forums.php +++ b/phpBB/adm/admin_forums.php @@ -1463,7 +1463,7 @@ function delete_forum_content($forum_id) $db->sql_query($sql . $sql_using . $sql_where); - $tables_ary = array('phpbb_forum_access', TOPICS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, ACL_GROUPS_TABLE, ACL_USERS_TABLE, MODERATOR_TABLE, LOG_TABLE); + $tables_ary = array(FORUMS_ACCESS_TABLE, TOPICS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, ACL_GROUPS_TABLE, ACL_USERS_TABLE, MODERATOR_TABLE, LOG_TABLE); foreach ($tables_ary as $table) { $db->sql_query("DELETE QUICK FROM $table WHERE forum_id = $forum_id"); @@ -1551,7 +1551,7 @@ function delete_forum_content($forum_id) } unset($ids, $id_list); - $table_ary = array('phpbb_forum_access', TOPICS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, ACL_GROUPS_TABLE, ACL_USERS_TABLE, MODERATOR_TABLE, LOG_TABLE); + $table_ary = array(FORUMS_ACCESS_TABLE, TOPICS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, ACL_GROUPS_TABLE, ACL_USERS_TABLE, MODERATOR_TABLE, LOG_TABLE); foreach ($table_ary as $table) { $db->sql_query("DELETE FROM $table WHERE forum_id = $forum_id"); diff --git a/phpBB/adm/admin_users.php b/phpBB/adm/admin_users.php index 67a6d68c7b..de8ff4fe30 100644 --- a/phpBB/adm/admin_users.php +++ b/phpBB/adm/admin_users.php @@ -913,7 +913,7 @@ function marklist(match, status) // Update Custom Fields if (sizeof($cp_data)) { - $sql = 'UPDATE ' . CUSTOM_PROFILE_DATA . ' + $sql = 'UPDATE ' . PROFILE_DATA_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $cp_data) . " WHERE user_id = $user_id"; $db->sql_query($sql); @@ -924,7 +924,7 @@ function marklist(match, status) $db->return_on_error = true; - $sql = 'INSERT INTO ' . 'phpbb_profile_fields_data' . ' ' . $db->sql_build_array('INSERT', $cp_data); + $sql = 'INSERT INTO ' . PROFILE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data); $db->sql_query(); $db->return_on_error = false; diff --git a/phpBB/common.php b/phpBB/common.php index 59a3d81b79..52638d2073 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -128,6 +128,11 @@ define('PRIVMSGS_OUTBOX', -2); define('PRIVMSGS_SENTBOX', -1); define('PRIVMSGS_INBOX', 0); +// Full Folder Actions +define('FULL_FOLDER_NONE', -3); +define('FULL_FOLDER_DELETE', -2); +define('FULL_FOLDER_HOLD', -1); + // Download Modes - Attachments define('INLINE_LINK', 1); define('PHYSICAL_LINK', 2); @@ -167,7 +172,10 @@ define('BOTS_TABLE', $table_prefix.'bots'); define('CACHE_TABLE', $table_prefix.'cache'); define('CONFIG_TABLE', $table_prefix.'config'); define('CONFIRM_TABLE', $table_prefix.'confirm'); -define('CUSTOM_PROFILE_DATA', $table_prefix.'profile_fields_data'); +define('PROFILE_FIELDS_TABLE', $table_prefix.'profile_fields'); +define('PROFILE_LANG_TABLE', $table_prefix.'profile_lang'); +define('PROFILE_DATA_TABLE', $table_prefix.'profile_fields_data'); +define('PROFILE_FIELDS_LANG_TABLE', $table_prefix.'profile_fields_lang'); define('DISALLOW_TABLE', $table_prefix.'disallow'); // define('DRAFTS_TABLE', $table_prefix.'drafts'); define('EXTENSIONS_TABLE', $table_prefix.'extensions'); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 9b399312c7..19d72bf919 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -660,7 +660,7 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) $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']); + $user->set_cookie('track', serialize($tracking), time() + 31536000); unset($tracking); } break; @@ -720,7 +720,7 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) { $tracking[$forum_id][base_convert($topic_id, 10, 36)] = 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']); + $user->set_cookie('track', serialize($tracking), time() + 31536000); } unset($tracking); } @@ -1645,6 +1645,7 @@ function page_header($page_title = '') 'U_SEARCH_SELF' => "{$phpbb_root_path}search.$phpEx$SID&search_id=egosearch", 'U_SEARCH_NEW' => "{$phpbb_root_path}search.$phpEx$SID&search_id=newposts", 'U_SEARCH_UNANSWERED' => "{$phpbb_root_path}search.$phpEx$SID&search_id=unanswered", + 'U_DELETE_COOKIES' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=delete_cookies", 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, 'S_USER_PM_POPUP' => $user->optionget('popuppm'), diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 1932e2d2df..6140bd500a 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -129,7 +129,12 @@ function display_forums($root_data = '', $display_moderators = TRUE) // Include subforum topic/post counts in parent counts $forum_rows[$parent_id]['forum_topics'] += $row['forum_topics']; - $forum_rows[$parent_id]['forum_posts'] += $row['forum_posts']; + + // Do not list redirects in LINK Forums as Posts. + if ($row['forum_type'] != FORUM_LINK) + { + $forum_rows[$parent_id]['forum_posts'] += $row['forum_posts']; + } if (isset($forum_rows[$parent_id]) && $row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time']) { diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index cf500b4f51..71c775864f 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -428,6 +428,13 @@ class queue set_config('last_queue_run', time()); + // Delete stale lock file + if (file_exists($this->cache_file . '.lock') && !file_exists($this->cache_file)) + { + @unlink($this->cache_file . '.lock'); + return; + } + if (!file_exists($this->cache_file) || (file_exists($this->cache_file . '.lock') && filemtime($this->cache_file) > time() - $config['queue_interval'])) { return; @@ -1158,7 +1165,7 @@ function mail_encode($str, $encoding) // define start delimimter, end delimiter and spacer $end = "?="; - $start = "=?$this->encoding?B?"; + $start = "=?$encoding?B?"; $spacer = "$end\r\n $start"; // determine length of encoded text within chunks and ensure length is even diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index aa7e02fc4f..4708cd0e1a 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -31,7 +31,8 @@ class session $this->page = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : $_ENV['REQUEST_URI']; // Generate Valid URL - $this->cur_page = preg_replace('#^.*?([a-z]+?)\.' . $phpEx . '\?sid=[a-z0-9]*?(&.*)?$#i', '\1.' . $phpEx . '?\2', htmlspecialchars($this->page)); + // TODO: need another one with sid for normal redirects + $this->cur_page = preg_replace('#^.*?([a-z]+?)\.' . $phpEx . '\?sid=[a-z0-9]*?(&.*)?$#i', '\1.' . $phpEx . '?\2', str_replace('&', '&', htmlspecialchars($this->page))); $this->page = preg_replace('#^.*?([a-z]+?)\.' . $phpEx . '\?sid=[a-z0-9]*?(&.*)?$#i', '\1\2', $this->page); $this->page .= (isset($_POST['f'])) ? 'f=' . intval($_POST['f']) : ''; @@ -740,11 +741,14 @@ class user extends session return; } - $sql = 'SELECT * FROM ' . CUSTOM_PROFILE_DATA . " + // TODO: think about adding this to the session code too? + // Grabbing all user specific options (all without the need of special complicate adding to the sql query) might be useful... + $sql = 'SELECT * FROM ' . PROFILE_DATA_TABLE . " WHERE user_id = $user_id"; $result = $db->sql_query_limit($sql, 1); $user->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row; + $db->sql_freeresult($result); } function img($img, $alt = '', $width = false, $suffix = '') diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 0ac721b1be..afa9acf81c 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -277,7 +277,7 @@ class ucp_profile extends module // Update Custom Fields if (sizeof($cp_data)) { - $sql = 'UPDATE ' . CUSTOM_PROFILE_DATA . ' + $sql = 'UPDATE ' . PROFILE_DATA_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $cp_data) . ' WHERE user_id = ' . $user->data['user_id']; $db->sql_query($sql); @@ -288,7 +288,7 @@ class ucp_profile extends module $db->return_on_error = true; - $sql = 'INSERT INTO ' . CUSTOM_PROFILE_DATA . ' ' . $db->sql_build_array('INSERT', $cp_data); + $sql = 'INSERT INTO ' . PROFILE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data); $db->sql_query($sql); $db->return_on_error = false; diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 70be8ffb8a..7b3f4477c5 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 ' . PROFILE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data)); $db->sql_query($sql); } diff --git a/phpBB/language/en/admin.php b/phpBB/language/en/admin.php index 2cde583ae4..d8b9ea56bd 100644 --- a/phpBB/language/en/admin.php +++ b/phpBB/language/en/admin.php @@ -606,10 +606,32 @@ $lang += array( // Message Settings $lang += array( + 'MESSAGE_SETTINGS_EXPLAIN' => 'Here you can set all default settings for private messaging', + '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.', + 'FULL_FOLDER_ACTION' => 'Full folder default action', + 'FULL_FOLDER_ACTION_EXPLAIN'=> 'Default Action to take if an users folder is full and if the users folder action set is not applicable. For the special folder "SENTBOX" the default action is always deleting old messages.', + 'HOLD_NEW_MESSAGES' => 'Hold new messages', + 'PM_EDIT_TIME' => 'Limit editing time', + 'PM_EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a private message not already delivered, zero equals infinity', + + 'ALLOW_MASS_PM' => 'Allow Mass PM\'s', + 'ALLOW_HTML_PM' => 'Allow HTML in private messages', + 'ALLOW_BBCODE_PM' => 'Allow BBCode in private messages', + 'ALLOW_SMILIES_PM' => 'Allow smilies in private messages', + 'ALLOW_DOWNLOAD_PM' => 'Allow downloading of attachments in private messages', + 'ALLOW_SIG_PM' => 'Allow signatures in private messages', + 'ALLOW_REPORT_PM' => 'Allow reporting of private messages', + 'ALLOW_FORWARD_PM' => 'Allow forwarding of private messages', + 'ALLOW_QUOTE_PM' => 'Allow quoting of private messages', + 'ALLOW_PRINT_PM' => 'Allow print view in private messaging', + 'ALLOW_EMAIL_PM' => 'Allow emailing private messages', + 'ALLOW_IMG_PM' => 'Allow use of IMG BBCode Tag', + 'ALLOW_FLASH_PM' => 'Allow use of FLASH BBCode Tag', + 'ENABLE_PM_ICONS' => 'Enable use of topic icons in private messages' ); // Cookie settings diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index d325db31ed..3eb4ad909e 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -78,11 +78,13 @@ $lang += array( 'CLICK_VIEW_PRIVMSG' => 'Click %sHere%s to visit your Inbox', 'CONFIRM' => 'Confirm', 'CONGRATULATIONS' => 'Congratulations to', + 'COOKIES_DELETED' => 'All Board Cookies successfully deleted.', 'CURRENT_TIME' => 'The time is %s', 'DAY' => 'Day', 'DAYS' => 'Days', 'DELETE' => 'Delete', + 'DELETE_COOKIES' => 'Delete all board cookies', 'DELETE_MARKED' => 'Delete Marked', 'DESCENDING' => 'Descending', 'DISABLED' => 'Disabled', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 56a76a64a9..365d7a4256 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -100,6 +100,7 @@ $lang += array( 'DELETE_AVATAR' => 'Delete Image', 'DELETE_MARKED_PM' => 'Delete Marked Messages', 'DELETE_MARKED_PM_CONFIRM' => 'Are you sure you want to delete all marked messages?', + 'DELETE_OLDEST_MESSAGES' => 'Delete Oldest Messages', 'DELETE_PM' => 'Delete PM', 'DELETE_RULE' => 'Delete Rule', 'DELETE_RULE_CONFIRM' => 'Are you sure you want to delete this rule?', @@ -136,6 +137,7 @@ $lang += array( 'FULL_FOLDER_OPTION_CHANGED'=> 'Full Folder Option changed successfully', 'HIDE_ONLINE' => 'Hide my online status', + 'HOLD_NEW_MESSAGES' => 'Do not accept new messages (New messages will be held back until enough space is available)', 'IF_FOLDER_FULL' => 'If Folder Full', 'IMPORTANT_NEWS' => 'Important announcements', diff --git a/phpBB/posting.php b/phpBB/posting.php index 725295f5bf..159e8a6fed 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -910,7 +910,6 @@ switch ($mode) $page_title = $user->lang['EDIT_POST']; } -// Build navigation links $forum_data = array( 'parent_id' => $parent_id, 'forum_parents' => $forum_parents, @@ -923,10 +922,10 @@ $forum_data = array( 'forum_rules_link' => $forum_rules_link ); -// Generate Navigation Links +// Build Navigation Links generate_forum_nav($forum_data); -// Generate Forum Rules +// Build Forum Rules generate_forum_rules($forum_data); $s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '' : ''; @@ -968,7 +967,6 @@ $template->assign_vars(array( 'U_PROGRESS_BAR' => "posting.$phpEx$SID&mode=popup", 'S_PRIVMSGS' => false, - 'S_FORUM_RULES' => false, 'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']), 'S_DISPLAY_PREVIEW' => ($preview && !sizeof($error)), 'S_EDIT_POST' => ($mode == 'edit'), diff --git a/phpBB/styles/subSilver/template/index_body.html b/phpBB/styles/subSilver/template/index_body.html index a32a1fab69..7b78daf63a 100644 --- a/phpBB/styles/subSilver/template/index_body.html +++ b/phpBB/styles/subSilver/template/index_body.html @@ -70,6 +70,7 @@ + {L_DELETE_COOKIES}

diff --git a/phpBB/styles/subSilver/theme/stylesheet.css b/phpBB/styles/subSilver/theme/stylesheet.css index 61a24258a7..ec71cb5342 100644 --- a/phpBB/styles/subSilver/theme/stylesheet.css +++ b/phpBB/styles/subSilver/theme/stylesheet.css @@ -24,7 +24,7 @@ #datebar { position: absolute; width: 95%; top: 145px; left: 2.5%; } #findbar { width: 100%; margin: 0px; padding: 0px; border: 0px; } -#forumrules { width: 100%; } +.forumrules { background-color: #ECECEC; border-width: 1px; border-style: solid; border-color: #A9B8C2; padding: 4px; font-weight: normal; font-size: 60%; font-family: Verdana, Arial, Helvetica, sans-serif; } #pageheader { } #pagecontent { } @@ -141,8 +141,18 @@ select { color: black; background-color: white; font-family: Verdana, serif; fon .syntaxkeyword { color: #007700; } .syntaxstring { color: #DD0000; } +/* + PM +*/ + +.pm_message_reported_colour { background-color: #FFFFFF; } +.pm_marked_colour { background-color: #000000; } +.pm_replied_colour { background-color: #A9B8C2; } +.pm_friend_colour { background-color: #007700; } +.pm_foe_colour { background-color: #DD0000; } /* OTHER */ img { border: 0px; } +.blue { color: #006699; } diff --git a/phpBB/ucp.php b/phpBB/ucp.php index 2b1e6e0a51..35063d6184 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -295,6 +295,30 @@ switch ($mode) $message = $user->lang['LOGOUT_REDIRECT'] . '

' . sprintf($user->lang['RETURN_PAGE'], '', ' '); trigger_error($message); break; + + case 'delete_cookies': + // Delete Cookies with dynamic names (do NOT delete poll cookies) + $set_time = time() - 31536000; + foreach ($_COOKIE as $cookie_name => $cookie_data) + { + $cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name); + if (!strstr($cookie_name, '_poll')) + { + $user->set_cookie($cookie_name, '', $set_time); + } + } + $user->set_cookie('track', '', $set_time); + $user->set_cookie('data', '', $set_time); + $user->set_cookie('sid', '', $set_time); + + // We destroy the session here, the user will be logged out nevertheless + $user->destroy(); + + meta_refresh(3, "{$phpbb_root_path}index.$phpEx"); + + $message = $user->lang['COOKIES_DELETED'] . '

' . sprintf($user->lang['RETURN_INDEX'], "", ''); + trigger_error($message); + break; } diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 24a9829920..cb38d98041 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -68,6 +68,12 @@ else $sql_lastread = $lastread_select = ''; $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); + + if (!isset($tracking_topics[$forum_id]) && $user->data['user_id'] != ANONYMOUS) + { + markread('mark', $forum_id); + redirect($user->cur_page); + } } $sql_from = ($sql_lastread) ? '((' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . ")) $sql_lastread)" : '(' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . '))'; @@ -412,7 +418,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) $topic_type = $user->lang['VIEW_TOPIC_MOVED']; $topic_id = $row['topic_moved_id']; - $folder_img = 'folder'; + $folder_img = 'folder_moved'; $folder_alt = 'Topic_Moved'; $newest_post_img = ''; } @@ -457,6 +463,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) if ($user->data['user_id'] != ANONYMOUS) { $unread_topic = $new_votes = true; + if ($mark_time_topic >= $row['topic_last_post_time'] || $mark_time_forum >= $row['topic_last_post_time'] || ($row['topic_last_post_time'] == $row['poll_last_vote'] && $replies)) { $unread_topic = false; @@ -499,7 +506,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) $times = 1; for($j = 0; $j < $replies + 1; $j += $config['posts_per_page']) { - $goto_page .= "$times"; + $goto_page .= "$times"; if ($times == 1 && $total_pages > 4) { $goto_page .= ' ... '; @@ -520,7 +527,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) } // Generate all the URIs ... - $view_topic_url = "viewtopic.$phpEx$SID&f=" . $row['forum_id'] . "&t=$topic_id"; + $view_topic_url = "viewtopic.$phpEx$SID&f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id"; $last_post_img = "' . $user->img('icon_post_latest', 'VIEW_LATEST_POST') . ''; @@ -592,7 +599,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) { if (($mark_time_topic && $row['topic_last_post_time'] > $mark_time_topic) || (!$mark_time_topic && $mark_time_forum && $row['topic_last_post_time'] > $mark_time_forum)) { - if (!$unread_topic && !empty($row['mark_time']) && $mark_time_topic) + if (isset($unread_topic) && !$unread_topic && !empty($row['mark_time']) && $mark_time_topic) { markread('topic', $forum_id, $topic_id); } diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 5224eda215..8a59d5e6b4 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -65,9 +65,17 @@ if ($view && !$post_id) } else { - $tracking_topics = unserialize(request_var($config['cookie_name'] . '_track', array())); - $sql_unread_time = base_convert(max($tracking_topics[$forum_id]), 36, 10); - $sql_unread_time = max($sql_unread_time, $user->data['session_last_visit']); + $sql_lastread = ''; + $sql_unread_time = 0; + if (isset($_COOKIE[$config['cookie_name'] . '_track'])) + { + $tracking_topics = unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])); + if (isset($tracking_topics[$forum_id])) + { + $sql_unread_time = base_convert(max($tracking_topics[$forum_id]), 36, 10); + $sql_unread_time = max($sql_unread_time, $user->data['session_last_visit']); + } + } } $sql = 'SELECT p.post_id @@ -198,10 +206,18 @@ if ($user->data['user_id'] != ANONYMOUS) } else { - $tracking_topics = unserialize(request_var($config['cookie_name'] . '_track', array())); - $topic_last_read = base_convert(max($tracking_topics[$forum_id]), 36, 10); - $topic_last_read = max($sql_unread_time, $user->data['session_last_visit']); - unset($tracking_topics); + $topic_last_read = 0; + if (isset($_COOKIE[$config['cookie_name'] . '_track'])) + { + $tracking_topics = unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])); + + if (isset($tracking_topics[$forum_id])) + { + $topic_last_read = base_convert(max($tracking_topics[$forum_id]), 36, 10); + $topic_last_read = max($topic_last_read, $user->data['session_last_visit']); + } + unset($tracking_topics); + } } } else @@ -535,7 +551,7 @@ if (!empty($poll_start)) if ($user->data['user_id'] == ANONYMOUS) { - setcookie($config['cookie_name'] . '_poll_' . $topic_id, implode(',', $voted_id), time() + 31536000, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']); + $user->set_cookie('poll_' . $topic_id, implode(',', $voted_id), time() + 31536000); } //, topic_last_post_time = ' . time() . " @@ -950,7 +966,7 @@ if (count($attach_list)) // Instantiate BBCode if need be if ($bbcode_bitfield) { - include($phpbb_root_path . 'includes/bbcode.'.$phpEx); + include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); $bbcode = new bbcode($bbcode_bitfield); }