Posted: Sat Sep 11, 2004 11:05 am Post subject: Random Photo block error line 61???
Please help, I searched, and also had this working, but it stoped. I reloaded everything but I got this error:
Fatal error: main(): Failed opening required '/path/to/your/modules/gallery/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/palmosce/public_html/Nuke2/blocks/NG-RandomPhoto_functions.php on line 61
I know my init.php is there,
here is my RandomPhoto_functions.php contents
<?php
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Developed by Dariush Molavi at NukedGallery.net
* Version 2.0
* 13 December 2003
*/
if (eregi("block-NG-RandomPhoto_functions.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_EMBEDDED_INSIDE_TYPE, $GALLERY_MODULENAME, $Version_Num;
/*******************************************************************/
/* Full path to your Gallery, don't forget the trailing / */
/*******************************************************************/
$GALLERY_BASEDIR = "/home/palmosce/public_html/mahonfamiles-com/Nuke2/modules/gallery/";
/*******************************************************************/
/* The module name of your Gallery, default is "gallery" */
/*******************************************************************/
$GALLERY_MODULENAME = "gallery";
/*******************************************************************/
/* Time, in seconds, to refresh random photo cache. Default is */
/* 86400 (check it daily) */
/*******************************************************************/
define(CACHE_EXPIRED, 10);
/*******************************************************************/
/* Full path to your albums directory, don't forget the trailing / */
/*******************************************************************/
define(ALBUM_DIRECTORY,"/home/palmosce/public_html/mahonfamiles-com/Nuke2/modules/gallery/albums/");
/*******************************************************************/
/* STOP!! DO NOT EDIT ANYTHING BELOW THIS POINT */
/*******************************************************************/
define(CACHE_FILE, ALBUM_DIRECTORY."block-random.cache");
function createBlockContent($album,$index,$scale,$auto=0) {
global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_EMBEDDED_INSIDE_TYPE, $GALLERY_MODULENAME;
function get_random_photo_id(){
/* Initializing the seed */
srand ((double) microtime() * 1000000);
// Check the cache file to see if it's up to date
$rebuild = 0;
if (fs_file_exists(CACHE_FILE)) {
$stat = fs_stat(CACHE_FILE);
$mtime = $stat[9];
if ((time() - $mtime) > CACHE_EXPIRED) {
$rebuild = 1;
}
}
else {
$rebuild = 1;
}
if ($rebuild) {
scanalbums();
savecache();
}
else {
readcache();
}
$album = choosealbum();
if ($album) {
$index = choosephoto($album);
}
return array($album,$index);
}
function savecache() {
global $cache;
$fd = fopen(CACHE_FILE, "w");
foreach ($cache as $key => $val) {
fwrite($fd, "$key/$val\n");
}
fclose($fd);
}
function readcache() {
global $cache;
if ($fd = fs_fopen(CACHE_FILE, "r")) {
while ($line = fgets($fd, 4096)) {
list($key, $val) = explode("/", $line);
$cache[$key] = $val;
}
fclose($fd);
}
}
function choosephoto($album) {
global $cache, $gallery;
Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Sat Sep 11, 2004 6:41 pm Post subject: Re: Random Photo block error line 61???
you have to replace the '/path/to/your/modules/gallery/init.php' with the actual path, ie '/home/jimbob/public_html/modules/gallery/init.php' (that is only an example!!).
Posted: Sat Sep 11, 2004 8:59 pm Post subject: Re: Random Photo block error line 61???
First Thanks for the reply
But where and how do I do that?
I am guessing, here
require_once($GALLERY_BASEDIR . "init.php");
but what should the new line look like?
Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Sat Sep 11, 2004 9:16 pm Post subject: Re: Random Photo block error line 61???
it should be something like:
require_once("/home/palmosce/public_html/mahonfamiles-com/Nuke2/modules/gallery/init.php");
not sure why the GALLERY_BASEDIR isn't working...probably because that variable is gone in the latest versions of Gallery. I need to recode these blocks, but I haven't had the time.
Posted: Sat Sep 11, 2004 11:47 pm Post subject: Re: Random Photo block error line 61???
Which file does that change need to be made in? I have modified the NG_RandomPhoto_Functions.php to have the correct base directory, but don't see anything in any of the three files that has a specific path to the init.php
Posted: Sun Sep 12, 2004 8:41 am Post subject: Re: Random Photo block error line 61???
Figured it out as in it worked?
I added the fix above, but still get this message:
Fatal error: main(): Failed opening required '/home/palmosce/public_html/mahonfamiles-com/Nuke2/modules/gallery/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/palmosce/public_html/Nuke2/blocks/NG-RandomPhoto_functions.php on line 61
Posted: Sat Nov 06, 2004 11:34 pm Post subject: Re: Random Photo block error line 61???
Palmoscentral, if you are still having the error in line 61 the answer is easy. It seems this dizn0g figured it out but does not share information. I was having the same problem. Look in your gallery directory and see if the g in gallery is capitalized. If it is your full path to gallery will be - $GALLERY_BASEDIR = "/home/palmosce/public_html/mahonfamiles-com/Nuke2/modules/Gallery/";
and the module name to your gallery will be - $GALLERY_MODULENAME = "Gallery"; This was my solution to this problem.
Joined: Nov 23, 2004 Posts: 20 Location: Zimmerman/MN
Posted: Wed Nov 24, 2004 11:50 am Post subject: Re: Random Photo block error line 61???
i was having this problem until i moved my albums to the main directory. Dont know if that helps? But thos is how my new structure is setup
Code: › /*******************************************************************/
/* Full path to your Gallery, don't forget the trailing / */
/*******************************************************************/
$GALLERY_BASEDIR = "/home/photoan/public_html/modules/gallery/";
/*******************************************************************/
/* The module name of your Gallery, default is "gallery" */
/*******************************************************************/
$GALLERY_MODULENAME = "gallery";
/*******************************************************************/
/* Time, in seconds, to refresh random photo cache. Default is */
/* 86400 (check it daily) */
/*******************************************************************/
define(CACHE_EXPIRED, 10);
/*******************************************************************/
/* Full path to your albums directory, don't forget the trailing / */
/*******************************************************************/
define(ALBUM_DIRECTORY,"/home/photoan/public_html/albums/");
/*******************************************************************/
/* STOP!! DO NOT EDIT ANYTHING BELOW THIS POINT */
/*******************************************************************/
define(CACHE_FILE, ALBUM_DIRECTORY."block-random.cache");
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum