Re: [htdig] random banner ad's on header.html


Gilles Detillieux (grdetil@scrc.umanitoba.ca)
Mon, 10 May 1999 12:40:58 -0500 (CDT)


According to Greg:
> I am battling to get the hang of the SSI in the results. Are there sample scripts
> that can show a newbie how to setup a simple script to call the htsearch. At
> present I run a simple random banner script that is called by <!--#exec
> cmd="banner.cgi"--> within the html document. I would at all possible like to
> use this script as it contains all the necessary images, URL and ALT tags. I
> am running Apache 1.3.4 on Linux machine. I would assume I could add to
> this script to call the htsearch.

Definitely one for the FAQ...

While htsearch doesn't currently provide a means of doing SSI on its
output, or calling other CGI scripts, it does have the capability (since
3.1.0b3) of using environment variables in templates.

The easiest way to get rotating banners in htsearch is to replace htsearch
with a wrapper script that sets an environment variable to the banner
content, or whatever dynamically generated content you want. Your script
can then call the real htsearch to do the work. You'd then need to
reference that environment variable in header.html (or wrapper.html if
that's what you're using), to indicate where the dynamic content should
be placed.

If the dynamic content is generated by a CGI script, your new wrapper
script which calls this CGI would then have to strip out the parts that
you don't want embedded in the output (headers, some tags) so that only
the relevant content gets put into the environment variable you want.
You'd also have to make sure this CGI script doesn't grab the POST data
or get confused by the QUERY_STRING contents intended for htsearch.

Your wrapper script can be written as a shell script, or in perl, C,
C++, or whatever you feel comfortable using.

An alternative approach is to have a cron job that periodically regenerates
a different header.html or wrapper.html with the new banner ad, or changes
a link to a different pregenerated header.html or wrapper.html file.

-- 
Gilles R. Detillieux              E-mail: <grdetil@scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930
------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig@htdig.org containing the single word "unsubscribe" in
the SUBJECT of the message.



This archive was generated by hypermail 2.0b3 on Mon May 10 1999 - 10:51:03 PDT