coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Upload => Topic started by: bryan on July 05, 2004, 03:38:36 AM

Title: Solution to solve your /albums/edit from being deleted ...
Post by: bryan on July 05, 2004, 03:38:36 AM
Hi,

I managed to get 'koder', also the system admin of my photo gallery to solve this problem for me. So just to share with you all ...

This simple script he added into 'upload.php' will actually automatically re-create the /albums/edit (if it's deleted) with the index.html inside if a user clicks 'Upload Files'.

Hope it helps you as it did for us.

Regards,
Bryan

Quote from: koder on July 05, 2004, 12:30:39 AM
Okay, seeing as you guys are having a shocker with this....

If you have no clue why it's getting deleted, why not just prevent the error for the time being?

Do the below, and it will make the directory if it doesn't exist, saving you the nightly mkdir :P


/* Search for spring_cleaning in upload.php, around line 403 */
function spring_cleaning($directory_path) {

    // Quickfix Start.
    if (!file_exists($directory_path)) {
               mkdir($directory_path);
               touch($directory_path.'/index.html');
   }
   // Quickfix End.  Do not modify anything else.

   /* This is for reference.  Do not modify the line below. */
    $directory_handle = opendir($directory_path);

Title: Re: Solution to solve your /albums/edit from being deleted ...
Post by: omniscientdeveloper on July 05, 2004, 03:41:48 AM
Actually, spring_cleaning has been updated. I doubt that the problem persists. If so, let me know. I'll have a look at it again.


-omni

[edit]

Hmm...I didn't update the stable version. It's in there now, so you shouldn't have to apply this patch. Try copying "upload.php" from the stable branch of CVS, and tell me if the problem persists. I don't have any problems.

[/edit]
Title: Re: Solution to solve your /albums/edit from being deleted ...
Post by: Joachim Müller on July 05, 2004, 08:26:15 AM
it won't hurt to add the checking for the edit folder and create it if it's not there, so I suggest to incorporate Koder's fix even if there's no reason why the edit folder should vanish at all. There should be an additional chmod in the routine though...

GauGau
Title: Re: Solution to solve your /albums/edit from being deleted ...
Post by: Tarique Sani on July 05, 2004, 09:07:27 AM
upload.php from Stable has a parse error  >:( >:( >:(

It is strongly recomended for all the devs that scripts be tested locally atleast once before commiting to CVS  :-\\
Title: Re: Solution to solve your /albums/edit from being deleted ...
Post by: omniscientdeveloper on July 05, 2004, 11:56:03 AM
  :o :\'(

Sorry. It's fixed now.

XX


-omni