Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [Hank] Long + Short Display

Quote Reply
Re: [Hank] Long + Short Display In reply to
Hi,

Let replace the subroutine below in HTML.pm

sub generate_search_results {
#----------------------------------------------------------------------
my $tags = GT::Template->tags;
my $record = $tags->{results}[$tags->{row_num}-1];
if ($tags->{home}->{cgi}->{fm} eq 'short') {
my $num_cols = $tags->{home}->{cgi}->{num_cols} || 3;
my $output = '<table border=1 cellpadding=0 cellspacing=0><tr><td><table border=0 width=500>';
my $cols = $tags->{home}->{db}->cols;
my @ordered_cols = $tags->{home}->{db}->ordered_columns;
my @pk = $tags->{home}->{db}->pk;
my $pk_url = ($tags->{home}->{cgi}->{sid})? "sid=$tags->{home}->{cgi}->{sid}" : '';
foreach (@pk) {
$pk_url .= ($pk_url)? "&$_=$record->{$_}&$_-opt==" : "$_=$record->{$_}&$_-opt==";
}
my $count;
foreach (@ordered_cols) {
my $title = $cols->{$_}->{form_display} || $_;
$output .= qq~<tr ><td width='30%'><font face='Tahoma,Arial,Helvetica' size=2>
$title </td><td width='70%'><font face='Tahoma,Arial,Helvetica' size=2>
$record->{$_}</font></td></tr>
~;
$count++;
last if ($count == $num_cols);
}
$output .= "<tr><td><a href='db.cgi?db=$tags->{home}->{cgi}->{db}&do=search_results&$pk_url'>Details</a></td></tr></table></td></tr></table>";
return $output;
}
else {
my $output = $tags->{home}->{disp}->display ( { mode => 'search_results', values => $record } );
return $output;
}
}
Hope that helps.

Cheers,
TheStone.

B.
Subject Author Views Date
Thread Long + Short Display lubatico 5433 Aug 20, 2001, 8:26 AM
Thread Re: Long + Short Display
911 5329 Aug 20, 2001, 9:47 AM
Thread Re: [911] Long + Short Display
Suomi 5174 Nov 9, 2001, 7:58 AM
Thread Re: [Hank] Long + Short Display
604 5180 Nov 9, 2001, 10:05 AM
Thread Re: [TheStone] Long + Short Display
Suomi 5183 Nov 9, 2001, 11:08 AM
Post Re: [Hank] Long + Short Display
604 5169 Nov 9, 2001, 11:26 AM
Thread Re: [911] Long + Short Display
Bearwithme 5125 Nov 10, 2001, 9:48 AM
Thread Re: [Bearwithme] Long + Short Display
604 5135 Nov 12, 2001, 10:13 AM
Thread Re: [TheStone] Long + Short Display
Suomi 5104 Nov 12, 2001, 11:53 AM
Thread Re: [Hank] Long + Short Display
604 5125 Nov 13, 2001, 10:37 AM
Post Re: [TheStone] Long + Short Display
Suomi 5079 Nov 14, 2001, 6:47 AM
Post Re: [TheStone] Long + Short Display
Bearwithme 5122 Nov 12, 2001, 4:14 PM
Post Re: Long + Short Display
santana 5294 Aug 21, 2001, 2:46 AM