| Author |
Message |
sharlein
User


Joined: Apr 07, 2003 Posts: 30
|
Posted: Mon May 05, 2003 12:45 pm Post subject: Block Random (Improved) |
|
|
| I keep getting error messages and I am confused. Code: › /Fatal error: Failed opening required 'www.xxx.xxx/public_html/Nuke/html/modules/gallery/init.php' (include_path='') in /home/xxx/public_html/Nuke/html/blocks/block-random.php on line 29
Here r the first couple of lines of the blockCode: › $GALLERY_BASEDIR = "www.xxx.xx/public_html/Nuke/html/modules/gallery/";
define(ALBUM_BASEADDR, "http://www.xxx.xxx/albums/");
define(SERVER_ADDR, "http://www.xxx.xxx/");
require_once($GALLERY_BASEDIR . "init.php");
require_once($GALLERY_BASEDIR . "random_support.php"); And from random support:Code: › $GALLERY_BASEDIR = "www.xxx.xxx/public_html/Nuke/html/modules/gallery/";
require_once($GALLERY_BASEDIR . "init.php");
Thanx, Steve |
|
| Back to top |
|
|
AdBot
|
| Post subject: Block Random (Improved) |
|
|
|
|
|
| Back to top |
|
 |
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Tue May 06, 2003 3:04 pm Post subject: |
|
|
i doubt that your gallery base directory is in the form of www.xxx.yyy, it's probably more along the lines of /home/foo_bar/public_html/Nuke/html/modules/gallery/
here is the top couple of lines from my block-random.php file:Code: › $GALLERY_BASEDIR = "/home/httpd/htdocs/modules/gallery/";
define(ALBUM_BASEADDR, "http://www.nukedgallery.net/albums/");
define(SERVER_ADDR, "http://www.nukedgallery.net/");
require_once($GALLERY_BASEDIR . "init.php");
require_once($GALLERY_BASEDIR . "random_support.php");
define(CACHE_FILE, $gallery->app->albumDir . "/block-random.cache");
define(CACHE_EXPIRED, 86400);
and from my random_support.php file:Code: ›
$GALLERY_BASEDIR = "/home/httpd/htdocs/modules/gallery/";
require_once($GALLERY_BASEDIR . "init.php"); |
|
| Back to top |
|
|
sharlein
User


Joined: Apr 07, 2003 Posts: 30
|
Posted: Tue May 06, 2003 3:59 pm Post subject: |
|
|
Dari, I'm just getting too old to learn, I think. You saidQuote: › i doubt that your gallery base directory is in the form of www.xxx.yyy, it's probably more along the lines of /home/foo_bar/public_html/Nuke/html/modules/gallery/
I am confused. My gallery is located atCode: › www.sharlein.net/nuke/html/modules/gallery What would be my GALLERY_BASEDIR =? The rest of the info is the same as yours. Thanks, Steve
P.S. - what the heck is foo_bar??? |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Tue May 06, 2003 4:27 pm Post subject: |
|
|
a ha...make sure you have a slash before the beginning of your basedir name:
Code: › GALLERY_BASEDIR="/home/www.xxx.yyy/blah/blah/blah/gallery/";
and don't forget the /home part either. |
|
| Back to top |
|
|
sharlein
User


