FatLab Music logo

Monthly Archive for January, 2009

A few fixes for Podcasting plugin feed validation errors

I just got a Feedburner warning that my podcast feed was invalid. I was also getting quite a few Feed Validator errors, but nothing I could fix in Podcasting’s settings or trace to bugs in the plugin code. Evidently, some versions ago, Podcasting stored a few odd values in my WP database that had to be manually corrected. Here’s how I fixed them.

Check your feed’s <itunes:name> and <itunes:email> values and make sure they are not reversed. Mine were. So just find your “pod_itunes_ownername” and “pod_itunes_owneremail” values in your “wp_postmeta” table and edit them.

SELECT * 
FROM  `wp_options` 
WHERE  `option_name` LIKE 'pod_itunes_owner%'

Second, a bunch of my posts’ “explicit” values were stored as “default” instead of the correct “” (empty string). iTunes only allows “no”, “yes”, and “clean” for <itunes:explicit>, and Podcasting didn’t translate “default” into anything, so you gotta fixup these posts:

SELECT * FROM `wp_postmeta`
WHERE
     `meta_key` = 'enclosure' and
     `meta_value` like '%s:8:"explicit";s:7:"default";%'

… and after making sure your database is backed up and all that, just run this query to update them:

UPDATE `wp_postmeta`
SET `meta_value` = replace(`meta_value`, 's:8:"explicit";s:7:"default";', 's:8:"explicit";s:0:"";')
WHERE
     `meta_key` = 'enclosure' and
     `meta_value` like '%s:8:"explicit";s:7:"default";%'

Frankie is 2 today

65 pounds instead of 15. Not much else has changed.

Frankie - 2 monthsFrankie – 2 months

Frankie - 2 yearsFrankie – 2 years

“Snow Dude” hits the iPhone App Store

Our pal Ben has coded apps that help Spiderman fly and that help cure cancer. Now he’s tackled the iPhone, coding his first app for the Lycette Brothers.

It’s called “Snow Dude“, and it’s available today from the iTunes App Store for $1.99. Check it out!

'Snow Dude' at the iTunes App Store

Get 'Snow Dude' from the iTunes App Store

How-to modify jQuery Lightbox Plugin to use Image Sets

UPDATE (2/16/09): Another jQuery Lightbox plugin exists that supports imagesets by default. I am using the newer plugin now and recommend everyone do the same.

  • Both releases were at version 0.5, so I thought they were the same. Looking closer at the changelogs, I found this new one by Warren Krewenki to be better maintained and supports imagesets without hacking.
  • NOTE: My modification below only applies to the Leandro Vieira Pinho version.
  • Be aware that Krewenki’s Lightbox function is called lightbox, all lowercase. Pinho’s was camelcased as lightBox. In addition to pointing to the filenames of Krewenki’s new .js and .css files, your initializing function needs to be updated to all lowercase. Most settings don’t carryover either between the two jQuery plugs — although Krewenki’s match to the original Lightbox better — so verify those, too.

Buy Snowferno. $1.99 on the App Store
ORIGINAL POST:
I use the very popular Lightbox 2 script in places on this site, which is built upon the Javascript framework Prototype and script.aculo.us library. But, I also love the Javascript image gallery Galleria which requires jQuery. I don’t want to load both frameworks all the time, so I was happy to find a jQuery port of Lightbox called jQuery lightbox plugin.

The HTML syntax is almost identical between the two lightbox scripts, so I don’t have to recode any IMG tags. However, version 0.5 of the jQuery lightbox plugin does not recognize Lightbox 2 image sets (a group name between square brackets in the rel attribute).

By adding one IF statement to jquery.lightbox-0.5.js, jQuery lightbox plugin can gain this feature. The code below should replace lines 79-82.

jquery.lightbox-0.5-modified.js

79
80
81
82
83
84
// Add an Array (as many as we have that match the objClicked 'rel' attr), with href and title atributes, inside the Array that storage the images references		
for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
	if(jQueryMatchedObj[i].getAttribute('rel')==objClicked.getAttribute('rel')) {
		settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));
	}
}

Line 81 in the above code is the key. The matching elements passed in the jQuery object get added to the image array only if their ‘rel’ attributes match the initial ‘rel’ attribute of objClicked.

Then, your initializing function should read like this:

your-image-page.html

$(function() {
	// Select all links whose attribute rel starts with lightbox
	$('a[rel^=lightbox]').lightBox();
});

Note the caret character after ‘rel’, which matches all elements having the ‘rel’ attribute and values *beginning* with ‘lightbox’. Also, jQuery’s Selector API documentation says that the “@” before the attribute name has been deprecated as of v1.2. See more under the “Selectors > Attribute Filters” section of jQuery documentation.

Maybe there is a more elegant way to compare elements that doesn’t require matching the ‘rel’ attributes. But, to retain the same HTML syntax for those converting from the Prototype/script.aculo.us script to jQuery plugin, this hack will do nicely.

No More iTunes DRM (songs, at least)

Most every song in the iTunes store went “Plus” today, meaning they are double-quality (and size) 256k AAC format and best, DRM free! Songs will play on unlimited iPods, iPhones, Mac, Windows, and unlimited CD playlist burns.

Upgrading is a crummy $0.30 per track, which made sense when a Plus version went for $1.29. But still, it’s only $0.30 to gain a lot of freedom.

DRM does not work. It assumes the consumer is the criminal and only punishes people who actually pay for stuff. People that steal songs get them DRM-free anyway. Kudos to the record companies for finally letting Apple do this.

Click here to be taken to iTunes’ Library Upgrade page, and our pups will get a scoop of food on you:
Apple iTunes


Performance Optimization WordPress Plugins by W3 EDGE