- 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
This commit is contained in:
Meik Sievertsen 2004-05-31 18:00:10 +00:00
parent 6aa42b69ab
commit 2c470e4b27
19 changed files with 158 additions and 45 deletions

View file

@ -123,7 +123,6 @@ $display_vars = array(
'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false), '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_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_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' => array('lang' => 'ALLOW_HTML', 'type' => 'radio:yes_no', 'explain' => false),
'allow_html_tags' => array('lang' => 'ALLOWED_TAGS', 'type' => 'text:30:255', 'explain' => true), '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), 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
@ -136,25 +135,27 @@ $display_vars = array(
'message' => array( 'message' => array(
'auth' => 'a_defaults', 'auth' => 'a_defaults',
'title' => 'MESSAGE_SETTINGS', 'title' => 'MESSAGE_SETTINGS',
'lang' => 'ucp',
'vars' => array( 'vars' => array(
'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'type' => 'text:4:4', 'explain' => true), '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), '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), '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), '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_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), 'auth_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), 'auth_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_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), '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), '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), // '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_report_pm' => array('lang' => 'ALLOW_REPORT_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_quote_pm' => array('lang' => 'AUTH_QUOTE_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' => 'PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false), 'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false),
'email_pm' => array('lang' => 'EMAIL_PM', 'type' => 'radio:yes_no', 'explain' => false), 'email_pm' => array('lang' => 'ALLOW_EMAIL_PM', 'type' => 'radio:yes_no', 'explain' => false),
'forward_pm' => array('lang' => 'FORWARD_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' => 'AUTH_IMG_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' => 'AUTH_FLASH_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) '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']); trigger_error($user->lang['NO_ADMIN']);
} }
if (isset($display_vars['lang']))
{
$user->add_lang($display_vars['lang']);
}
$new = $config; $new = $config;
$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', '') : $new; $cfg_array = (isset($_REQUEST['config'])) ? request_var('config', '') : $new;
@ -396,7 +402,7 @@ function full_folder_select($value)
{ {
global $user; global $user;
return '<option value="1"' . (($value == 1) ? ' selected="selected"' : '') . '>' . $user->lang['DELETE_OLD_MESSAGES'] . '</option><option value="2"' . (($value == 2) ? ' selected="selected"' : '') . '>' . $user->lang['HOLD_NEW_MESSAGES'] . '</option>'; return '<option value="1"' . (($value == 1) ? ' selected="selected"' : '') . '>' . $user->lang['DELETE_OLDEST_MESSAGES'] . '</option><option value="2"' . (($value == 2) ? ' selected="selected"' : '') . '>' . $user->lang['HOLD_NEW_MESSAGES'] . '</option>';
} }
function select_ip_check($value) function select_ip_check($value)

View file

