vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   change default search option? (https://vborg.vbsupport.ru/showthread.php?t=201507)

zero5854 01-12-2009 12:45 PM

change default search option?
 
Is there a way to change the search option in Advanced search from

"Search Entire Posts" TO "Search Titles Only" ?? see att below...THANKS!

http://www.image-plex.com/files/ei0t70ipzixvrya95fc.png

Dismounted 01-13-2009 05:24 AM

Edit the search template, if you could post that up, I'm sure we could help. :)

zero5854 01-13-2009 11:38 PM

ok here it is...thanks !!

Code:

$stylevar[htmldoctype]
<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - <if condition="$show['searchthread']">$vbphrase[search_thread]<else />$vbphrase[search_forums]</if></title>
$tag_cloud_headinclude
</head>

<body>
$header
$navbar

<if condition="$show['errors']">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat">
                        $vbphrase[errors_occured_with_search]:
        </td>
</tr>
<tr>
        <td class="alt1">
                        <ol>$errorlist</ol>
        </td>
</tr>
</table>

<br />
</if>

<form action="search.php?do=process" method="post" name="vbform" id="searchform" style="display:block; margin:0px">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="do" value="process" />
<input type="hidden" name="searchthreadid" value="$searchthreadid" />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat">
                <if condition="$show['searchthread']">$vbphrase[search_thread] - <a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]">$threadinfo[title]</a><else />$vbphrase[search_forums]</if>
        </td>
