Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [shann123] upgrade from dbman to dbmansql 1

Quote Reply
Re: [shann123] upgrade from dbman to dbmansql 1 In reply to
Modify is working now. Here is what I did:

In sub validate_record:

Make sure quotes are around "$SAVE_DIRECTORY/$newdirname" in this line:

else {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$newdirname") or &cgierr("unable to open directory. Reason: $!");

I had a hell of a time with this since it wasn't in there originally.

Next in sub modify_record, replace:
($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);

with:
($auth_user_field >= 0) and ($in{$auth_user_field} = $db_userid);

Replace everything between
"# Check to make sure the record passes the reg exp and null checks."
and:
"# Build the SET string to be used in the SQL query. We quote all input and int all"

with:

foreach $key (keys %in) {
if ($in{$key} eq 'delete') {
unlink "$SAVE_DIRECTORY/$in{$db_key}/$key";
}
}

$num_files=0;
if (-e "$SAVE_DIRECTORY/$in{$db_key}") {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$in{$db_key}") or &cgierr("unable to open directory: $SAVE_DIRECTORY/$rec{$db_key}. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
foreach $file (@files) {
next if ($file =~ /^\./); # Skip "." and ".." entries..
next if ($file =~ /^index/); # Skip index.htm type files..
++$num_files;
}
}

if ($num_files or $in{'file-to-upload-1'}) { $in{'Graphic'} = 'Yes'; }
else { $in{'Graphic'} = ''; }


$status = &validate_record; # Check to make sure the modifications are ok!

if (($status eq "ok") && ($in{'file-to-upload-1'})) { $status = &validate_upload; } #Validate Pictures

if ($status eq "ok") {


Should be good to go with those changes! Smile
This only took about 6 hours and 4 packs of cigs for this newbie to figure out.. lol (not kidding about the cigs!)

Guess I'm off to try getting the validate mod working.


DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)
Subject Author Views Date
Thread upgrade from dbman to dbmansql 1 shann123 12275 Jan 19, 2004, 5:06 PM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
ltillner 12060 Jan 22, 2004, 1:37 PM
Thread Re: [ltillner] upgrade from dbman to dbmansql 1
shann123 12115 Jan 22, 2004, 2:18 PM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 12073 Jan 23, 2004, 6:08 PM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 12094 Jan 24, 2004, 6:52 AM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 12049 Jan 24, 2004, 7:08 PM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 12047 Jan 25, 2004, 4:50 AM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
ltillner 12074 Jan 26, 2004, 8:37 AM
Thread Re: [ltillner] upgrade from dbman to dbmansql 1
shann123 12041 Jan 26, 2004, 1:08 PM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 12052 Jan 27, 2004, 4:58 PM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 12036 Jan 27, 2004, 6:48 PM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 12028 Jan 30, 2004, 10:06 PM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
timbo 11998 Feb 5, 2004, 11:13 AM
Post Re: [timbo] upgrade from dbman to dbmansql 1
shann123 11995 Feb 8, 2004, 12:10 AM
Thread Re: [timbo] upgrade from dbman to dbmansql 1
ltillner 11987 Feb 10, 2004, 11:24 AM
Thread Re: [ltillner] upgrade from dbman to dbmansql 1
shann123 11894 Mar 2, 2004, 3:21 AM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 11903 Mar 2, 2004, 5:54 AM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 11875 Mar 3, 2004, 2:23 AM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 11846 Mar 3, 2004, 6:35 PM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 11862 Mar 4, 2004, 4:36 AM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 11858 Mar 6, 2004, 8:17 AM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 11840 Mar 7, 2004, 7:20 AM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 11865 Mar 8, 2004, 4:37 AM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 11852 Mar 10, 2004, 10:24 AM
Thread Re: [shann123] upgrade from dbman to dbmansql 1
shann123 11818 Mar 11, 2004, 11:59 AM
Post Re: [shann123] upgrade from dbman to dbmansql 1
shann123 1696 Mar 16, 2004, 5:44 AM