Main | November 2004 »

August 25, 2004

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.

August 15, 2004

mac.com worth it?

This whole effort of getting our own web site started some time ago when I realized that we were paying a fortune for mac.com. I guess one account would be okay -I'm spending the same, about $100/year, for www.maumae.net- but we had to have 2 accounts (one for me and one for Céline, as AFAIK, mac.com can not support multiple email addresses per account. After all, it's the philosophy behind how it's called, no? My account name is frigaut@mac.com, and that's an address, hu? Anyway, so we had to have 2 accounts. That ended up being too expensive, so I though about moving to an independent host. Here are the pros and cons of doing that, one mac.com vs one independent host:

  • Pros:
    1. I'm getting my own domain
    2. I can create 1000 email accounts, for me and my family
    3. I have, not 100MB, but 800MB of disk space
    4. I have, at long last, access to a cgi directory where I can run cgi and perl scripts for dynamic web pages. This means, of course, that I can run stuff like a proper weblog.
    5. I have -almost- full control over this site, with administrator privileges. Of course, I would have even more extensive control if I were to run the server on my own machine, but I am fully satisfied with what lunarpages provides. Beside, it would be much more work to set up my own server and keep it secure, without mentionning the hassle of having a connection and a server 100% uptime, and the cost of that with my link provider (roadrunner).
  • Cons:
    1. I lost the ability and great interplay between my web site and many of my apps:
      1. iPhoto to produce quickly wonderful looking web pages for my pictures. I have been able in a few hours to replace this by Minigal, a php script that produce similar results, and that is more configurable, so no loss here.
      2. iSync: This will be lost forever when my mac.com account goes down (October). And because I have 2 macs (a powerbook and a G5), this was useful. But this is not such a huge deal, as iSync only synchronizes safari bookmarks, address list and calendars. I can easily write a small script, or even do the sync by hand. But it will require more attention in the future.
      3. iChat: I will not have the mac.com address I use right now for iChat, but I can (can I?) get a AIM address. Or does it require a AIM paying account?
    2. I loose the iDisk, mounted transparently as a webdav share. I'll have to live with this. But I can almost as easily ftp into my webserver. Not as trannsparent but faster. I usually do most of my stuff in the command line anyway, but one can use a GUI interface if needed (by the way, I discovered and installed ncftp, which is neat and much more powerful that the standard ftp: for instance you can transfer directories recursively).

For me, pros 2 and 4 did the trick. No more restrictions on email accounts and access to cgi-bin. I've been really happy with the switch and had a lot of fun setting up my own webserver. Now the above list shows that it is not a win-win situation. one gains some, and one looses some. In the end, it all depends what's more important for you.

Beach Story

I have spent part of the afternoon installing Minigal, an open source PHP package to create picture galleries. It is very simple to set up, has a nice and quite comprehensive interface, and produce results that are pleasing enough to the eye. I have moved all my pictures galleries from my mac.com homepage to maumae.net, so now I am not dependant on mac.com anymore. Except of course for synchronization through iSync and iChat (see more on that below).

Ecto

I'm writing this post using ecto. Simple as hell to config to interface to this MovableType powered blog.
There has been quite some improvement in ecto since the last time I used it. Well, anyway, back in the bloging world, and now for real: my 2 previous blogs were running either on my own laptop, or on a LAN, so in both cases not accessible from the outside.
This blog is hosted by maumae.net, which is a website I created a week ago. I'm using lunarpages as host, and for now I have been really happy with them. I haven't tested their support yet, for one good reason: I haven't had a need of it! They've got all the useful software there already (perl, php, mysql, etc...). Everything I did ran smoothly: Creation of email accounts, installation of MT. Managing the website is turning out to be pretty easy.