| Author |
Message |
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
|
Posted: Tue Aug 12, 2003 2:57 pm Post subject: [RELEASE] - Improved New Albums Block |
|
|
There is a new, improved New Albums block available here at NukedGallery.net. Go here:
http://www.nukedgallery.net/article28.html [nukedgallery.net]
for the story.
EDIT: IF YOU DOWNLOADED THIS BLOCK PRIOR TO WEDNESDAY, AUGUST 13 AT 8:45AM (EDT), YOU MUST CHANGE THIS IN THE CODE:
ON LINE 134, IT READS:
Code: › $stat = fs_stat(CACHE_FILE);
IT SHOULD READ:
Code: › $stat = fs_stat(ALBUMCACHE);
THE DOWNLOAD THAT IS AVAILABLE AT THIS SITE HAS BEEN UPDATED WITH THIS FIX AS OF THIS TIME. _________________

Last edited by dari on Wed Aug 13, 2003 7:40 am; edited 2 times in total |
|
| Back to top |
|
|
AdBot
|
| Post subject: [RELEASE] - Improved New Albums Block |
|
|
|
|
|
| Back to top |
|
 |
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Aug 12, 2003 3:12 pm Post subject: |
|
|
Nice one - great work as usual!
Amended the config, installed the block and worked first time!
However after refresh I got the following error:
Warning: stat() [function.stat]: Stat failed for CACHE_FILE (errno=2 - No such file or directory) in /my/path/to/modules/gallery/platform/fs_unix.php on line 75
Maybe my server (permissions, etc)
What do you think?
It's running on the test site - have a look |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Aug 12, 2003 3:50 pm Post subject: |
|
|
Hmn - my fault - I had display_errors 'ON' in my php.ini
However it was still flagged as an error - is it a problem? |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
|
Posted: Tue Aug 12, 2003 3:53 pm Post subject: Re: [RELEASE] - Improved New Albums Block |
|
|
you still getting the error after making the php.ini change? the stat() function is a standard PHP call: http://www.php.net/stat and shouldn't give an error when the file has been created already. (the way the code works, stat isn't called unless the file exists..).
let me know if it pops up again. _________________
 |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Aug 12, 2003 4:00 pm Post subject: |
|
|
NO error gone! But because display_errors if OFF. I guess the error is still there - but doesn't seem to be affecting the block. Is it likely that it's NOT using the new style of CACHE FILE? |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
|
Posted: Tue Aug 12, 2003 4:02 pm Post subject: |
|
|
take a look in your album directory. see if album_list.cache is there and populated... _________________
 |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Aug 12, 2003 4:08 pm Post subject: |
|
|
YEP - it's there and fully loaded!!! Now we're cooking on GAS!
Hey 100 posts - do I get a GOLD STAR! (95 useless rubbish, 5 just about worth while! ) |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
|
Posted: Tue Aug 12, 2003 7:16 pm Post subject: Re: [RELEASE] - Improved New Albums Block |
|
|
congrats on hitting 100
this should help speed things up for people with massive galleries (several thousands of photos).
i just need to get the caching implemented in the Most Popular photo block. this will be slightly more complex, as it would require a fairly large cache file. there are several ways of doing it:
1. the cache file lists every photo in all the albums with their associated click counts. BAD BAD BAD...lots of photos == HUGE cache file.
2. the cache file contains only the photo name and click count of the photo from each album with the most number of hits. this would lower it to just one photo per album. it still would be big, and require a large amount of time to regenerate the cache file, but it would be quick for the rest of the time. what would be the ideal update rate on the cache file? hourly, daily, etc?
3. keep it the way it is. get the stats real time. takes a long time, everytime.
solution 2 seems to be the best. it'll probably take me half a day or so to code it up and debug it, so it might not happen till later in the week. _________________
 |
|
| Back to top |
|
|
channone
Beginner


