TinyPortal

Development => Support => Topic started by: melow on October 22, 2006, 05:58:14 PM

Title: adding goggle searchbox module
Post by: melow on October 22, 2006, 05:58:14 PM
Hi,

i have RC3 smf+ 0.96 TP, and i want to add google as a module on my site. i have this code that download from google (http://code.google.com/apis/ajaxsearch/) and here is the code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>My Google AJAX Search API Application</title>
    <link href="http://www.google.com/uds/css/gsearch.css" type="text/css" rel="stylesheet"/>
    <script src="http://www.google.com/uds/api?file=uds.js&amp;v=1.0&amp;key=ABQIAAAAezDOtRvr4VGZZdQ-vjEhghSAtp1xRgqkOY0wMDVtcQ7cRhnqWRSwbFp3KzSs1FVaTACEgOq3xVy0Hg" type="text/javascript"></script>
    <script language="Javascript" type="text/javascript">
    //<![CDATA[

    function OnLoad() {
      // Create a search control
      var searchControl = new GSearchControl();

      // Add in a full set of searchers
      var localSearch = new GlocalSearch();
      searchControl.addSearcher(localSearch);
      searchControl.addSearcher(new GwebSearch());
      searchControl.addSearcher(new GvideoSearch());
      searchControl.addSearcher(new GblogSearch());

      // Set the Local Search center point
      localSearch.setCenterPoint("New York, NY");

      // Tell the searcher to draw itself and tell it where to attach
      searchControl.draw(document.getElementById("searchcontrol"));

      // Execute an inital search
      searchControl.execute("google");
    }

    //]]>
    </script>
  </head>
  <body onload="OnLoad()">
    <div id="searchcontrol"/>
  </body>
</html>


i really have no idea how to install this as a module. i tried to open index.template.php and i have no clue where to put the code.
as i have no knowledge in php :(.any help is appreciated.

Thanks
Title: Re: adding goggle searchbox module
Post by: G6Cad on October 22, 2006, 06:08:00 PM
Why dont you use the google blocks that already exist ?

Look in the block code and snippets forum. The first sticky post there have a list for easy find :)