Fork me on GitHub

Pagemaster 0.4.2 image delete  Bottom

  • 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
  • Yes, there was a note somewhere about that behavior too.
    I'm reviewing all the plugins and will see if can implement this too icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • 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

This list is based on users active over the last 60 minutes.