Gossamer Forum
Home : Products : DBMan : Customization :

Alphabet links on my DBman homepage

Quote Reply
Alphabet links on my DBman homepage
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 sk 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
Quote Reply
Re: [JPWiese] Alphabet links on my DBman homepage In reply to
Since you have 2 separate fields for the mother's and father's name I don't see any other way than to put a search for each field.

Search by mother's name
Search by father's name

As far as your special characters, there is a thread called "Substituting special characters" in the FAQ under the section for 'Syntax' that may help to solve that issue.

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Alphabet links on my DBman homepage In reply to
Hi again.

I tried to make a search for both Mother_last and Father_last. In my case my last name is Wiese and my wife's last name is Sanne. It (DBman) makes a link out of both letters. When I press the W I get our record. But when I press the S I get the searchpage and a message telling me it didn't find any records. You can see it here:


http://www.colombiaklubben.no/dbman/db.cgi


The other thing was the three missing letters in the alphabeth. The 4 last letters in our alphabet is Z, , and . I didn't get that.

My code in html.pl now look like this:

Code:
# Srearch for mother's last name $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;# Search for father's last name $fieldnum = 64;
$fieldname = Father_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
Quote Reply
Re: [JPWiese] Alphabet links on my DBman homepage In reply to
You don't have the complete code written twice for each individual field you are searching? The display code portion would need to be included so you have 2 different sets of the alphabet listed for doing the search.

Did the thread I referenced above help you to locate the changes to sub query so perhaps it would recognize the extra characters?

Without signing up I can't view your database.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Alphabet links on my DBman homepage In reply to
Sorry that you had to do all this work, but I've given up on this one. THX

Jan Peter