Gallery Block [v1.1.3]
by Andy Maloney [asmaloney@users.sf.net]
16 Jun 2005
Table of Contents
Description
This block displays a listing of recently updated albums and/or a list of the most viewed albums in your gallery.
It will only list albums visible to the current user.
It is fairly customisable through the config.php file.
Inspired by the 'Gallery Last Updated' and 'Gallery Top 10' blocks from squatty.com.
Developed Using These Tools
- gallery 1.5
- Geeklog 1.3.11
- PHP 5.0.4
- Firefox 1.0.4
- MacOS X 10.4.1
Version History
- v1.1.3 [16 Jun 2005]
- v1.1.2 [07 Mar 2005]
- [fix] use a different function from gallery for generating URLs so that the rewrite preference is respected [reported by Ajay Gopal]
- v1.1.1 [27 Mar 2004]
- v1.1.0 [22 Mar 2004]
- [new] optionally show nested albums [now the default behaviour]
- v1.0.1 [20 Feb 2004]
- [fix] no longer produces an error when the cache file does not exist [reported by Rogan Lynch]
- [fix] removes newlines from album titles and date formats [reported by Rogan Lynch]
- [fix] checks that albums in the cache actually exist before trying to use them [in case an album has been deleted or renamed since the cache was created]
- minor code cleanups
- v1.0.0 [09 Feb 2004]
Upgrade/Installation
A note on paths:
- a path beginning with ./ is the directory this README is in
- /path/to/geeklog/public_html/ is where your lib-common.php file may be found
- a path beginning with geeklog/ is where your config.php file for geeklog may be found
New Installation
- Ensure that gallery is properly installed and embedded in your geeklog installation.
- Copy the ./public_html/galleryblock directory to /path/to/geeklog/public_html/.
- Copy the ./blocks/galleryblock directory to the geeklog/blocks/ directory [you may have to create geeklog/blocks/].
- Copy the function from add-to-lib-custom.php into your lib-custom.php file located in the geeklog/system/ directory.
- Configure the block by changing geeklog/blocks/galleryblock/config.php. At least $GALLERY_BASEDIR will have to be set.
- Login to your website and add a new block using the Block Manager. Select "PHP Block" as the block type. Set the block function to phpblock_GalleryBlock.
Upgrading 1.1.2 to 1.1.3
- Disable the block using Admin->Blocks
- Delete the current cache file
- Copy ./public_html/galleryblock/galleryblock.php to the /path/to/geeklog/public_html/galleryblock directory
- Copy ./blocks/galleryblock/phpblock.php to the geeklog/blocks/galleryblock directory
- [No changes are required to config.php or the function in lib-custom.php]
- Enable the block using Admin->Blocks
Upgrading 1.1.1 to 1.1.2
- Copy ./blocks/galleryblock/phpblock.php to the geeklog/blocks/galleryblock directory
Upgrading 1.0.1 to 1.1.1
- Disable the Gallery Block using Admin->Blocks
- Copy ./blocks/galleryblock/phpblock.php to the geeklog/blocks/galleryblock directory
- In geeklog/blocks/galleryblock/config.php, change this:
$GB_CONF['lu_image_path'] = $_CONF['path'] . 'galleryblock/update.gif';
to this:
$GB_CONF['lu_image_path'] = 'galleryblock/update.gif';
- Enable the Gallery Block using Admin->Blocks
Upgrading 1.0.1 to 1.1.0
- Disable the Gallery Block using Admin->Blocks
- Delete the current cache file
- Copy ./public_html/galleryblock/galleryblock.php to the /path/to/geeklog/public_html/galleryblock directory
- Add the 'Nested Albums' section from ./blocks/galleryblock/config.php to your config.php file and tune to your requirements
- Enable the Gallery Block using Admin->Blocks
Upgrading 1.0.0 to 1.0.1
- Disable the block using Admin->Blocks
- Delete the current cache file
- Copy ./public_html/galleryblock/galleryblock.php to the /path/to/geeklog/public_html/galleryblock directory
- Copy ./blocks/galleryblock/phpblock.php to the geeklog/blocks/galleryblock directory
- [No changes are required to config.php or the function in lib-custom.php]
- Enable the block using Admin->Blocks
Customisation
There is a config.php file located in the geeklog/blocks/galleryblock/ directory.
It contains descriptions of all the options.
You can edit the HTML in the geeklog/blocks/galleryblock/phpblock.php file.
You shouldn't need to change anything in the /path/to/geeklog/public/html/galleryblock/ directory.
Mini FAQ
1. Can I use the Gallery Block with multiple gallery installations?
No. Because this block includes files from the gallery installation which define functions, trying to include them multiple times results in PHP errors. At this time there is no way that I know of to work around this.
2. Why do I get this PHP error: "Fatal error: Call to a member function on a non-object in /path/to/gallery/classes/User.php on line 136"?
This may be caused by a problem with the title of your gallery. Version 1.0.1 of Gallery Block tries to fix this by removing newlines from gallery titles.
3. Why do I get this PHP warning: "session_start(): Cannot send session cookie - headers already sent by..."?
As of version 1.1.3, you should not get this warning. If you do, please
contact me so we can sort it out.
Things You Can Do
- Check my PHP and tell me if there are better ways to do any of this. [email me]
- Let me know if you use it or have any suggestions. [email me]
- Link to my site [http://imol.gotdns.com] somewhere on yours.
- Support development by making a donation:
or by using one of the following links to shop at amazon:
or by going to [http://imol.gotdns.com] and clicking on an interesting Google ad or two
License
This is licensed under my special 'Do-Whatever-You-Want-With-It' license.
So... do whatever you want with it.