mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 07:07:51 +02:00
Used foreach ... changed for for for PHP3 compatibility
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3079 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e8a901c6e8
commit
14fd9d195b
@ -445,20 +445,22 @@ if ( count($orig_word) )
|
||||
//
|
||||
// Was a highlight request part of the URI?
|
||||
//
|
||||
$highlight_match = '';
|
||||
$highlight_match = $highlight = '';
|
||||
if (isset($HTTP_GET_VARS['highlight']))
|
||||
{
|
||||
// Split words and phrases
|
||||
$words = explode(' ', trim(htmlspecialchars(urldecode($HTTP_GET_VARS['highlight']))));
|
||||
|
||||
foreach ($words as $word)
|
||||
for($i = 0; $i < sizeof($words); $i++)
|
||||
{
|
||||
if (trim($word) != '')
|
||||
if (trim($words[$i]) != '')
|
||||
{
|
||||
$highlight_match .= (($highlight_match != '') ? '|' : '') . str_replace('*', '\w*', preg_quote($word, '#'));
|
||||
$highlight_match .= (($highlight_match != '') ? '|' : '') . str_replace('*', '\w*', preg_quote($words[$i], '#'));
|
||||
}
|
||||
}
|
||||
unset($words);
|
||||
|
||||
$highlight = urlencode($HTTP_GET_VARS['highlight']);
|
||||
}
|
||||
|
||||
//
|
||||
@ -584,7 +586,7 @@ if ( $can_watch_topic )
|
||||
// If we've got a hightlight set pass it on to pagination,
|
||||
// I get annoyed when I lose my highlight after the first page.
|
||||
//
|
||||
$pagination = ( $highlight_active ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=" . urlencode($HTTP_GET_VARS['highlight']), $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);
|
||||
$pagination = ( $highlight_active ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);
|
||||
|
||||
//
|
||||
// Send vars to template
|
||||
@ -625,7 +627,7 @@ $template->assign_vars(array(
|
||||
'S_TOPIC_ADMIN' => $topic_mod,
|
||||
'S_WATCH_TOPIC' => $s_watching_topic,
|
||||
|
||||
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=" . urlencode($HTTP_GET_VARS['highlight'])),
|
||||
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=$highlight"),
|
||||
'U_VIEW_FORUM' => $view_forum_url,
|
||||
'U_VIEW_OLDER_TOPIC' => $view_prev_topic_url,
|
||||
'U_VIEW_NEWER_TOPIC' => $view_next_topic_url,
|
||||
|
Loading…
x
Reference in New Issue
Block a user