diff options
Diffstat (limited to 'phpBB/viewforum.php')
| -rw-r--r-- | phpBB/viewforum.php | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index f41879da78..61408b06d9 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -12,10 +12,10 @@ * @ignore */ define('IN_PHPBB', true); -$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.' . $phpEx); -include($phpbb_root_path . 'includes/functions_display.' . $phpEx); +if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './'); +if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); +include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); +include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT); // Start session $user->session_begin(); @@ -139,10 +139,10 @@ $template->set_filenames(array( 'body' => 'viewforum_body.html') ); -make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id); +make_jumpbox(append_sid('viewforum'), $forum_id); $template->assign_vars(array( - 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&start=$start"), + 'U_VIEW_FORUM' => append_sid('viewforum', "f=$forum_id&start=$start"), )); // Not postable forum or showing active topics? @@ -158,7 +158,7 @@ if (!$auth->acl_get('f_read', $forum_id)) $template->assign_vars(array( 'S_NO_READ_ACCESS' => true, 'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false, - 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') . '&redirect=' . urlencode(str_replace('&', '&', build_url(array('_f_')))), + 'S_LOGIN_ACTION' => append_sid('ucp', 'mode=login') . '&redirect=' . urlencode(str_replace('&', '&', build_url(array('_f_')))), )); page_footer(); @@ -169,7 +169,7 @@ if ($mark_read == 'topics') { markread('topics', $forum_id); - $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); + $redirect_url = append_sid('viewforum', 'f=' . $forum_id); meta_refresh(3, $redirect_url); trigger_error($user->lang['TOPICS_MARKED'] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>')); @@ -184,7 +184,7 @@ if ($forum_data['forum_topics_per_page']) // Do the forum Prune thang - cron type job ... if ($forum_data['prune_next'] < time() && $forum_data['enable_prune']) { - $template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=prune_forum&f=' . $forum_id) . '" alt="cron" width="1" height="1" />'); + $template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid('cron', 'cron_type=prune_forum&f=' . $forum_id) . '" alt="cron" width="1" height="1" />'); } // Forum rules and subscription info @@ -291,17 +291,17 @@ $template->assign_vars(array( 'S_WATCH_FORUM_LINK' => $s_watching_forum['link'], 'S_WATCH_FORUM_TITLE' => $s_watching_forum['title'], 'S_WATCHING_FORUM' => $s_watching_forum['is_watching'], - 'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&start=$start"), + 'S_FORUM_ACTION' => append_sid('viewforum', "f=$forum_id&start=$start"), 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false, - 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'fid[]=' . $forum_id), + 'S_SEARCHBOX_ACTION' => append_sid('search', 'fid[]=' . $forum_id), 'S_SINGLE_MODERATOR' => (!empty($moderators[$forum_id]) && sizeof($moderators[$forum_id]) > 1) ? false : true, 'S_IS_LOCKED' => ($forum_data['forum_status'] == ITEM_LOCKED) ? true : false, 'S_VIEWFORUM' => true, - 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '', - 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id) : '', - 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&$u_sort_param&start=$start"), - 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&mark=topics") : '', + 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid('mcp', "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '', + 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid('posting', 'mode=post&f=' . $forum_id) : '', + 'U_VIEW_FORUM' => append_sid('viewforum', "f=$forum_id&$u_sort_param&start=$start"), + 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid('viewforum', "f=$forum_id&mark=topics") : '', )); // Grab icons @@ -512,7 +512,7 @@ if ($s_display_active) } $template->assign_vars(array( - 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&$u_sort_param"), $topics_count, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination(append_sid('viewforum', "f=$forum_id&$u_sort_param"), $topics_count, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), 'TOTAL_TOPICS' => ($s_display_active) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count))) ); @@ -600,11 +600,11 @@ if (sizeof($topic_list)) topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); // Generate all the URIs ... - $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $topic_id); + $view_topic_url = append_sid('viewtopic', 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $topic_id); $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false; $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false; - $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : ''; + $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid('mcp', 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : ''; // Send vars to template $template->assign_block_vars('topicrow', array( @@ -654,7 +654,7 @@ if (sizeof($topic_list)) 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'U_VIEW_TOPIC' => $view_topic_url, - 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $forum_id . '&t=' . $topic_id, true, $user->session_id), + 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&mode=reports&f=' . $forum_id . '&t=' . $topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue, 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test) |
