Ejemplo n.º 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;
}
Ejemplo n.º 2
0
$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 = "相册删除失败";
}
returnpage($page, $info, $cnt, $albumids1, $yeshu, $url);
function returnpage($page, $info, $cnt, $albumids1, $yeshu, $url)
{
Ejemplo n.º 3
0
 $sql = "select * from galleries_photos ";
 $res = mysql_query($sql);
 $deletedRecs = 0;
 $missinFiles = '';
 while ($row = mysql_fetch_array($res)) {
     $fid = $row['id'];
     $folder = $row['folder'];
     $photo = $row['photo'];
     $checkSlash = substr($folder, 0, 1);
     if ($checkSlash == '/') {
         $folder = substr($folder, 1);
         updateFolder($folder, $fid);
     }
     $file = '../../../uploads/' . $folder . $photo;
     if (!file_exists($file)) {
         delPhoto($row['id']);
         $missinFiles .= '<div style="color:#600">' . $file . '</div>';
         $deletedRecs++;
     }
 }
 echo 'Missing Files : ' . $deletedRecs;
 echo "<p>" . $missinFiles . "</p>";
 /**************Sync files***************/
 $files = loadFiles($_POST['folder']);
 $syncFiles = 0;
 $syncFilesList = '';
 for ($i = 0; $i < count($files); $i++) {
     //echo "<br>".$files[$i];
     if (!checkFile($files[$i])) {
         $syncFiles++;
         $syncFilesList .= '<div style="color:#060">-' . $files[$i] . '</div>';