Tiny Search Box for other sites to use!
November 17, 2007 05:59PM
This isn't so much a MOD as an additional tool for getting people to your site. It isn't too impressive but its a little bit of something I would like to contribute.

Replace YOURSITEHERE with your url or the whole domain can be replaces to reflect where your search.php is.

There is a small GIF called LOGOSM.GIF that you can make for your search otherwise you can get rid of it completely.

This should work on any site that can read HTML and JavaScript.

This isn't anything all too ground breaking but I know I find it highly useful.


<!-- Begin Search Box -->
<!-- Thrown together by Koletzke and Rowe -->

<table border="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#6699FF" width="230" id="AutoNumber1" height="49">
<tr><td width="226" height="0" align="center">
<img border="0" src="http://www.YOURSITEHERE.com/images/LOGOSM.gif" width="164" height="56"><font face="Arial" size="1" color="#D5888F"><br>
<font face="Arial" size="1" color="#6699FF">What are you looking for?</font></font><script type="text/javascript">
function goTo()
{
var url = document.forms[0].url.value;
var rurl = document.forms[0].rurl.value;
var query = document.forms[0].query.value;
window.location = url+'?query='+query+rurl;
return false;
}
</script><form action="" method="get" onsubmit="return goTo()">
<input type="hidden" name="url" id="url" value="http://www.YOURSITEHERE.com/search.php">
<input type="hidden" name="rurl" id="rurl" value="&results=10&search=1">
<input type="text" name="query" id="query" size="20">

<input type="submit" value="Submit">
</form></td></table>

<!-- End Search Box -->



Take care guys!

-Flyntlok
Re: Tiny Search Box for other sites to use!
November 24, 2007 04:31AM
Hey, i think this is great, but i want to know if it´s posible that the search results window open in a new blank page? thanks. (excuse me about my english, i´m from Venezuela smiling smiley)
Re: Tiny Search Box for other sites to use!
April 01, 2008 04:41AM
Thanks! Did you have a image already made for the .gif though? I installed it without and either way it is a very slick looking thing for the site, looks like it's professional rather than amateur as I am.
Re: Tiny Search Box for other sites to use!
April 02, 2008 02:40PM
Hi Pokas

Change this:

<form action="" method="get" onsubmit="return goTo()">

So you have this:

<form action="" method="get" onsubmit="return goTo()" target="_blank">

Hope this helps
Re: Tiny Search Box for other sites to use!
September 24, 2008 04:02PM
I second pokas question. Is there a way that the page would open up to the actual results instead of the homepage with the search term in the search box?



Thanks,
Selym
Re: Tiny Search Box for other sites to use!
November 11, 2008 07:41PM
This is a great mod!

I do have one question though, when using this on a subdomain of my site, it tries to use the existing URL and not the URL I've specified.

For example, the search box is on:

forums.domain.com

And the URL for the search is at:

www.domain.com/search/search.php

Therefore, when the search field is on forums.domain.com, the URL is modified to:

forums.domain.com/?query=query&results=10&search=1

Any ideas why?

Hummdis Communications
Freelance Website Design/IT & Network Consulting
http://www.hummdis.com



Edited 1 time(s). Last edit at 11/11/2008 07:42PM by Hummdis.
Re: Tiny Search Box for other sites to use!
November 17, 2008 08:44PM
No one has any idea?

Hummdis Communications
Freelance Website Design/IT & Network Consulting
http://www.hummdis.com
Re: Tiny Search Box for other sites to use!
November 18, 2008 04:40AM
Hummdis Wrote:
-------------------------------------------------------
> No one has any idea?

Post your code
Re: Tiny Search Box for other sites to use!
December 02, 2008 10:29PM
Here it is:

<DIV CLASS="search">
<TABLE BORDER="0" CELLSPACING="0" ID="AutoNumber1" ALIGN="RIGHT">
<TR>
<TD ALIGN="right">
<SCRIPT TYPE="text/javascript">
  function goTo() {
  var url = document.forms[0].url.value;
  var rurl = document.forms[0].rurl.value;
  var query = document.forms[0].query.value;
  window.location = url+'?query='+query+rurl;
  return false;
  }
