• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

Show images to maintain

Status
Not open for further replies.

wout000

Chevereto Member
this little script

<?php

$path = "./";
$dir_handle = @opendir($path) or die("Unable to open folder");

while (false !== ($file = readdir($dir_handle))) {

if($file == "index.php")
continue;
if($file == ".")
continue;
if($file == "..")
continue;

echo "<img src='$file' alt='$file'><br />";

}
closedir($dir_handle);

?>

shows the images in a directory. Might be of some use to maintain your images.
Maybe if someone can add checkboxes so you can delete them..

this adds a checkbox
<?php

$path = "./";
$dir_handle = @opendir($path) or die("Unable to open folder");

while (false !== ($file = readdir($dir_handle))) {

if($file == "index.php")
continue;
if($file == ".")
continue;
if($file == "..")
continue;

echo "<input type=CHECKBOX name=$file>";
echo "<img src='$file' alt='$file'><br />";

}
closedir($dir_handle);

?>

and this i can't get to work 🙂

<?php
$path = "./";
$dir_handle = @opendir($path) or die("Unable to open folder");

//We list the name of the files again, since the name of the checkbox is the same with the name of the file
while (false !== ($file = readdir($dir_handle))) {

if($file == "index.php")
continue;
if($file == ".")
continue;
if($file == "..")
continue;

if(isset($_POST[$file])){
$checkbox = $_POST[$file];
if($checkbox == on) { //checkbox is selected
//Delete the file
if(!unlink($file)) die("Failed to delete file");
}
}
?>

I suggest you put this script in your THUMBS folder otherwise if you have lots of images it will load all day 🙂
also edited your htaccess file to allow PHP files in the folder.
 
Status
Not open for further replies.
Back
Top