Hi,
As I was trying to add some rotating banners to the htsearch output and
because Apache does not parse CGI scripts' output for SSI tags I had to
make some changes to htsearch so that it would run the SSI scripts instead.
Before I did that I checked in the mailing list archives and although I did
not find solution to the problem I discovered that other people were trying
to do deal with the same problem.
The code is real ugly but does the job if one is careful. I am posting it
here in case anyone would want to give it a try and hope that it would not
end up in the official release of htdig the way it is :-)))
(To make use of it simply replace Display::displayParsedFile() in
Display.cc with the code below)
Jivko
===========================================
Display::displayParsedFile(char *filename)
{
FILE *fl = fopen(filename, "r");
char buffer[1000];
char *chp;
char c_cmd[1000];
while (fl && fgets(buffer, sizeof(buffer), fl))
{
// 11/23/98: Jivko patches the code to kind of support SSI
if(memcmp(buffer,"<!--#exec cgi=",14)==0)
{
chp=strchr(buffer+14,' '); // find the end of the script's name
if(chp)
{
*chp=0;
sprintf(c_cmd,"./%s",buffer+14);
fflush(NULL);
system(c_cmd);
}
}
else
expandVariables(buffer);
}
if (fl)
fclose(fl);
}
----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the body of the message.