If you aren’t familiar with PowerGallery, it is a PHP web app that I created for WebAssist. Basically, you can upload your images and display them on your page with several built in gallery designs. When programming this product, one thing I wanted was easy extensibility so more designs could be added easily. The 1.1 release added 3 slideshows that were great.
I’ve created another design called Stack and you can download it for free below. To install it, just unzip the file and upload the stack directory to the galleries directory inside your PowerGallery installation. That’s it! Log in to the admin and you’ll see Stack a new choice on the Choose Design page.

This gallery was created using the ElementStack MooTools plugin. You can see a live demo here. Since PowerGallery uses MooTools 1.2, you can easily create galleries yourself and just drop them into the galleries folder for easy use.
Download the design
I was working on a PayPal powered commerce website and for the checkout form, I needed to create a dropdown list of the countries that PayPal supports. I couldn’t find a list in the exact format that I needed, so I created a JavaScript array of JSON objects. Pretty straightfoward, but I thought it would be a good starting point for some of you if you need the same thing.
This list uses the countries listed on PayPal’s website. PayPal requires that you send the 2-character IS0-3166-1 code to their API. Below I have the name and code combinations.
Continue Reading
Over the last few weeks, I have been learning CodeIgniter which is an open source PHP framework. It follows the MVC (model-view-controller) methodology, but allows you to utilize your existing PHP skillset. Overall I think CodeIgniter is great so far, but there are are few gotchas to look out for.
I found an issue today regarding the built in encryption library. Basically, the encrypted string might not be the same thing every time. For example, you might want to encrypt a user’s email address. The first time you might encrypt it on a sign up form. Now on the login page, I want to compare the value the user typed in with the database. The problem is, if I encrypt the email again, it most likely will not match even though the original string is the same!
$this->load->library('encrypt');
$a = $this->encrypt->encode('justin');
$b = $this->encrypt->encode('justin');
echo $a == $b ? 'equals' : 'nope!'; //will print nope!
Behind the scenes, CodeIgniter is basically rotating keys to produce different encrypted strings that decrypt to the same thing. It’s actually a really cool and secure way of handling the encryption, but for the purpose of comparing values (on a login form for example) it just doesn’t work.
Alternatives
So, if you need to do some comparisons using your encrypted data, you have a few alternatives. If you want to stick with PHP, you can make use of the mcrypt_encrypt and mycrypt_decrypt functions. If you want a MySQL solution, look into the encryption functions in their manual.