@ -1463,7 +1463,7 @@ function delete_forum_content($forum_id)
$db->sql_query($sql . $sql_using . $sql_where); $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) foreach ($tables_ary as $table)
{ {
$db->sql_query("DELETE QUICK FROM $table WHERE forum_id = $forum_id"); $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); 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) foreach ($table_ary as $table)
{ {
$db->sql_query("DELETE FROM $table WHERE forum_id = $forum_id"); $db->sql_query("DELETE FROM $table WHERE forum_id = $forum_id");

View file

@ -913,7 +913,7 @@ function marklist(match, status)
// Update Custom Fields // Update Custom Fields
if (sizeof($cp_data)) if (sizeof($cp_data))
{ {
$sql = 'UPDATE ' . CUSTOM_PROFILE_DATA . ' $sql = 'UPDATE ' . PROFILE_DATA_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $cp_data) . " SET ' . $db->sql_build_array('UPDATE', $cp_data) . "
WHERE user_id = $user_id"; WHERE user_id = $user_id";
$db->sql_query($sql); $db->sql_query($sql);
@ -924,7 +924,7 @@ function marklist(match, status)
$db->return_on_error = true; $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->sql_query();
$db->return_on_error = false; $db->return_on_error = false;

View file

@ -128,6 +128,11 @@ define('PRIVMSGS_OUTBOX', -2);
define('PRIVMSGS_SENTBOX', -1); define('PRIVMSGS_SENTBOX', -1);
define('PRIVMSGS_INBOX', 0); 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 // Download Modes - Attachments
define('INLINE_LINK', 1); define('INLINE_LINK', 1);
define('PHYSICAL_LINK', 2); define('PHYSICAL_LINK', 2);
@ -167,7 +172,10 @@ define('BOTS_TABLE', $table_prefix.'bots');
define('CACHE_TABLE', $table_prefix.'cache'); define('CACHE_TABLE', $table_prefix.'cache');
define('CONFIG_TABLE', $table_prefix.'config'); define('CONFIG_TABLE', $table_prefix.'config');
define('CONFIRM_TABLE', $table_prefix.'confirm'); 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('DISALLOW_TABLE', $table_prefix.'disallow'); //
define('DRAFTS_TABLE', $table_prefix.'drafts'); define('DRAFTS_TABLE', $table_prefix.'drafts');
define('EXTENSIONS_TABLE', $table_prefix.'extensions'); define('EXTENSIONS_TABLE', $table_prefix.'extensions');

View file

@ -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); $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); unset($tracking);
} }
break; 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); $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); unset($tracking);
} }
@ -1645,6 +1645,7 @@ function page_header($page_title = '')
'U_SEARCH_SELF' => "{$phpbb_root_path}search.$phpEx$SID&amp;search_id=egosearch", 'U_SEARCH_SELF' => "{$phpbb_root_path}search.$phpEx$SID&amp;search_id=egosearch",
'U_SEARCH_NEW' => "{$phpbb_root_path}search.$phpEx$SID&amp;search_id=newposts", 'U_SEARCH_NEW' => "{$phpbb_root_path}search.$phpEx$SID&amp;search_id=newposts",
'U_SEARCH_UNANSWERED' => "{$phpbb_root_path}search.$phpEx$SID&amp;search_id=unanswered", 'U_SEARCH_UNANSWERED' => "{$phpbb_root_path}search.$phpEx$SID&amp;search_id=unanswered",
'U_DELETE_COOKIES' => "{$phpbb_root_path}ucp.$phpEx$SID&amp;mode=delete_cookies",
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
'S_USER_PM_POPUP' => $user->optionget('popuppm'), 'S_USER_PM_POPUP' => $user->optionget('popuppm'),

View file

