From 6f4538c676ebd3b6e299a606a04f672698ebc487 Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 4 Jul 2012 10:34:09 -0500 Subject: [ticket/8323] Hide the Send PM link if users cannot receive the PM Updated memberlist/viewtopic to the new rules PHPBB3-8323 --- phpBB/viewtopic.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index b75f4aeccf..10ec6f4ee7 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -16,6 +16,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); include($phpbb_root_path . 'includes/bbcode.' . $phpEx); +include($phpbb_root_path . 'includes/functions_user.' . $phpEx); // Start session management $user->session_begin(); @@ -1108,6 +1109,7 @@ while ($row = $db->sql_fetchrow($result)) $id_cache[] = $poster_id; $user_cache[$poster_id] = array( + 'user_type' => $row['user_type'], 'joined' => $user->format_date($row['user_regdate']), 'posts' => $row['user_posts'], 'warnings' => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0, @@ -1315,6 +1317,13 @@ if ($bbcode_bitfield !== '') $bbcode = new bbcode(base64_encode($bbcode_bitfield)); } +// Get the list of users who can receive private messages +$can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm'); +$can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm']; + +// Get the list of banned users +$banned_users = phpbb_get_banned_user_ids(array_keys($user_cache)); + $i_total = sizeof($rowset) - 1; $prev_post_id = ''; @@ -1487,6 +1496,9 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) !$row['post_edit_locked'] ))); + // Can this user receive a Private Message? + $can_receive_pm = ($user_cache[$poster_id]['user_type'] <> USER_IGNORE && (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || ($user_cache[$poster_id]['allow_pm'] && in_array($poster_id, $can_receive_pm_list) && !in_array($poster_id, $banned_users))) ? true : false; + // $postrow = array( 'POST_AUTHOR_FULL' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_full'] : get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), @@ -1527,7 +1539,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_PROFILE' => $user_cache[$poster_id]['profile'], 'U_SEARCH' => $user_cache[$poster_id]['search'], - 'U_PM' => ($poster_id != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_cache[$poster_id]['allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $row['post_id']) : '', + 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && $can_receive_pm) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&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'], -- cgit v1.2.1 From 0f4956b280468e8890b1c84df41d7bb1eb2447c5 Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 4 Jul 2012 20:52:07 -0500 Subject: [ticket/8323] Do not allow sending PMs to Inactive users PHPBB3-8323 --- 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 10ec6f4ee7..49ed785ec7 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1497,7 +1497,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) ))); // Can this user receive a Private Message? - $can_receive_pm = ($user_cache[$poster_id]['user_type'] <> USER_IGNORE && (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || ($user_cache[$poster_id]['allow_pm'] && in_array($poster_id, $can_receive_pm_list) && !in_array($poster_id, $banned_users))) ? true : false; + $can_receive_pm = ($user_cache[$poster_id]['user_type'] <> USER_IGNORE && $user_cache[$poster_id]['user_type'] <> USER_INACTIVE && (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || ($user_cache[$poster_id]['allow_pm'] && in_array($poster_id, $can_receive_pm_list) && !in_array($poster_id, $banned_users))) ? true : false; // $postrow = array( -- cgit v1.2.1 From 362ba43f18c07c70855e72ebfaea222e04af1183 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 10 Jul 2012 09:58:10 -0500 Subject: [ticket/8323] Allow sending PMs to temporarily banned users Added an argument to the phpbb_get_banned_user_ids() function to allow specifying a banned end time (default true for current functionality, false for only permanent bans, timestamp to find banned until a specified time) PHPBB3-8323 --- phpBB/viewtopic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 49ed785ec7..362451fd83 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1321,8 +1321,8 @@ if ($bbcode_bitfield !== '') $can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm'); $can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm']; -// Get the list of banned users -$banned_users = phpbb_get_banned_user_ids(array_keys($user_cache)); +// Get the list of permanently banned users +$banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false); $i_total = sizeof($rowset) - 1; $prev_post_id = ''; -- cgit v1.2.1 From 07b9c1e2fdeeab5d394c0b166fb0a6488b049cd1 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 10 Jul 2012 10:05:39 -0500 Subject: [ticket/8323] Cleanup viewtopic code (not sure how this mess happened) PHPBB3-8323 --- 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 362451fd83..779e6a8fa7 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1497,7 +1497,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) ))); // Can this user receive a Private Message? - $can_receive_pm = ($user_cache[$poster_id]['user_type'] <> USER_IGNORE && $user_cache[$poster_id]['user_type'] <> USER_INACTIVE && (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || ($user_cache[$poster_id]['allow_pm'] && in_array($poster_id, $can_receive_pm_list) && !in_array($poster_id, $banned_users))) ? true : false; + $can_receive_pm = ($user_cache[$poster_id]['user_type'] <> USER_INACTIVE && (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || ($user_cache[$poster_id]['allow_pm'] && in_array($poster_id, $can_receive_pm_list) && !in_array($poster_id, $banned_users)))) ? true : false; // $postrow = array( -- cgit v1.2.1 From 33852e6251cf9eea29efde4aebdd64500b7e7c2b Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 10 Jul 2012 16:07:12 -0500 Subject: [ticket/8323] Correct PM notification settings (only notify those who can receive them) Also correcting the way it was setup for users to be able to receive PMs (do not allow administrators/moderators to send to banned, inactive, or non-standard users, that just doesn't make sense) PHPBB3-8323 --- phpBB/viewtopic.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 779e6a8fa7..e892689a1e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1322,7 +1322,7 @@ $can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm'); $can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm']; // Get the list of permanently banned users -$banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false); +$permanently_banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false); $i_total = sizeof($rowset) - 1; $prev_post_id = ''; @@ -1497,7 +1497,13 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) ))); // Can this user receive a Private Message? - $can_receive_pm = ($user_cache[$poster_id]['user_type'] <> USER_INACTIVE && (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || ($user_cache[$poster_id]['allow_pm'] && in_array($poster_id, $can_receive_pm_list) && !in_array($poster_id, $banned_users)))) ? true : false; + $can_receive_pm = ( + $user_cache[$poster_id]['user_type'] != USER_IGNORE && // They must be a "normal" user + $user_cache[$poster_id]['user_type'] != USER_INACTIVE && // They must not be deactivated by the administrator + in_array($poster_id, $can_receive_pm_list) && // They must be able to read PMs + !in_array($poster_id, $permanently_banned_users) && // They must not be permanently banned + (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm']) // They must allow users to contact via PM + ) ? true : false; // $postrow = array( -- cgit v1.2.1 From b25efd744db56f7565453caccf26630404db07c7 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 10 Jul 2012 17:41:27 -0500 Subject: [ticket/8323] Only disable administrative deactivated accounts from receiving PMs Allow other types of inactive accounts to receive PMs. Remove the banned PM error message and use the string saying they do not have permission (less translation) PHPBB3-8323 --- phpBB/viewtopic.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index e892689a1e..4306ca2f3f 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1109,7 +1109,9 @@ while ($row = $db->sql_fetchrow($result)) $id_cache[] = $poster_id; $user_cache[$poster_id] = array( - 'user_type' => $row['user_type'], + 'user_type' => $row['user_type'], + 'user_inactive_reason' => $row['user_inactive_reason'], + 'joined' => $user->format_date($row['user_regdate']), 'posts' => $row['user_posts'], 'warnings' => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0, @@ -1499,7 +1501,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) // Can this user receive a Private Message? $can_receive_pm = ( $user_cache[$poster_id]['user_type'] != USER_IGNORE && // They must be a "normal" user - $user_cache[$poster_id]['user_type'] != USER_INACTIVE && // They must not be deactivated by the administrator + ($user_cache[$poster_id]['user_type'] != USER_INACTIVE && $user_cache[$poster_id]['user_inactive_reason'] == INACTIVE_MANUAL) && // They must not be deactivated by the administrator in_array($poster_id, $can_receive_pm_list) && // They must be able to read PMs !in_array($poster_id, $permanently_banned_users) && // They must not be permanently banned (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm']) // They must allow users to contact via PM -- cgit v1.2.1 From 4ab07aa45ebdf568a252821edf0837e17f1d9f20 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 7 Dec 2012 18:51:06 -0600 Subject: [ticket/8323] Comments PHPBB3-8323 --- phpBB/viewtopic.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 90cb7e9567..f209f61442 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1553,12 +1553,21 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) // Can this user receive a Private Message? $can_receive_pm = ( - $user_cache[$poster_id]['user_type'] != USER_IGNORE && // They must be a "normal" user - ($user_cache[$poster_id]['user_type'] != USER_INACTIVE && $user_cache[$poster_id]['user_inactive_reason'] == INACTIVE_MANUAL) && // They must not be deactivated by the administrator - in_array($poster_id, $can_receive_pm_list) && // They must be able to read PMs - !in_array($poster_id, $permanently_banned_users) && // They must not be permanently banned - (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm']) // They must allow users to contact via PM - ) ? true : false; + // They must be a "normal" user + $user_cache[$poster_id]['user_type'] != USER_IGNORE && + + // They must not be deactivated by the administrator + ($user_cache[$poster_id]['user_type'] != USER_INACTIVE && $user_cache[$poster_id]['user_inactive_reason'] == INACTIVE_MANUAL) && + + // They must be able to read PMs + in_array($poster_id, $can_receive_pm_list) && + + // They must not be permanently banned + !in_array($poster_id, $permanently_banned_users) && + + // They must allow users to contact via PM + (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm']) + ); // $post_row = array( -- cgit v1.2.1 From 3384e87b6f1f6ba3532257585392a8b7e1034a18 Mon Sep 17 00:00:00 2001 From: PayBas Date: Sun, 6 Apr 2014 16:43:25 +0200 Subject: [ticket/12363] Mark winning (most votes) results bar PHPBB3-12363 --- phpBB/viewtopic.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 1a74ad3e38..422ca1d12f 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -864,6 +864,7 @@ if (!empty($topic_data['poll_start'])) $option_pct_txt = sprintf("%.1d%%", round($option_pct * 100)); $option_pct_rel = ($poll_most > 0) ? $poll_option['poll_option_total'] / $poll_most : 0; $option_pct_rel_txt = sprintf("%.1d%%", round($option_pct_rel * 100)); + $option_winner = ($poll_option['poll_option_total'] > 0 && $poll_option['poll_option_total'] == $poll_most) ? true : false; $template->assign_block_vars('poll_option', array( 'POLL_OPTION_ID' => $poll_option['poll_option_id'], @@ -874,6 +875,7 @@ if (!empty($topic_data['poll_start'])) 'POLL_OPTION_PCT' => round($option_pct * 100), 'POLL_OPTION_WIDTH' => round($option_pct * 250), 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false, + 'POLL_OPTION_WINNER' => $option_winner, )); } -- cgit v1.2.1 From b64c5f84abf64a040b5d81b1ab7a214676039c19 Mon Sep 17 00:00:00 2001 From: PayBas Date: Sun, 6 Apr 2014 22:18:52 +0200 Subject: [ticket/12363] changed _winner_ to _most-votes_ PHPBB3-12363 --- phpBB/viewtopic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 422ca1d12f..e7358d682d 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -864,7 +864,7 @@ if (!empty($topic_data['poll_start'])) $option_pct_txt = sprintf("%.1d%%", round($option_pct * 100)); $option_pct_rel = ($poll_most > 0) ? $poll_option['poll_option_total'] / $poll_most : 0; $option_pct_rel_txt = sprintf("%.1d%%", round($option_pct_rel * 100)); - $option_winner = ($poll_option['poll_option_total'] > 0 && $poll_option['poll_option_total'] == $poll_most) ? true : false; + $option_most_votes = ($poll_option['poll_option_total'] > 0 && $poll_option['poll_option_total'] == $poll_most) ? true : false; $template->assign_block_vars('poll_option', array( 'POLL_OPTION_ID' => $poll_option['poll_option_id'], @@ -875,7 +875,7 @@ if (!empty($topic_data['poll_start'])) 'POLL_OPTION_PCT' => round($option_pct * 100), 'POLL_OPTION_WIDTH' => round($option_pct * 250), 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false, - 'POLL_OPTION_WINNER' => $option_winner, + 'POLL_OPTION_MOST_VOTES' => $option_most_votes, )); } -- cgit v1.2.1 From 975c5655f0e9b65b7de3f2b832f1ef660a473832 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Tue, 15 Apr 2014 08:55:39 -0700 Subject: [ticket/12265] Define a loop for contact icons. PHPBB3-12265 --- phpBB/viewtopic.php | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 1a74ad3e38..5d7314635e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1586,6 +1586,14 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) !$row['post_edit_locked'] ))); + $u_pm = ''; + + if (($poster_id != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm') + && ($user_cache[$poster_id]['allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')))) + { + $u_pm = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $row['post_id']); + } + // $post_row = array( 'POST_AUTHOR_FULL' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_full'] : get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), @@ -1625,7 +1633,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '', 'U_SEARCH' => $user_cache[$poster_id]['search'], - 'U_PM' => ($poster_id != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_cache[$poster_id]['allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $row['post_id']) : '', + 'U_PM' => $u_pm, 'U_EMAIL' => $user_cache[$poster_id]['email'], 'U_JABBER' => $user_cache[$poster_id]['jabber'], @@ -1695,11 +1703,46 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) // Dump vars into template $template->assign_block_vars('postrow', $post_row); + $contact_fields = array( + array( + 'ID' => 'pm', + 'NAME' => $user->lang['PRIVATE_MESSAGES'], + 'U_CONTACT' => $u_pm, + ), + array( + 'ID' => 'email', + 'NAME' => $user->lang['SEND_EMAIL'], + 'U_CONTACT' => $user_cache[$poster_id]['email'], + ), + array( + 'ID' => 'jabber', + 'NAME' => $user->lang['JABBER'], + 'U_CONTACT' => $user_cache[$poster_id]['jabber'], + ), + ); + + foreach ($contact_fields as $field) + { + if ($field['U_CONTACT']) + { + $template->assign_block_vars('postrow.contact', $field); + } + } + if (!empty($cp_row['blockrow'])) { foreach ($cp_row['blockrow'] as $field_data) { $template->assign_block_vars('postrow.custom_fields', $field_data); + + if ($field_data['S_PROFILE_CONTACT']) + { + $template->assign_block_vars('postrow.contact', array( + 'ID' => $field_data['PROFILE_FIELD_IDENT'], + 'NAME' => $field_data['PROFILE_FIELD_NAME'], + 'U_CONTACT' => $field_data['PROFILE_FIELD_CONTACT'], + )); + } } } -- cgit v1.2.1 From 31e11d81e8de4a4f5ca5c91590681edab887f2aa Mon Sep 17 00:00:00 2001 From: n-aleha Date: Thu, 17 Apr 2014 01:47:18 +0300 Subject: [ticket/12406] Fix variable description of core.viewtopic_modify_page_title Variable page_title should be described as "Title of the viewtopic page". PHPBB3-12406 --- 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 ad7e8c29bc..25d79a2527 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1877,7 +1877,7 @@ $page_title = $topic_data['topic_title'] . ($start ? ' - ' . sprintf($user->lang * You can use this event to modify the page title of the viewtopic page * * @event core.viewtopic_modify_page_title -* @var string page_title Title of the index page +* @var string page_title Title of the viewtopic page * @var array topic_data Array with topic data * @var int forum_id Forum ID of the topic * @var int start Start offset used to calculate the page -- cgit v1.2.1 From c2dace762ec295c7a2d67758006b1fff56f1f573 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 20 Apr 2014 15:13:13 +0200 Subject: [ticket/12273] Fix long $vars lines for existing events PHPBB3-12273 --- phpBB/viewtopic.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index ad7e8c29bc..5be578423f 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1000,7 +1000,8 @@ $sql_ary = array( * @since 3.1-A1 * @change 3.1.0-a2 Added vars forum_id, topic_id, topic_data, post_list, sort_days, sort_key, sort_dir, start */ -$vars = array('forum_id', 'topic_id', 'topic_data', 'post_list', 'sort_days', 'sort_key', 'sort_dir', 'start', 'sql_ary'); +$vars = array('forum_id', 'topic_id', 'topic_data', 'post_list', 'sort_days'); +$vars = array_merge($vars, array('sort_key', 'sort_dir', 'start', 'sql_ary')); extract($phpbb_dispatcher->trigger_event('core.viewtopic_get_post_data', compact($vars))); $sql = $db->sql_build_query('SELECT', $sql_ary); @@ -1679,7 +1680,8 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @change 3.1.0-a3 Added vars start, current_row_number, end, attachments * @change 3.1.0-b3 Added topic_data array, total_posts */ - $vars = array('start', 'current_row_number', 'end', 'total_posts', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row', 'topic_data'); + $vars = array('start', 'current_row_number', 'end', 'total_posts', 'row', 'cp_row'); + $vars = array_merge($vars, array('attachments', 'user_poster_data', 'post_row', 'topic_data')); extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars))); $i = $current_row_number; @@ -1726,14 +1728,18 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @var int start Start item of this page * @var int current_row_number Number of the post on this page * @var int end Number of posts on this page + * @var int total_posts Total posts count * @var array row Array with original post and user data * @var array cp_row Custom profile field data of the poster * @var array attachments List of attachments * @var array user_poster_data Poster's data from user cache * @var array post_row Template block array of the post + * @var array topic_data Array with topic data * @since 3.1.0-a3 + * @change 3.1.0-b3 Added topic_data array, total_posts */ - $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); + $vars = array('start', 'current_row_number', 'end', 'total_posts', 'row', 'cp_row'); + $vars = array_merge($vars, array('attachments', 'user_poster_data', 'post_row', 'topic_data')); extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_row_after', compact($vars))); $i = $current_row_number; -- cgit v1.2.1 From 87899b0e140400e23341ea1286d50e330132be90 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 25 Apr 2014 11:46:44 +0200 Subject: [ticket/12273] Update existing events PHPBB3-12273 --- phpBB/viewtopic.php | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 5be578423f..0dbda7564f 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1000,8 +1000,17 @@ $sql_ary = array( * @since 3.1-A1 * @change 3.1.0-a2 Added vars forum_id, topic_id, topic_data, post_list, sort_days, sort_key, sort_dir, start */ -$vars = array('forum_id', 'topic_id', 'topic_data', 'post_list', 'sort_days'); -$vars = array_merge($vars, array('sort_key', 'sort_dir', 'start', 'sql_ary')); +$vars = array( + 'forum_id', + 'topic_id', + 'topic_data', + 'post_list', + 'sort_days', + 'sort_key', + 'sort_dir', + 'start', + 'sql_ary', +); extract($phpbb_dispatcher->trigger_event('core.viewtopic_get_post_data', compact($vars))); $sql = $db->sql_build_query('SELECT', $sql_ary); @@ -1680,8 +1689,18 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @change 3.1.0-a3 Added vars start, current_row_number, end, attachments * @change 3.1.0-b3 Added topic_data array, total_posts */ - $vars = array('start', 'current_row_number', 'end', 'total_posts', 'row', 'cp_row'); - $vars = array_merge($vars, array('attachments', 'user_poster_data', 'post_row', 'topic_data')); + $vars = array( + 'start', + 'current_row_number', + 'end', + 'total_posts', + 'row', + 'cp_row', + 'attachments', + 'user_poster_data', + 'post_row', + 'topic_data', + ); extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars))); $i = $current_row_number; @@ -1738,8 +1757,18 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @since 3.1.0-a3 * @change 3.1.0-b3 Added topic_data array, total_posts */ - $vars = array('start', 'current_row_number', 'end', 'total_posts', 'row', 'cp_row'); - $vars = array_merge($vars, array('attachments', 'user_poster_data', 'post_row', 'topic_data')); + $vars = array( + 'start', + 'current_row_number', + 'end', + 'total_posts', + 'row', + 'cp_row', + 'attachments', + 'user_poster_data', + 'post_row', + 'topic_data', + ); extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_row_after', compact($vars))); $i = $current_row_number; -- cgit v1.2.1 From 2ec9c08a2bce2cb83c68339d2d07039cabc44d68 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 11 Apr 2014 14:10:58 +0200 Subject: [ticket/12052] Use different visibility when post was edited ... and needs to be reapproved. PHPBB3-12052 --- phpBB/viewtopic.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 9dc965240f..87ba09f66b 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -266,7 +266,7 @@ if ($topic_data['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_appro if ($post_id) { // are we where we are supposed to be? - if ($topic_data['post_visibility'] == ITEM_UNAPPROVED && !$auth->acl_get('m_approve', $topic_data['forum_id'])) + if (($topic_data['post_visibility'] == ITEM_UNAPPROVED || $topic_data['post_visibility'] == ITEM_REAPPROVE) && !$auth->acl_get('m_approve', $topic_data['forum_id'])) { // If post_id was submitted, we try at least to display the topic as a last resort... if ($topic_id) @@ -1028,7 +1028,7 @@ while ($row = $db->sql_fetchrow($result)) { $attach_list[] = (int) $row['post_id']; - if ($row['post_visibility'] == ITEM_UNAPPROVED) + if ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) { $has_attachments = true; } @@ -1642,7 +1642,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, 'S_MULTIPLE_ATTACHMENTS' => !empty($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]) > 1, - 'S_POST_UNAPPROVED' => ($row['post_visibility'] == ITEM_UNAPPROVED) ? true : false, + 'S_POST_UNAPPROVED' => ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) ? true : false, 'S_POST_DELETED' => ($row['post_visibility'] == ITEM_DELETED) ? true : false, 'L_POST_DELETED_MESSAGE' => $l_deleted_message, 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false, -- cgit v1.2.1 From b32895308d13d5d9b0cd954fd8ce871a1fa073da Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 25 Apr 2014 12:15:44 +0200 Subject: [ticket/12273] Update since version to 3.1.0-a* style PHPBB3-12273 --- phpBB/viewtopic.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 0dbda7564f..76e20b8492 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -997,7 +997,7 @@ $sql_ary = array( * @var string sort_dir Direction the posts are sorted by * @var int start Pagination information * @var array sql_ary The SQL array to get the data of posts and posters -* @since 3.1-A1 +* @since 3.1.0-a1 * @change 3.1.0-a2 Added vars forum_id, topic_id, topic_data, post_list, sort_days, sort_key, sort_dir, start */ $vars = array( @@ -1083,7 +1083,7 @@ while ($row = $db->sql_fetchrow($result)) * @event core.viewtopic_post_rowset_data * @var array rowset_data Array with the rowset data for this post * @var array row Array with original user and post data - * @since 3.1-A1 + * @since 3.1.0-a1 */ $vars = array('rowset_data', 'row'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_rowset_data', compact($vars))); @@ -1139,7 +1139,7 @@ while ($row = $db->sql_fetchrow($result)) * @var array user_cache_data Array with the user's data * @var int poster_id Poster's user id * @var array row Array with original user and post data - * @since 3.1-A1 + * @since 3.1.0-a1 */ $vars = array('user_cache_data', 'poster_id', 'row'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_cache_guest_data', compact($vars))); @@ -1199,7 +1199,7 @@ while ($row = $db->sql_fetchrow($result)) * @var array user_cache_data Array with the user's data * @var int poster_id Poster's user id * @var array row Array with original user and post data - * @since 3.1-A1 + * @since 3.1.0-a1 */ $vars = array('user_cache_data', 'poster_id', 'row'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_cache_user_data', compact($vars))); @@ -1685,7 +1685,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @var array user_poster_data Poster's data from user cache * @var array post_row Template block array of the post * @var array topic_data Array with topic data - * @since 3.1-A1 + * @since 3.1.0-a1 * @change 3.1.0-a3 Added vars start, current_row_number, end, attachments * @change 3.1.0-b3 Added topic_data array, total_posts */ @@ -1916,7 +1916,7 @@ $page_title = $topic_data['topic_title'] . ($start ? ' - ' . sprintf($user->lang * @var array topic_data Array with topic data * @var int forum_id Forum ID of the topic * @var int start Start offset used to calculate the page -* @since 3.1-A1 +* @since 3.1.0-a1 */ $vars = array('page_title', 'topic_data', 'forum_id', 'start'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_page_title', compact($vars))); -- cgit v1.2.1 From a4a7fcb93df33c41d1d0faa51e3c322145e97b4e Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 2 May 2014 12:06:00 -0700 Subject: [ticket/12477] Fix logic to prevent admin-deactivated users from getting PM's. PHPBB3-12477 --- 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 0691355563..c46f30d038 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1609,7 +1609,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) $user_cache[$poster_id]['user_type'] != USER_IGNORE && // They must not be deactivated by the administrator - ($user_cache[$poster_id]['user_type'] != USER_INACTIVE && $user_cache[$poster_id]['user_inactive_reason'] == INACTIVE_MANUAL) && + ($user_cache[$poster_id]['user_type'] != USER_INACTIVE || $user_cache[$poster_id]['user_inactive_reason'] != INACTIVE_MANUAL) && // They must be able to read PMs in_array($poster_id, $can_receive_pm_list) && -- cgit v1.2.1 From 0684d9c6891c38c838b1f169d4a8af40d8e1c810 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 2 May 2014 12:17:24 -0700 Subject: [ticket/12477] Tab instead of spaces. PHPBB3-12477 --- 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 c46f30d038..7495e6baee 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1621,7 +1621,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm']) ); - $u_pm = ''; + $u_pm = ''; if ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && $can_receive_pm) { -- cgit v1.2.1 From 68f4e84e62774db985aa74e93ca7944ce2b890be Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 2 May 2014 14:22:16 -0700 Subject: [ticket/12482] Fixed undefined variable: data. PHPBB3-12482 --- 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 7495e6baee..1f59019245 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1618,7 +1618,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) !in_array($poster_id, $permanently_banned_users) && // They must allow users to contact via PM - (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm']) + (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $user_cache[$poster_id]['allow_pm']) ); $u_pm = ''; -- cgit v1.2.1 From 2c5a2a13902975183ccf43c949aa9bc943641f06 Mon Sep 17 00:00:00 2001 From: PayBas Date: Sat, 3 May 2014 23:07:30 +0200 Subject: [ticket/12488] Add user warning indication to viewtopic posts PHPBB3-12488 --- 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 1f59019245..789d7a2a19 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1641,7 +1641,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POSTER_JOINED' => $user_cache[$poster_id]['joined'], 'POSTER_POSTS' => $user_cache[$poster_id]['posts'], 'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'], - 'POSTER_WARNINGS' => $user_cache[$poster_id]['warnings'], + 'POSTER_WARNINGS' => ($auth->acl_get('m_warn') && $poster_id != ANONYMOUS) ? $user_cache[$poster_id]['warnings'] : '', 'POSTER_AGE' => $user_cache[$poster_id]['age'], 'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false), -- cgit v1.2.1 From 20022f0dc85442d2d54dc62e55dd561c2d086477 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 4 May 2014 16:15:50 +0200 Subject: [ticket/12494] Undefined index: user_type on viewtopic.php PHPBB3-12494 --- phpBB/viewtopic.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 1f59019245..84040af2bb 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1109,6 +1109,7 @@ while ($row = $db->sql_fetchrow($result)) if ($poster_id == ANONYMOUS) { $user_cache_data = array( + 'user_type' => USER_IGNORE, 'joined' => '', 'posts' => '', -- cgit v1.2.1 From cefeb7f752e59edc1c1a48f0e3563c2f090625b6 Mon Sep 17 00:00:00 2001 From: PayBas Date: Sun, 4 May 2014 22:07:03 +0200 Subject: [ticket/12488] Removed and removed anonymous check PHPBB3-12488 --- 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 789d7a2a19..34eee8bfc5 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1641,7 +1641,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POSTER_JOINED' => $user_cache[$poster_id]['joined'], 'POSTER_POSTS' => $user_cache[$poster_id]['posts'], 'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'], - 'POSTER_WARNINGS' => ($auth->acl_get('m_warn') && $poster_id != ANONYMOUS) ? $user_cache[$poster_id]['warnings'] : '', + 'POSTER_WARNINGS' => $auth->acl_get('m_warn' ? $user_cache[$poster_id]['warnings'] : '', 'POSTER_AGE' => $user_cache[$poster_id]['age'], 'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false), -- cgit v1.2.1 From 172fa9e7aa7e535e9141d3b132ea43e272ea3f29 Mon Sep 17 00:00:00 2001 From: PayBas Date: Sun, 4 May 2014 22:19:55 +0200 Subject: [ticket/12488] Typo fix PHPBB3-12488 --- 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 34eee8bfc5..2b340ca236 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1641,7 +1641,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POSTER_JOINED' => $user_cache[$poster_id]['joined'], 'POSTER_POSTS' => $user_cache[$poster_id]['posts'], 'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'], - 'POSTER_WARNINGS' => $auth->acl_get('m_warn' ? $user_cache[$poster_id]['warnings'] : '', + 'POSTER_WARNINGS' => $auth->acl_get('m_warn') ? $user_cache[$poster_id]['warnings'] : '', 'POSTER_AGE' => $user_cache[$poster_id]['age'], 'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false), -- cgit v1.2.1