Minahito
minah****@users*****
2006年 5月 10日 (水) 19:23:50 JST
Index: xoops2jp/html/modules/base/class/image.php diff -u xoops2jp/html/modules/base/class/image.php:1.1.2.1 xoops2jp/html/modules/base/class/image.php:1.1.2.2 --- xoops2jp/html/modules/base/class/image.php:1.1.2.1 Tue May 9 19:21:10 2006 +++ xoops2jp/html/modules/base/class/image.php Wed May 10 19:23:50 2006 @@ -34,6 +34,28 @@ var $mTable = "image"; var $mPrimary = "image_id"; var $mClass = "BaseImageObject"; + + /** + * + * Delete object and image file. + * + * @param $obj BaseImageObject + * @param $force boolean + * @return boolean + */ + function delete(&$obj, $force = false) + { + if (parent::delete($obj, $force)) { + $filepath = XOOPS_UPLOAD_PATH . "/" . $obj->get('image_name'); + if (file_exists($filepath)) { + @unlink($filepath); + } + + return true; + } + + return false; + } } ?>