Author Topic: Make Default Search only for Image Name & Keywords  (Read 5208 times)

0 Members and 1 Guest are viewing this topic.

Offline up23

  • Pre-Newbie
  • Posts: 5
    • View Profile
Make Default Search only for Image Name & Keywords
« on: April 01, 2006, 03:58:53 AM »
Does anyone know how to make it so that the search bar that appears on everypage only searches the image names/title and keywords instead of everything? I only want the advanced search to search description.

Also, does anyone know how to take out words in the search string? The common words like "the" or "of" or "to" I want not to search for.

Thanks.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Make Default Search only for Image Name & Keywords
« Reply #1 on: April 02, 2006, 09:00:36 PM »
Does anyone know how to make it so that the search bar that appears on everypage only searches the image names/title and keywords instead of everything? I only want the advanced search to search description.
sorry, 4images search engine does not support that.

Also, does anyone know how to take out words in the search string? The common words like "the" or "of" or "to" I want not to search for.
The "no search" words are stored in lang/<your language>/stop_searchterms.txt
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline up23

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: Make Default Search only for Image Name & Keywords
« Reply #2 on: April 03, 2006, 05:16:13 AM »
Ok, thanks

Offline didoman

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Make Default Search only for Image Name & Keywords
« Reply #3 on: February 06, 2009, 07:51:06 AM »
A cosmetic way around this is to include radio buttons into the default search code (the search found on every page)
And if you make the radio button as automatically checked then that field will be searched first up.

You can put other radio buttons to give the user more choices. But remember there isn't much space to play with.

Basically I am just trimming the Advanced Search and putting it on each page (default search form)

Here is an example of how it can look. Of course play around with it for design purposes specific to your site
Remember to put the checked="checked" on the radio button you want automatically selected.

Quote
<form method="post" action="{url_search}">
  <table cellspacing="0" cellpadding="0">
  <tr>
    <td><input type="text" name="search_keywords" size="24" class="search" /></td>
    <td><input type="submit" value="" name="submit" /></td>
  </tr>
  <tr>
  <td><input type="radio" name="search_fields" value="image_name" checked="checked" />Image Title
          <input type="radio" name="search_fields" value="all" />Entire Site
  </td>
  </tr>
  </table>
</form>