Archive for July, 2007

The Ultimate JavaScript Library for Embedding Flash Content

Posted on July 31, 2007 in Function by Jeff Starr

[ Image: SWFfix Logo ] Earlier this year, Geoff Stearns and Bobby van der Sluis teamed up to create the “ultimate JavaScript library for embedding Flash content” into web documents. For those of you familiar with techniques for embedding Flash, these two names are instantly recognizable. Geoff Stearns is the author of SWFObject and Bobby van der Sluis is the author of UFO. Easily, SWFObject and UFO are the two best and most widely used techniques for detecting and embedding Flash content. Needless to say, when I heard that these two great minds were collaborating on an even better method to embed Flash, I was very excited to check out the fruits of their collective efforts..

On July 25th, 2007 the first publicly available version (0.2 - public alpha) of SWFFix was released to the masses. SWFFix is a Flash-embedding JavaScript library featuring standards-compliant markup, Flash-version detection, and Express-Install support. SWFFix uses the nested-objects method to optimize cross-browser support, deliver alternate content, and facilitate graceful degradation. SWFFix “fixes” the issues commonly associated with the nested-objects method (e.g., the click-to-activate requirement of IE6 and Opera 9+), providing greater functionality and a richer user experience. SWFFix also features dynamic embedding of Flash content for (X)HTML documents. Best of all, the SWFFix library consists of a single, extremely lightweight JavaScript file — only 12KB (unzipped) or 3.4KB (gzipped)! Overall, definitely impressive.

Continue Reading

Get Organized, Save Time with the HTC 8525 Pocket PC

Posted on July 30, 2007 in Technology by Jeff Starr

The AT&T 8525 is the first UMTS/HSDPA smart phone to be offered in the United States. It has integrated Bluetooth 2.0, Wi-Fi, and supports AT&T’s new music, video, and location-based services. The Windows Mobile device also has push e-mail capabilities, a 2-megapixel camera, a spacious QWERTY keyboard, and good call quality. — CNET Editors’ Review of the AT&T 8525

[ Image: HTC 8525 ]
Perishable Press via AT&T 8525 (click image for more..)
Thusly inspired, I recently purchased an AT&T 8525 Pocket PC by HTC. The device now serves as my virtual satellite, keeping me connected to the internet, networked to the office, and prepared for serious business. With its many features and streamlined functionality, the AT&T 8525 enables me to operate in maximized fashion, increasing efficiency and improving productivity. This article presents a concise rundown of how each of the phone’s primary features helps me to succeed as I fight a hellish battle everyday.

Continue Reading

Unicode Character Reference for Bloggers

Posted on July 29, 2007 in Blogging, Websites by Jeff Starr

[ Image: Two Hip Characters ] Virtually every article written here at Perishable Press requires at least one or two “special” characters. Some of these characters — such as quotation marks, hyphens, and dashes — are very common, while others — such as the copyright symbol, bullet, and arrow — happen less frequently. As a blogger, I find myself repeatedly using a select handful of very common special characters. Very rarely do I ever find myself blogging a latin “Ä” (i.e., capital letter “A” with a diaeresis). To save time and effort, I need a quick reference that targets only the characters I find useful as a blogger. With that in mind, I assembled the following table of essential Unicode (UTF-8 encoded) characters 1 for bloggers:

Continue Reading

Slideshow Code for Dead Letter Art

Posted on July 29, 2007 in Function, Websites by Jeff Starr

[ Icon: DLa Joker ] Pardon this post! I am posting this information online for personal references purposes. I may need to revisit this code at some point in the future, and if I post it here I will always know where to find it (trust me, it would disappear into the abyss if I tried storing it offline). So, although it is intended solely for myself, feel free to extract and use anything you like, as long as commented attribution remains. What we have here are two different methods for including a slideshow on a web page. The first method employs the techniques discussed in this article, while the second method skips the Flash and employs only the JavaScript portion of the slideshow. Here is some additional help with embedding Flash content, including slideshows, and JavaScript techniques.

Continue Reading

MySQL Magic: Find and Replace Data

Posted on July 25, 2007 in Function, Websites by Jeff Starr

Recently, I needed to find and replace all instances of “http://website” in the wp_comments table of the WordPress database. Fortunately, SQL provides a simple way to find and replace data with its wonderful UPDATE function.

General Example

Using the SQL UPDATE command is straightforward. Here is the general syntax:

UPDATE table_name SET field_name = replace( field_name, 'string_to_find', 'string_to_replace' ) ;

Simply replace the table_name and both instances of field_name with your specific information, and then edit string_to_find, and string_to_replace with the desired values. This is pretty standard stuff, but it is always a good idea to backup your database before executing commands. To run a “Find and Replace” via phpMyAdmin, simply login, select your database, and enter the command via the SQL tab. Copy, paste, and go!

