The .zip version is working but the images aren't showing up. I'm not sure why. I can navigate to www.4crg.org/pics/getalbumpics.php?id=jaguar and that looks right:
Code:
var jaguar={
baseurl: "http://4crg.org/pics/",
images: [
[0, "hi.JPG", "Sep 24, 2012 20:45:04"],
[1, "howsitgoing.jpg", "Sep 24, 2012 20:46:30"],
[2, "goodhowareyou.jpg", "Sep 24, 2012 20:47:19"],
[3, "decent.jpg", "Sep 24, 2012 20:48:24"],
[4, "justdecent.jpg", "Sep 24, 2012 20:49:05"],
[5, "yup.jpg", "Sep 24, 2012 20:43:37"],
["placeholder"]
],
desc: []
}
Except that the baseurl doesn't have the www. part in it. It should. It looks like the server has some sort of rewrite engine on. I can't see any of that. But I'm seeing the results. You cannot navigate to anything on that domain without the www. part. If you try, you get redirected the the index page with www. added. Either that rewrite engine needs to be modified or www. has to be added to the baseurl when and if it's missing.
Try this getalbumpics.php file, replace the existing one in the zip installation:
PHP Code:
<?php
Header("content-type: application/x-javascript");
function returnimages($dirname=".") {
$pattern='/\.(jpg|jpeg|png|gif|bmp)$/i';
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(preg_match($pattern, $file)){
$filedate=date ("M d, Y H:i:s", filemtime($file));
echo " [$curimage, \"$file\", \"$filedate\"],\n";
$curimage++;
}
}
echo ' ["placeholder"]' . "\n";
closedir($handle);
}
}
$photovar=$_GET['id'];
if (!preg_match('/^[a-z0-9_]+$/i', $photovar)){
echo "alert(\"Photo Album ID must contain only letters, numbers, or underscore, and cannot start with a number\")";
die();
}
echo "var $photovar={\n";
echo " baseurl: \"http://www." . $_SERVER["SERVER_NAME"] . dirname($_SERVER['PHP_SELF']) . "/\",\n";
echo " images: [\n";
returnimages();
echo " ],\n";
echo " desc: []\n";
echo "}\n";
?>
The browser cache may need to be cleared and/or the page refreshed to see changes. And the server might need to have its cache cleared too. On the pics.htm page you can add the highlighted:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="pics/getalbumpics.php?id=jaguar&bust=7329"></script>
<script type="text/javascript">
//Optional, manual description for . . .
to make the server fetch the file new. Each time you change the file, you need to use a different number. But that's only if the server is caching it.
Bookmarks