Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 844
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Customize Quick Search Block to search only a few boards

Started by gameballa, November 17, 2010, 10:58:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gameballa

I want to customize my quick search block so it only searches in boards I want it to... Any way of doing this??

Nathaniel

Code ("Find (Sources/PortalBlocks.php)") Select
echo '
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<div class="sp_center">
<input type="text" name="search" value="" class="sp_search" /><br />
<input type="submit" name="submit" value="', $txt[182], '" />
<input type="hidden" name="advanced" value="0" />';


Code ("Replace") Select
echo '
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<div class="sp_center">
<input type="text" name="search" value="" class="sp_search" /><br />
<input type="submit" name="submit" value="', $txt[182], '" />
<input type="hidden" name="advanced" value="0" />
<input type="hidden" name="brd[0]" value="1" />
<input type="hidden" name="brd[1]" value="1" />';


That is an example, the quick search block will only search boards 0 and 1 with those settings. The "{id}" part of the "brd[{id}]" code, refers to the board id. If you want the block to search more than two boards, then you will need to add "<input type="hidden" name="brd[{id}]" value="1" />" for each board that you want the block to search. (Make sure that you put that code BEFORE the single quote, otherwise you will get fatal parse errors)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

gameballa

#2
had to change the value number to correspond with the brd id as well..

Here is the code the way it should be for those others who want to do this..



echo '

<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">

<div class="sp_center">

<input type="text" name="search" value="" class="sp_search" /><br />

<input type="submit" name="submit" value="', $txt[182], '" />

<input type="hidden" name="advanced" value="0" />

<input type="hidden" name="brd[0]" value="1" />

<input type="hidden" name="brd[2]" value="2" />

<input type="hidden" name="brd[3]" value="3" />';




Thanks Nathaniel for the quick help you have given me you are great!