vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Forum Display Enhancements - [How to: VB4] Change Default Advanced Search Tab (https://vborg.vbsupport.ru/showthread.php?t=306509)

BasilFawlty 12-31-2013 11:00 PM

[How to: VB4] Change Default Advanced Search Tab
 
1 Attachment(s)
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.

mdawg 06-25-2023 11:24 PM

Same process for 4.2.5 via AdminCP > Styles & Templates > Style Manager > [Edit Templates]

Double click on navbar, find 'search.php'


All times are GMT. The time now is 04:44 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02423 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete