Ejemplo n.º 1
0
 function checkFolder($album, $album_cleaned)
 {
     global $count, $albumcount;
     $subalbums = $album->getAlbums(0);
     foreach ($subalbums as $subalbum) {
         $obj = newAlbum($subalbum);
         cleanAlbum($obj);
     }
     $folder = $album->name . '/';
     $files = $album->getImages(0);
     foreach ($files as $filename) {
         $seoname = seoFriendly($filename);
         if (stripSuffix($seoname) != stripSuffix($filename)) {
             $image = newImage($album, $filename);
             if ($e = $image->rename($seoname)) {
                 $error = getE($e, $filename, $seoname);
                 printf(gettext('<em>%1$s</em> rename to <em>%2$s</em> failed: %3$s'), $folder . $filename, $seoname, $error);
                 echo "<br />\n";
             } else {
                 $image->save();
                 clearstatcache();
                 echo '&nbsp;&nbsp;';
                 printf(gettext('<em>%1$s</em> renamed to <em>%2$s</em>'), $folder . $filename, $seoname);
                 echo "<br />\n";
                 $count++;
                 if (!$album_cleaned) {
                     Gallery::clearCache(SERVERCACHE . '/' . $album->name);
                     if (extensionEnabled('static_html_cache')) {
                         Gallery::clearCache(SERVERPATH . '/' . STATIC_CACHE_FOLDER);
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 function checkFolder($album)
 {
     global $count, $albumcount;
     $subalbums = $album->getAlbums(0);
     foreach ($subalbums as $subalbum) {
         $obj = newAlbum($subalbum);
         cleanAlbum($obj);
     }
     $folder = $album->name . '/';
     $files = $album->getImages(0);
     foreach ($files as $filename) {
         $seoname = seoFriendly($filename);
         if (stripSuffix($seoname) != stripSuffix($filename)) {
             $image = newImage($album, $filename);
             if ($e = $image->rename($seoname)) {
                 $error = getE($e, $filename, $seoname);
                 printf(gettext('<em>%1$s</em> rename to <em>%2$s</em> failed: %3$s'), $folder . $filename, $seoname, $error);
                 echo "<br />\n";
             } else {
                 $image->save();
                 clearstatcache();
                 echo '&nbsp;&nbsp;';
                 printf(gettext('<em>%1$s</em> renamed to <em>%2$s</em>'), $folder . $filename, $seoname);
                 echo "<br />\n";
                 $count++;
             }
         }
     }
 }