Index.php
PHP Code:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// SimpleViewer
// ---------------------------------------------------------------------
// Access your SimpleViewer gallery right through this page. For
// embedding purposes it only includes a the SimpleViewer.php
//
//
// Note:
// This index.php just includes the summary page.
//
// ---------------------------------------------------------------------
// Copyright (c) 2004 Christian Machmeier
// ---------------------------------------------------------------------
//
// $Id: index.php,v 1.1.1.1 2004/05/27 22:20:25 grisu Exp $
//
// {{{ Cache control headers
header("Expires: Mon, 31 Dec 2003 12:34:56 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") ." GMT");
header("Pragma: no-cache");
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0", false);
// }}}
// Load the SimpleViewer configuration.
require_once 'SimpleViewerConfig.php';
// Load the SimpleViewer functions library.
require_once 'SimpleViewerFunctions.php';
// Get the current number of albums.
$dirList = getDirList('./', '', false, 'dirs');
// SimpleViewer is not installed yet.
if ($dirList['Number'] == 0) {
header('Location:SimpleViewerAdmin.php');
exit;
}
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php echo $simpleViewer['title']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="SimpleViewerCss.php" />
</head>
<body>
<?php require_once 'SimpleViewer.php'; ?>
</body>
</html>
and
simpleViewer.php
PHP Code:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// SimpleViewer
// ---------------------------------------------------------------------
// Access your SimpleViewer gallery right through this page by getting
// a summary of your currently installed albums first. After your choice
// the requested album will be loaded from the according directory.
//
// Note:
// This file contains the summary, the albums and the installation link.
// This file is embedded in the index.php.
// ---------------------------------------------------------------------
// Copyright (c) 2004 Christian Machmeier
// ---------------------------------------------------------------------
//
// $Id: SimpleViewer.php,v 1.2 2004/06/06 20:52:35 grisu Exp $
//
// Load the SimpleViewer configuration.
require_once 'SimpleViewerConfig.php';
// Load the SimpleViewer functions library.
require_once 'SimpleViewerFunctions.php';
// An album name was specified.
if (!empty($_GET['album']) && is_dir($_GET['album'])) {
$albumConfig = getConfig('./' . $_GET['album'] . '/imageData.xml');
?>
<script language="javascript" type="text/javascript" src="flash_detect.js">
<!--
function getFlashVersion() { return null; };
//-->
</script>
<script language="javascript" type="text/javascript">
<!--
var flashVersion = getFlashVersion();
if (flashVersion < 6) {
window.location.replace("upgrade.html");
}
//-->
</script>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="<?php echo $simpleViewer['galleryWidth']; ?>" height="<?php echo $simpleViewer['galleryHeight']; ?>" id="viewer" align="middle">
<param name="movie" value="viewer.swf" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="bgcolor" value="<?php echo str_replace('0x', '#', $albumConfig['backgroundColor']); ?>" />
<param name="FlashVars" value="xmlDataPath=SimpleViewerImageData.php?album=<?php echo $_GET['album'];?>" />
<embed src="viewer.swf" width="<?php echo $simpleViewer['galleryWidth']; ?>" height="<?php echo $simpleViewer['galleryHeight']; ?>" align="middle" quality="high" scale="noscale" bgcolor="<?php echo str_replace('0x', '#', $albumConfig['backgroundColor']); ?>" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="xmlDataPath=SimpleViewerImageData.php?album=<?php echo $_GET['album'];?>" />
</object>
<?php
// No album name was specified
} else {
?>
<table cellpadding="0" cellspacing="0" width="<?php echo $simpleViewer['galleryWidth']; ?>" height="<?php echo $simpleViewer['galleryHeight']; ?>" border="0">
<tr>
<td align="center" valign="middle" style="height: 10px; font: sans-serif;"">
<div id="overview">
<?php
// Get the current number of albums.
$dirList = getDirList('./', '', false, 'dirs');
// SimpleViewer is not installed yet.
if ($dirList['Number'] == 0) {
echo '
<h2>SimpleViewer is not installed!</h2>
Please log in: <a href="SimpleViewerAdmin.php" class="overview">' . $simpleViewer['adminTitle'] . '</a>
';
// SimpleViewer is installed, show the list of albums.
} else {
echo '
<h2>' . $simpleViewer['title'] . '</h2>
SELECT ALBUM:
<ul>
';
// sort and output the album list.
natsort($dirList['List']);
foreach ($dirList['List'] as $k => $v) {
$xmlData = getConfig('./' . $v . '/imageData.xml');
echo '<li><a href="?album=' . $v . '" class="overview">' . $xmlData['title'] . "</a></li>\n";
}
echo '
</ul>
GALLERY MANAGEMENT <a href="SimpleViewerAdmin.php" class="overview">LOGIN!</a>
';
}
?>
</div>
</td>
</tr>
<tr>
<td style="text-align: right; height: 10px; font: sans-serif;">
<a href="http://www.redsplash.de/projects/simplevieweradmin/" class="overview" style="margin-right: 5px;" target="_blank">SimpleViewerAdmin <?php echo $simpleViewer['version']; ?></a>
</td>
</tr>
</table>
<?php
}
?>