I am encountering a strange proble, with my DBman script. It used to work fine but now let's me no longer add any more records to the default.db file. However the file is only 89 kb large, containing 52 entries. If I delte an entry from teh file, I may again add a new record. But after that it will again give me an unspecific CGI error (I have turned on the debugger) when I try to make another entry. It happened all at once and none of teh otehr files seems to be corrupt. Thus I am unfortnately very stuck. Any thoughts or hints are most welcome. Thank you! I am attaching my files as a ZIP file.
Jun 22, 2006, 8:23 AM
Veteran / Moderator (8669 posts)
Jun 22, 2006, 8:23 AM
Post #2 of 9
Views: 12323
I'm not sure if this is the source of your problem, but it could be. You have the following combination of parameters in your .cfg file:
'ID' => [10, 'numer', -2, 15, 0, '', '']
$db_key = 'ID';
$db_key_track = 1;
$auth_user_field = 10;
As a result, the key values for your database records are things like:
Admin
Admio
Admip
Admiq
and so on to
Admkm
So, the first thing you need to do is to change the $auth_user_field to -1, change all of your key fields in the .db file to numbers and reset your default.count file to whatever the last number you end up with in your .db file.
Give that a try and see if it doesn't help. If not, at least that problem will be fixed.
BTW, it really helps when debugging to have the comment lines.
JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
'ID' => [10, 'numer', -2, 15, 0, '', '']
$db_key = 'ID';
$db_key_track = 1;
$auth_user_field = 10;
As a result, the key values for your database records are things like:
Admin
Admio
Admip
Admiq
and so on to
Admkm
So, the first thing you need to do is to change the $auth_user_field to -1, change all of your key fields in the .db file to numbers and reset your default.count file to whatever the last number you end up with in your .db file.
Give that a try and see if it doesn't help. If not, at least that problem will be fixed.
BTW, it really helps when debugging to have the comment lines.
JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Jun 22, 2006, 12:45 PM
Novice (9 posts)
Jun 22, 2006, 12:45 PM
Post #3 of 9
Views: 12354
Dear Carol, thanks alot for your thoughts! I have made the changes it now works! Thank you! The only new problem I am expiriencing now is that my uploaded pictures do not get properly displayed anymore.
I have changed all the keyfields in the .db file to numbers, starting at 1, ending up at 52. Then I changed the counter file to 52 and finally also changed the uploaded images to match with the keyfields. (E.g. if record / keyfield 3 had a Graphic / 'YES', I would name the coresponding uploaded picture to 3.jpg.
However now pictures get displayed in post that ought not to have any pictures in them. Some recordss that were supposed to have no pictures with them, even display up to 3 pictures!
Hm? Did I make anything wrong?
By the way, speaking of pictures: Do you still have your Image Dimensions mod available? I couldn't find it on your webpage. OH! And yes, the AMIGA was a fantastic machine.
I am attaching the modified files. To see the messed up images e.g. try this link:
http://www.thunting.com/cgi-bin/thunting/news/db.cgi?db=default&uid=default&Category=Treasure+Hunting&Title=&Source=&Publishing+Date=&Country=---&Message=&Link=&Link+URL=&Date=&Filename=&keyword=&sb=---&so=ascend&mh=15&view_records=View+Records?db=default&uid=&ww=on&Category=Tresure+Hunting&view_records=1
Thanks again for your help,
Christian
I have changed all the keyfields in the .db file to numbers, starting at 1, ending up at 52. Then I changed the counter file to 52 and finally also changed the uploaded images to match with the keyfields. (E.g. if record / keyfield 3 had a Graphic / 'YES', I would name the coresponding uploaded picture to 3.jpg.
However now pictures get displayed in post that ought not to have any pictures in them. Some recordss that were supposed to have no pictures with them, even display up to 3 pictures!
Hm? Did I make anything wrong?
By the way, speaking of pictures: Do you still have your Image Dimensions mod available? I couldn't find it on your webpage. OH! And yes, the AMIGA was a fantastic machine.
I am attaching the modified files. To see the messed up images e.g. try this link:
http://www.thunting.com/cgi-bin/thunting/news/db.cgi?db=default&uid=default&Category=Treasure+Hunting&Title=&Source=&Publishing+Date=&Country=---&Message=&Link=&Link+URL=&Date=&Filename=&keyword=&sb=---&so=ascend&mh=15&view_records=View+Records?db=default&uid=&ww=on&Category=Tresure+Hunting&view_records=1
Thanks again for your help,
Christian
Jun 22, 2006, 1:05 PM
Veteran / Moderator (8669 posts)
Jun 22, 2006, 1:05 PM
Post #4 of 9
Views: 12302
In sub html_record, instead of
foreach $file (@files) {
if ($file =~ /^$file_test/) {
Try
if ((lc($file) eq ($rec{$db_key}. ".gif")) || (lc($file) eq ($rec{$db_key}. ".jpg"))) {
Technically, the original code should work, but it doesn't seem to be working for you, so this is plan B.
No, the Image Dimensions thing didn't work and I couldn't make it work. Maybe I can see about doing it again, but not right now.
I still have my Amiga. It hasn't been turned on in more than five years, but I still have it. I have hopes of someday being able to use it again. :-)
JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Code:
$file_test = $rec{$db_key} . "."; foreach $file (@files) {
if ($file =~ /^$file_test/) {
Try
Code:
foreach $file (@files) { if ((lc($file) eq ($rec{$db_key}. ".gif")) || (lc($file) eq ($rec{$db_key}. ".jpg"))) {
Technically, the original code should work, but it doesn't seem to be working for you, so this is plan B.
No, the Image Dimensions thing didn't work and I couldn't make it work. Maybe I can see about doing it again, but not right now.
I still have my Amiga. It hasn't been turned on in more than five years, but I still have it. I have hopes of someday being able to use it again. :-)
JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Jun 22, 2006, 3:55 PM
Novice (9 posts)
Jun 22, 2006, 3:55 PM
Post #5 of 9
Views: 12302
Hello Carol! Wow! It works fine now! Thank you so much! One problem less in my (web)life. Thanks!
I just noticed two more things:
When I try to access / sort by 'New' records only, it will give me a Error 'Message : fatal error: Undefined subroutine in sort at db.cgi line 503.' ???
Also is there a possibility to have the pictures displayed when selecting 'List All'? When I do that it does not display the pictures. Only if I view / browse a category or a specific record. So many questions! I am sorry!
Things were much easier when I was justusing an Amiga for enjoyment *smile*
I just noticed two more things:
When I try to access / sort by 'New' records only, it will give me a Error 'Message : fatal error: Undefined subroutine in sort at db.cgi line 503.' ???
Also is there a possibility to have the pictures displayed when selecting 'List All'? When I do that it does not display the pictures. Only if I view / browse a category or a specific record. So many questions! I am sorry!
Things were much easier when I was justusing an Amiga for enjoyment *smile*
Jun 23, 2006, 6:47 AM
Veteran / Moderator (8669 posts)
Jun 23, 2006, 6:47 AM
Post #6 of 9
Views: 12290
Quote:
When I try to access / sort by 'New' records onlyI'm unfamiliar with that code. It's not my "newest records" mod, is it? I'd have to do a lot of studying of it it figure out what was going on.
Quote:
Also is there a possibility to have the pictures displayed when selecting 'List All'?
Add the following to the beginning of sub html_record:
$rec{$db_key} =~ s/<?.B>//gi;
JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Jun 23, 2006, 7:50 PM
Novice (9 posts)
Jun 23, 2006, 7:50 PM
Post #7 of 9
Views: 12285
Hi Carol, thank you for your advice!
I have replaced the old 'New Additions' routine with yours and it works fine now!
I have also intergrated your preview mod as I thought it would be very usefull and user friendly. The script doesn't give me an error after its integration but now it no longer adds a (numeric) value for the ID field to the .db file but leaves it empty. The counter file is thus empty, too.
It thus won't display images (of newly added records) anymore either (as they are named after the ID field - which is now empty for each new post).
Uh, these Perl scripts are killing me !? *smile*
I have replaced the old 'New Additions' routine with yours and it works fine now!
I have also intergrated your preview mod as I thought it would be very usefull and user friendly. The script doesn't give me an error after its integration but now it no longer adds a (numeric) value for the ID field to the .db file but leaves it empty. The counter file is thus empty, too.
It thus won't display images (of newly added records) anymore either (as they are named after the ID field - which is now empty for each new post).
Uh, these Perl scripts are killing me !? *smile*
Last edited by:
samurai-lupin: Jun 23, 2006, 8:23 PM
Jun 24, 2006, 6:00 AM
Veteran / Moderator (8669 posts)
Jun 24, 2006, 6:00 AM
Post #8 of 9
Views: 12261
I really don't have time to debug the preview mod right now. The best thing I can tell you is to take it out. Another thing to go on my to-do list.
JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Jun 24, 2006, 8:41 AM
Veteran / Moderator (3034 posts)
Jun 24, 2006, 8:41 AM
Post #9 of 9
Views: 12261
samurai-lupin:
If you visit the DBMan unofficial FAQ there are threads that pertain to using the preview mod with the image upload and the changes that are necessary.
Just do a search for preview mod and you should be able to easily find the related threads.
Unoffical DBMan FAQ
http://creativecomputingweb.com/dbman/index.shtml/
If you visit the DBMan unofficial FAQ there are threads that pertain to using the preview mod with the image upload and the changes that are necessary.
Just do a search for preview mod and you should be able to easily find the related threads.
Unoffical DBMan FAQ
http://creativecomputingweb.com/dbman/index.shtml/