iPAP: Photo Album Publisher

iPAP is the PHP–based application used for publishing this site’s photos section. Recently, it has made appearances at other sites, fulfilling the simple task it was made for — publish photo albums on the web.

The first public release is was made a year ago, and updated six months later.

Important note: Since this a beta/preview release only, a lot of things may change as the development moves forward. No guarantees are made regarding support or compatibility, though I will try to do what I can concerning these matters.


  • ipap-0.9-beta2.zip Version 0.9-beta2 (June 25, 2005)
  • ipap-0.9-beta.zip Version 0.9-beta (June 19, 2005)
  • ipap-0.71-preview.zip Version 0.71 (December 2, 2004)
  • ipap-0.7-preview.zip Version 0.7 (June 14, 2004)

Current Limitations

The current iteration of this software may contain what others may consider as “limitations.” Listed below are some of them:

  • Only JPG files are currently supported.
  • Uploading several photos at one time may be difficult, batch uploading not (yet?) available/implemented.
  • A flat-file database storage class is used instead of MySQL for simplicity and portability. MySQL is now used for storage.
  • Uploading photos does not automatically resize them. Resizing upon upload is now available, but I still recommend you do that on the desktop with your nice photo-editing software. The default template is optimized for photos roughly 500 pixels wide.
  • The database backup file backup.zip is not password-protected and can be accessed directly! Secure the file. Consider this a privacy risk. You’ve been warned. This is no longer valid for the current release.


  • PHP 4 (Tested on version 4.2 and above.)
  • MySQL (I use version 3.23 for development.)
  • Version 2 of the GD Image Library
  • Optional: mod_rewrite for clean permalinks


  1. Unzip everything to a folder on your desktop.
  2. Edit ipap-config.php and change the necessary variables, especially those marked with “== CHANGE THIS==”.
  3. If you are upgrading from an earlier version, the directory containing the your photos and thumbnails is now /ipap-photos/, changed from the previous /ipap-uploads/. This will be used for future versions of the application. You may rename your old /ipap-uploads/ directory to /ipap-photos/, sorry if that breaks some things. Alternatively, you may edit ipap-settings.php and change $path_photos to ipap-uploads/.
  4. Upload everything to your webserver, typically to a sub-directory photos/ of your domain. Like ( http://rebelpixel.com/photos/ )
  5. CHMOD the directories ipap-photos and ipap-temp to 0777.
  6. At this point the directory structure should be like this:

  7. In your browser, open the file ipap-install.php to create the required tables. (The script might report that the table wasn’t created successfully, we’re still fixing this. Clicking on the link should create the table without problems.)If you are upgrading from an older version (0.7), run the import script ipap-upgrade.php after the first file.
  8. The admin section is located at /ipap-admin/index.php, login with your username and password.
  9. You’re all set to go!


If you want to use mod_rewrite to produce nice URIs and permalinks, you need to set the variable $use_mod_rewrite to TRUE in ipap-config.php. Create a .htaccess file with the following rewrite rules:

RewriteEngine On
RewriteBase /

RewriteRule    ^labels/([_0-9a-z-]+)/?$    index.php?l=$1   [L]
RewriteRule    ^([_0-9a-z-]+)/([0-9]{5})/?$    index.php?a=$1&i=$2   [L]
RewriteRule    ^([_0-9a-z-]+)/?$    index.php?a=$1   [L]

However, if you have other rewrite rules in your root’s .htaccess file, you might need to add modified rules to that file instead:

RewriteEngine on
RewriteBase /

RewriteRule    ^photos_url/labels/([_0-9a-z-]+)/?$    photos_url/index.php?l=$1   [L]
RewriteRule    ^photos_url/([_0-9a-z-]+)/([0-9]{5})/?$    photos_url/index.php?a=$1&i=$2   [L]
RewriteRule    ^photos_url/([_0-9a-z-]+)/?$    photos_url/index.php?a=$1   [L]

Where photos_url is the “nice path” you intend to use, and photos_path is the real path to to your iPAP install.

Template Tags

If you customized the templates of a previous 0.7 install, copy the files ipap-album.tpl.php, ipap-gallery.tpl.php, and ipap-styles.css to a unique directory in ipap-templates/. Set $template_path in ipap-config.php to that directory, and set $use_old_tags to TRUE. You may need to edit some variables in the template files for it to work correctly.

There are two functions that act as text filters that may be of interest to template developers: alt() and short_alt(). Their usage are best explained by inspecting the default template files.

For information on older deprecated tags, you may refer to this page.

Support iPAP

If you like iPAP, please support the project. Feel free to link to this project page, and evangelize. You may also use the template “help-ipap” which contains my adsense code. That way, you are directly and indirectly providing for the project’s growth.


CC-GNU GPL Copying, modification and redistribution is allowed under the terms of the GPL, better explained by the CC–GPL (Creative Commons Deed). A link to my site and the projects’s page will be greatly appreciated.