[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/plugins/ -> function.google_search.php (source)

   1  <?php
   2  #CMS - CMS Made Simple
   3  #(c)2004 by Ted Kulp (wishy@users.sf.net)
   4  #This project's homepage is: http://cmsmadesimple.sf.net
   5  #
   6  #This program is free software; you can redistribute it and/or modify
   7  #it under the terms of the GNU General Public License as published by
   8  #the Free Software Foundation; either version 2 of the License, or
   9  #(at your option) any later version.
  10  #
  11  #This program is distributed in the hope that it will be useful,
  12  #but WITHOUT ANY WARRANTY; without even the implied warranty of
  13  #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14  #GNU General Public License for more details.
  15  #You should have received a copy of the GNU General Public License
  16  #along with this program; if not, write to the Free Software
  17  #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18  
  19  function smarty_cms_function_google_search($params, &$smarty) {
  20      $domain = $_SERVER['SERVER_NAME'];
  21      $buttonText = 'Search Site';
  22      if (!empty($params['domain']))
  23          $domain = $params['domain'];
  24      if (!empty($params['buttonText'])) 
  25          $buttonText = $params['buttonText'];
  26  
  27      return '<form method="get" action="http://www.google.com/search">
  28      <div>
  29      <input type="hidden" name="ie" value="utf-8" />
  30      <input type="hidden" name="oe" value="utf-8" />
  31      <input type="hidden" name="sitesearch" value="'.$domain.'" />
  32      <input type="text" id="textSearch" name="q" maxlength="255" value="" />
  33      <input type="submit" id="buttonSearch" value="'.$buttonText.'" />
  34      </div>
  35      </form>';
  36  
  37  }
  38  
  39  function smarty_cms_help_function_google_search() {
  40      ?>
  41      <h3>What does this do?</h3>
  42      <p>Search's your website using Google's search engine.</p>
  43      <h3>How do I use it?</h3>
  44      <p>Just insert the tag into your template/page like: <code>{google_search}</code><br>
  45      <br>
  46      Note: Google needs to have your website indexed for this to work. You can submit your website to google <a href="http://www.google.com/addurl.html">here</a>.</p>
  47      <h3>What if I want to change the look of the textbox or button?</h3>
  48      <p>The look of the textbox and button can be changed via css. The textbox is given an id of textSearch and the button is given an id of buttonSearch.</p>
  49  
  50      <h3>What parameters does it take?</h3>
  51      <ul>
  52          <li><em>(optional)</em> domain - This tells google the website domain to search. This script tries to determine this automatically.</li>
  53          <li><em>(optional)</em> buttonText - The text you want to display on the search button. The default is "Search Site".</li>
  54      </ul>
  55      </p>
  56      <?php
  57  }
  58  
  59  function smarty_cms_about_function_google_search() {
  60      ?>
  61      <p>Author: Brett Batie&lt;brett-cms@classicwebdevelopment.com&gt;</p>
  62      <p>Version: 1.0</p>
  63      <p>
  64      Change History:<br/>
  65      None
  66      </p>
  67      <?php
  68  }
  69  
  70  ?>


Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7