Not sure if I understand completely, but I'll give it a shot.
Quote:
1) ive setup some configurations other than using defualt.foo how and what do i use to incorporate them? do i have to copy my db.cgi to another name? is this common?
I am not sure what you mean by this? We run 6 different DBMan databases and setup each database with a unique name and folder. Example: hardware news is stored in .../dbman/hardware_news/ and all the original default names have been changed to hardwarenews.cfg, hardwarenews.cgi, hardwarenews.db, etc.
Quote:
2) i run a content based website and i want to call articles via SSI. is this possible and if so how? based on rowid?
Not exactly sure what you have in mind with (rowid,) but I will give this a shot and see if it helps. Keep in mind this is how we do it, others may have a different or better way but this has worked out great for us. Here is a link to the page that shows the output of the following DBMan code.
www.makeitsimple.com/news/technews/index.shtml In default.cgi (or whatever you named it) setup a new subroutine: ################## V I E W _ R E C O R D S _ S S I ###################
sub view_records_ssi {
my ($status, @hits) = &query("view");
if ($status eq "ok") {
&html_view_success_ssi(@hits);
}
else {
&html_view_failure_ssi($status);
}
}
In default.cgi add the following to the the subroutine (main) elsif ($in{'view_records_ssi'}) { if ($per_view) { &view_records_ssi; } else { &html_unauth; } }
In your html.pl file setup the following new subtroutines: ########### R E C O R D _ S S I ########################
sub html_record_ssi {
my (%rec) = @_;
my $font_color = 'font face="Arial, Helvetica, sans-serif" size=2 color=”#808080”';
my $font = 'font size=1';
print qq|
<$font_color><A HREF= "$rec{'URL'}" target="_blank" class="link1">$rec{'Headline'} - $rec{'Type'}</A><$font>
($rec{'Source'}) $rec{'PostTime'}</Font></font><br></font>
|;
}
############ V I E W _ S U C C E S S _ S S I ########################
sub html_view_success_ssi {
my ($i);
my (@hits) = @_;
my ($numhits) = ($#hits+1) / ($#db_cols+1);
my ($count) = ($numhits);
my ($maxhits); $in{'mh'} ? ($maxhits = $in{'mh'}) : ($maxhits = $db_max_hits);
for (0 .. $numhits - 1) {
if($count && $i > $count-1) { last; }
if(!($i%5) && $i) { print "<BR>"; }
$i++;
&html_record_ssi (&array_to_hash($_, @hits));
}
}
############ V I E W _ F A I L U R E _ S S I ########################
sub html_view_failure_ssi {
my ($message) = $_[0];
print qq|
<$font><P>There were problems with the search.<BR><BR>
Reason:<$error_color><B>$message</B></FONT>
<BR><BR>We are working to fix this please check back later.</p>
|;
}
After you add all of the above it’s time to try the SSI on a page, here is the call we use <!--#include virtual="cgi-bin/dbman/hardware_news/hardwarenews.cgi?db=hardwarenews&uid=default&Headline=*&sb=7&so=descend&mh=25&view_records_ssi=View+Rec ords"-->
After you get SSI working then you can change the output of (sub html_record_ssi) to suit your needs.
Asside from possible copy/paste errors I think the above code should give a good idea of how to get SSI working.
Good Luck! and may the SSI force be with you.
------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com [This message has been edited by NgtCrwlr (edited October 30, 1999).]