Beispiel #1
0
function Del_Albumtype($moduleid)
{
    $album_result = Query_Album($moduleid);
    $album_num = Query_AlbumNum($album_result);
    for ($i1 = 0; $i1 < $album_num; $i1++) {
        $album_array = Query_AlbumArray($album_result);
        $album_array_id = $album_array['ids'];
        $photo_result = getPhotoResultByAlbumID($album_array_id);
        $photo_num = getPhotoNumByAlbumID($photo_result);
        for ($i2 = 0; $i2 < $photo_num; $i2++) {
            $photo_array = getPhotoArrayByAlbumID($photo_result);
            $photo_pathnew = "../" . $photo_array['photo_path'];
            $photo_thumbnailnew = "../" . $photo_array['photo_thumbnail'];
            $photoid = $photo_array['ids'];
            if (delPhoto($photoid) == true) {
                delFileo($photo_thumbnailnew);
                delFileo($photo_pathnew);
            }
        }
        delAlbumByAlbumID($album_array_id);
    }
    if (delAlbumTypeByID($moduleid) == true) {
        $info = "相册分类删除成功";
    } else {
        $info = "由于网络原因,操作失败,请稍后重试...";
    }
    return $info;
}
Beispiel #2
0
$albumids = $_GET['albumids'];
$cnt = $_GET['cnt'];
$yeshu = $_GET['yeshu'];
$albumids1 = explode(',', $albumids);
$url = str_replace(" ", "", $_GET['url']);
$page = str_replace(" ", "", $_GET['page']);
$album_name = "默认相册";
//获取当前用户的默认相册
$sql = "select ids,album_name,album_author from blog_album where album_author='{$blog_userid}' and album_name='{$album_name}'";
$moren_array = $public_function->getarray($public_function->getresult($sql));
$moren_albumid = $moren_array['ids'];
for ($i = 0; $i < count($albumids1); $i++) {
    $photo_result = getPhotoResultByAlbumID($albumids1[$i]);
    $photo_num = getPhotoNumByAlbumID($photo_result);
    for ($i2 = 0; $i2 < $photo_num; $i2++) {
        $photo_array = getPhotoArrayByAlbumID($photo_result);
        $photo_pathnew = "../" . $photo_array['photo_path'];
        $photo_thumbnailnew = "../" . $photo_array['photo_thumbnail'];
        $photoid = $photo_array['ids'];
        if (delPhoto($photoid) == true) {
            delFileo($photo_thumbnailnew);
            delFileo($photo_pathnew);
        }
    }
    $boolean = delAlbumByAlbumID($albumids1[$i]);
}
$info = "";
if ($boolean == true) {
    $info = "相册删除成功";
} else {
    $info = "相册删除失败";