Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

Block Random (Improved)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Blocks View previous topicPrinter friendly versionView next topic
Author Message
sharlein

User
User


Joined: Apr 07, 2003
Posts: 30

PostPosted: Mon May 05, 2003 12:45 pm    Post subject: Block Random (Improved) Reply with quote

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 block
Code: › $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
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: Block Random (Improved)  

Back to top
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Tue May 06, 2003 3:04 pm    Post subject: Reply with quote

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
Offline View user's profile Send private message Visit poster's website
sharlein

User
User


Joined: Apr 07, 2003
Posts: 30

PostPosted: Tue May 06, 2003 3:59 pm    Post subject: Reply with quote

Dari, I'm just getting too old to learn, I think. You said
Quote: › 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 at
Code: › 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
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Tue May 06, 2003 4:27 pm    Post subject: Reply with quote

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
Offline View user's profile Send private message Visit poster's website
sharlein

User
User


Joined: Apr 07, 2003
Posts: 30

PostPosted: Tue May 06, 2003 5:37 pm    Post subject: Reply with quote

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
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Tue May 06, 2003 6:45 pm    Post subject: Reply with quote

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
Offline View user's profile Send private message Visit poster's website
sharlein

User
User


Joined: Apr 07, 2003
Posts: 30

PostPosted: Tue May 06, 2003 9:23 pm    Post subject: Reply with quote

Well, that changed some things Very Happy . Now I get
Code: › Warning: fopen("/home/sharlein/public_html/albums/block-random.cache", "r") - No such file or directory in /home/sharlein/public_html/Nuke/html/modules/gallery/platform/fs_unix.php on line 53

Warning: Invalid argument supplied for foreach() in /home/sharlein/public_html/Nuke/html/modules/gallery/random_support.php on line 230

Warning: Unable to open '/home/sharlein/public_html/albums//.thumb.jpg' for reading: No such file or directory in /home/sharlein/public_html/Nuke/html/modules/gallery/platform/fs_unix.php on line 24
I think I am going backwards. Steve
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Wed May 07, 2003 7:30 am    Post subject: Reply with quote

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
Offline View user's profile Send private message Visit poster's website
sharlein

User
User


Joined: Apr 07, 2003
Posts: 30

PostPosted: Wed May 07, 2003 8:42 am    Post subject: Reply with quote

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>";
and
Code: › $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
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Wed May 07, 2003 9:36 am    Post subject: Reply with quote

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;
to
Code: › // Check the cache file to see if it's up to date
$rebuild = 1;

that should fix it.
Back to top
Offline View user's profile Send private message Visit poster's website
sharlein

User
User


Joined: Apr 07, 2003
Posts: 30

PostPosted: Wed May 07, 2003 9:47 am    Post subject: Reply with quote

Excellent work. Thank you very much - up and running. Very Happy 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
Offline View user's profile Send private message Visit poster's website
sharlein

User
User


Joined: Apr 07, 2003
Posts: 30

PostPosted: Wed May 07, 2003 9:51 am    Post subject: Reply with quote

Just read your article - answers my questions.. tyvm
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Wed May 07, 2003 9:55 am    Post subject: Reply with quote

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
Offline View user's profile Send private message Visit poster's website
sharlein

User
User


Joined: Apr 07, 2003
Posts: 30

PostPosted: Wed May 07, 2003 10:18 am    Post subject: Reply with quote

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 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
Clicked the album link under photo and got another 404
Code: › http://www.sharlein.net/modules.php?set_albumName=album06&op=modload&name=gallery&file=index&include=view_album.php
What did I do????????? Embarassed
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Wed May 07, 2003 10:22 am    Post subject: Reply with quote

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
Offline View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Blocks View previous topicPrinter friendly versionView next topic
Goto page 1, 2  Next

 
Jump to:  
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
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Dedicated ServersDomain NamesWeb HostingDomain Name RegistrationDedicated Web HostingWeb Design New YorkCompare VoIPseo packagesSEO CompanyNew York Yellow PagesFind LocationsVOIP Phone ServiceNeckermannOnline internetSEORestaurant Locator • Get great HP coupons from CouponSnapshot • Search for great dell coupons at CouponSnapshot.com.au • Graduation DressesAndroid TabletSEO IndiaBuy Phen375fuel filterWorld Meds Direct

8th year online! 2003-2011
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia