Gossamer Forum
Home : Products : DBMan : Customization :

counter for previous mod

Quote Reply
counter for previous mod
JPD I need your help again.
You did a mod for me a few days ago, which was a two teired short display mod, and for the life of me I carn't seem to incorperate a counter into it.
I,ve tried to add some from previous postings, but I carn't get them to go.
It,s just the usual count for grouped displayes, ie apples(10), etc.
The code for one level of results is below, I can put it into the other one.
Code:
sub list_makes {
# --------------------------------------------------------
open (DB, "<$db_file_name") or
&cgierr("error. unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
@lines = <DB>;
close DB;
$make_fieldnum = 4; # Change this to match the field number of your model field
$category_fieldnum = 3; # Change this to match the field number of your make field
foreach $line (@lines) {
chomp($line);
@data = &split_decode($line);
if ($data[$category_fieldnum] eq $in{'Category'}) {
if (!(grep $_ eq $data[$make_fieldnum], @make_list)) {
push (@make_list, $data[$make_fieldnum]);
}
}
}
foreach $make (@make_list) {
$make_link = &urlencode($make);
$category_link = &urlencode($in{'Category'});
print qq|<a href="$db_script_link_url&Make=$make_link&Category=$category_link&view_records=1">$make</a><BR>|;
}

}
thanks again
Bob
Subject Author Views Date
Thread counter for previous mod lanerj 1481 Sep 4, 1999, 2:26 AM
Post Re: counter for previous mod
JPDeni 1393 Sep 4, 1999, 6:17 AM
Post Re: counter for previous mod
lanerj 1397 Sep 4, 1999, 3:06 PM