Re: htdig: Inserting banner ads into my header.html and

Gilles Detillieux (
Fri, 8 Jan 1999 09:18:22 -0600 (CST)

According to Jerry Preeper:
> Yes, I'm pretty sure you can call a perl script from a C program, at least
> I am calling another c program from htdig to display banner ads on the
> pages on one of my sites. It's been a while since I had all the code
> modified to put this all together, but what we did was create a variable
> that you could place on the header.html file like
> wherever you want the banner ad to appear - much like the other variables
> that you want to appear on these pages.
> Then you need to modify and Display.h , but I'm not sure what
> else we might have modified right off the top of my head (like I said, it's
> been a while since we put this together). In Display.h we added an int and
> a char function in the Methods are that are in . These basically
> execute the banner ad program and write the results to a temp file
> somewhere. Then when the page is read, it simply reads the temp file data.
> This way the execution of the program allows the statistics tracking on
> displays and such, and any clicking of the banners will get recorded as
> they normally would.
> The biggest thing was setting up the file locking as I recall and making
> sure that when the next page is called with more results, it rotates the
> banner there and doesn't keep calling the same temp file.

The latest versions (3.1.0b3 & b4) support use of environment variables
in header.html, so here's a trick you could use that wouldn't require
modifying the C++ code at all. Just replace cgi-bin/htsearch with a
shell script or Perl script that sets the environment variable BANNERAD
to the contents you want embedded in the header, and place a reference to
$(BANNERAD) in header.html, where you want the ad. Then, your script can
call the real htsearch program to do the work. I think that should do
the trick!

Gilles R. Detillieux              E-mail: <>
Spinal Cord Research Centre       WWW:
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 containing the single word "unsubscribe" in
the body of the message.

This archive was generated by hypermail 2.0b3 on Sun Jan 10 1999 - 16:36:30 PST