</tr>
<tr>
        <td class="panelsurround" align="center">

        <table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
        <tr>
                <td align="$stylevar[left]" valign="top" width="50%">
                        <fieldset class="fieldset" style="margin:0px">
                                <legend>$vbphrase[search_by_key_word]</legend>
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                                <tr>
                                        <td colspan="2">
                                                <div>$vbphrase[key_words]:</div>
                                                <div><input type="text" class="bginput" name="query" size="35" value="$query" style="width:250px" /></div>
                                        </td>
                                </tr>
                                <if condition="!$show['searchthread']">
                                <tr>
                                        <td>
                                                <select name="titleonly">
                                                        <option value="0" $titleonlyselected[0]>$vbphrase[search_entire_posts]</option>
                                                        <option value="1" $titleonlyselected[1]>$vbphrase[search_titles_only]</option>
                                                </select><if condition="$show['nocache']"> <label for="cb_nocache"><input type="checkbox" name="nocache" value="1" id="cb_nocache" />$vbphrase[do_not_use_cached_results]</label></if>
                                        </td>
                                </tr>
                                </if>
                                </table>
                        </fieldset>
                </td>
                <td align="$stylevar[left]" valign="top" width="50%">
                        <fieldset class="fieldset" style="margin:0px">
                                <legend>$vbphrase[search_by_user_name]</legend>
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                                <tr>
                                        <td colspan="2">
                                                <div>$vbphrase[username]:</div>
                                                <div id="userfield">
                                                        <input type="text" class="bginput" name="searchuser" id="userfield_txt" size="35"  value="$searchuser" style="width:250px" />
                                                </div>
                                                <if condition="$show['searchthread']">
                                                        <div>
                                                                <label for="cb_exactname"><input type="checkbox" name="exactname" value="1" id="cb_exactname" $exactnamechecked[1] />$vbphrase[exact_name]</label>
                                                        </div>
                                                </if>
                                                <if condition="$show['popups']">
                                                        <div id="userfield_menu" class="vbmenu_popup" style="display:none"></div>
                                                        <script type="text/javascript" src="clientscript/vbulletin_ajax_namesugg.js?v=$vboptions[simpleversion]"></script>
                                                        <script type="text/javascript">
                                                        <!--
                                                        vbmenu_register('userfield', true);
                                                        snc = new vB_AJAX_NameSuggest('snc', 'userfield_txt', 'userfield');
                                                        //-->
                                                        </script>
                                                </if>
                                        </td>
                                </tr>
                                <if condition="!$show['searchthread']">
                                <tr>
                                        <td>
                                                <select name="starteronly">
                                                        <option value="0" $starteronlyselected[0]>$vbphrase[find_posts_by_user]</option>
                                                        <option value="1" $starteronlyselected[1]>$vbphrase[find_threads_started_by_user]</option>
                                                </select>
                                        </td>
                                        <td><label for="cb_exactname"><input type="checkbox" name="exactname" value="1" id="cb_exactname" $exactnamechecked[1] />$vbphrase[exact_name]</label></td>
                                </tr>
                                </if>
                                </table>
                        </fieldset>

                </td>
        </tr>
        <if condition="$human_verify">
        <tr>
                <td align="$stylevar[left]" valign="top" colspan="2">$human_verify</td>
        </tr>
        </if>
        </table>

        <div align="$stylevar[left]">

        <div class="thead" style="padding:$stylevar[cellpadding]px">
                <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('search_adv')"><img id="collapseimg_search_adv" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_search_adv].gif" alt="" border="0" /></a>
                $vbphrase[search_options]
        </div>

        <div id="collapseobj_search_adv" style="$vbcollapse[collapseobj_search_adv]">
        <table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
        <tr valign="top">
                <td width="50%">
                        <if condition="!$show['searchthread']">
                        <if condition="$prefix_options">
                        <fieldset class="fieldset">
                                <legend>$vbphrase[find_threads_with_prefix]</legend>
                                <div style="padding:$stylevar[formspacer]px">
                                        <div>
                                                <select style="<if condition="is_browser('mozilla')">min-width:250px<else />width:100%</if>" name="prefixchoice[]" size="5" multiple="multiple">
                                                        <option value=""$prefix_selected[any]>$vbphrase[any_prefix_meta]</option>
                                                        <option value="-1"$prefix_selected[none]>$vbphrase[no_prefix_meta]</option>
                                                        $prefix_options
                                                </select>
                                        </div>
                                </div>
                        </fieldset>
                        </if>

                        <fieldset class="fieldset">
                                <legend>$vbphrase[find_threads_with]</legend>
                                <div style="padding:$stylevar[formspacer]px">
                                        <select name="replyless" style="width:150px">
                                                <option value="0" $replylessselected[0]>$vbphrase[at_least]</option>
                                                <option value="1" $replylessselected[1]>$vbphrase[at_most]</option>
                                        </select>
                                        <input type="text" class="bginput" style="font-size:11px" name="replylimit" size="3" value="$replylimit" /> $vbphrase[replies]
                                </div>
                        </fieldset>
                        </if>

                        <fieldset class="fieldset">
                                <legend>$vbphrase[find_posts_from]</legend>
                                <div style="padding:$stylevar[formspacer]px">
                                        <select name="searchdate" style="width:150px">
                                                <option value="0" $searchdateselected[0]>$vbphrase[any_date]</option>
                                                <option value="lastvisit" $searchdateselected[lastvisit]>$vbphrase[your_last_visit]</option>
                                                <option value="1" $searchdateselected[1]>$vbphrase[yesterday]</option>
                                                <option value="7" $searchdateselected[7]>$vbphrase[a_week_ago]</option>
                                                <option value="14" $searchdateselected[14]><phrase 1="2">$vbphrase[x_weeks_ago]</phrase></option>
                                                <option value="30" $searchdateselected[30]>$vbphrase[a_month_ago]</option>
                                                <option value="90" $searchdateselected[90]><phrase 1="3">$vbphrase[x_months_ago]</phrase></option>
                                                <option value="180" $searchdateselected[180]><phrase 1="6">$vbphrase[x_months_ago]</phrase></option>
                                                <option value="365" $searchdateselected[365]>$vbphrase[a_year_ago]</option>
                                        </select>
                                        <select name="beforeafter">
                                                <option value="after" $beforeafterselected[after]>$vbphrase[and_newer]</option>
                                                <option value="before" $beforeafterselected[before]>$vbphrase[and_older]</option>
                                        </select>
                                </div>
                        </fieldset>

                        <if condition="!$show['searchthread']">
                        <fieldset class="fieldset">
                                <legend>$vbphrase[sort_results_by]</legend>
                                <div style="padding:$stylevar[formspacer]px">
                                        <select name="sortby" style="width:150px">
                                                <option value="rank" $sortbyselected[rank]>$vbphrase[relevancy]</option>
                                                <option value="title" $sortbyselected[title]>$vbphrase[title]</option>
                                                <option value="replycount" $sortbyselected[replycount]>$vbphrase[number_of_replies]</option>
                                                <option value="views" $sortbyselected[views]>$vbphrase[number_of_views]</option>
                                                <option value="threadstart" $sortbyselected[threadstart]>$vbphrase[thread_start_date]</option>
                                                <option value="lastpost" $sortbyselected[lastpost]>$vbphrase[last_posting_date]</option>
                                                <option value="postusername" $sortbyselected[postusername]>$vbphrase[username]</option>
                                                <option value="forum" $sortbyselected[forum]>$vbphrase[forum]</option>
                                        </select>
                                        <select name="order">
                                                <option value="descending" $sortorderselected[descending]>$vbphrase[in_descending_order]</option>
                                                <option value="ascending" $sortorderselected[ascending]>$vbphrase[in_ascending_order]</option>
                                        </select>
                                </div>
                        </fieldset>

                        <fieldset class="fieldset">
                                <legend>$vbphrase[show_results_as]</legend>
                                <div style="padding:$stylevar[formspacer]px">
                                        <label for="rb_showposts_0"><input type="radio" name="showposts" value="0" id="rb_showposts_0" $showpostschecked[0] />$vbphrase[threads]</label>
                                        <label for="rb_showposts_1"><input type="radio" name="showposts" value="1" id="rb_showposts_1" $showpostschecked[1] />$vbphrase[posts]</label>
                                </div>
                        </fieldset>
                        </if>
                </td>
                <if condition="!$show['searchthread']">
                <td width="50%">
                        <if condition="$show['tag_option']">
                        <fieldset class="fieldset">
                                <legend>$vbphrase[search_by_tag]</legend>
                                <div style="padding:$stylevar[formspacer]px">
                                        <div>$vbphrase[tag]:</div>
                                        <div id="tag_add"><input type="text" class="bginput" name="tag" id="tag_add_input" size="35" value="$formdata[tag]" style="width:250px" /></div>

                                        <if condition="$show['popups']">
                                                <div id="tag_add_menu" class="vbmenu_popup" style="display:none"></div>
                                                <script type="text/javascript" src="clientscript/vbulletin_ajax_tagsugg.js?v=$vboptions[simpleversion]"></script>
                                                <script type="text/javascript">
                                                <!--
                                                vbmenu_register('tag_add', true);
                                                tag_add_comp = new vB_AJAX_TagSuggest('tag_add_comp', 'tag_add_input', 'tag_add');
                                                //-->
                                                </script>
                                        </if>
                                </div>
                        </fieldset>
                        </if>

                        <fieldset class="fieldset" style="margin:0px">
                                <legend>$vbphrase[search_in_forums]</legend>
                                <div style="padding:$stylevar[formspacer]px">
                                        <div>
                                                <select style="width:100%" name="forumchoice[]" size="13" multiple="multiple">
                                                        <option value="0" $noforumselected>$vbphrase[search_all_open_forums]</option>
                                                        <option value="subscribed">$vbphrase[search_subscribed_forums]</option>
                                                        $searchforumbits
                                                </select>
                                        </div>
                                        <div><label for="cb_childforums"><input type="checkbox" name="childforums" value="1" id="cb_childforums" $childforumschecked[1] />$vbphrase[also_search_in_child_forums]</label></div>
                                        <if condition="$show['cantsearchposts']">$vbphrase[you_can_only_search_thread_titles]</if>
                                </div>
                        </fieldset>
                </td>
                </if>
        </tr>
        </table>
        </div>

        </div>

        <div style="margin-top:$stylevar[cellpadding]px">
                <input type="submit" class="button" name="dosearch" value="$vbphrase[search_now]" accesskey="s" />
                <input type="reset" class="button" value="$vbphrase[reset_fields]" accesskey="r" onclick="window.location='search.php?$session[sessionurl]type=advanced';" />
        </div>
        </td>
