From 773561f862e9cf4016a4176454e3fb59489259ac Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 11 Jul 2011 19:20:45 +0200 Subject: [ticket/10237] Handle watching and unwatching the same way. Also add some information to the confirm-box (forum_name / topic title) PHPBB3-10237 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 08e82591de..8b081b4aec 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -488,7 +488,7 @@ $s_watching_topic = array( if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify'] && $user->data['is_registered']) { - watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $topic_data['notify_status'], $start); + watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $topic_data['notify_status'], $start, $topic_data['topic_title']); // Reset forum notification if forum notify is set if ($config['allow_forum_notify'] && $auth->acl_get('f_subscribe', $forum_id)) -- cgit v1.2.1 From 91fd6df4308583c570dd7710d80a142a84c106aa Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 13 Jul 2011 00:01:37 +0200 Subject: [ticket/10243] Call phpbb_gmgetdate() from various places. PHPBB3-10243 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 08e82591de..3f73fe356a 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -995,7 +995,7 @@ $sql = $db->sql_build_query('SELECT', array( $result = $db->sql_query($sql); -$now = getdate(time() + $user->timezone + $user->dst - date('Z')); +$now = phpbb_gmgetdate(time() + $user->timezone + $user->dst); // Posts are stored in the $rowset array while $attach_list, $user_cache // and the global bbcode_bitfield are built -- cgit v1.2.1 From 0648923b19e450d44e02426e7a510efb831f78d1 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Mon, 9 May 2011 02:04:58 -0400 Subject: [ticket/10199] Delete a useless join in viewtopic. PHPBB3-10199 --- phpBB/viewtopic.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 2f3a4cf2e4..f1ab30aad3 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -196,7 +196,7 @@ if ($db->sql_layer === 'firebird') // The FROM-Order is quite important here, else t.* columns can not be correctly bound. if ($post_id) { - $sql_array['SELECT'] .= ', p.post_approved'; + $sql_array['SELECT'] .= ', p.post_approved, p.post_time'; $sql_array['FROM'][POSTS_TABLE] = 'p'; } @@ -314,12 +314,11 @@ if ($post_id) } else { - $sql = 'SELECT COUNT(p1.post_id) AS prev_posts - FROM ' . POSTS_TABLE . ' p1, ' . POSTS_TABLE . " p2 - WHERE p1.topic_id = {$topic_data['topic_id']} - AND p2.post_id = {$post_id} - " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p1.post_approved = 1' : '') . ' - AND ' . (($sort_dir == 'd') ? 'p1.post_time >= p2.post_time' : 'p1.post_time <= p2.post_time'); + $sql = 'SELECT COUNT(p.post_id) AS prev_posts + FROM ' . POSTS_TABLE . " p + WHERE p.topic_id = {$topic_data['topic_id']} + " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . ' + AND ' . (($sort_dir == 'd') ? "p.post_time >= {$topic_data['post_time']}" : "p.post_time <= {$topic_data['post_time']}"); $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); -- cgit v1.2.1 From bb7e8bb4244eece7dbbe2a81216b9da976f6c0e9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 8 Apr 2011 14:44:21 +0200 Subject: [ticket/9976] Fix link to post when two posts have the same post_time. When two posts have the same post_time, a link to the first post being on page 1, leads you to the second post with the same timestamp on page two. So in case the post_times are equal, we need to use the post_id to correctly order the posts. PHPBB3-9976 --- phpBB/viewtopic.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index f1ab30aad3..203b8586ce 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -196,7 +196,7 @@ if ($db->sql_layer === 'firebird') // The FROM-Order is quite important here, else t.* columns can not be correctly bound. if ($post_id) { - $sql_array['SELECT'] .= ', p.post_approved, p.post_time'; + $sql_array['SELECT'] .= ', p.post_approved, p.post_time, p.post_id'; $sql_array['FROM'][POSTS_TABLE] = 'p'; } @@ -317,8 +317,16 @@ if ($post_id) $sql = 'SELECT COUNT(p.post_id) AS prev_posts FROM ' . POSTS_TABLE . " p WHERE p.topic_id = {$topic_data['topic_id']} - " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . ' - AND ' . (($sort_dir == 'd') ? "p.post_time >= {$topic_data['post_time']}" : "p.post_time <= {$topic_data['post_time']}"); + " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : ''); + + if ($sort_dir == 'd') + { + $sql .= " AND (p.post_time > {$topic_data['post_time']} OR (p.post_time = {$topic_data['post_time']} AND p.post_id >= {$topic_data['post_id']}))"; + } + else + { + $sql .= " AND (p.post_time < {$topic_data['post_time']} OR (p.post_time = {$topic_data['post_time']} AND p.post_id <= {$topic_data['post_id']}))"; + } $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); -- cgit v1.2.1 From 1a19388aa38113262db648caedd4a745f5691ed1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 20 Jul 2011 00:55:49 +0200 Subject: [ticket/10237] Display login-box for guests, when (un)subscribing Also initialise $is_watching for PHP Notice: Undefined variable is_watching PHPBB3-10237 --- phpBB/viewtopic.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 8b081b4aec..bb88241481 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -486,9 +486,10 @@ $s_watching_topic = array( 'is_watching' => false, ); -if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify'] && $user->data['is_registered']) +if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify']) { - watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $topic_data['notify_status'], $start, $topic_data['topic_title']); + $notify_status = (isset($topic_data['notify_status'])) ? $topic_data['notify_status'] : null; + watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $notify_status, $start, $topic_data['topic_title']); // Reset forum notification if forum notify is set if ($config['allow_forum_notify'] && $auth->acl_get('f_subscribe', $forum_id)) -- cgit v1.2.1 From dfb7cc625a37c6345fa647ee3a21f890ba5c9649 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 8 Dec 2011 23:35:26 +0200 Subject: [ticket/10319] Missing hidden fields in search form Missing hidden fields in search form (bug added in 3.0.9) PHPBB3-10319 --- phpBB/viewtopic.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index df631a474c..01cd6a28a8 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -602,6 +602,15 @@ if ($_SID) $s_search_hidden_fields['sid'] = $_SID; } +if (!empty($_EXTRA_URL)) +{ + foreach ($_EXTRA_URL as $url_param) + { + $url_param = explode('=', $url_param, 2); + $s_hidden_fields[$url_param[0]] = $url_param[1]; + } +} + // Send vars to template $template->assign_vars(array( 'FORUM_ID' => $forum_id, -- cgit v1.2.1