aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2018-01-07 11:02:31 +0100
committerMarc Alexander <admin@m-a-styles.de>2018-01-07 11:02:31 +0100
commit1b4bad6583ffa8a7ba8a1e7f5f9c29c5654bba99 (patch)
treed70037f3f547a71e4a6b87bcddb31aeb19db7328 /phpBB/viewtopic.php
parent3ae016954212e90032a10d1427c34a4ff9d9637c (diff)
parent182a96f2738316adcb292816a9ac8af0e0cb5866 (diff)
downloadforums-1b4bad6583ffa8a7ba8a1e7f5f9c29c5654bba99.tar
forums-1b4bad6583ffa8a7ba8a1e7f5f9c29c5654bba99.tar.gz
forums-1b4bad6583ffa8a7ba8a1e7f5f9c29c5654bba99.tar.bz2
forums-1b4bad6583ffa8a7ba8a1e7f5f9c29c5654bba99.tar.xz
forums-1b4bad6583ffa8a7ba8a1e7f5f9c29c5654bba99.zip
Merge remote-tracking branch 'upstream/3.2.x' into prep-release-3.2.2
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php48
1 files changed, 24 insertions, 24 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 9037918a20..38eba32374 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -32,7 +32,7 @@ $topic_id = $request->variable('t', 0);
$post_id = $request->variable('p', 0);
$voted_id = $request->variable('vote_id', array('' => 0));
-$voted_id = (sizeof($voted_id) > 1) ? array_unique($voted_id) : $voted_id;
+$voted_id = (count($voted_id) > 1) ? array_unique($voted_id) : $voted_id;
$start = $request->variable('start', 0);
@@ -740,7 +740,7 @@ $template->assign_vars(array(
'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total_posts),
'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=topic_view&amp;f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start") . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : ''), true, $user->session_id) : '',
- 'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]) : '',
+ 'MODERATORS' => (isset($forum_moderators[$forum_id]) && count($forum_moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]) : '',
'POST_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'FORUM_LOCKED') : $user->img('button_topic_new', 'POST_NEW_TOPIC'),
'QUOTE_IMG' => $user->img('icon_post_quote', 'REPLY_WITH_QUOTE'),
@@ -763,7 +763,7 @@ $template->assign_vars(array(
'S_SELECT_SORT_DIR' => $s_sort_dir,
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
- 'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true,
+ 'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && count($forum_moderators[$forum_id]) > 1) ? false : true,
'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start")),
'S_MOD_ACTION' => $s_quickmod_action,
@@ -856,9 +856,9 @@ if (!empty($topic_data['poll_start']))
(($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) &&
$topic_data['topic_status'] != ITEM_LOCKED &&
$topic_data['forum_status'] != ITEM_LOCKED &&
- (!sizeof($cur_voted_id) ||
+ (!count($cur_voted_id) ||
($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']))) ? true : false;
- $s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
+ $s_display_results = (!$s_can_vote || ($s_can_vote && count($cur_voted_id)) || $view == 'viewpoll') ? true : false;
/**
* Event to manipulate the poll data
@@ -893,16 +893,16 @@ if (!empty($topic_data['poll_start']))
if ($update && $s_can_vote)
{
- if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id) || !check_form_key('posting'))
+ if (!count($voted_id) || count($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id) || !check_form_key('posting'))
{
$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start"));
meta_refresh(5, $redirect_url);
- if (!sizeof($voted_id))
+ if (!count($voted_id))
{
$message = 'NO_VOTE_OPTION';
}
- else if (sizeof($voted_id) > $topic_data['poll_max_options'])
+ else if (count($voted_id) > $topic_data['poll_max_options'])
{
$message = 'TOO_MANY_VOTE_OPTIONS';
}
@@ -996,7 +996,7 @@ if (!empty($topic_data['poll_start']))
'user_votes' => array_flip($valid_user_votes),
'vote_counts' => $vote_counts,
'total_votes' => array_sum($vote_counts),
- 'can_vote' => !sizeof($valid_user_votes) || ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']),
+ 'can_vote' => !count($valid_user_votes) || ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']),
);
$json_response = new \phpbb\json_response();
$json_response->send($data);
@@ -1016,7 +1016,7 @@ if (!empty($topic_data['poll_start']))
$parse_flags = ($poll_info[0]['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
- for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
+ for ($i = 0, $size = count($poll_info); $i < $size; $i++)
{
$poll_info[$i]['poll_option_text'] = generate_text_for_display($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield'], $parse_flags, true);
}
@@ -1158,7 +1158,7 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
-if (!sizeof($post_list))
+if (!count($post_list))
{
if ($sort_days)
{
@@ -1482,7 +1482,7 @@ if ($config['load_cpf_viewtopic'])
}
// Generate online information for user
-if ($config['load_onlinetrack'] && sizeof($id_cache))
+if ($config['load_onlinetrack'] && count($id_cache))
{
$sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline
FROM ' . SESSIONS_TABLE . '
@@ -1500,7 +1500,7 @@ if ($config['load_onlinetrack'] && sizeof($id_cache))
unset($id_cache);
// Pull attachment data
-if (sizeof($attach_list))
+if (count($attach_list))
{
if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id))
{
@@ -1518,7 +1518,7 @@ if (sizeof($attach_list))
$db->sql_freeresult($result);
// No attachments exist, but post table thinks they do so go ahead and reset post_attach flags
- if (!sizeof($attachments))
+ if (!count($attachments))
{
$sql = 'UPDATE ' . POSTS_TABLE . '
SET post_attachment = 0
@@ -1526,7 +1526,7 @@ if (sizeof($attach_list))
$db->sql_query($sql);
// We need to update the topic indicator too if the complete topic is now without an attachment
- if (sizeof($rowset) != $total_posts)
+ if (count($rowset) != $total_posts)
{
// Not all posts are displayed so we query the db to find if there's any attachment for this topic
$sql = 'SELECT a.post_msg_id as post_id
@@ -1583,12 +1583,12 @@ $can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_li
// Get the list of permanently banned users
$permanently_banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false);
-$i_total = sizeof($rowset) - 1;
+$i_total = count($rowset) - 1;
$prev_post_id = '';
$template->assign_vars(array(
'S_HAS_ATTACHMENTS' => $topic_data['topic_attachment'],
- 'S_NUM_POSTS' => sizeof($post_list))
+ 'S_NUM_POSTS' => count($post_list))
);
/**
@@ -1633,7 +1633,7 @@ extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_data', comp
// Output the posts
$first_unread = $post_unread = false;
-for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
+for ($i = 0, $end = count($post_list); $i < $end; ++$i)
{
// A non-existing rowset only happens if there was no user present for the entered poster_id
// This could be a broken posts table.
@@ -1676,7 +1676,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
if (($row['post_edit_count'] && $config['display_last_edited']) || $row['post_edit_reason'])
{
// Get usernames for all following posts if not already stored
- if (!sizeof($post_edit_list) && ($row['post_edit_reason'] || ($row['post_edit_user'] && !isset($user_cache[$row['post_edit_user']]))))
+ if (!count($post_edit_list) && ($row['post_edit_reason'] || ($row['post_edit_user'] && !isset($user_cache[$row['post_edit_user']]))))
{
// Remove all post_ids already parsed (we do not have to check them)
$post_storage_list = (!$store_reverse) ? array_slice($post_list, $i) : array_slice(array_reverse($post_list), $i);
@@ -1740,7 +1740,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
if ($row['post_visibility'] == ITEM_DELETED && $row['post_delete_user'])
{
// Get usernames for all following posts if not already stored
- if (!sizeof($post_delete_list) && ($row['post_delete_reason'] || ($row['post_delete_user'] && !isset($user_cache[$row['post_delete_user']]))))
+ if (!count($post_delete_list) && ($row['post_delete_reason'] || ($row['post_delete_user'] && !isset($user_cache[$row['post_delete_user']]))))
{
// Remove all post_ids already parsed (we do not have to check them)
$post_storage_list = (!$store_reverse) ? array_slice($post_list, $i) : array_slice(array_reverse($post_list), $i);
@@ -1983,7 +1983,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_MULTIPLE_ATTACHMENTS' => !empty($attachments[$row['post_id']]) && count($attachments[$row['post_id']]) > 1,
'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,
@@ -1992,7 +1992,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'S_FRIEND' => ($row['friend']) ? true : false,
'S_UNREAD_POST' => $post_unread,
'S_FIRST_UNREAD' => $s_first_unread,
- 'S_CUSTOM_FIELDS' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
+ 'S_CUSTOM_FIELDS' => (isset($cp_row['row']) && count($cp_row['row'])) ? true : false,
'S_TOPIC_POSTER' => ($topic_data['topic_poster'] == $poster_id) ? true : false,
'S_IGNORE_POST' => ($row['foe']) ? true : false,
@@ -2048,7 +2048,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$i = $current_row_number;
- if (isset($cp_row['row']) && sizeof($cp_row['row']))
+ if (isset($cp_row['row']) && count($cp_row['row']))
{
$post_row = array_merge($post_row, $cp_row['row']);
}
@@ -2161,7 +2161,7 @@ if (isset($user->data['session_page']) && !$user->data['is_bot'] && (strpos($use
$db->sql_query($sql);
// Update the attachment download counts
- if (sizeof($update_count))
+ if (count($update_count))
{
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
SET download_count = download_count + 1