Continue Reading

Another Mystery Solved..

Posted on July 25, 2007 in Function, WordPress by Jeff Starr

Recently, after researching comment links for an upcoming article, I realized that my default <input> values were being submitted as the URL for all comments left without associated website information. During the most recent site redesign, I made the mistake of doing this in comments.php:

...

<input class="input" name="url" id="url" value="[website]" onfocus="this.select();" type="text" tabindex="3" size="44" maxlength="133" alt="website" />

...

Notice the value="[website]" attribute? It seemed like a good idea at the time — I even threw in a nice onfocus auto-highlighting snippet for good measure. I ran the form with this in place for around eight weeks before finally noticing multiple comments using this for their site URL:

Continue Reading

Absolutely Fabulous Browser Bookmarklet Things

Posted on July 24, 2007 in Websites by Jeff Starr

[ Image: Fabulous Shot of Immortal's Abbath and Horgh ] ..Or something. Frankly, I just needed an excuse to post these steaming little beauties online. Please note that I don’t lay claim 1 to most of these browser bookmarklet/favelet tricks, but I do find them extremely useful. They are posted here for the sake of convenience and for reference purposes, so use at your own risk (i.e., I am not responsible if they crash your browser). Although I use most of these bad boys with Firefox, I wouldn’t be terribly surprised if they also functioned properly in other modern browsers. Nonetheless, along with each bookmarklet/favelet thing, I try to provide as much relevant information as possible, because sometimes you just feel like you’re from another planet. Happy head-scratching!

What are these things?

“Bookmarklets,” “Favelets,” “Browser Enhancement Things” — whatever you want to call them — help increase productivity and simplify tasks executed from within your browser window. Basically, these things are stored as bookmarks and perform some task — such as resize the browser window — when they are clicked. Hmm, perhaps I should check Wikipedia for the “Official” definition .. — nah.

How do I install them?

Installation of these lil’ miracles could not be easier. In most modern browsers, simply drag and drop the bookmarklet link onto your shortcut toolbar (Firefox, Safari, et al) or right-click and “Add to Favorites” (Internet Explorer). Pretty easy. There is a more complicated method as well. Create an empty bookmark or Favorite and copy & paste the bookmarklet source code into the URL field. Either way, these things are pretty common and you shouldn’t have too much trouble. So, without further ado..

Continued..

Permanently Redirect a Specific IP Request for a Single Page via htaccess

Posted on July 23, 2007 in Function by Jeff Starr

Not the most interesting title, but “oh well”..

Recently, a reader named Alison left a comment requesting help with a particular htaccess trick. She wanted to know how to permanently redirect (301) all requests for a specific page when requested from a specific IP address. In other words, when a visitor coming from 123.456.789 requests the page requested-page.html, the visitor will be redirected to just-for-you.html. All visitors not coming from that specific IP address are not redirected, and thus will see the originally requested page. Further, the redirect must apply only to requested-page.html, such that every visitor — including the one coming from 123.456.789 — will be able to see all of the other pages. Here is the htaccess code to make it happen:

# permanently redirect specific IP request for single page
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} 123\.456\.789
RewriteCond %{REQUEST_URI} /requested-page\.html$
RewriteRule .* /just-for-you.html [R=301,L]

To use this redirect, simply edit the IP address, requested page, and redirect page. Copy and paste the code into your htaccess file and upload to your server. Test the 301 redirect via proxy and that’s it. Relax and enjoy!

CSS Throwdown: Preload Images without JavaScript

Posted on July 22, 2007 in Presentation by Jeff Starr

Clean, easy, effective. You don’t need no stinking JavaScript to preload your images. Nope. Try some tasty CSS and (X)HTML instead! Here’s how.. (only two steps!)

Step 1 — Place this in your CSS file:

div#preloaded-images {
   position: absolute;
   overflow: hidden;
   left: -9999px; 
   top: -9999px;
   height: 1px;
   width: 1px;
}

Step 2 — Place this at the bottom of your (X)HTML document:

<div id="preloaded-images">
   <img src="http://perishablepress.com/image-01.png" width="1" height="1" alt="" />
   <img src="http://perishablepress.com/image-02.png" width="1" height="1" alt="" />
   <img src="http://perishablepress.com/image-03.png" width="1" height="1" alt="" />
</div>

..and that’s a wrap! All images are preloaded and ready for calling as you please. Completely valid, standards-compliant image preloading via CSS and (X)HTML!!

Wrapping Your Head around Downlevel Conditional Comments

