Hi,
I made few modifications to pagemaster and recently have discovered that images uploaded by pagemaster are not removed when deleting an publication. Is this common?
--
rgfdgafgaf
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Pagemaster 0.4.2 image delete
-
- Rank: Freshman
- Registered: Dec 30, 2006
- Last visit: Apr 20, 2010
- Posts: 58
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Yes, there was a note somewhere about that behavior too.
I'm reviewing all the plugins and will see if can implement this too
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Freshman
- Registered: Dec 30, 2006
- Last visit: Apr 20, 2010
- Posts: 58
Is it possible to delete images in delete action? I have separate actions for every pubtype I have tried yesterday code like that:
Code
$uploadpath = pnGetBaseURL().pnModGetVar('PageMaster', 'uploadpath');
$_OGLIMAGENAME = DBUtil::selectFieldByID('pagemaster_pubdata'.$pub['tid'], '_OGLIMAGENAME', $pub['id'], 'id');
if (!empty($_OGLIMAGENAME)) {
$old_image_arr = unserialize($_OGLIMAGENAME);
unlink($uploadpath.'/'.$old_image_arr['tmb_name']);
unlink($uploadpath.'/'.$old_image_arr['pre_name']);
unlink($uploadpath.'/'.$old_image_arr['full_name']);
unlink($uploadpath.'/'.$old_image_arr['file_name']);
LogUtil::registerStatus(__('Done! Publication1 deleted.', $dom));
}
But I'm receiving an error(SQL error) it seams that Im using DBUtil::selectFieldByID not as I suppose.
Other thing is the path to the image to delete it. Should it be:
BaseUrl + uploadpath + filename
or
uploadpath + filename
I know it is ugly I'm having 3000+ expired classfieds with images and I need to delete them cuz my server need space :D it would be ease just delete them from the server but there are mixed with images from other pubtypes.
Now I have changed the way how images are named so I have like that:
{$tid}-{$randName}-tmb.{$ext} instead of {$randName}-tmb.{$ext}
Other way to delete those images (I think it may work) is to get list of all expired image names save it to a text file and then use to multiple delete in console :)
I think it is possible but I have no idea how to do it yet, I'm more comfortable to delete each ad separately... will get someone to do that for me :D less stress:D less cigarettes...
Edited by Kaik on Oct 26, 2010 - 11:14 PM.
--
rgfdgafgaf
- Moderated by:
- Support
