Back to vBulletin 4.x Template Modifications

[How to: VB4] Change Default Advanced Search Tab
Mod Version: 1.00, by BasilFawlty

vB Version: 4.2.x Rating: (0 vote - 0 average) Installs: 4
Released: 01 Jan 2014 Last Update: Never Downloads: 0
Not Supported Template Edits Re-usable Code  

Many of my forum members are older folks (like me) and I like to make things as simple as possible for them. Currently, when you click Advanced Search, the default search tab is "Search Multiple Content Types." Since 99% of my members are only interested in searching "Posts", I wanted to make the "Search Single Content Type" the default tab so they don't get confused about which "content types" to select. If you want to change your default Advanced Search Tab to "Single Content Type", here is what you do:

1.) Make sure you are in debug mode so you can see the "MASTER Style" Template in admincp. To do this, edit your /includes/config.php file and change this:

Code:
$config['Misc']['debug'] = false;
to this:

Code:
$config['Misc']['debug'] = true;
NOTE: Be sure to change it back when you are done with this mod.

Then in the "navbar" template, under the Navigation / Breadcrumb Templates (in the MASTER Style):

Find this code:

PHP Code:
<ul class="navbar_advanced_search">
       <
li><a href="search.php?{vb:raw session.sessionurl_q}" accesskey="4">{vb:rawphrase advanced_search}</a></li>                {vb:raw template_hook.navbar_advanced_search}
            </
ul
and change it to this:

PHP Code:
<ul class="navbar_advanced_search">
        <
li><a href="search.php?{vb:raw session.sessionurl_q}search_type=1" accesskey="4">{vb:rawphrase advanced_search}</a></li>                {vb:raw template_hook.navbar_advanced_search}
            </
ul
All you are doing here is adding "search_type=1" following the {vb:raw session.sessionurl_q}

IMPORTANT: If you are running VB 4.2.2 you will notice that the "?" is missing from here
Code:
search.php?{vb:raw session.sessionurl_q}
so it looks like this:

Code:
search.php{vb:raw session.sessionurl_q}
If you don't see the "?" after "search.php" be sure to add it, otherwise it will not work. I don't know why they took out the "?" in 4.2.2, but it seems that did, so make sure you add it back if necessary.

Download

No files for download.

Similar Mods

Boolean Search as Default in Advanced Search Options vBulletin 3.5 Template Modifications

vblts.ru supports vBulletin®, 2022-2024