Images in the File-section are not physically being deleted

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Images in the File-section are not physically being deleted

Post by Moan »

Hi there dear community,

I have a little problem with the "deleted" files in the filemanager. Apparently they are not completely deleted from the HD. It seems that there is just a flag inside the DB that sets them to the status "deleted".
The problem is now that when I would like to insert a picture in the WYSIWYG-Editor (in this case it's the FCK) ALL pictures - even the deleted ones - show up. When - as in my case - you have quite a big amount of images inside the filesystem it is very hard to find the right picture inside the whole lot of pictures.

Is there a possibility to really delete the images/files to not let them show up anymore in the Imagebrowser? I'm using the phpWCMS-Browser since the alternative "Insert picture" was hard to tweak to the right directory.

Thank you very much in advance!! :lol:

Daniel
User avatar
Oliver Georgi
Site Admin
Posts: 9904
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

files uploaded by WYSIWYG editors are not handled by phpwcms. So you have to delete these (inside pictures only) manually.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Post by Moan »

Hi Oliver,

I don't upload them inside the WYSIWYG-Editor. I use the normel file-section for that or for multiple-uploads an ftp-connection and then the file-section for taking over these files.

Thanks for your really quick answer... 8)

Daniel
User avatar
Oliver Georgi
Site Admin
Posts: 9904
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

then you are right - deleting just marks files as deleted. In admin section you can find a function to remove such files. But these are moved to folder "can_be_deleted" inside file storage folder only. But you can delete files there if necessary.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Post by Moan »

Okay, thanks. Though this wasn't the thing I wanted to hear, i can now "build" on your answer :)

Thanks again

Daniel
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Post by Moan »

Ok, me again.

Since this fact really bothers me I am trying to work things out.

Has anyone ever tried to display only the files that are not flagged "deleted" inside the phpWCMS_ImageBrowser? If yes, could you give ma a hint? I already found the file ImageManager.php inside the FCKeditor installation and in my opinion the following function has to be changed.

Code: Select all

deleted!
Since this function just lists all physical files inside the imagedirectory it also displays the ones that I deleted. But that's what I don't want.
So, a workaround is needed to access the DB inside the ImageManager.php and just pick out the images that have not yet been deleted.

If anyone already has done such a workaround could you be so kind and post it here? Otherwise I'm going to try ma luck now 8)

@Oliver: To be honest I haven't found the option to move files to the "can_be_deleted" folder inside the admin section :(

Cheers and thx

Daniel
User avatar
Oliver Georgi
Site Admin
Posts: 9904
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Please, do NOT mix image handling inside WYSIWYG editor and phpwcms file manager. These are completely different things!

An image browser for Spaw2 will follow which connects to phpwcms file management.

All files stored in "pictures" are not handled by phpwcms.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Post by Moan »

Hi Oliver,

I know that phpwcms doesn't handle the files inside the "picture"-folder.

And I finally accept that mixing up the two things (phpWCMS_ImageBrowser and the internal filesystem) is no good. But my customer is quite mixed up since he has a whole lot of pictures that he deleted but still show up :( OK, then I wait for SPAW2 whatever that may be :)

Cheers

Daniel
User avatar
Oliver Georgi
Site Admin
Posts: 9904
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

spaw2 is another WYSIWYG editor included by default since 1.2.9.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Peekay
Posts: 286
Joined: Sun 25. Jul 2004, 23:24
Location: UK

Post by Peekay »

@moan
When you delete an image from a folder in the file manager, it winds up in the trash. Open the 'trash can' tab and you can permanently 'empty' the trash, however this simply makes the files un-restorable. To remove the files from the disc, you need to select the 'ADMIN' menu and choose 'Remove delete files' from the sidebar menu. This *moves* the files from 'PHPWCMS_Filestorage' into the 'can be deleted' folder.

I would assume that this would also remove the files from any WYSIWYG editor plugin list of available files, assuming the plugin was configured to look in PHPWCMS_Filestorage.

Your client can perform this housekeeping process in the backend, provided they have administrator status. It is up to you to periodically delete the files from the 'can_be_deleted' folder, either via FTP or a cron job.

But wait... there's more :wink:

When you USE an image in an article via a content-part, a copy of the image is created by PHPWCMS at the desired dimensions and placed in the 'content/images' folder. This is the image that is linked to the article. That's why even if you delete images from the file manager, they will still appear in articles.

Fortunately, when you open a web page containing an image, the re-sized version in the content/images folder is re-created dynamically from the 'master' copy in the file manager. This means you can safely empty the content/images folder periodically to 'purge' un-used re-sized images. The ones that are still in use will be regenerated 'on the fly'.

Once again, you will need to delete the folder contents via FTP or a cron job.

HTH.
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Post by Moan »

Hi there Peekay,

thanks for your answer. I will have a look at the option "Permanently delete files" - I already had a look but perhaps I was just blind. Is it already implemented in the 1.2.3-version?

The thing with the image being used inside an article is fine. It is just for pictures that were uploaded once upon a time and never been used afterwards again :lol:

I'll try my luck tonight and come back to you..

Cheers

Daniel
Peekay
Posts: 286
Joined: Sun 25. Jul 2004, 23:24
Location: UK

Post by Peekay »

Is it already implemented in the 1.2.3-version?
Arrived in version 1.25 (I think).
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Post by Moan »

Ahhh, I should upgrade one day 8)

Thx

Daniel
User avatar
Oliver Georgi
Site Admin
Posts: 9904
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

not one day - as soon as possible - 1.3.0 is much improved. And 1.2.5 has some security problems...

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Post by Moan »

Hi,

I know I know. The only pain I have is that I did some customizing inside phpwcms and whenver I overwrite all the files I have to do a **** between the changes I made back then and your changes :D

But yeah, you're right! Next weekend - it always takes sometime to upgrade :)

Cheers

Dani
Post Reply