Joined: Apr 07, 2003 Posts: 30
|
Posted: Tue May 06, 2003 5:37 pm Post subject: |
|
|
| I added the /home to both random_block and support.php. Now this error appears: Code: › Fatal error: Failed opening required '/home/www.sharlein.net/public_html/Nuke/html/modules/gallery/init.php' (include_path='') in /home/sharlein/public_html/Nuke/html/blocks/block-random.php on line 29
Steve |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Tue May 06, 2003 6:45 pm Post subject: |
|
|
sharlein wrote: › I added the /home to both random_block and support.php. Now this error appears: Code: › Fatal error: Failed opening required '/home/www.sharlein.net/public_html/Nuke/html/modules/gallery/init.php' (include_path='') in /home/sharlein/public_html/Nuke/html/blocks/block-random.php on line 29
Steve
hmm...well the part after the /home/ should be the same in both those messages (you must have it declared improperly, thus it's not finding the proper directory). i'm guessing that line should be:
Code: › $GALLERY_BASEDIR="/home/sharlein/public_html/Nuke/html/modules/gallery/";
just make sure that you have the capitalization correct, as Un*x and PHP are cASe SeNSitIve. |
|
| Back to top |
|
|
sharlein
User


Joined: Apr 07, 2003 Posts: 30
|
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Wed May 07, 2003 7:30 am Post subject: |
|
|
actually, the first error about not finding block-random.cache causes the second error (the function in which the second error occurs loops through the cache file and chooses a new random album to draw the pic from). that in turn, i believe causes the third error (thumbnailed photos have the .thumb.jpg extension), but since no cache file can be found, and the file can't be looped through to pick an album, it craps out and gives you a blank file name.
if there is already a block-random.cache file in the albums directory, delete it and see if the error occurs again.
also, please post the top couple of lines from both your block-random.php and random_support.php files that have all your directory declarations and such. |
|
| Back to top |
|
|
sharlein
User


Joined: Apr 07, 2003 Posts: 30
|
Posted: Wed May 07, 2003 8:42 am Post subject: |
|
|
| There was no block_random.cache file in the albums directory. Code: › $GALLERY_BASEDIR = "/home/sharlein/public_html/Nuke/html/modules/gallery/";
require_once($GALLERY_BASEDIR . "init.php");
function daily_photo(){
global $gallery;
if((fs_file_exists($gallery->app->albumDir."/daily.jpg"))){
$stat=stat($gallery->app->albumDir."/daily.jpg");
$modtime = $stat['mtime'];
if(date("d", $modtime) != date("d", time())) {
list($album,$index) = get_random_photo_id();
list($url, $albumURL) = random_photo($album,$index,24);
$content = "<center><a href=\"".$url."\"><img src=\"".ALBUM_BASEADDR."daily.jpg\"
border=\"0\"></a></center>";
andCode: › $GALLERY_BASEDIR = "/home/sharlein/public_html/Nuke/html/modules/gallery/";
define(ALBUM_BASEADDR, "http://www.sharlein.net/albums/");
define(SERVER_ADDR, "http://www.sharlein.net/");
require_once($GALLERY_BASEDIR . "init.php");
require_once($GALLERY_BASEDIR . "random_support.php");
define(CACHE_FILE, $gallery->app->albumDir . "/block-random.cache");
define(CACHE_EXPIRED, 86400);
/* VALID VALUES FOR $selector:
* "DAILY"
* "HOURLY"
* "RANDOM"
*/ |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Wed May 07, 2003 9:36 am Post subject: |
|
|
in the random_support.php file, locate the get_random_photo_id() method (around line 125).
Change:Code: › // Check the cache file to see if it's up to date
$rebuild = 0; toCode: › // Check the cache file to see if it's up to date
$rebuild = 1;
that should fix it. |
|
| Back to top |
|
|
sharlein
User


Joined: Apr 07, 2003 Posts: 30
|
Posted: Wed May 07, 2003 9:47 am Post subject: |
|
|
Excellent work. Thank you very much - up and running. If you have time for two more, can I use more than 1 block at a time, and how do I control the time interval? Steve |
|
| Back to top |
|
|
sharlein
User


Joined: Apr 07, 2003 Posts: 30
|
Posted: Wed May 07, 2003 9:51 am Post subject: |
|
|
| Just read your article - answers my questions.. tyvm |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Wed May 07, 2003 9:55 am Post subject: |
|
|
| hehe..no problem i was in the process of writing a reply when an email popped up notifying me of your response. if you have any other questions, let me know. |
|
| Back to top |
|
|
sharlein
User


Joined: Apr 07, 2003 Posts: 30
|
Posted: Wed May 07, 2003 10:18 am Post subject: |
|
|
| I was just getting ready to add a second block, and I was looking at my first one. Clicked the photo and got a 404. Hourly.txt read Code: › http://www.sharlein.net/modules.php?set_albumName=album06&id=Getting_Ready_to_do_it&op=modload&name=gallery&file=index&include=view_photo.php http://www.sharlein.net/modules.php?set_albumName=album06&op=modload&name=gallery&file=index&include=view_album.php Our Wedding URL on 404 readCode: › http://www.sharlein.net/modules.php?set_albumName=album06&id=Getting_Ready_to_do_it&op=modload&name=gallery&file=index&include=view_photo.php http://www.sharlein.net/modules.php?set_albumName=album06&op=modload&name=gallery&file=index&include=view_album.php Our Wedding Clicked the album link under photo and got another 404Code: › http://www.sharlein.net/modules.php?set_albumName=album06&op=modload&name=gallery&file=index&include=view_album.php What did I do?????????  |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Wed May 07, 2003 10:22 am Post subject: |
|
|
make sure that after the "modload&name=" has the name of your gallery (case sensitive).
EDIT: I checked it out. for some reason it isn't prepending /Nuke/html/ to your modules URL. it might be an error with the "makeAlbumURL" function that came shipped with gallery....I'll dig around. |
|
| Back to top |
|
|
|
|
|
|
|