I have a little trouble with the alphabet links om my DBman homepage.
1. In my database I have info on families. Here in Norway a lot of families have two last names (Mother one and Father one). These links finds first letter in the mothers last name and makes a link, but not the fathers. At the same time I dont want two links to for instance the letter A if there is a mother and a father who's last name starts on A. How can I do this?
2. In Norway we have 3 letters after Z (Z = last letter in english). These are Æ, Ø and Å (æ,ø,å). How can I put these in the links?
My files are:
http://www.colombiaklubben.no/dbman_txt/db_cgi.txt
http://www.colombiaklubben.no/..._txt/default_cfg.txt
http://www.colombiaklubben.no/dbman_txt/html_pl.txt
The links part of sub html_home is: (This part works fine)
# Lenker til alfabetsorterte søk i databasen (sortert på etternavn)
$fieldnum = 63;
$fieldname = Mother_last;
open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) {
flock(DB, 1);
}
LINE: while (<DB> ) {
next if /^#/;
next if /^\s*$/;
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
$letter = substr($fields[$fieldnum],0,1);
if (!(grep $_ eq $letter, @alphabet)) {
push (@alphabet, $letter);
}
}
close DB;
print qq|<P><CENTER>|;
$i = 65;
while ( $i < 91 ) {
if (grep $_ eq chr($i), @alphabet) {
print qq| <A HREF="$db_script_link_url&sb=1&so=ascend&$fieldname=%5E|;
print chr($i);
print qq|&re=on&view_records=1">[|;
print chr($i);
print qq|]</a>\n|;
}
else {
print "[" . chr($i) . "]";
}
++$i;
}
print qq|</CENTER></P>|;
Jan Peter
1. In my database I have info on families. Here in Norway a lot of families have two last names (Mother one and Father one). These links finds first letter in the mothers last name and makes a link, but not the fathers. At the same time I dont want two links to for instance the letter A if there is a mother and a father who's last name starts on A. How can I do this?
2. In Norway we have 3 letters after Z (Z = last letter in english). These are Æ, Ø and Å (æ,ø,å). How can I put these in the links?
My files are:
http://www.colombiaklubben.no/dbman_txt/db_cgi.txt
http://www.colombiaklubben.no/..._txt/default_cfg.txt
http://www.colombiaklubben.no/dbman_txt/html_pl.txt
The links part of sub html_home is: (This part works fine)
# Lenker til alfabetsorterte søk i databasen (sortert på etternavn)
$fieldnum = 63;
$fieldname = Mother_last;
open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) {
flock(DB, 1);
}
LINE: while (<DB> ) {
next if /^#/;
next if /^\s*$/;
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
$letter = substr($fields[$fieldnum],0,1);
if (!(grep $_ eq $letter, @alphabet)) {
push (@alphabet, $letter);
}
}
close DB;
print qq|<P><CENTER>|;
$i = 65;
while ( $i < 91 ) {
if (grep $_ eq chr($i), @alphabet) {
print qq| <A HREF="$db_script_link_url&sb=1&so=ascend&$fieldname=%5E|;
print chr($i);
print qq|&re=on&view_records=1">[|;
print chr($i);
print qq|]</a>\n|;
}
else {
print "[" . chr($i) . "]";
}
++$i;
}
print qq|</CENTER></P>|;
Jan Peter