1 # Blosxom Plugin: google_sitesearch
2 # Author(s): Rael Dornfest <rael@oreilly.com>
4 # Documentation: See the bottom of this file or type: perldoc google_sitesearch
6 package google_sitesearch;
8 # --- Configurable variables -----
10 # What text should appear on your Search button?
12 # To which domain(s) would you like to restrict your Google SiteSearch?
13 # (Defaults to what you set as your Blosxom $url)
17 # What customization bits were included in the "cof" field when
18 # you signed up for your free Google SiteSearch?
22 # --------------------------------
24 $searchbox; # use as $google_sitesearch::searchbox in flavour templates
28 $domains ||= $blosxom::url;
29 $domains =~ s!^\w+?://!!; # get rid of the http:// bit
31 $searchbox = <<"SEARCHBOX";
32 <!-- Search Google -->
33 <form method="GET" action="http://www.google.com/custom">
34 <a href="http://www.google.com/"><img src="http://www.google.com/logos/Logo_40wht.gif" border="0" alt="Google"></a>
36 <input name="q" type="text" size="25" maxlength="255" />
38 <input type="submit" name="sa" value="Google Search" />
39 <input type="hidden" name="domains" value="$domains">
40 <input type="hidden" name="cof" VALUE="$cof">
42 <font face=arial,sans-serif size=-1>
43 <input type="radio" name="sitesearch" value="" checked />Search WWW
44 <input type="radio" name="sitesearch" value="$domains" />Search $blosxom::blog_title
47 <!-- Search Google -->
50 0; # No need to continue; we're done.
60 Blosxom Plug-in: google_sitesearch
64 Provides Google Free SiteSearch [http://www.google.com/services/free.html]
69 Drop the google_sitesearch plug-in into your plugins directory.
71 Use $google_sitesearch::searchbox anywhere in your flavour templates you wish.
75 The google_sitesearch plug-in assumes you've signed up for Google's Free
76 SiteSearch [http://www.google.com/services/free.html] for your site.
78 The plug-in will just work out of the box without any configuration.
79 That said, it's probably best to apply any configuration settings you
80 made when you signed up for Google SiteSearch in the Configurable
83 While $domains defaults to something intelligent -- your Blosxom $url
84 sans the http:// bit -- you might fill in whatever values appear in
85 the domains field of the form Google created for you when you signed
88 e.g. <INPUT type=hidden name=domains value="example">
90 Simply paste everything between the "" between the "" of $domains in the
91 Configurable Variables section.
93 Also, Google Free SiteSearch allows you to customize the look-and-feel
94 of your results pages. If you'd like, you can set $cof to the value
95 appearing in the cof field of the form Google created for you when
98 e.g. <INPUT type=hidden name=cof VALUE="GIMP:#666666;T:#666666;ALC:#666666;L:http://www.example/images/example.gif;GFNT:#666666;LC:#666666;BGC:#dddddd;AH:center;VLC:#666666;GL:1;S:http://www.example/;GALT:#666666;AWFID:2498b45f59b093e3;">
100 Simply paste everything between the "" between the "" of $cof in the
101 Configurable Variables section.
107 Version number coincides with the version of Blosxom with which the
108 current version was first bundled.
112 Rael Dornfest <rael@oreilly.com>, http://www.raelity.org/
116 Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/
118 Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml
122 Address bug reports and comments to the Blosxom mailing list
123 [http://www.yahoogroups.com/group/blosxom].
127 Blosxom and this Blosxom Plug-in
128 Copyright 2003, Rael Dornfest
130 Permission is hereby granted, free of charge, to any person obtaining a
131 copy of this software and associated documentation files (the "Software"),
132 to deal in the Software without restriction, including without limitation
133 the rights to use, copy, modify, merge, publish, distribute, sublicense,
134 and/or sell copies of the Software, and to permit persons to whom the
135 Software is furnished to do so, subject to the following conditions:
137 The above copyright notice and this permission notice shall be included
138 in all copies or substantial portions of the Software.
140 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
141 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
142 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
143 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
144 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
145 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
146 OTHER DEALINGS IN THE SOFTWARE.