Список разделов › phpBBex 1.x (поддерживается) › Поддержка 1.x
function append_sid($url, $params = false, $is_amp = true, $session_id = false)
function append_sid_original($url, $params = false, $is_amp = true, $session_id = false)
function generate_board_url($without_script_path = false)
) добавить:function clean_viewtopic_url($url)
{
return preg_replace('#(\bf=\d+&(amp;)?|&(amp;)?f=\d+$)#', '', $url);
}
function append_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $phpbb_root_path, $phpEx, $config;
$url = append_sid_original($url, $params, $is_amp, $session_id);
if (strpos($url, "{$phpbb_root_path}viewtopic.$phpEx") === 0)
{
return clean_viewtopic_url($url);
}
return $url;
}
- 'U_CANONICAL' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id" . (($start) ? "&start=$start" : ''),
- 'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id",
+ 'U_CANONICAL' => clean_viewtopic_url(generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id" . (($start) ? "&start=$start" : '')),
+ 'U_TOPIC' => clean_viewtopic_url("{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id"),