mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/7888] Swap in-forum/topic search to GET forms.
This will allow sending URLs to search results to other users. The advanced search page has always worked like this, but these special pages used to cause problems. PHPBB3-7888
This commit is contained in:
@@ -45,11 +45,11 @@
|
||||
|
||||
<!-- IF S_DISPLAY_SEARCHBOX -->
|
||||
<div class="search-box">
|
||||
<form method="post" id="forum-search" action="{S_SEARCHBOX_ACTION}">
|
||||
<form method="get" id="forum-search" action="{S_SEARCHBOX_ACTION}">
|
||||
<fieldset>
|
||||
<input class="inputbox search tiny" type="text" name="keywords" id="search_keywords" size="20" value="{L_SEARCH_FORUM}" onclick="if (this.value == '{LA_SEARCH_FORUM}') this.value = '';" onblur="if (this.value == '') this.value = '{LA_SEARCH_FORUM}';" />
|
||||
<input class="button2" type="submit" value="{L_SEARCH}" />
|
||||
<input type="hidden" value="{FORUM_ID}" name="fid[]" />
|
||||
{S_SEARCH_HIDDEN_FIELDS}
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
@@ -38,12 +38,11 @@
|
||||
|
||||
<!-- IF S_DISPLAY_SEARCHBOX -->
|
||||
<div class="search-box">
|
||||
<form method="post" id="topic-search" action="{S_SEARCHBOX_ACTION}">
|
||||
<form method="get" id="topic-search" action="{S_SEARCHBOX_ACTION}">
|
||||
<fieldset>
|
||||
<input class="inputbox search tiny" type="text" name="keywords" id="search_keywords" size="20" value="{L_SEARCH_TOPIC}" onclick="if(this.value=='{LA_SEARCH_TOPIC}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_TOPIC}';" />
|
||||
<input class="button2" type="submit" value="{L_SEARCH}" />
|
||||
<input type="hidden" value="{TOPIC_ID}" name="t" />
|
||||
<input type="hidden" value="msgonly" name="sf" />
|
||||
{S_SEARCH_HIDDEN_FIELDS}
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
@@ -1 +1 @@
|
||||
<form method="post" name="search" action="{S_SEARCHBOX_ACTION}"><span class="gensmall">{L_SEARCH_FOR}:</span> <input class="post" type="text" name="keywords" size="20" /> <input class="btnlite" type="submit" value="{L_GO}" /></form>
|
||||
<form method="get" name="search" action="{S_SEARCHBOX_ACTION}"><span class="gensmall">{L_SEARCH_FOR}:</span> <input class="post" type="text" name="keywords" size="20" /> <input class="btnlite" type="submit" value="{L_GO}" />{S_SEARCH_HIDDEN_FIELDS}</form>
|
||||
|
@@ -267,6 +267,12 @@ $post_alt = ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['FORUM_LO
|
||||
// Display active topics?
|
||||
$s_display_active = ($forum_data['forum_type'] == FORUM_CAT && ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false;
|
||||
|
||||
$s_search_hidden_fields = array('fid' => $forum_id);
|
||||
if ($_SID)
|
||||
{
|
||||
$s_search_hidden_fields['sid'] = $_SID;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'MODERATORS' => (!empty($moderators[$forum_id])) ? implode(', ', $moderators[$forum_id]) : '',
|
||||
|
||||
@@ -304,7 +310,8 @@ $template->assign_vars(array(
|
||||
'S_WATCHING_FORUM' => $s_watching_forum['is_watching'],
|
||||
'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&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("{$phpbb_root_path}search.$phpEx"),
|
||||
'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),
|
||||
'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,
|
||||
|
@@ -585,6 +585,15 @@ $server_path = (!$view) ? $phpbb_root_path : generate_board_url() . '/';
|
||||
// Replace naughty words in title
|
||||
$topic_data['topic_title'] = censor_text($topic_data['topic_title']);
|
||||
|
||||
$s_search_hidden_fields = array(
|
||||
't' => $topic_id,
|
||||
'sf' => 'msgonly',
|
||||
);
|
||||
if ($_SID)
|
||||
{
|
||||
$s_search_hidden_fields['sid'] = $_SID;
|
||||
}
|
||||
|
||||
// Send vars to template
|
||||
$template->assign_vars(array(
|
||||
'FORUM_ID' => $forum_id,
|
||||
@@ -636,7 +645,8 @@ $template->assign_vars(array(
|
||||
|
||||
'S_VIEWTOPIC' => true,
|
||||
'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", 't=' . $topic_id),
|
||||
'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx"),
|
||||
'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),
|
||||
|
||||
'S_DISPLAY_POST_INFO' => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
|
||||
'S_DISPLAY_REPLY_INFO' => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
|
||||
|
Reference in New Issue
Block a user