vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to create a "search" link with "search titles only" by default (https://vborg.vbsupport.ru/showthread.php?t=107856)

stark427 02-13-2006 03:36 PM

Quote:

Originally Posted by MarcoH64
Don't use the forumid in the filename. Insert the followingline instead:
HTML Code:

                                <input type="hidden" name="forumid" value="29" />

Just tried.

Code:


<form action="forum/search.php" method="post">
        <input type="hidden" name="forumid" value="29" />
        <input type="hidden" name="do" value="process" />
        <input type="hidden" name="showposts" value="0" />
        <input type="hidden" name="quicksearch" value="1" />
        <input type="hidden" name="s" value="$session[sessionhash]" />
        <input type="text" class="bginput" name="query" size="20"/>&nbsp;$gobutton<br />
</form>

still searches the whole forum.

With a little help from Brian over at VBadvanced.com I found that this could work by adding this line :

Code:

<input type="hidden" name="forumchoice[]" value="your_forum_id_here" />
so the final code I have put (to search by titles ONLY + search only a specific forum) is this :

Code:

<form action="forum/search.php?titleonly=1" method="post">
        <input type="hidden" name="forumchoice[]" value="29" />
        <input type="hidden" name="do" value="process" />
        <input type="hidden" name="showposts" value="0" />
        <input type="hidden" name="quicksearch" value="1" />
        <input type="hidden" name="s" value="$session[sessionhash]" />
        <input type="text" class="bginput" name="query" size="20"/>&nbsp;$gobutton<br />
</form>


Now one last modification I want to make is to remove the "GO" button. I want it to have only the search field and the users to insert the keyword and press enter...

I was thinking of just removing this code

Code:

&nbsp;$gobutton
would this cause any problems - (maybe to specific browsers)?


All times are GMT. The time now is 01:41 PM.

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.01491 seconds
  • Memory Usage 1,725KB
  • 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
  • (1)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete