strange issue...i got the latest random block from squatty.com, for the latest gallery and gl 1.3.9
but when i setup the lib-custom file i get one parse error after another...and i cannot find any...its like a wild goose chase...any ideas are appreciated!!
function phpblock_galleryRandomPhoto() {
global $_CONF, $GALLERY_BASEDIR, $GALLERY_NO_SESSIONS, $gallery;
$GALLERY_NO_SESSIONS=true;
$GALLERY_BASEDIR = "/home/greenhil/public_html/godekalb-com/gallery/";
define(CACHE_FILE, "/home/greenhil/public_html/godekalb-com/gallery/block-random.cache");
define(CACHE_EXPIRED, 86400);
require_once($GALLERY_BASEDIR ."init.php");
include_once($_CONF['path_html'] . "/block-random.php");
if ($profile) {
$timer = time();
}
/* Initializing the seed */
srand ((double) microtime() * 1000000);
// Check the cache file to see if it's up to date
$rebuild = 1;
if (fs_file_exists(CACHE_FILE)) {
$stat = fs_stat(CACHE_FILE);
$mtime = $stat[9];
if (time() - $mtime
$rebuild = 0;
}
}
if ($rebuild) {
scanAlbums();
saveCache();
} else {
readCache();
}
$album = chooseAlbum();
if ($album) {
$index = choosePhoto($album);
}
if (isset($index)) {
$id = $album->getPhotoId($index);
$retval = ""
."
fields["name"], $id) .">"
.$album->getThumbnailTag($index)
."";
$caption = $album->getCaption($index);
// Add any exclusions that you want for captions. I don't always add an caption and Gallery use the default image name
// which I don't want to display. My Cannon digicam uses IMG_XXXX and my Kodak uses DCP_XXXX
if (($caption) AND(!strstr($caption,"IMG_")) AND (!strstr($caption,"DCP_"))) {
$retval .= "
$caption";
} else {
$retval .= "
";
}
$retval .= "
From: "
."
fields["name"]) .">"
.$album->fields["title"]
."";
} else {
$retval = "No photo chosen.";
}
if ($profile) {
$elapsed = time() - $timer;
$retval .= "
Elapsed: $elapsed secs";
}
return $retval;
}
?>