@ -129,7 +129,12 @@ function display_forums($root_data = '', $display_moderators = TRUE)
// Include subforum topic/post counts in parent counts // Include subforum topic/post counts in parent counts
$forum_rows[$parent_id]['forum_topics'] += $row['forum_topics']; $forum_rows[$parent_id]['forum_topics'] += $row['forum_topics'];
// Do not list redirects in LINK Forums as Posts.
if ($row['forum_type'] != FORUM_LINK)
{
$forum_rows[$parent_id]['forum_posts'] += $row['forum_posts']; $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']) if (isset($forum_rows[$parent_id]) && $row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time'])
{ {

View file

@ -428,6 +428,13 @@ class queue
set_config('last_queue_run', time()); 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'])) if (!file_exists($this->cache_file) || (file_exists($this->cache_file . '.lock') && filemtime($this->cache_file) > time() - $config['queue_interval']))
{ {
return; return;
@ -1158,7 +1165,7 @@ function mail_encode($str, $encoding)
// define start delimimter, end delimiter and spacer // define start delimimter, end delimiter and spacer
$end = "?="; $end = "?=";
$start = "=?$this->encoding?B?"; $start = "=?$encoding?B?";
$spacer = "$end\r\n $start"; $spacer = "$end\r\n $start";
// determine length of encoded text within chunks and ensure length is even // determine length of encoded text within chunks and ensure length is even

View file

@ -31,7 +31,8 @@ class session
$this->page = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : $_ENV['REQUEST_URI']; $this->page = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : $_ENV['REQUEST_URI'];
// Generate Valid URL // 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('&amp;', '&', htmlspecialchars($this->page)));
$this->page = preg_replace('#^.*?([a-z]+?)\.' . $phpEx . '\?sid=[a-z0-9]*?(&.*)?$#i', '\1\2', $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']) : ''; $this->page .= (isset($_POST['f'])) ? 'f=' . intval($_POST['f']) : '';
@ -740,11 +741,14 @@ class user extends session
return; 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"; WHERE user_id = $user_id";
$result = $db->sql_query_limit($sql, 1); $result = $db->sql_query_limit($sql, 1);
$user->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row; $user->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row;
$db->sql_freeresult($result);
} }
function img($img, $alt = '', $width = false, $suffix = '') function img($img, $alt = '', $width = false, $suffix = '')

View file

@ -277,7 +277,7 @@ class ucp_profile extends module
// Update Custom Fields // Update Custom Fields
if (sizeof($cp_data)) if (sizeof($cp_data))
{ {
$sql = 'UPDATE ' . CUSTOM_PROFILE_DATA . ' $sql = 'UPDATE ' . PROFILE_DATA_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $cp_data) . ' SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
WHERE user_id = ' . $user->data['user_id']; WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql); $db->sql_query($sql);
@ -288,7 +288,7 @@ class ucp_profile extends module
$db->return_on_error = true; $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->sql_query($sql);
$db->return_on_error = false; $db->return_on_error = false;

View file

@ -200,7 +200,7 @@ class ucp_register extends module
if (sizeof($cp_data)) if (sizeof($cp_data))
{ {
$cp_data['user_id'] = (int) $user_id; $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); $db->sql_query($sql);
} }

View file

@ -606,10 +606,32 @@ $lang += array(
// Message Settings // Message Settings
$lang += array( $lang += array(
'MESSAGE_SETTINGS_EXPLAIN' => 'Here you can set all default settings for private messaging',
'BOXES_MAX' => 'Max private message folders', 'BOXES_MAX' => 'Max private message folders',
'BOXES_MAX_EXPLAIN' => 'By default users may create this many personal folders for private messages..', 'BOXES_MAX_EXPLAIN' => 'By default users may create this many personal folders for private messages..',
'BOXES_LIMIT' => 'Max private messages per box', '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.', '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 // Cookie settings

View file

@ -78,11 +78,13 @@ $lang += array(
'CLICK_VIEW_PRIVMSG' => 'Click %sHere%s to visit your Inbox', 'CLICK_VIEW_PRIVMSG' => 'Click %sHere%s to visit your Inbox',
'CONFIRM' => 'Confirm', 'CONFIRM' => 'Confirm',
'CONGRATULATIONS' => 'Congratulations to', 'CONGRATULATIONS' => 'Congratulations to',
'COOKIES_DELETED' => 'All Board Cookies successfully deleted.',
'CURRENT_TIME' => 'The time is %s', 'CURRENT_TIME' => 'The time is %s',
'DAY' => 'Day', 'DAY' => 'Day',
'DAYS' => 'Days', 'DAYS' => 'Days',
'DELETE' => 'Delete', 'DELETE' => 'Delete',
'DELETE_COOKIES' => 'Delete all board cookies',
'DELETE_MARKED' => 'Delete Marked', 'DELETE_MARKED' => 'Delete Marked',
'DESCENDING' => 'Descending', 'DESCENDING' => 'Descending',
'DISABLED' => 'Disabled', 'DISABLED' => 'Disabled',

View file

@ -100,6 +100,7 @@ $lang += array(
'DELETE_AVATAR' => 'Delete Image', 'DELETE_AVATAR' => 'Delete Image',
'DELETE_MARKED_PM' => 'Delete Marked Messages', 'DELETE_MARKED_PM' => 'Delete Marked Messages',
'DELETE_MARKED_PM_CONFIRM' => 'Are you sure you want to delete all 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_PM' => 'Delete PM',
'DELETE_RULE' => 'Delete Rule', 'DELETE_RULE' => 'Delete Rule',
'DELETE_RULE_CONFIRM' => 'Are you sure you want to delete this 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', 'FULL_FOLDER_OPTION_CHANGED'=> 'Full Folder Option changed successfully',
'HIDE_ONLINE' => 'Hide my online status', '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', 'IF_FOLDER_FULL' => 'If Folder Full',
'IMPORTANT_NEWS' => 'Important announcements', 'IMPORTANT_NEWS' => 'Important announcements',

View file

@ -910,7 +910,6 @@ switch ($mode)
$page_title = $user->lang['EDIT_POST']; $page_title = $user->lang['EDIT_POST'];
} }
// Build navigation links
$forum_data = array( $forum_data = array(
'parent_id' => $parent_id, 'parent_id' => $parent_id,
'forum_parents' => $forum_parents, 'forum_parents' => $forum_parents,
@ -923,10 +922,10 @@ $forum_data = array(
'forum_rules_link' => $forum_rules_link 'forum_rules_link' => $forum_rules_link
); );
// Generate Navigation Links // Build Navigation Links
generate_forum_nav($forum_data); generate_forum_nav($forum_data);
// Generate Forum Rules // Build Forum Rules
generate_forum_rules($forum_data); generate_forum_rules($forum_data);
$s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '<input type="hidden" name="topic_cur_post_id" value="' . $topic_last_post_id . '" />' : ''; $s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '<input type="hidden" name="topic_cur_post_id" value="' . $topic_last_post_id . '" />' : '';
@ -968,7 +967,6 @@ $template->assign_vars(array(
'U_PROGRESS_BAR' => "posting.$phpEx$SID&mode=popup", 'U_PROGRESS_BAR' => "posting.$phpEx$SID&mode=popup",
'S_PRIVMSGS' => false, 'S_PRIVMSGS' => false,
'S_FORUM_RULES' => false,
'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']), 'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']),
'S_DISPLAY_PREVIEW' => ($preview && !sizeof($error)), 'S_DISPLAY_PREVIEW' => ($preview && !sizeof($error)),
'S_EDIT_POST' => ($mode == 'edit'), 'S_EDIT_POST' => ($mode == 'edit'),

View file

@ -70,6 +70,7 @@
</tr> </tr>
<!-- END forumrow --> <!-- END forumrow -->
</table> </table>
<a class="gensmall" href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a><br />
<br clear="all" /> <br clear="all" />

View file

@ -24,7 +24,7 @@
#datebar { position: absolute; width: 95%; top: 145px; left: 2.5%; } #datebar { position: absolute; width: 95%; top: 145px; left: 2.5%; }
#findbar { width: 100%; margin: 0px; padding: 0px; border: 0px; } #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 { } #pageheader { }
#pagecontent { } #pagecontent { }
@ -141,8 +141,18 @@ select { color: black; background-color: white; font-family: Verdana, serif; fon
.syntaxkeyword { color: #007700; } .syntaxkeyword { color: #007700; }
.syntaxstring { color: #DD0000; } .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 OTHER
*/ */
img { border: 0px; } img { border: 0px; }
.blue { color: #006699; }

View file

@ -295,6 +295,30 @@ switch ($mode)
$message = $user->lang['LOGOUT_REDIRECT'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a> '); $message = $user->lang['LOGOUT_REDIRECT'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a> ');
trigger_error($message); trigger_error($message);
break; 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'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], "<a href=\"{$phpbb_root_path}index.$phpEx\">", '</a>');
trigger_error($message);
break;
} }

View file

@ -68,6 +68,12 @@ else
$sql_lastread = $lastread_select = ''; $sql_lastread = $lastread_select = '';
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); $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'] . '))'; $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_type = $user->lang['VIEW_TOPIC_MOVED'];
$topic_id = $row['topic_moved_id']; $topic_id = $row['topic_moved_id'];
$folder_img = 'folder'; $folder_img = 'folder_moved';
$folder_alt = 'Topic_Moved'; $folder_alt = 'Topic_Moved';
$newest_post_img = ''; $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) if ($user->data['user_id'] != ANONYMOUS)
{ {
$unread_topic = $new_votes = true; $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)) 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; $unread_topic = false;
@ -499,7 +506,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
$times = 1; $times = 1;
for($j = 0; $j < $replies + 1; $j += $config['posts_per_page']) for($j = 0; $j < $replies + 1; $j += $config['posts_per_page'])
{ {
$goto_page .= "<a href=\"viewtopic.$phpEx$SID&amp;f=" . $row['forum_id'] . "&amp;t=$topic_id&amp;start=$j\">$times</a>"; $goto_page .= "<a href=\"viewtopic.$phpEx$SID&amp;f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id&amp;start=$j\">$times</a>";
if ($times == 1 && $total_pages > 4) if ($times == 1 && $total_pages > 4)
{ {
$goto_page .= ' ... '; $goto_page .= ' ... ';
@ -520,7 +527,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
} }
// Generate all the URIs ... // Generate all the URIs ...
$view_topic_url = "viewtopic.$phpEx$SID&amp;f=" . $row['forum_id'] . "&amp;t=$topic_id"; $view_topic_url = "viewtopic.$phpEx$SID&amp;f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id";
$last_post_img = "<a href=\"$view_topic_url&amp;p=" . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'] . '">' . $user->img('icon_post_latest', 'VIEW_LATEST_POST') . '</a>'; $last_post_img = "<a href=\"$view_topic_url&amp;p=" . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'] . '">' . $user->img('icon_post_latest', 'VIEW_LATEST_POST') . '</a>';
@ -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 (($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); markread('topic', $forum_id, $topic_id);
} }

View file

@ -65,10 +65,18 @@ if ($view && !$post_id)
} }
else else
{ {
$tracking_topics = unserialize(request_var($config['cookie_name'] . '_track', array())); $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 = base_convert(max($tracking_topics[$forum_id]), 36, 10);
$sql_unread_time = max($sql_unread_time, $user->data['session_last_visit']); $sql_unread_time = max($sql_unread_time, $user->data['session_last_visit']);
} }
}
}
$sql = 'SELECT p.post_id $sql = 'SELECT p.post_id
FROM (' . POSTS_TABLE . " p FROM (' . POSTS_TABLE . " p
@ -198,11 +206,19 @@ if ($user->data['user_id'] != ANONYMOUS)
} }
else else
{ {
$tracking_topics = unserialize(request_var($config['cookie_name'] . '_track', array())); $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 = base_convert(max($tracking_topics[$forum_id]), 36, 10);
$topic_last_read = max($sql_unread_time, $user->data['session_last_visit']); $topic_last_read = max($topic_last_read, $user->data['session_last_visit']);
}
unset($tracking_topics); unset($tracking_topics);
} }
}
} }
else else
{ {
@ -535,7 +551,7 @@ if (!empty($poll_start))
if ($user->data['user_id'] == ANONYMOUS) 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() . " //, topic_last_post_time = ' . time() . "
@ -950,7 +966,7 @@ if (count($attach_list))
// Instantiate BBCode if need be // Instantiate BBCode if need be
if ($bbcode_bitfield) if ($bbcode_bitfield)
{ {
include($phpbb_root_path . 'includes/bbcode.'.$phpEx); include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$bbcode = new bbcode($bbcode_bitfield); $bbcode = new bbcode($bbcode_bitfield);
} }