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

Version History

Upgrade/Installation

A note on paths:

New Installation

  1. Ensure that gallery is properly installed and embedded in your geeklog installation.
  2. Copy the ./public_html/galleryblock directory to /path/to/geeklog/public_html/.
  3. Copy the ./blocks/galleryblock directory to the geeklog/blocks/ directory [you may have to create geeklog/blocks/].
  4. Copy the function from add-to-lib-custom.php into your lib-custom.php file located in the geeklog/system/ directory.
  5. Configure the block by changing geeklog/blocks/galleryblock/config.php. At least $GALLERY_BASEDIR will have to be set.
  6. 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

  1. Disable the block using Admin->Blocks
  2. Delete the current cache file
  3. Copy ./public_html/galleryblock/galleryblock.php to the /path/to/geeklog/public_html/galleryblock directory
  4. Copy ./blocks/galleryblock/phpblock.php to the geeklog/blocks/galleryblock directory
  5. [No changes are required to config.php or the function in lib-custom.php]
  6. Enable the block using Admin->Blocks

Upgrading 1.1.1 to 1.1.2

  1. Copy ./blocks/galleryblock/phpblock.php to the geeklog/blocks/galleryblock directory

Upgrading 1.0.1 to 1.1.1

  1. Disable the Gallery Block using Admin->Blocks
  2. Copy ./blocks/galleryblock/phpblock.php to the geeklog/blocks/galleryblock directory
  3. 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';
  4. Enable the Gallery Block using Admin->Blocks

Upgrading 1.0.1 to 1.1.0

  1. Disable the Gallery Block using Admin->Blocks
  2. Delete the current cache file
  3. Copy ./public_html/galleryblock/galleryblock.php to the /path/to/geeklog/public_html/galleryblock directory
  4. Add the 'Nested Albums' section from ./blocks/galleryblock/config.php to your config.php file and tune to your requirements
  5. Enable the Gallery Block using Admin->Blocks

Upgrading 1.0.0 to 1.0.1

  1. Disable the block using Admin->Blocks
  2. Delete the current cache file
  3. Copy ./public_html/galleryblock/galleryblock.php to the /path/to/geeklog/public_html/galleryblock directory
  4. Copy ./blocks/galleryblock/phpblock.php to the geeklog/blocks/galleryblock directory
  5. [No changes are required to config.php or the function in lib-custom.php]
  6. 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

License

This is licensed under my special 'Do-Whatever-You-Want-With-It' license.
So... do whatever you want with it.