Gossamer Forum
Home : Products : DBMan : Customization :

SSI to call short record display

Quote Reply
SSI to call short record display
Hi,

I've got into the short/long display modification and have amended the old html.pl sub html_record as follows:

my (%rec) = @_;

if ($rec('UserID') ne "") {

print qq|
<-- Start of headline -->
<H3>
<a href="$rec('DestinationURL')" target="_blank">$rec{'Article_heading'}</a>
</H3>
<br>
$rec('Synopsis_of_article')
<-- End of headline -->
|;

}

}

And I have now tried using the following SSI on a page:

<!--#include virtual="/cgi-local/dbman/db.cgi?db=news&uid=default&ID=*&sb=0&so=descend&mh=4&view_records=1&ssi=1"-->

On loading the page, I get the following CGI error:

"This script must be called from the Web
using either GET or POST requests".

Am I missing something from the html.pl script sub routine?

TIA,

Andy
Quote Reply
Re: SSI to call short record display In reply to
Are you wanting to include that URL on a "static" web page? Or are you including it within the html.pl?

If it is the former, it would be problematic to include a query string within a cgi script and call it on a static web page (like .html or .shtml).

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: SSI to call short record display In reply to
Thanks.

Does that mean there's no way of displaying "headline" fields from each record as part of an .shtml page?

What I have in mind is www.lizdavies.org which (I believe) uses SSI to fire up NewsMan (a tweak of DBMan) and display a headline and synopsis from each record on the home page.

Any guidance as to how to achieve this would be a tremendous help.

TIA,

Andy
Quote Reply
Re: SSI to call short record display In reply to
Rather than using virtual include, have you tried the following:

Code:
<!--#exec cgi="/cgi-local/dbman/db.cgi?db=news&uid=default&ID=*&sb=0&so=descend&mh=4&view_records=1"-->

Without the ssi=1. I don't know what that argument does. I assume it stands for Server Side Includes (ssi). The site you referenced does not use that argument. Also, I am unsure if Liz is actually using SSI. She may be manually inputting the information and then linking to the expanded news stories.

Also, you might want to consider contacting Liz directly and ask her.

Smile

I know this probably doesn't help. But trying my best.

Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: SSI to call short record display In reply to
Hi

The ssi=1 idea come from this thread:
http://www.gossamer-threads.com/...um5/HTML/001090.html
it'll only stop the headers and footers displaying if some extra code is added to html.pl

I hope this helps

Chris
Quote Reply
Re: SSI to call short record display In reply to
Thanks, Chris, for clarifying the "SSI=1" part.

In the thread you referenced, you explain how the db.cgi script can be called using SSI. To quote you:

"And call the script via a .shtml page like this (you can use whatever you want in this string, the important thing is that you have ssi=1):

"code:
<!--#include virtual="/cgi-bin/dbman/db.cgi?db=default&uid=default&ID=*&sb=0&so=descend&mh=6&view_records=1&ssi=1" -->"

Trying DBMan and Newsman, I get the error message that this script must be called using GET or POST. (SSI works fine for other purposes on the server I use.) Have you tweaked the script to allow a call using SSI to function?

TIA,

Andy
Quote Reply
Re: SSI to call short record display In reply to
Hi Andy

Yes stuff in html.pl has to be changed for the ssi=1 to do anything - stuff you don't want on SSI pages need to be in a bit of code like this:

Code:
# detect if ssi=1, and if so don't print the top of the page
if (! $in{'ssi'}) {
# stuff you don't want in SSI pages

}

and if that means you haven't printed httpd headers you then need this:

Code:
if ($in{'ssi'}) { &html_print_headers; }

then you have the code you want to produce stuff on the SSI pages and then don't print the footer:

Code:

# detect if ssi=1, and if so don't print the bottom of the page

Code:
if (!$in{'ssi'}) {
# stuff you don't want in SSI pages
}

Hope this make it clearer

Chris
Quote Reply
Re: SSI to call short record display In reply to
Thanks, Chris. But I'm confused!

What you've covered here relates to using the SSI=1 command in the script to hide header and footer when you want "View records" to show extracts from the records on a page without showing the usual DBMan header and footer.

Am I right in thinking that something else is needed to allow SSI on an .shtml page to call the script in the first place (getting over my error message as above)? Cos I've tried NewsMan (with the SSI=1 command) and still got the error message.

Do you have any ideas?

Thanks again,

Andy
Quote Reply
Re: SSI to call short record display In reply to
Eliot (or anyone else)



Does the #exec cgi SSI present a security risk?

thanks,
Sigrid

Quote Reply
Re: SSI to call short record display In reply to
There is never 100% security with .cgi or any other application. It is relatively secure though.

Regards,

Eliot Lee