4images Forum & Community

4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: Ofuuzo on June 28, 2002, 12:24:05 PM

Title: Quick seach
Post by: Ofuuzo on June 28, 2002, 12:24:05 PM
I will like to add a function here I call a quick search dropdown list. For example:
<form>
    <select name="quick_search">
    <option value="">Quick search list</option>
    <option value="../search.php?search_keywords=Jan ">Jan</option>
    <option value="../search.php?search_keywords=Nicky ">Nicky</option>
     .......

Nicky and Jan exist either as image name, description or keywords.

Can you point me in which files I have to look or how I can do that in version 1.6.

Thanks.
Ofuuzo
Title: Yes, yes!
Post by: Chris on June 28, 2002, 02:58:41 PM
When I first installed 4images, I was thinking it would be really nice to have a php generated keyword search like this.  

In other words, let 4images generate a drop down list of all the available keywords like it already does for the available categories.  This would make search_form.html much more useful to the end user.

Keyword searching in its current form is great but it really only works if you already know all the available keywords in the database.
Title: Quick seach
Post by: Vienix on June 28, 2002, 03:19:04 PM
put this in your header or existing javascript:

Quote
<script LANGUAGE="JavaScript">
function iSearch(){
   var index;
   index = document.ZoekMaar.service.selectedIndex;
   var site;
   site = document.ZoekMaar.service.options[index].value;
   {top.location=site;
   }
}
</script>


and this is your form:

Quote
<FORM action="javascript:iSearch();void(0)//" method=get name="ZoekMaar">
<p>
<SELECT name=service size=1 style="font-family: Arial; font-size: 10pt;">
<OPTION selected value="http://adam/search.php?search_keywords=test">TEST</OPTION>
<OPTION value="http://adam/search.php?search_keywords=test">TEST</OPTION>
<OPTION value="http://adam/search.php?search_keywords=test">TEST</OPTION>
</SELECT>
<INPUT onclick="iSearch()" type=button value="GO" style="font-family: Arial; font-size: 10pt;"></p>
</form>


And my server is in the attic, not on the internet, so you better change that :)
Title: Quick seach
Post by: jengwen on January 25, 2003, 06:36:40 PM
Does anyone have an example of this working?  Also, maybe this should be moved/copied to the new mod forum so everyone can find it easier.
Title: Quick seach
Post by: Chris on January 25, 2003, 09:25:14 PM
The post by Vienix was for a static list of fixed keywords.  In other words, the list is predetermined and not generated by PHP.  Another mod does this here: http://www.4homepages.de/forum/viewtopic.php?t=1888

Which you already know because you posted a reply there too.  I never tried what Vienix posted.