2020-05-09 18:53:47 +00:00
|
|
|
<?php
|
|
|
|
session_start();
|
|
|
|
if(!isset($_SESSION["login"])) header("Location: /img/login.php");
|
|
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Pòsweg's image gallery</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<?php
|
|
|
|
include("include/header.php");
|
|
|
|
include("config.php");
|
|
|
|
|
|
|
|
echo "<h2>Woah</h2>";
|
|
|
|
|
|
|
|
$images = array();
|
|
|
|
|
|
|
|
$dir = "drw";
|
|
|
|
if(isset($_GET["l"])) $dir = $_GET["l"];
|
|
|
|
if ($handle = opendir($dir)) {
|
|
|
|
while (false !== ($entry = readdir($handle))) {
|
|
|
|
$x = pathinfo($entry,PATHINFO_EXTENSION);
|
2020-12-23 07:42:16 +00:00
|
|
|
if ($x == "" && $entry != "." && $entry != "..") {
|
|
|
|
echo("<a href='" . $BASE_PATH . "/admin.php?l=$dir/$entry'>$entry</a><br/>\n");
|
2020-05-09 18:53:47 +00:00
|
|
|
}
|
|
|
|
else if($x == "jpg" || $x == "jpeg" || $x == "png"){
|
|
|
|
array_push($images, $entry);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
closedir($handle);
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach($images as $img){
|
|
|
|
$output = "";
|
|
|
|
exec($tmsu . "tags -1 '$dir/$img'", $output);
|
|
|
|
$num_tags = sizeof($output);
|
|
|
|
echo("<div style='float:left';>");
|
2020-12-23 07:42:16 +00:00
|
|
|
echo("<img width='100px' src='" . $BASE_PATH . "/$dir/$img'/>");
|
|
|
|
echo("<form action='admin.php'>");
|
|
|
|
echo("<input type='text' name='tags[" . $img . "]' value='");
|
|
|
|
for($i = 1; $i < $num_tags; $i++) echo $output[$i] . " ";
|
|
|
|
echo("'/>");
|
|
|
|
|
|
|
|
echo("<input type='hidden' name='l' value='" . $_GET["l"] . "'/>");
|
|
|
|
echo("</form>");
|
2020-05-09 18:53:47 +00:00
|
|
|
echo("</div>");
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</body>
|
|
|
|
</html>
|