Author Archives: Ammon

We’re getting the band back together!

I met my wife 5 years ago at the beginning of a run of the Sondheim musical Assassins at ART here in Portland. I played John Hinckley, Jr., the guy who shot Reagan in ’81. It was an amazing show, and not just because I met the love of my life. The show itself is [...]

Posted in Musings | Tagged | Leave a comment

Clever checkbox handling with PHP

An unchecked checkbox returns nothing when a form is submitted, but most of the time you want it to return something, so you can work with that $_POST variable. This is easy with the addition of a hidden input with the same name as your checkbox: <?php     // If the box was checked, keep it [...]

Posted in Musings | Leave a comment

Lightbox + jQuery UI Dialog + IE8 = conflict city

It worked fine in Firefox, Safari, Chrome, and even IE7, but for some reason if you have the Lightbox 2 plugin installed and you enqueue jQuery UI Dialog you will get a whole mess of errors in Internet Explorer 8 when you create a dialog. The solution is simple: disable Lightbox 2 and install the [...]

Posted in Musings | Tagged , , , | Leave a comment

The cobbler has shoes! Finally!

After years of using the plain-jane but wonderful Thematic default theme for my personal site, I’ve finally gotten around to designing a theme of my very own. Its a child theme of Thematic like all my sites these days. The colors are from the Tango icons color palette. It was drawn in Inkscape and Gimp. [...]

Posted in Musings | Tagged , | Leave a comment

Show the jQuery version number

This prints the version of jQuery you’re using: $.jquery(); Which is handy in situations where you don’t have direct access to the script itself. In Firebug you might do something like this: console.log(‘jQuery version: ‘, $.jquery());

Posted in Musings | Tagged | Leave a comment

Control error reporting level in WordPress

When you enable error reporting in WordPress you automatically get all errors, notices, warnings and what have you written to your wp-content/debug.log. One of my plugins was creating so many undefined index errors it made the log impossible to read. I needed to fine tune my error reporting. WordPress error reporting bypasses your php.ini settings [...]

Posted in Musings | Tagged , | Leave a comment

Serve web pages from your home directory in Ubuntu 10.04

This guide assumes that you have lamp installed already (which is super easy in Ubuntu). Enable the userdir mod $ cd /etc/apache2/mods-enabled $ sudo ln -s ../mods-available/userdir.conf $ sudo ln -s ../mods-available/userdir.load Enable php parsing from a user directory $ sudo nano /etc/apache2/mods-available/php5.conf Comment out this code: <IfModule mod_userdir.c> <Directory /home/*/public_html> php_admin_value engine Off </Directory> [...]

Posted in Musings | Tagged , , | Leave a comment

A fix for WP e-Commerce error: “The following directories are not writable”

If you get this error: The following directories are not writable: * /var/www/mysite/wp-content/uploads/wpsc/downloadables/ * /var/www/mysite/wp-content/uploads/wpsc/previews/ * /var/www/mysite/wp-content/uploads/wpsc/product_images/ * /var/www/mysite/wp-content/uploads/wpsc/product_images/thumbnails/ * /var/www/mysite/wp-content/uploads/wpsc/category_images/ * /var/www/mysite/wp-content/uploads/wpsc/upgrades/ You won’t be able to upload any images or files here. You will need to change the permissions on these directories to make them writable. When you click on “Products” in WP [...]

Posted in Solutions | Tagged , | 4 Comments

Your WordPress blog already has custom feeds

I was this close to wasting a ton of time coding a plugin to produce a feed for a single category when I came across this: http://codex.wordpress.org/WordPress_Feeds Which let me know that WordPress already does what I need. Say you have a category, ‘events’, that you want to make into a feed. Here’s the URL: [...]

Posted in Musings | Leave a comment

Make your phpMyAdmin session persist… forever!

Or for a year, which is a pretty long time. NOTE: This is for local development purposes only, cause it’s not safe enough for production servers. Open up /etc/phpmyadmin/config.inc.php in your favorite text editor (you must have root priviliges) Add the following lines to this file just inside the first if clause: /* * Prevent [...]

Posted in Musings | Tagged , | Leave a comment