Joined: Jul 29, 2003 Posts: 5
|
Posted: Wed Aug 13, 2003 1:29 am Post subject: |
|
|
I had the same error. i did the following and it went away.
define(ALBUMCACHE, $gallery->app->albumDir . "/album_list.cache");
/* define(ALBUMCACHE,ALBUM_DIRECTORY."album_list.cache"); */
line 134 or so
if(fs_file_exists(ALBUMCACHE)) {
/* $stat = fs_stat(CACHE_FILE); */
$stat = fs_stat(ALBUMCACHE);
it's late and I took a quick stab at it..seems to work. |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Wed Aug 13, 2003 1:49 am Post subject: |
|
|
Yep - works for me!  |
|
| Back to top |
|
|
Ciro
Beginner


Joined: Aug 13, 2003 Posts: 4
|
Posted: Wed Aug 13, 2003 3:23 am Post subject: Re: [RELEASE] - Improved New Albums Block .: ERROR :. |
|
|
I get these errors:
Warning: main(/home2/user2582/public_html/html/modules/gallery/albums/init.php): failed to open stream: No such file or directory in /home2/user2582/public_html/html/blocks/block-NG-NEW-newAlbums.php on line 36
Fatal error: main(): Failed opening required '/home2/user2582/public_html/html/modules/gallery/albums/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/user2582/public_html/html/blocks/block-NG-NEW-newAlbums.php on line 36
Running on an upgraded PHPNuke (6.0 => 6.5) as a center block.
What could be wrong? |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Wed Aug 13, 2003 3:42 am Post subject: |
|
|
Check your GALLERY setup - it appears your paths are wrong. Run the /modules/gallery/setup again.
Unless you have done something different to the standard install - this is wrong:
/home2/user2582/public_html/html/modules/gallery/albums/init.php
Should be more like:
/home2/user2582/public_html/html/modules/gallery/init.php
/home2/user2582/public_html/html/albums
ALBUMS should be outside of your MODULES folder |
|
| Back to top |
|
|
techmike
Beginner


Joined: Aug 03, 2003 Posts: 3 Location: Sweden
|
Posted: Wed Aug 13, 2003 4:12 am Post subject: Re: [RELEASE] - Improved New Albums Block |
|
|
Hi I'm new to this Gallery thing.
However when I'm tried your block I got these errors:
Warning: Invalid argument supplied for foreach() in /var/www/mikenet/php/html/gallery-1.3.4/session.php on line 55
Fatal error: Failed opening required '/var/www/mikenet/php/html//var/www/mikenet/php/html/gallery-1.3.4/ML_files/ML_settings.inc' (include_path='.:/usr/share/pear') in /var/www/mikenet/php/html/gallery-1.3.4/ML_files/ML_config.php on line 108
I'm running PHP-Nuke 6.8.
Any ideas what I'm doing wrong? |
|
| Back to top |
|
|
Ciro
Beginner


Joined: Aug 13, 2003 Posts: 4
|
Posted: Wed Aug 13, 2003 4:15 am Post subject: |
|
|
slackbladder wrote: › Check your GALLERY setup - it appears your paths are wrong. Run the /modules/gallery/setup again.
My paths are very fine:
/* CHANGE THESE VARIABLES */
$GALLERY_BASEDIR = "/home2/user2582/public_html/html/modules/gallery/";
define(WEB_BASE_ADDR,"http://way-point.org/");
define(GALLERY_NAME,"gallery");
define(USE_THUMBS,0); // Set to 1 to show thumbnails, 0 to just list albums.
define(HOROZONTAL,0); //Set to 1 to list horozontally, 0 for vertically. If USE_THUMBS is 0,
//this is ignored, and albums will be listed vertically.
define(ALBUM_DIRECTORY,"/home2/user2582/public_html/html/modules/gallery/albums/");
/* DON"T CHANGE ANYTHING BELOW HERE */
public_html/html/modules/gallery/ => http://way-point.org/html/modules/gallery/ [way-point.org]
main site=http://way-point.org/html/ [way-point.org], ebedded gallery is here: http://way-point.org/html/modules.php?name=gallery [way-point.org]
slackbladder wrote: ›
Unless you have done something different to the standard install - this is wrong:
/home2/user2582/public_html/html/modules/gallery/albums/init.php
Should be more like:
/home2/user2582/public_html/html/modules/gallery/init.php
/home2/user2582/public_html/html/albums
ALBUMS should be outside of your MODULES folder
I'm using a standard install of Gallery, wich was first standalone (1.3.3) & then embedded in PHP-Nuke 6.0 with a ported phpBB. Then I upgraded PHP-Nuke to 6.5 and the Gallery to 1.3.4 and short after that to 1.3.4-pl1.
Why should the albums be outside the modules BTW?
EDIT: The Migrating Gallery Frequently Asked Questions on http://gallery.menalto.com/ [menalto.com] says nothing about moving the albums outside te modules dir when migrating into PHP-Nuke.
Tnx for your answer!
EDIT: I changed define(USE_THUMBS,0); to define(USE_THUMBS,1); and now I'm getting this error:
Fatal error: Call to undefined function: numaccessiblealbums() in /home2/user2582/public_html/html/blocks/block-NG-NEW-newAlbums.php on line 47
Which is another topic i saw...
---
Gallery v.1.3.4-pl1 on PHP-Nuke 6.5
PHP Version: 4.3.2 - MySQL version: 4.0.13 - Apache version: 1.3.28 (Unix) - OS: Linux |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Wed Aug 13, 2003 5:03 am Post subject: |
|
|
Ciro wrote: ›
My paths are very fine:
/* CHANGE THESE VARIABLES */
$GALLERY_BASEDIR = "/home2/user2582/public_html/html/modules/gallery/";
define(WEB_BASE_ADDR,"http://way-point.org/");
define(GALLERY_NAME,"gallery");
define(USE_THUMBS,0); // Set to 1 to show thumbnails, 0 to just list albums.
define(HOROZONTAL,0); //Set to 1 to list horozontally, 0 for vertically. If USE_THUMBS is 0,
//this is ignored, and albums will be listed vertically.
define(ALBUM_DIRECTORY,"/home2/user2582/public_html/html/modules/gallery/albums/");
/* DON"T CHANGE ANYTHING BELOW HERE */
This is wrong:
define(WEB_BASE_ADDR,"http://way-point.org/");
Currently points to a POSTNUKE install, should be:
define(WEB_BASE_ADDR,"http://way-point.org/html/");
Quote: ›
Why should the albums be outside the modules BTW?
Doesn't have to be - I was referring to a STANDARD install, where GALLERY places the file location for you - you have chosen a different place for the album files.
By putting the albums folder inside MODULES, your current robots.txt could be stopping Crawler BOTS from finding your photos, so you may lose traffic (Google image search, etc).
Quote: ›
I changed define(USE_THUMBS,0); to define(USE_THUMBS,1); and now I'm getting this error:
Fatal error: Call to undefined function: numaccessiblealbums() in /home2/user2582/public_html/html/blocks/block-NG-NEW-newAlbums.php on line 47
Save config.php and your albums directory and remove everything else. Then do a fresh install of 1.3.5 - you mave have some wrong files in place from the upgrade to 1.3.4 |
|
| Back to top |
|
|
|
|
|
|
|