</SCRIPT>
<FORM ACTION="" METHOD="get" onSubmit="return goTo()">
<INPUT TYPE="hidden" NAME="url" ID="url" VALUE="http://www.domain.com/search/search.php">
<INPUT TYPE="hidden" NAME="rurl" ID="rurl" VALUE="&results=10&search=1">
Search:<INPUT TYPE="text" NAME="query" ID="query" SIZE="15">
<INPUT TYPE="submit" VALUE="Submit">
</FORM></TD></TABLE>
</DIV>

Hummdis Communications
Freelance Website Design/IT & Network Consulting
http://www.hummdis.com
Re: Tiny Search Box for other sites to use!
December 04, 2008 03:43AM
At first glance it looks like you did not modify the VALUE for the hidden input:

VALUE="http://www.domain.com/search/search.php"

should be:

VALUE="http://forums.domain.com/search/search.php"

?

Also, why use this code when you can simply copy the code in search_form.html?

<table cellpadding="5" cellspacing="1" class="searchBox">
<tr>
<td align="center">

<form action="search.php" method="get">

<table><tr><td>
<div align="left">
<input type="text" name="query" id="query" size="40" value="<?php print quote_replace($query);?>" onClick="initializeSuggestFramework();" action="/include/js_suggest/suggest.php" columns="2" autocomplete="off" delay="1500" style="font-size:150%;">
</div>
<td>
<input type="submit" value="<?php print $sph_messages['Search']?>" style="font-size:150%;">
</td></tr></table>
Re: Tiny Search Box for other sites to use!
December 15, 2008 08:57AM
Thanks for the great code!
"_blank" is not causing page to open in new window.


<!-- Begin Search Box -->
<!-- Thrown together by Koletzke and Rowe -->

<table border="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#6699FF" width="230" id="AutoNumber1" height="49">
<tr><td width="226" height="0" align="center">
<img border="0" src="http://www.sumtercentral.com/images/paypal.jpg" width="164" height="56"><font face="Arial" size="1" color="#D5888F"><br>
<font face="Arial" size="1" color="#6699FF">What are you looking for?</font></font><script type="text/javascript">
function goTo()
{
var url = document.forms[0].url.value;
var rurl = document.forms[0].rurl.value;
var query = document.forms[0].query.value;
window.location = url+'?query='+query+rurl;
return false;
}
</script><form action="" method="get" onsubmit="return goTo()" target="_blank">
<input type="hidden" name="url" id="url" value="http://www.sumtercentral.com/sumter-search/search.php">
<input type="hidden" name="rurl" id="rurl" value="&results=10&search=1">
<input type="text" name="query" id="query" size="50">

<input type="submit" value="Submit">
</form></td></table>

<!-- End Search Box -->


I have also tried putting it after the url which does not work either.
Any Ideas?
Re: Tiny Search Box for other sites to use!
December 27, 2008 08:39PM
having the same problem={
Re: Tiny Search Box for other sites to use!
February 12, 2009 12:04PM
Why not just use something simple like the following.

<center>
<form action="http://www.instantfreeadvertising.com/search/search.php" method="post" target="_blank">
<table cellpadding="5" cellspacing="1" class="searchBox">
<TR>
<TD><img src='http://www.instantfreeadvertising.com/search/img/sq_instantifa.jpg' title='IFA Search' alt='Instant Free Advertising Search'/><BR>
<input type="text" name="query" id="query" size="15" ><BR><input type="image" name="submit" src="http://snazzynichesearch.snazzypromotions.com/img/findit.jpg">
</TD>
</TR>
<TR>
<TD><input type="hidden" name="search" value="1"> </TD>
</TR>
</TABLE>
</form></center>

replace my domain and images for your own.
Just make sure you have the full web url path to the search.php and not just ./search.php or ../search.php or search.php

All those will call from the folder you are in.

For example
If you are in --basket.somewhere.com-- and your post url is only search.php it will be read as --basket.somewhere.com/search.php -- when infact the correct url should be --www.somewhere.com/search.php--.

So always ensure you have the full web url entered as the post url.

Refer my code above.

Hope this helps

Arty

Instant Free Advertising
Where Advertising Your Site Begins
http://www.instantfreeadvertising.com/search/index.php?m=1
Re: Tiny Search Box for other sites to use!
April 07, 2009 09:22AM
This is a fantastic search box. I love it

This may seem obvious to everybody else, but how do i change the text input color and the color of the text in the "submit" button?
Sorry, only registered users may post in this forum.

Click here to login