gzuncompress
|
Server IP : 172.19.0.2 / Your IP : 216.73.216.178 Web Server : Apache/2.4 System : Linux 880f91b28fd7 5.15.0-117-generic #127~20.04.1-Ubuntu SMP Thu Jul 11 15:36:12 UTC 2024 x86_64 User : tomlinde ( 155017) PHP Version : 5.6.40 Disable Function : dl, syslog, opcache_get_status MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/webpages/lima-city/tomlinde/html/gallery_peggy/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] | [ Lock Shell ] | [ Logout ] |
|---|
<?php
include("config.inc.php");
require_once 'internals/globalConstants.php';
if($pass_required)
if (!( isset($_SERVER['PHP_AUTH_USER'])
&& strtolower($_SERVER['PHP_AUTH_USER']) == $pass_user
&& strtolower($_SERVER['PHP_AUTH_PW']) == $pass_password) ) {
header('WWW-Authenticate: Basic realm='.$title);
header('HTTP/1.0 401 Unauthorized');
echo 'Username or password is wrong. Access denied.';
exit;
}
//ob_start();
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="pictures.xsl"?>
<website>
';
echo "\t<title>$title</title>\n";
$path = "./pictures/";
$active = getActive();
echo "\t<active>".$active."</active>\n";
$d = dir(IMAGE_CACHE_PATH);
echo "\t<cache>\n";
while (false !== ($entry = $d->read())) {
if($entry == "." || $entry == "..")
continue;
echo "\t\t<size>".$entry."</size>\n";
}
echo "\t</cache>\n";
$d = dir($path);
while (false !== ($entry = $d->read())) {
if($entry == "." || $entry == "..")
continue;
//$date = date("d.m.Y", filemtime($path.$entry));
if(is_dir($path.$entry))
{
$sub_path = $path.$entry."/";
echo "\t<folder name=\"".$entry."\">\n";
$sd = dir($sub_path);
while (false !== ($sub_entry = $sd->read())) {
if($sub_entry == "." || $sub_entry == "..")
continue;
if(!is_dir($sub_path.$sub_entry)){
if($active != "" and $path.$active."/".$_GET['p'] == $sub_path.$sub_entry)
echo "\t\t<img current=\"true\">$sub_entry</img>\n";
else
echo "\t\t<img>$sub_entry</img>\n";
}
}
echo "\t</folder>\n";
continue;
} else {
if($path.$_GET['p'] == $path.$entry)
echo "\t<img current=\"true\">$entry</img>\n";
else
echo "\t<img>$entry</img>\n";
}
}
$d->close();
echo "</website>";
/*
//------------ going for output -----------------
$XMLContent = ob_get_clean();
$xslDoc = new DOMDocument();
$xslDoc->load("pictures.xsl");
$xmlDoc = new DOMDocument();
$xmlDoc->loadXML($XMLContent);
$proc = new XSLTProcessor();
$proc->importStylesheet($xslDoc);
header ("content-type: text/html; charset=utf-8;");
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo "\n";
echo $proc->transformToXML($xmlDoc);
ob_flush();
*/
function getActive() {
global $path;
$thumbPath = $path;
$active = "";
if( isset($_GET['active']) )
$active = $_GET['active'];
else {
$d = dir($thumbPath);
while (false !== ($entry = $d->read())) {
if($entry == "." || $entry == "..")
continue;
$active = $entry;
break;
}
}
return $active;
}
?>