« mac.com worth it? | Main | Black Tuesday »

Modify Minigal to include a Slide Show mode

As I said in an earlier post, Minigal is a great open-source PHP script to build Picture Gallery (e.g. see mine). I am not sure if this will make it in the next Minigal release, and people seem interested, so here are the instructions to implement this hack.

If you don't want to bother, or feel uncomfortable modifying a few files, you can download the whole modified package (if you have problem with the tar.gz format, you can comment on this post and I will see what I can do).

NOTE: I have not bothered to create the navigation images for styles other than "blackframe". If you intend to install this and use another style, be prepared to do some image editing. You can start from the distributed images and modify the color scheme using the gimp or photoshop. Also, the files style.css, template_header and template_imagenav are in the style subdirectories, so be prepared to modify them in the way described below (for style.css, you can safely add the lines listed below at the end of the file).

Overall, I would advise to wait for an official release of Minigal by Thomas Rybak, including the slide show mode, especially if you are not using the blackframe style (see note above). If you damage anything in your minigal installation, don't come back to me, I'm not responsible!

Instructions to modify Minigal (B13) to include the slideshow mode. I strongly suggest to do a backup of your current Minigal install in case something goes wrong.

  1. In gallery/index.php:

    insert the following line in the "INCLUDES AND VARIABLES" section

    if (isset($_REQUEST['slideshow'])) {
      $slideshow = 1;
    }
    
  2. In Gallery/classes.php:

    Replace the whole file by this one. The only difference is the function imagenav(), but it has been modified enough than posting the instructions would be cumbersome for both me and you.

  3. in gallery/language.php:

    Somewhere in "THE GALLERY" section, e.g., after:

    $MGaction->lang['last']                 = "Last";
    
    add:
    $MGaction->lang['start slideshow']      = "Start Slideshow";
    $MGaction->lang['stop slideshow']       = "Stop Slideshow";
    
  4. In gallery/styles/blackframe/templates/template_header.php:

    After the line:

      <meta http-equiv="Content-Type" content="text/html; charset=" />
    
    insert:
      <? if ($slideshow == 1) $MGaction->imagenav(0); ?>
    
  5. in gallery/styles/blackframe/templates/template_imagenav.php:

    Replace:

      <? echo $nav_last ?>
    
    by:
      <? echo $nav_last ?> &nbsp;
      <? echo $nav_slideshow ?>
    
  6. in gallery/styles/blackframe/images/, 4 additional images are needed:
    nav_start_slideshow.gif
    nav_start_slideshow_blank.gif
    nav_stop_slideshow_blank.gif
    nav_stop_slideshow.gif
    
  7. in gallery/styles/blackframe/css/style.css:

    At the end, add:

    .imagenav a {
      text-decoration: none;
    }
    .imagenav a span {
      display:none;
      font-size: 80%;
      font-weight: normal;
      color:#d0d0d0;
      background:#707070;
      margin:0px;
      padding:2px 4px 2px 4px;
      border:solid 1px #000000;
      text-decoration: none;
    }
    .imagenav a:hover span {
      position:absolute;
      right: 5px;
      top: 33px;
      display:block;
      text-decoration: none;
    }
    
    .navgal a { 
      padding-left: 10px;
    }
    

You're done. Kind of long, isn't it? Again, unless you know what you're doing, wait for the next Minigal release.

Comments

Tried to download yoru code from http://www.maumae.net/blog/archives/2004/08/modify_minigal.html but it was not available.

Could you please email it to me

Regards
Keren

Sorry, Keren, this was a issue with relative url and location of the blog single entry vs the main blog. This is fixed now. Download and enjoy.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)