Ignore:
Timestamp:
Mar 31, 2010, 6:32:40 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Aktualizace fóra.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/forum/viewtopic.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: viewtopic.php 9138 2008-11-30 16:53:36Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2929$voted_id       = request_var('vote_id', array('' => 0));
    3030
     31$voted_id = (sizeof($voted_id) > 1) ? array_unique($voted_id) : $voted_id;
     32
     33
    3134$start          = request_var('start', 0);
    3235$view           = request_var('view', '');
     
    4245$update         = request_var('update', false);
    4346
     47$s_can_vote = false;
    4448/**
    4549* @todo normalize?
     
    8387                                " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') . "
    8488                                AND post_time > $topic_last_read
     89                                AND forum_id = $forum_id
    8590                        ORDER BY post_time ASC";
    8691                $result = $db->sql_query_limit($sql, 1);
     
    182187);
    183188
     189// Firebird handles two columns of the same name a little differently, this
     190// addresses that by forcing the forum_id to come from the forums table.
     191if ($db->sql_layer === 'firebird')
     192{
     193        $sql_array['SELECT'] = 'f.forum_id AS forum_id, ' . $sql_array['SELECT'];
     194}
     195
    184196// The FROM-Order is quite important here, else t.* columns can not be correctly bound.
    185197if ($post_id)
    186198{
     199        $sql_array['SELECT'] .= ', p.post_approved';
    187200        $sql_array['FROM'][POSTS_TABLE] = 'p';
    188201}
     
    232245else
    233246{
    234         $sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id" . ((!$auth->acl_get('m_approve', $forum_id)) ? ' AND p.post_approved = 1' : '');
     247        $sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id";
    235248}
    236249
     
    260273$db->sql_freeresult($result);
    261274
     275// link to unapproved post or incorrect link
    262276if (!$topic_data)
    263277{
    264278        // If post_id was submitted, we try at least to display the topic as a last resort...
    265         if ($post_id && $forum_id && $topic_id)
    266         {
    267                 redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"));
     279        if ($post_id && $topic_id)
     280        {
     281                redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id" . (($forum_id) ? "&f=$forum_id" : '')));
    268282        }
    269283
     
    271285}
    272286
     287$forum_id = (int) $topic_data['forum_id'];
    273288// This is for determining where we are (page)
    274289if ($post_id)
    275290{
     291        // are we where we are supposed to be?
     292        if (!$topic_data['post_approved'] && !$auth->acl_get('m_approve', $topic_data['forum_id']))
     293        {
     294                // If post_id was submitted, we try at least to display the topic as a last resort...
     295                if ($topic_id)
     296                {
     297                        redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id" . (($forum_id) ? "&f=$forum_id" : '')));
     298                }
     299
     300                trigger_error('NO_TOPIC');
     301        }
    276302        if ($post_id == $topic_data['topic_first_post_id'] || $post_id == $topic_data['topic_last_post_id'])
    277303        {
     
    304330}
    305331
    306 $forum_id = (int) $topic_data['forum_id'];
    307332$topic_id = (int) $topic_data['topic_id'];
    308 
    309333//
    310334$topic_replies = ($auth->acl_get('m_approve', $forum_id)) ? $topic_data['topic_replies_real'] : $topic_data['topic_replies'];
     
    395419
    396420$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
    397 $sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.post_time', 's' => 'p.post_subject');
     421$sort_by_sql = array('a' => array('u.username_clean', 'p.post_id'), 't' => 'p.post_time', 's' => array('p.post_subject', 'p.post_id'));
     422$join_user_sql = array('a' => true, 't' => false, 's' => false);
    398423
    399424$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
     
    550575// Moderators
    551576$forum_moderators = array();
    552 get_moderators($forum_moderators, $forum_id);
     577if ($config['load_moderators'])
     578{
     579        get_moderators($forum_moderators, $forum_id);
     580}
    553581
    554582// This is only used for print view so ...
     
    598626        'WARN_IMG'                      => $user->img('icon_user_warn', 'WARN_USER'),
    599627
    600         'S_IS_LOCKED'                   =>($topic_data['topic_status'] == ITEM_UNLOCKED) ? false : true,
     628        'S_IS_LOCKED'                   => ($topic_data['topic_status'] == ITEM_UNLOCKED && $topic_data['forum_status'] == ITEM_UNLOCKED) ? false : true,
    601629        'S_SELECT_SORT_DIR'     => $s_sort_dir,
    602630        'S_SELECT_SORT_KEY'     => $s_sort_key,
     
    605633        'S_TOPIC_ACTION'                => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"),
    606634        'S_TOPIC_MOD'                   => ($topic_mod != '') ? '<select name="action" id="quick-mod-select">' . $topic_mod . '</select>' : '',
    607         'S_MOD_ACTION'                  => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;quickmod=1&amp;redirect=" . urlencode(str_replace('&amp;', '&', $viewtopic_url)), true, $user->session_id),
     635        'S_MOD_ACTION'                  => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start&amp;quickmod=1&amp;redirect=" . urlencode(str_replace('&amp;', '&', $viewtopic_url)), true, $user->session_id),
    608636
    609637        'S_VIEWTOPIC'                   => true,
     
    613641        'S_DISPLAY_POST_INFO'   => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
    614642        'S_DISPLAY_REPLY_INFO'  => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
     643        'S_ENABLE_FEEDS_TOPIC'  => ($config['feed_topic'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $topic_data['forum_options'])) ? true : false,
    615644
    616645        'U_TOPIC'                               => "{$server_path}viewtopic.$phpEx?f=$forum_id&amp;t=$topic_id",
     
    680709        }
    681710
    682         $s_can_vote = (((!sizeof($cur_voted_id) && $auth->acl_get('f_vote', $forum_id)) ||
    683                 ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change'])) &&
     711        // Can not vote at all if no vote permission
     712        $s_can_vote = ($auth->acl_get('f_vote', $forum_id) &&
    684713                (($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) &&
    685714                $topic_data['topic_status'] != ITEM_LOCKED &&
    686                 $topic_data['forum_status'] != ITEM_LOCKED) ? true : false;
     715                $topic_data['forum_status'] != ITEM_LOCKED &&
     716                (!sizeof($cur_voted_id) ||
     717                ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']))) ? true : false;
    687718        $s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
    688719
     
    690721        {
    691722
    692                 if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id))
     723                if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id) || !check_form_key('posting'))
    693724                {
    694725                        $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start");
     
    703734                                $message = 'TOO_MANY_VOTE_OPTIONS';
    704735                        }
     736                        else if (in_array(VOTE_CONVERTED, $cur_voted_id))
     737                        {
     738                                $message = 'VOTE_CONVERTED';
     739                        }
    705740                        else
    706741                        {
    707                                 $message = 'VOTE_CONVERTED';
     742                                $message = 'FORM_INVALID';
    708743                        }
    709744
     
    859894$store_reverse = false;
    860895$sql_limit = $config['posts_per_page'];
     896$sql_sort_order = $direction = '';
    861897
    862898if ($start > $total_posts / 2)
     
    870906
    871907        // Select the sort order
    872         $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
     908        $direction = (($sort_dir == 'd') ? 'ASC' : 'DESC');
    873909        $sql_start = max(0, $total_posts - $sql_limit - $start);
    874910}
     
    876912{
    877913        // Select the sort order
    878         $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
     914        $direction = (($sort_dir == 'd') ? 'DESC' : 'ASC');
    879915        $sql_start = $start;
     916}
     917
     918if (is_array($sort_by_sql[$sort_key]))
     919{
     920        $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
     921}
     922else
     923{
     924        $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
    880925}
    881926
     
    888933// Go ahead and pull all data for this topic
    889934$sql = 'SELECT p.post_id
    890         FROM ' . POSTS_TABLE . ' p' . (($sort_by_sql[$sort_key][0] == 'u') ? ', ' . USERS_TABLE . ' u': '') . "
     935        FROM ' . POSTS_TABLE . ' p' . (($join_user_sql[$sort_key]) ? ', ' . USERS_TABLE . ' u': '') . "
    891936        WHERE p.topic_id = $topic_id
    892937                " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . "
    893                 " . (($sort_by_sql[$sort_key][0] == 'u') ? 'AND u.user_id = p.poster_id': '') . "
     938                " . (($join_user_sql[$sort_key]) ? 'AND u.user_id = p.poster_id': '') . "
    894939                $limit_posts_time
    895940        ORDER BY $sql_sort_order";
     
    899944while ($row = $db->sql_fetchrow($result))
    900945{
    901         $post_list[$i] = $row['post_id'];
     946        $post_list[$i] = (int) $row['post_id'];
    902947        ($store_reverse) ? $i-- : $i++;
    903948}
     
    953998        }
    954999
    955         $poster_id = $row['poster_id'];
     1000        $poster_id = (int) $row['poster_id'];
    9561001
    9571002        // Does post have an attachment? If so, add it to the list
    9581003        if ($row['post_attachment'] && $config['allow_attachments'])
    9591004        {
    960                 $attach_list[] = $row['post_id'];
     1005                $attach_list[] = (int) $row['post_id'];
    9611006
    9621007                if ($row['post_approved'])
     
    10931138                                'jabber'                => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=jabber&amp;u=$poster_id") : '',
    10941139                                'search'                => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&amp;sr=posts") : '',
     1140
     1141                                'author_full'           => get_username_string('full', $poster_id, $row['username'], $row['user_colour']),
     1142                                'author_colour'         => get_username_string('colour', $poster_id, $row['username'], $row['user_colour']),
     1143                                'author_username'       => get_username_string('username', $poster_id, $row['username'], $row['user_colour']),
     1144                                'author_profile'        => get_username_string('profile', $poster_id, $row['username'], $row['user_colour']),
    10951145                        );
    10961146
     
    11441194if ($config['load_cpf_viewtopic'])
    11451195{
    1146         include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
     1196        if (!class_exists('custom_profile'))
     1197        {
     1198                include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
     1199        }
    11471200        $cp = new custom_profile();
    11481201
    11491202        // Grab all profile fields from users in id cache for later use - similar to the poster cache
    1150         $profile_fields_cache = $cp->generate_profile_fields_template('grab', $id_cache);
     1203        $profile_fields_tmp = $cp->generate_profile_fields_template('grab', $id_cache);
     1204
     1205        // filter out fields not to be displayed on viewtopic. Yes, it's a hack, but this shouldn't break any MODs.
     1206        $profile_fields_cache = array();
     1207        foreach ($profile_fields_tmp as $profile_user_id => $profile_fields)
     1208        {
     1209                $profile_fields_cache[$profile_user_id] = array();
     1210                foreach ($profile_fields as $used_ident => $profile_field)
     1211                {
     1212                        if ($profile_field['data']['field_show_on_vt'])
     1213                        {
     1214                                $profile_fields_cache[$profile_user_id][$used_ident] = $profile_field;
     1215                        }
     1216                }
     1217        }
     1218        unset($profile_fields_tmp);
    11511219}
    11521220
     
    13821450                // post and only the topic poster and last poster are allowed to bump.
    13831451                // Admins and mods are bound to the above rules too...
    1384                 $l_bumped_by = '<br /><br />' . sprintf($user->lang['BUMPED_BY'], $user_cache[$topic_data['topic_bumper']]['username'], $user->format_date($topic_data['topic_last_post_time']));
     1452                $l_bumped_by = sprintf($user->lang['BUMPED_BY'], $user_cache[$topic_data['topic_bumper']]['username'], $user->format_date($topic_data['topic_last_post_time'], false, true));
    13851453        }
    13861454        else
     
    14051473        }
    14061474
     1475        $edit_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_edit', $forum_id) || (
     1476                $user->data['user_id'] == $poster_id &&
     1477                $auth->acl_get('f_edit', $forum_id) &&
     1478                !$row['post_edit_locked'] &&
     1479                ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])
     1480        )));
     1481
     1482        $delete_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_delete', $forum_id) || (
     1483                $user->data['user_id'] == $poster_id &&
     1484                $auth->acl_get('f_delete', $forum_id) &&
     1485                $topic_data['topic_last_post_id'] == $row['post_id'] &&
     1486                ($row['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']) &&
     1487                // we do not want to allow removal of the last post if a moderator locked it!
     1488                !$row['post_edit_locked']
     1489        )));
     1490
    14071491        //
    14081492        $postrow = array(
    1409                 'POST_AUTHOR_FULL'              => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
    1410                 'POST_AUTHOR_COLOUR'    => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
    1411                 'POST_AUTHOR'                   => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
    1412                 'U_POST_AUTHOR'                 => get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
     1493                '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']),
     1494                'POST_AUTHOR_COLOUR'    => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_colour'] : get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
     1495                'POST_AUTHOR'                   => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_username'] : get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
     1496                'U_POST_AUTHOR'                 => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_profile'] : get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
    14131497
    14141498                'RANK_TITLE'            => $user_cache[$poster_id]['rank_title'],
     
    14221506                'POSTER_AGE'            => $user_cache[$poster_id]['age'],
    14231507
    1424                 'POST_DATE'                     => $user->format_date($row['post_time']),
     1508                'POST_DATE'                     => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false),
    14251509                'POST_SUBJECT'          => $row['post_subject'],
    14261510                'MESSAGE'                       => $message,
     
    14381522                'S_ONLINE'                              => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
    14391523
    1440                 'U_EDIT'                        => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
     1524                'U_EDIT'                        => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
    14411525                'U_QUOTE'                       => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
    14421526                'U_INFO'                        => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=post_details&amp;f=$forum_id&amp;p=" . $row['post_id'], true, $user->session_id) : '',
    1443                 'U_DELETE'                      => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && !$row['post_edit_locked'] && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
     1527                'U_DELETE'                      => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
    14441528
    14451529                'U_PROFILE'             => $user_cache[$poster_id]['profile'],
     
    15151599
    15161600// Update topic view and if necessary attachment view counters ... but only for humans and if this is the first 'page view'
    1517 if (isset($user->data['session_page']) && !$user->data['is_bot'] && strpos($user->data['session_page'], '&t=' . $topic_id) === false)
     1601if (isset($user->data['session_page']) && !$user->data['is_bot'] && (strpos($user->data['session_page'], '&t=' . $topic_id) === false || isset($user->data['session_created'])))
    15181602{
    15191603        $sql = 'UPDATE ' . TOPICS_TABLE . '
     
    15321616}
    15331617
     1618// Get last post time for all global announcements
     1619// to keep proper forums tracking
     1620if ($topic_data['topic_type'] == POST_GLOBAL)
     1621{
     1622        $sql = 'SELECT topic_last_post_time as forum_last_post_time
     1623                FROM ' . TOPICS_TABLE . '
     1624                WHERE forum_id = 0
     1625                ORDER BY topic_last_post_time DESC';
     1626        $result = $db->sql_query_limit($sql, 1);
     1627        $topic_data['forum_last_post_time'] = (int) $db->sql_fetchfield('forum_last_post_time');
     1628        $db->sql_freeresult($result);
     1629
     1630        $sql = 'SELECT mark_time as forum_mark_time
     1631                FROM ' . FORUMS_TRACK_TABLE . '
     1632                WHERE forum_id = 0
     1633                        AND user_id = ' . $user->data['user_id'];
     1634        $result = $db->sql_query($sql);
     1635        $topic_data['forum_mark_time'] = (int) $db->sql_fetchfield('forum_mark_time');
     1636        $db->sql_freeresult($result);
     1637}
     1638
    15341639// Only mark topic if it's currently unread. Also make sure we do not set topic tracking back if earlier pages are viewed.
    15351640if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id] && $max_post_time > $topic_tracking_info[$topic_id])
    15361641{
    1537         markread('topic', $forum_id, $topic_id, $max_post_time);
     1642        markread('topic', (($topic_data['topic_type'] == POST_GLOBAL) ? 0 : $forum_id), $topic_id, $max_post_time);
    15381643
    15391644        // Update forum info
    1540         $all_marked_read = update_forum_tracking_info($forum_id, $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
     1645        $all_marked_read = update_forum_tracking_info((($topic_data['topic_type'] == POST_GLOBAL) ? 0 : $forum_id), $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
    15411646}
    15421647else
     
    15791684        }
    15801685}
     1686
     1687// let's set up quick_reply
     1688$s_quick_reply = false;
     1689if ($user->data['is_registered'] && $config['allow_quick_reply'] && ($topic_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) && $auth->acl_get('f_reply', $forum_id))
     1690{
     1691        // Quick reply enabled forum
     1692        $s_quick_reply = (($topic_data['forum_status'] == ITEM_UNLOCKED && $topic_data['topic_status'] == ITEM_UNLOCKED) || $auth->acl_get('m_edit', $forum_id)) ? true : false;
     1693}
     1694
     1695if ($s_can_vote || $s_quick_reply)
     1696{
     1697        add_form_key('posting');
     1698
     1699        if ($s_quick_reply)
     1700        {
     1701                $s_attach_sig   = $config['allow_sig'] && $user->optionget('attachsig') && $auth->acl_get('f_sigs', $forum_id) && $auth->acl_get('u_sig');
     1702                $s_smilies              = $config['allow_smilies'] && $user->optionget('smilies') && $auth->acl_get('f_smilies', $forum_id);
     1703                $s_bbcode               = $config['allow_bbcode'] && $user->optionget('bbcode') && $auth->acl_get('f_bbcode', $forum_id);
     1704                $s_notify               = $config['allow_topic_notify'] && ($user->data['user_notify'] || $s_watching_topic['is_watching']);
     1705
     1706                $qr_hidden_fields = array(
     1707                        'topic_cur_post_id'             => (int) $topic_data['topic_last_post_id'],
     1708                        'lastclick'                             => (int) time(),
     1709                        'topic_id'                              => (int) $topic_data['topic_id'],
     1710                        'forum_id'                              => (int) $forum_id,
     1711                );
     1712
     1713                // Originally we use checkboxes and check with isset(), so we only provide them if they would be checked
     1714                (!$s_bbcode)                                    ? $qr_hidden_fields['disable_bbcode'] = 1               : true;
     1715                (!$s_smilies)                                   ? $qr_hidden_fields['disable_smilies'] = 1              : true;
     1716                (!$config['allow_post_links'])  ? $qr_hidden_fields['disable_magic_url'] = 1    : true;
     1717                ($s_attach_sig)                                 ? $qr_hidden_fields['attach_sig'] = 1                   : true;
     1718                ($s_notify)                                             ? $qr_hidden_fields['notify'] = 1                               : true;
     1719                ($topic_data['topic_status'] == ITEM_LOCKED) ? $qr_hidden_fields['lock_topic'] = 1 : true;
     1720
     1721                $template->assign_vars(array(
     1722                        'S_QUICK_REPLY'                 => true,
     1723                        'U_QR_ACTION'                   => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&amp;f=$forum_id&amp;t=$topic_id"),
     1724                        'QR_HIDDEN_FIELDS'              => build_hidden_fields($qr_hidden_fields),
     1725                        'SUBJECT'                               => 'Re: ' . censor_text($topic_data['topic_title']),
     1726                ));
     1727        }
     1728}
     1729// now I have the urge to wash my hands :(
     1730
    15811731
    15821732// We overwrite $_REQUEST['f'] if there is no forum specified
     
    15881738}
    15891739
     1740// We need to do the same with the topic_id. See #53025.
     1741if (empty($_REQUEST['t']) && !empty($topic_id))
     1742{
     1743        $_REQUEST['t'] = $topic_id;
     1744}
     1745
    15901746// Output the page
    1591 page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title']);
     1747page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'], true, $forum_id);
    15921748
    15931749$template->set_filenames(array(
Note: See TracChangeset for help on using the changeset viewer.