Posted on July 18, 2007 in Function by Jeff Starr

If you think you understand the logic behind Microsoft’s downlevel conditional comments, you are sadly mistaken. Sure, they seem simple enough on the surface, but as you really try to wrap your head around how and why they work, the subtle complexities of downlevel conditional comments may leave you dazed and confused…

[ Image: Human Head via Photographic Cubism ] In our previous article on Internet Explorer’s exclusive browser-detection method, downlevel conditional comments (DCC), we present an introductory exposition, defining expressions and providing several generalized code examples. Overall, it is a very useful article but partially fails at explaining the logic and functionality behind conditional comments. In this article, we strive toward a solid understanding of downlevel conditional comments — how they work, why they work, and where they work. Sure, you could just copy and paste code until something clicks, but actually understanding conditional comments will give you the edge — increasing your knowledge and improving your productivity.

Continue Reading

WP-ShortStat Slowing Down Root Index Pages

Posted on July 17, 2007 in Function, WordPress by Jeff Starr

For over a year now, I have been using Markus Kämmerer’s (Happy Arts Blog) WP-ShortStat plugin for WordPress. The plugin is relatively well-maintained and remains one of my favorite admin tools. Great for popping in on stats without logging into Mint. Nonetheless, due to its IP/country-detection functionality, WP-ShortStat has experienced its share of difficulties (e.g., read through the change log on the plugin’s home page). In this article, I describe how WP-Shortstat slows down the root index-page of a site, and then suggest a (temporary) fix for the issue.

Continue Reading

Allow Google Reader Access to Hotlink-Protected Images

Posted on July 16, 2007 in Function, Technology by Jeff Starr

[ Image: Google Reader Icon ] In our previous article, we explain the process of allowing Feedburner to access your hotlink-protected images. The article details the entire process, which covers the basics of hotlink protection and involves adding several lines of code to your htaccess file. In this article, we skip the detailed explanations and present only the main points. The discussion is very similar for both Feedburner and Google Reader, and may be extrapolated to serve virtually any purpose.

If you are using htaccess to protect your images from hotlinking and have yet to check your feeds in Google Reader, you may be in for a little surprise. Unless you explicitly permit Google Reader access, your htaccess rules may be inadvertently preventing subscribers from viewing the images in your feeds. The same is true for Google Reader Mobile, which is probably far more popular than you may realize.

Continue Reading

WordPress Plugin: Export Blogroll for del.icio.us

Posted on July 11, 2007 in WordPress by Jeff Starr

Announcing an easy way to export and automatically format your WordPress Blogroll for import into your del.icio.us social bookmarking account!

[ Image: Export Blogroll Icon ] The Export Blogroll plugin for del.icio.us simplifies the process of transferring your WordPress Blogroll to your del.icio.us account. del.icio.us now provides a way to import multiple links with a single file, however the file must emulate a specific (browser bookmark) format. The Export Blogroll plugin automatically formats your exported Blogroll content according to del.icio.us batch-upload specifications, making it super-easy to import and share your links. The Export Blogroll for del.icio.us plugin provides several export options:

Continue Reading

Bookmark Exodus: Export the WordPress Blogroll and Import to del.icio.us

Posted on July 10, 2007 in WordPress by Jeff Starr

[ Image: del.icio.us Icon ] After our recent WordPress-2.1 blogroll debacle, we concluded that the WordPress Links Manager (aka the Blogroll) is no longer a viable, long-term solution for managing bookmark collections containing large numbers of links. A far better solution, in the eyes of many savvy web users, is the free social bookmarking service del.icio.us. Using del.icio.us for over a year now, we have found it to be highly flexible, always reliable, and infinitely extensible. Plus, as a social bookmark service, everyone benefits from everyone and quality resources are much easier to find. The dec.isio.n to switching from the Blogroll to del.icio.us is, in our opinion, a no-brainer.

Continue Reading

Allow Feedburner Access to Hotlink-Protected Images

Posted on July 9, 2007 in Function by Jeff Starr

[ Image: Feedburner Icon ] Recently, we installed and configured the excellent WordPress Feedburner plugin by the venerable Steve Smith 1. The plugin basically redirects our various WordPress-powered content feeds to Feedburner, which then delivers them to subscribers. This method enables us to take advantage of Feedburner’s excellent statistical tools. Further, all of the action happens silently, beneath the surface, and without the subscriber even realizing it.

After a few weeks running the plugin with great success, we began hearing reports of broken and missing images messing up our feeds. After some investigating, we realized that our tried-and-true anti-hotlinking htaccess rules were doing their job a little too well — blocking everyone outside our domain from accessing our image content — including Feedburner.

Continue Reading