Gossamer Forum
Quote Reply
SSI
Hello,
I have been trying to get some ssi commands to work on my first page to make it more dynamic. I would like to include the ssi call, that says the number of items in each catagory.

To include the total number of items, I am using this code
Code:
Total Number of Items:
<!--#include file="default.count"-->

But how would I include the number of items with the title of "Widget"?
Code:
Total Number of Widgets:
<!--#exec ="???"-->
[/code

http://www.heritageantiquemaps.com/auction/orders/database/db.pl?db=default&uid=admin.94933702295044&ID=&Title=Widgets&view_records=View+Rec ords

So in the above example, there are no records matching widgets, so I would want a "0" returned. However, if there were 10 widgets, then I would want "10" returned.

Please note that I am on an NT server, so unix commands won't work.

Thanks guys.
Quote Reply
Re: SSI In reply to
I am trying to do something similar, because I want to be able to display some fields from one dbman db in the results field of another. I thought I could accomplish this using SSI (because apparently (from what I have been able to search/read/etc) you cannot reference more than one db using dbman) by calling the script URI from the page...

And it would work too, save for the fact that the server (apache in my case) will only processs pages that have a special extension (.shtml or whatever you want) so that it would know to preprocess them...BUT when you call data in dbman it has no extension thus no SSI processing by server!

If you find out otherwise, let me know
Quote Reply
Re: SSI In reply to
I have to use the *.shtml extension also to make the ssi calls work. Maybe we could write the count data to a count.txt file for each catagory that we want to display... I am not quite sure how to do this, do you have any idea's?

Also, it is funny that you mentioned your idea if adding other records to the bottom of one. I was thinking about trying a similar mod, "if you like this record, then check out the following..."

I will let you know if I come across something that can handle the ssi calls. You may want to check out this thread:
http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/001290.html

[This message has been edited by dataKing (edited January 31, 2000).]
Quote Reply
Re: SSI In reply to
I believe this is the thread you are looking for http://www.gossamer-threads.com/...m12/HTML/000853.html

------------------
The Immuatable Order of Modding
-=-=-=-=-=-=-=-
1. Read the FAQ, 2. Search the board, 2a. Search the board again, 3. ask the question, 4. back-up, 5. experiment, 6. rephrase question (or better yet, post solution to original question)
Quote Reply
Re: SSI In reply to
I just had an ephiphane (or brain fart as I call them)...It just occurred to me that you need to have the .shtml extension so the server will process any SSI commands.

Well, I don't know if this will work in NT, but it would in unix...This does not solve your internal problem of counting records, but it may (I have not tested it yet) solve your technical problem in getting the server to process SSI requests embedded on your database...
...ready?

Instead of calling your cgi db.cgi, how about calling it db.shtml, thus forcing the server to process all ssi commands in your database?!

Its worth a shot!

I found an earlier post that is an even better solution...
http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/001066.html

[This message has been edited by Luis (edited February 01, 2000).]
Quote Reply
Re: SSI In reply to
Didn't work....back to the drawing board...
Quote Reply
Re: SSI In reply to
I'm not quite sure what you are all trying to do but we use SSI extensively on our sites. When I wanted to include our standard SSi calls in DBMan, Alex helped us out by writing a bit of code that we now include in EVERY version of DBMan we set up. Maybe his format here might lead you to some clues. If not, well...maybe you can use it for something else.

This code goes into the html.pl file.

<pre>
##########################################################
## SSI Include Replacement ##
##########################################################

sub include {
# --------------------------------------------------------
# This is text to include. Use like an SSI.

my $file = shift;
open (FILE, "<$file") or die "Can't open $file ($!)";
print <FILE>;
close FILE;
}

## Then add this line wherever you want file included
## |; &include ("../path/to/file"); print qq|
</pre>



------------------
Regards,

Richard Bilger, Publisher
mailto:RBilger@MERGInet.com
__________________________________________________
MERGInet Medical Resources
http://www.MERGInet.com
mailto:info@MERGInet.com
__________________________________________________