</tr>
</table>

<if condition="$show['member']">
        <div align="center" style="margin-top:20px">
                <select name="saveprefs">
                        <option value="1" selected="selected">$vbphrase[save_search_preferences]</option>
                        <option value="0">$vbphrase[clear_search_preferences]</option>
                </select>
                <input type="submit" class="button" name="doprefs" value="$vbphrase[go]" id="save_searchprefs" />
                <input type="image" src="$vboptions[cleargifurl]" style="width: 1px; height: 1px;" />
                <script type="text/javascript" src="clientscript/vbulletin_ajax_search.js?v=$vboptions[simpleversion]"></script>
                <script type="text/javascript">

                <!--
                vB_AJAX_SearchPrefs_Init('save_searchprefs');
                //-->

                </script>
        </div>
</if>

</form>

<if condition="$tag_cloud">
        <div style="margin-top:20px">$tag_cloud</div>
</if>

$footer

</body>
</html>

EDIT NVM I FOUND IT! I had to swith the true false values. IE : sitch the 1's to 0's and the 0's to 1's in ther to options

EDIT#2
OR NOT! all it did was change it to SAY "search titles only" but it actually doesnt after testing.. :(

Dismounted 01-14-2009 03:42 AM

Find:
HTML Code:

<select name="titleonly">
        <option value="0" $titleonlyselected[0]>$vbphrase[search_entire_posts]</option>
        <option value="1" $titleonlyselected[1]>$vbphrase[search_titles_only]</option>
</select>

Replace With:
HTML Code:

<select name="titleonly">
        <option value="0">$vbphrase[search_entire_posts]</option>
        <option value="1" selected="selected">$vbphrase[search_titles_only]</option>
</select>


zero5854 01-14-2009 12:52 PM

AWESOME it worked! Thanks so much!


All times are GMT. The time now is 04:42 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.01861 seconds
  • Memory Usage 1,829KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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