47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
<?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);
|
|
if ($x == "" && $entry != ".") {
|
|
echo("<a href='/img/admin.php?l=$dir/$entry'>$entry</a><br/>\n");
|
|
}
|
|
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';>");
|
|
echo("<img width='100px' src='/img/$dir/$img'/>");
|
|
echo("<form><input type='text' value='");
|
|
for($i = 1; $i < $num_tags; $i++) echo $output[$i] . " ";
|
|
echo("'/></form>");
|
|
echo("</div>");
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|