mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-20 08:31:32 +02:00
more fun with cookies
git-svn-id: file:///svn/phpbb/trunk@4054 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -35,8 +35,9 @@ function set_config($config_name, $config_value, $is_dynamic = FALSE)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->sql_query('DELETE FROM ' . CONFIG_TABLE . "
|
$sql = 'DELETE FROM ' . CONFIG_TABLE . "
|
||||||
WHERE config_name = '" . $config_name . "'");
|
WHERE config_name = '$config_name'";
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . CONFIG_TABLE . " (config_name, config_value)
|
$sql = 'INSERT INTO ' . CONFIG_TABLE . " (config_name, config_value)
|
||||||
VALUES ('$config_name', '" . $db->sql_escape($config_value) . "')";
|
VALUES ('$config_name', '" . $db->sql_escape($config_value) . "')";
|
||||||
|
@@ -55,8 +55,8 @@ function display_forums($root_data = '', $display_moderators = TRUE)
|
|||||||
$lastread_select = '';
|
$lastread_select = '';
|
||||||
$sql_lastread = '';
|
$sql_lastread = '';
|
||||||
|
|
||||||
$tracking_forums = (isset($_COOKIE[$config['cookie_name'] . '_f'])) ? unserialize($_COOKIE[$config['cookie_name'] . '_f']) : array();
|
$tracking_forums = (isset($_COOKIE[$config['cookie_name'] . '_f'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_f'])) : array();
|
||||||
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_t'])) ? unserialize($_COOKIE[$config['cookie_name'] . '_t']) : array();
|
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_t'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_t'])) : array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT f.* $lastread_select
|
$sql = "SELECT f.* $lastread_select
|
||||||
|
@@ -1173,7 +1173,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
|
|||||||
|
|
||||||
// Mark this topic as read and posted to.
|
// Mark this topic as read and posted to.
|
||||||
$mark_mode = ($mode == 'post' || $mode == 'reply' || $mode == 'quote') ? 'post' : 'topic';
|
$mark_mode = ($mode == 'post' || $mode == 'reply' || $mode == 'quote') ? 'post' : 'topic';
|
||||||
markread($mark_mode, $post_data['forum_id'], $post_data['topic_id'], $post_data['post_id']);
|
markread($mark_mode, $post_data['forum_id'], $post_data['topic_id'], $post_data['post_time']);
|
||||||
|
|
||||||
$db->sql_transaction('commit');
|
$db->sql_transaction('commit');
|
||||||
|
|
||||||
|
@@ -519,7 +519,7 @@ if ($forum_data['forum_type'] == FORUM_POST)
|
|||||||
|
|
||||||
if ($config['load_db_lastread'])
|
if ($config['load_db_lastread'])
|
||||||
{
|
{
|
||||||
if ($row['mark_time'] > $row['topic_last_post_time'] && !isset($update_forum))
|
if ($row['mark_time'] >= $row['topic_last_post_time'] && !isset($update_forum))
|
||||||
{
|
{
|
||||||
$update_forum = true;
|
$update_forum = true;
|
||||||
}
|
}
|
||||||
@@ -530,7 +530,7 @@ if ($forum_data['forum_type'] == FORUM_POST)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($tracking_topics[$topic_id] > $row['topic_last_post_time'] && !isset($update_forum))
|
if ($tracking_topics[$topic_id] >= $row['topic_last_post_time'] && !isset($update_forum))
|
||||||
{
|
{
|
||||||
$update_forum = true;
|
$update_forum = true;
|
||||||
}
|
}
|
||||||
@@ -549,7 +549,7 @@ if ($forum_data['forum_type'] == FORUM_POST)
|
|||||||
// after reading a topic
|
// after reading a topic
|
||||||
if ($user->data['user_id'] != ANONYMOUS && $update_forum)
|
if ($user->data['user_id'] != ANONYMOUS && $update_forum)
|
||||||
{
|
{
|
||||||
markread('mark', $forum_id);
|
markread('mark', $forum_id, false, time());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user