PDA

View Full Version : Do not delete photos from source directory not working


skidpics
March 8th, 2008, 09:56 AM
The bulk upload function of "Do not delete photos from source directory" is not working correctly, my images are still being deleted.

What do you need so we can look into this?

Chuck S
March 8th, 2008, 10:36 AM
Try in uploadphoto.php adding in bold as noted.


'keywords' => STRING, 'mature' => STRING, 'donotdelete' => STRING) );



then twice this


if( isset($skipwater) )
{
forward( "bulkupload.php?ppaction=addphotos&do=preview&donotdelete=$donotdelete&photopath=$uploaduser&upuser=$upuser&notify=$notify&defcat=$category&numprocess=$numprocess&deftitle=$deftitle&defdesc=$defdesc&keywords=$keywords&updir=$updir&processall=$processall&skipwater=true&dthumbs=$dthumbs&mature=$ismature", $Globals['pp_lang']['prepare'] );
}
else {
forward( "bulkupload.php?ppaction=addphotos&do=preview&donotdelete=$donotdelete&photopath=$uploaduser&upuser=$upuser&notify=$notify&defcat=$category&numprocess=$numprocess&deftitle=$deftitle&defdesc=$defdesc&keywords=$keywords&updir=$updir&processall=$processall&dthumbs=$dthumbs&mature=$ismature", $Globals['pp_lang']['prepare'] );
}

skidpics
March 8th, 2008, 11:25 AM
didn't fix the problem.. lets see if our code matches..

'keywords' => STRING, 'mature' => STRING,donotdelete => STRING) );

forward( "bulkupload.php?ppaction=addphotos&do=preview&donotdelete=$donotdelete&photopath=$uploaduser&upuser=$upuser&notify=$notify&defcat=$category&numprocess=$numprocess&deftitle=$deftitle&defdesc=$defdesc&keywords=$keywords&updir=$updir&processall=$processall&skipwater=true&dthumbs=$dthumbs&mature=$mature", $Globals['pp_lang']['prepare'] );

forward( "bulkupload.php?ppaction=addphotos&do=preview&donotdelete=$donotdelete&photopath=$uploaduser&upuser=$upuser&notify=$notify&defcat=$category&numprocess=$numprocess&deftitle=$deftitle&defdesc=$defdesc&keywords=$keywords&updir=$updir&processall=$processall&dthumbs=$dthumbs&mature=$mature", $Globals['pp_lang']['prepare'] );

sorry for about it being so long. cannot find the function to put it into a table..

Chuck S
March 8th, 2008, 11:40 AM
the bulkupload forwards there are 4 of them did you get them all

skidpics
March 8th, 2008, 12:21 PM
Replaced the 4 lines as instructed, no luck. Successfully upload the uploadphoto.php file twice to make sure it was there.

Chuck S
March 8th, 2008, 01:02 PM
I will have to play with it some but I see no reason why it would not work. As long as you pass donotdelete to the bulkupload script there is this code in there which should work fine.


// Delete thumb and image from temp dir
if ( file_exists( $filein ) && $donotdelete != "donotdelete" )
{
@unlink ($filein);
}
}
else
{
// Delete the image and thumb from temp dir
if ( file_exists( $filein ) && $donotdelete != "donotdelete" )
{
@unlink ($filein);
}

skidpics
March 8th, 2008, 01:12 PM
I will have to play with it some but I see no reason why it would not work. As long as you pass donotdelete to the bulkupload script there is this code in there which should work fine.


// Delete thumb and image from temp dir
if ( file_exists( $filein ) && $donotdelete != "donotdelete" )
{
@unlink ($filein);
}
}
else
{
// Delete the image and thumb from temp dir
if ( file_exists( $filein ) && $donotdelete != "donotdelete" )
{
@unlink ($filein);
}



I am review that code. I am not sure 100% how it works, but it seems like the first entry and the 'else' entry is performing the same function?

Chuck S
March 8th, 2008, 01:49 PM
what it says is if the file exists and donotdelete is not equal to donotdelete then delete the file

What I am saying is if we pass donotdelete to bulkupload then it should not delete the images

Like I said I will test it out and see if I see anything

skidpics
March 13th, 2008, 12:26 AM
any luck yet?

Chuck S
March 13th, 2008, 10:13 AM
Not yet there are many delete functions within the file. I need to debug each one. Try at line 241 make this line has the code in bold and try


if ( file_exists( $filein ) && $donotdelete != "donotdelete" )

skidpics
March 14th, 2008, 01:40 PM
that didn't work.. just tried it..

Chuck S
March 14th, 2008, 01:46 PM
You did that to every line in that file BULKUPLOAD.PHP?

skidpics
March 14th, 2008, 01:54 PM
You did that to every line in that file BULKUPLOAD.PHP?

you stated 241, either way, replaced $donotdelete != "donotdelete"

in the corrsponding lines with $donotdelete == "donotdelete"


line 241, 425, 433

skidpics
March 14th, 2008, 01:59 PM
just tried that and I just got a blank bulkupload screen once submitting bulk upload - revert back to original for now.

skidpics
March 14th, 2008, 02:01 PM
is it supposed to be if ( file_exists( $filein ) && $donotdelete == "donotdelete" )

or if ( file_exists( $filein ) && $donotdelete !== "donotdelete" )

notice the ! from a previous post here.

Chuck S
March 14th, 2008, 02:38 PM
Yes

if ( file_exists( $filein ) && $donotdelete != "donotdelete" )

that would be right

Chuck S
March 14th, 2008, 02:59 PM
Please just pm me ftp account info and I will upload the changed files as I applied the changes I noted and things work from what i see.