Welcome to Geeklog, Anonymous Tuesday, November 26 2024 @ 07:36 pm EST
Geeklog Forums
random photo block lib custom problem
Status: offline
greenhil
Forum User
Chatty
Registered: 07/20/04
Posts: 51
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;
}
?>
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;
}
?>
7
7
Quote
dlcheetham
Anonymous
and the resolution was ???
5
8
Quote
greenhil
Anonymous
sorry, forgot to add the link:
http://www.squatty.com/forum/viewtopic.php?forum=1&showtopic=1934
http://www.squatty.com/forum/viewtopic.php?forum=1&showtopic=1934
5
7
Quote
All times are EST. The time is now 07:36 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content