Changeset 702 for trunk/forum/viewtopic.php
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/viewtopic.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : viewtopic.php 9138 2008-11-30 16:53:36Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 29 29 $voted_id = request_var('vote_id', array('' => 0)); 30 30 31 $voted_id = (sizeof($voted_id) > 1) ? array_unique($voted_id) : $voted_id; 32 33 31 34 $start = request_var('start', 0); 32 35 $view = request_var('view', ''); … … 42 45 $update = request_var('update', false); 43 46 47 $s_can_vote = false; 44 48 /** 45 49 * @todo normalize? … … 83 87 " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') . " 84 88 AND post_time > $topic_last_read 89 AND forum_id = $forum_id 85 90 ORDER BY post_time ASC"; 86 91 $result = $db->sql_query_limit($sql, 1); … … 182 187 ); 183 188 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. 191 if ($db->sql_layer === 'firebird') 192 { 193 $sql_array['SELECT'] = 'f.forum_id AS forum_id, ' . $sql_array['SELECT']; 194 } 195 184 196 // The FROM-Order is quite important here, else t.* columns can not be correctly bound. 185 197 if ($post_id) 186 198 { 199 $sql_array['SELECT'] .= ', p.post_approved'; 187 200 $sql_array['FROM'][POSTS_TABLE] = 'p'; 188 201 } … … 232 245 else 233 246 { 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"; 235 248 } 236 249 … … 260 273 $db->sql_freeresult($result); 261 274 275 // link to unapproved post or incorrect link 262 276 if (!$topic_data) 263 277 { 264 278 // 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" : ''))); 268 282 } 269 283 … … 271 285 } 272 286 287 $forum_id = (int) $topic_data['forum_id']; 273 288 // This is for determining where we are (page) 274 289 if ($post_id) 275 290 { 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 } 276 302 if ($post_id == $topic_data['topic_first_post_id'] || $post_id == $topic_data['topic_last_post_id']) 277 303 { … … 304 330 } 305 331 306 $forum_id = (int) $topic_data['forum_id'];307 332 $topic_id = (int) $topic_data['topic_id']; 308 309 333 // 310 334 $topic_replies = ($auth->acl_get('m_approve', $forum_id)) ? $topic_data['topic_replies_real'] : $topic_data['topic_replies']; … … 395 419 396 420 $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); 398 423 399 424 $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; … … 550 575 // Moderators 551 576 $forum_moderators = array(); 552 get_moderators($forum_moderators, $forum_id); 577 if ($config['load_moderators']) 578 { 579 get_moderators($forum_moderators, $forum_id); 580 } 553 581 554 582 // This is only used for print view so ... … … 598 626 'WARN_IMG' => $user->img('icon_user_warn', 'WARN_USER'), 599 627 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, 601 629 'S_SELECT_SORT_DIR' => $s_sort_dir, 602 630 'S_SELECT_SORT_KEY' => $s_sort_key, … … 605 633 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"), 606 634 '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&t=$topic_id& quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id),635 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id&start=$start&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id), 608 636 609 637 'S_VIEWTOPIC' => true, … … 613 641 'S_DISPLAY_POST_INFO' => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false, 614 642 '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, 615 644 616 645 'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id", … … 680 709 } 681 710 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) && 684 713 (($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) && 685 714 $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; 687 718 $s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false; 688 719 … … 690 721 { 691 722 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')) 693 724 { 694 725 $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"); … … 703 734 $message = 'TOO_MANY_VOTE_OPTIONS'; 704 735 } 736 else if (in_array(VOTE_CONVERTED, $cur_voted_id)) 737 { 738 $message = 'VOTE_CONVERTED'; 739 } 705 740 else 706 741 { 707 $message = ' VOTE_CONVERTED';742 $message = 'FORM_INVALID'; 708 743 } 709 744 … … 859 894 $store_reverse = false; 860 895 $sql_limit = $config['posts_per_page']; 896 $sql_sort_order = $direction = ''; 861 897 862 898 if ($start > $total_posts / 2) … … 870 906 871 907 // 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'); 873 909 $sql_start = max(0, $total_posts - $sql_limit - $start); 874 910 } … … 876 912 { 877 913 // 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'); 879 915 $sql_start = $start; 916 } 917 918 if (is_array($sort_by_sql[$sort_key])) 919 { 920 $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; 921 } 922 else 923 { 924 $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; 880 925 } 881 926 … … 888 933 // Go ahead and pull all data for this topic 889 934 $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': '') . " 891 936 WHERE p.topic_id = $topic_id 892 937 " . ((!$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': '') . " 894 939 $limit_posts_time 895 940 ORDER BY $sql_sort_order"; … … 899 944 while ($row = $db->sql_fetchrow($result)) 900 945 { 901 $post_list[$i] = $row['post_id'];946 $post_list[$i] = (int) $row['post_id']; 902 947 ($store_reverse) ? $i-- : $i++; 903 948 } … … 953 998 } 954 999 955 $poster_id = $row['poster_id'];1000 $poster_id = (int) $row['poster_id']; 956 1001 957 1002 // Does post have an attachment? If so, add it to the list 958 1003 if ($row['post_attachment'] && $config['allow_attachments']) 959 1004 { 960 $attach_list[] = $row['post_id'];1005 $attach_list[] = (int) $row['post_id']; 961 1006 962 1007 if ($row['post_approved']) … … 1093 1138 'jabber' => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=jabber&u=$poster_id") : '', 1094 1139 'search' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&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']), 1095 1145 ); 1096 1146 … … 1144 1194 if ($config['load_cpf_viewtopic']) 1145 1195 { 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 } 1147 1200 $cp = new custom_profile(); 1148 1201 1149 1202 // 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); 1151 1219 } 1152 1220 … … 1382 1450 // post and only the topic poster and last poster are allowed to bump. 1383 1451 // 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)); 1385 1453 } 1386 1454 else … … 1405 1473 } 1406 1474 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 1407 1491 // 1408 1492 $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']), 1413 1497 1414 1498 'RANK_TITLE' => $user_cache[$poster_id]['rank_title'], … … 1422 1506 'POSTER_AGE' => $user_cache[$poster_id]['age'], 1423 1507 1424 'POST_DATE' => $user->format_date($row['post_time'] ),1508 'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false), 1425 1509 'POST_SUBJECT' => $row['post_subject'], 1426 1510 'MESSAGE' => $message, … … 1438 1522 'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false), 1439 1523 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&f=$forum_id&p={$row['post_id']}") : ''),1524 'U_EDIT' => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '', 1441 1525 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', 1442 1526 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&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&f=$forum_id&p={$row['post_id']}") : ''),1527 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '', 1444 1528 1445 1529 'U_PROFILE' => $user_cache[$poster_id]['profile'], … … 1515 1599 1516 1600 // 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)1601 if (isset($user->data['session_page']) && !$user->data['is_bot'] && (strpos($user->data['session_page'], '&t=' . $topic_id) === false || isset($user->data['session_created']))) 1518 1602 { 1519 1603 $sql = 'UPDATE ' . TOPICS_TABLE . ' … … 1532 1616 } 1533 1617 1618 // Get last post time for all global announcements 1619 // to keep proper forums tracking 1620 if ($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 1534 1639 // Only mark topic if it's currently unread. Also make sure we do not set topic tracking back if earlier pages are viewed. 1535 1640 if (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]) 1536 1641 { 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); 1538 1643 1539 1644 // 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); 1541 1646 } 1542 1647 else … … 1579 1684 } 1580 1685 } 1686 1687 // let's set up quick_reply 1688 $s_quick_reply = false; 1689 if ($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 1695 if ($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&f=$forum_id&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 1581 1731 1582 1732 // We overwrite $_REQUEST['f'] if there is no forum specified … … 1588 1738 } 1589 1739 1740 // We need to do the same with the topic_id. See #53025. 1741 if (empty($_REQUEST['t']) && !empty($topic_id)) 1742 { 1743 $_REQUEST['t'] = $topic_id; 1744 } 1745 1590 1746 // Output the page 1591 page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'] );1747 page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'], true, $forum_id); 1592 1748 1593 1749 $template->set_filenames(array(
Note:
See TracChangeset
for help on using the changeset viewer.