Gossamer Forum
Home : Products : DBMan : Customization :

short/long bug

Quote Reply
short/long bug
Hi again.. this place is a must for newbie's like myself.. thanks to all who take the time to help out Smile

I have a problem or two concerning the long and short display of records..

Everything is working, and looking, beautifully, and the long record looks fine. However, all the records on each page link to the first record on the page since I have changed $db_key to "Title", $db_key_track to 0 and deleted the "ID" row from .cfg and html.pl files.

Also I've added an url-link to go to the modify_record function directly

<A HREF="$db_script_url?db=$db_setup&uid=$db_uid&modify_form_record=1&modify=$rec{$db_key}">Modify</A>

This Link doesn't work now, since I have changed this($db_key to "Title", $db_key_track to 0 and deleted the "ID" row from .cfg and html.pl files.).

here are my .cfg, html.pl and db.cgi

http://www.seyhan-phone.de/images/html.txt

http://www.seyhan-phone.de/images/db.txt

http://www.seyhan-phone.de/images/defaultcfg.txt

Any help is appreciated!
Quote Reply
Re: [uhrwerk] short/long bug In reply to
I don't know what happens now. I have empty database file saved on my server and I have the following problem now: I see the record in long format, but without picture and also url-link to go to the modify_record function directly doesn't work. I use Alphabetic listing with following code

$fieldnum = 0;
$fieldname = Title;
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>


|;

It seems to be also a not working part in my database.

I don't really know what has happened with my database!!!!



Help me to solve this problem
Quote Reply
Re: [uhrwerk] short/long bug In reply to
When you made changes to your .cfg and html.pl files did you manually edit or start over with a fresh .db file?

It sounds like your database may be corrupted since you made the changes to the configuration.

What happens if you start adding records using a blank .db file?

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] short/long bug In reply to
Yes, I started over only with a fresh .db file and I have the same problem as was earlier about which I already wrote:

I see the record in long format, but without picture and also url-link to go to the modify_record function directly

<A HREF="$db_script_url?db=$db_setup&uid=$db_uid&modify_form_record=1&modify=$rec{$db_key}">Modify</A>

doesn't work.

Also the Alphabetic listing with following code doesn't work:

$fieldnum = 0;
$fieldname = Title;
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>


|;
Quote Reply
Re: [LoisC] short/long bug In reply to
I have tried to start over with absolutely new default .cfg, .pl and .cgi files. I have only changed $db_key to "Title", $db_key_track to "0" and installed short/long dipslay. The url-link to go to the modify_record function directly :

<A HREF="$db_script_url?db=$db_setup&uid=$db_uid&modify_form_record=1&modify=$rec{$db_key}">Modify</A>

and Alphabetic listing don't work.


I assume it has with "$long_url" something to do.
Quote Reply
Re: [uhrwerk] short/long bug In reply to
I could be wrong but I think you will have problems trying to use a title, which could contain more than one word, as your db_key.

I would suggest changing back to use a number for your db_key.

Did you switch to the title field to avoid duplicate entries within that field? If so, there are other means of preventing duplicates. If that is the case, you can find out how within the FAQ noted below.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] short/long bug In reply to
Thank you for your help. Now it works!!