private function _pic_unlink_for_hash($hash) { $list = Lua::get_more("select filename from lua_files where hash='{$hash}' and systemname='" . SYSNAME . "'"); if ($list) { foreach ($list as $v) { $file = LUA_ROOT . SYSNAME . '/' . $v['filename']; if (file_exists($file)) { unlink($file); } $thumbfile = LUA_ROOT . SYSNAME . '/' . Lua::get_thumb($v['filename']); if (file_exists($thumbfile)) { unlink($thumbfile); } for ($i = 1; $i < 6; $i++) { $thumb_any = LUA_ROOT . SYSNAME . '/' . Lua::get_thumb($v['filename'], '_' . $i . '00'); if (file_exists($thumb_any)) { unlink($thumb_any); } } } } Doo::db()->query("delete from lua_files where hash='{$hash}' and systemname='" . SYSNAME . "'"); }