Gossamer Forum
Home : Products : DBMan : Customization :

Need help "modifying a mod"

Quote Reply
Need help "modifying a mod"
Following my quest noted on the post below (Mixing short & long results), I found a solution, (thanks again, CarolC for pointing me in that direction) and just need a minor tweak:

the solution I found is:


sub list_titles {
#----------------------------------
my ($cat_field,$cat_name,%titles,$title,@fields);
my $fieldnum1 = 4; # Change this to the number of your Category field
my $fieldnum2 = 5; # Change this to the number of your Title field
open (DB, "<$db_file_name") or &cgierr("error in list_titles. unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
next if /^#/;
next if /^\s*$/;
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
if ($fields[$fieldnum1] eq $in{$db_cols[$fieldnum1]}) {
$titles{$fields[$fieldnum2]} = $fields[$db_key_pos];
}
}
close DB;

$cat_field = &urlencode($db_cols[$fieldnum1]);
$cat_name = &urlencode($in{$db_cols[$fieldnum1]});
foreach $title (sort keys %titles) {
print qq|
<a href="$db_script_link_url&$cat_field=$cat_name&$db_key=$titles{$title}&ww=on&view_records=1">$title</a> |;
}
}


This works exactly as I wanted, but now all I need to do is to exclude from this list the current record, the one being displayed.

Can anybody help?

Thanks again for any help,

Gustavo Melo