Archive for October, 2006

Theme Edits for IE7

Posted on October 31, 2006 in Perishable, Websites by Jeff Starr

This post is a working repository of code edits and other changes made to Perishable Press themes in order for them to function properly in Internet Explorer 7 (IE7)..

Jupiter Theme
*:first-child+html div.comwrap {
	overflow: visible;
}
Lithium Theme
*:first-child+html div.comwrap {
	overflow: visible;
}
Casket Theme
Removed html selector from first ruleset.

Exploring the (X)HTML Link Element

Posted on October 31, 2006 in Structure by Jeff Starr

Most Web authors are familiar with the <link> element included within the <head> element of many (X)HTML documents. The <link> element enables authors to associate external resources to the (X)HTML document. <link> element references include various types of metadata, navigation, and styling information. This brief post provides examples of these and other important uses of the (X)HTML <link> element.

<!-- indicate the starting location -->
<link rel="start" href="http://domain.com/directory/" />

<!-- indicate the previous item -->
<link rel="prev" href="http://domain.com/directory/prev/" />

<!-- indicate the next item -->
<link rel="next" href="http://domain.com/directory/next/" />

<!-- indicates the index location -->
<link rel="contents" href="http://domain.com/directory/index.html" />

<!-- indicates location of a help file -->
<link rel="help" href="http://domain.com/directory/help.html" />

<!-- indicates location of a site feed -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://domain.com/directory/feed.rdf" />

<!-- indicates location of FOAF metadata -->
<link rel="meta" type="application/rdf+xml" title="FOAF" href="http://domain.com/directory/foaf.xrdf" />

<!-- provides contact information -->
<link rev="made" href="mailto:name@domain.com" title="contact name" />

<!-- indicates location of translated document -->
<link rel="alternate" href="http://domain.com/directory/translated.html" hreflang="fr" title="french translation" />

<!-- provides a link to the stylesheet -->
<link rel="stylesheet" href="http://domain.com/directory/style.css" type="text/css" media="screen" />

Extreme Makeover for Gravatars in WordPress

Posted on October 30, 2006 in Websites, WordPress by Jeff Starr

Strategic Methods for Improving Gravatar Functionality in WordPress

Gravatars have become a popular way of adding spice to the "comments" page of many WordPress-powered sites. So popular, in fact, that the gravatar server is often overloaded, bogged down with millions of gravatar requests every second. This immense server load effects user pages everywhere, resulting in slow loading times, unresolved server requests, and missing gravatars. Such broken presentations appear unprofessional, tarnish reputations, and may provoke confusion. This article provides essential solutions for an extreme gravatar makeover..

Continue Reading

Epson Slide Scanning

Posted on October 30, 2006 in Technology by Jeff Starr

The Epson Perfection 1260 Scanner is equipped with an external lamp adapter that enables the scanning of slides. To use this feature via Photoshop, follow this procedure:

  1. Remove scanner lid and plug in the adapter
  2. Restart the computer and open Photoshop
  3. Click on File » Import » EPSON TWAIN 5..
  4. From the Document Source drop-down menu, select Color Positive Film (TPU)
  5. Set the resolution to 2400dpi, which is equivalent to an image that is approximately 10″ x 6″
  6. Set other settings accordingly
  7. Place slide in the adapter
  8. Pre-scan to check positioning
  9. Highlight scan area accordingly
  10. Scan it!

References

Compressed CSS Compression

Posted on October 23, 2006 in Function by Jeff Starr

In this article, we have consolidated the priceless information provided in fiftyfoureleven.com’s fine post, The Definitive Post on Gzipping your CSS, which discusses two practical methods for compressing CSS documents. Complete and utter credit for the contents of this article is hereby attributed to fiftyfoureleven.com.

Method One

Overview: This method involves adding a small PHP script to your CSS document and replacing its .css extension with a .php extension.

Place the following PHP script into the top of the CSS document that you wish to compress. Then change the .css extension to .php, to arrive at something similar to: compressed-css.php. Remember to use the new name when referencing the file.

<?php 
   ob_start ("ob_gzhandler");
   header ("content-type: text/css; charset: UTF-8");
   header ("cache-control: must-revalidate");
   $offset = 60 * 60;
   $expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";
   header ($expire);
?>

Here is the same PHP script commented with functional explanations:

<?php

   // initialize ob_gzhandler function to send and compress data
   ob_start ("ob_gzhandler");

   // send the requisite header information and character set
   header ("content-type: text/css; charset: UTF-8");

   // check cached credentials and reprocess accordingly
   header ("cache-control: must-revalidate");

   // set variable for duration of cached content
   $offset = 60 * 60;

   // set variable specifying format of expiration header
   $expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";

   // send cache expiration header to the client broswer
   header ($expire);

?>

Functional Summary: The previous PHP function will first check to see if the browser requesting the file will accept "gzip-deflate" encoding. If no such support is detected, the requested file is sent without compression. Next, the function sends a header for the content type and character set (in this case, "text/css" and "UTF-8"). Then, a "must-revalidate" "cache-control" header requires revalidation against currently specified variables. Finally, an "expires" header specifies the time duration for which the cached content should persist (one hour in this case).

Method Two

Overview: This method involves placing the PHP script in a separate .php file and adding a set of rules to an .htaccess file.

A more discrete, unobtrusive method for compressing CSS involves two steps. First, save the script provided in the first method (above) as a seperate gzip-css.php file and place it in a CSS-exclusive directory. Then, add the following ruleset to an .htaccess file located in the same CSS-exclusive directory (i.e., the CSS directory should contain only CSS files):

# css compression htaccess ruleset
AddHandler application/x-httpd-php .css
php_value auto_prepend_file gzip-css.php
php_flag zlib.output_compression On

Here is the same htaccess ruleset commented with functional explanations:

# css compression htaccess ruleset

# process all CSS files in current directory as PHP
AddHandler application/x-httpd-php .css

# prepend the PHP script to all PHP files in the current directory
php_value auto_prepend_file gzip-css.php

# compress all parsed PHP pages from current directory
# this rule is redundantly present as the first line of the PHP script
php_flag zlib.output_compression On

Functional Summary: The .htaccess rules above first instruct Apache to parse all CSS files in the current directory as PHP. After this, Apache is instructed to insert the contents of the "gzip-css.php" file into the beginning of each PHP (i.e., CSS) file parsed from the current directory. And finally, Apache is instructed to compress automatically every parsed document in the current directory.

Confirmed Browsers

  • Internet Explorer 5 and up: works great
  • Netscape Navigator 6 and up: works fine
  • Mozilla/Firefox: all versions seem to work
  • Opera: does not cache compressed CSS

References

Contact Perishable via Comment

Posted on October 22, 2006 in Perishable by Jeff Starr

If you have question, comment, or concern, and prefer to leave a comment rather than send an email, please drop a comment via the form below. I keep a close eye on all comments left on this post, and will do my best to respond in as soon as possible. Please note that all comments left at this post are open to the public and available for anyone to see. That said, have at it!

W3C Validation Services

Posted on October 16, 2006 in Accessibility, Standards by Jeff Starr

Here are the validation services currently provided by the W3C 1:

References

Delete Unwanted Context Menu Items in WinXP

Posted on October 16, 2006 in Technology by Jeff Starr

Within the right-click context menu is the option to create "New" file items. While the list of available documents within the "New" submenu often contains several useful file types, such as .txt or .zip, it also contains lots of unnecessary entries.

To clean up the "New" right-click context menu, open the Registry Editor, regedit.exe, and Find all instances of "ShellNew". Examine the search results. Every ShellNew branch belongs to a specific type of file. As each ShellNew branch corresponds to an entry in the "New" right-click context menu, delete the ShellNew branch for each "New" file type that you would like to remove. And that, as they say, is that.

Folder Background Images in WinXP

Posted on October 16, 2006 in Technology by Jeff Starr

This brief tutorial explains how to add a background image to any folder in Windows XP.

First, make sure all hidden files are visible on your system. Then, open the folder for which you wish to add a background image. Within the folder, right-click and select Properties » Customize tab » Customize. There, choose any icon, click Apply and OK.

That process should have created a "desktop.ini" file. Open that file with a text editor and add these lines of code:

[ExtShellFolderViews]
{BE098140-A513-11D0-A3A4-00C04FD706EC}={BE098140-A513-11D0-A3A4-00C04FD706EC}
[{BE098140-A513-11D0-A3A4-00C04FD706EC}]
IconArea_Image=C:\path\folder\background.jpg

To customize this according to your needs, edit the path in the last line to reflect to the location of the image you wish to use as the background image for that folder. Refresh the folder and the new background should appear.

Finally, to remove the default icon chosen during the creation of the desktop.ini and restore the default folder icon, delete these lines of code from within the desktop.ini file:

[.ShellClassInfo]
IconFile=%SystemRoot%\system32\shell32.dll
IconIndex=(some number)

One Link to Open Them All

Posted on October 4, 2006 in Function by Jeff Starr

Welcome to Perishable Press! This article explains several methods for opening multiple frames with a single link. For more excellent (X)HTML information, check out the (X)HTML tag archive. If you like what you see, I encourage you to subscribe to Perishable Press for a periodic dose of online enlightenment ;)

Opening Multiple Frames with One Link

Method 1:

The first method of targeting multiple frames involves replacing either the entire frameset (via target="_top") or a subset of frames (via target="subset"). For example, any number of frames may be updated with a single link if that link targets a new frameset containing all of the new frames. Likewise, multiple frames within a nested frameset may be updated by replacing the nested frameset itself. This method works well when many frames need updating. In the following example, the nested frameset, "nested-frameset.html", contains multiple frames that need updating when a single link is clicked. When this happens, the "dynamic" frame is refreshed with multiple new frames, while the "static" frame remains constant. Using this method, virtually any combination of frames or framesets may be updated with a single link.

<frameset cols="*,3*">
   <frame src="static-content.html" name="static">
   <frame src="nested-frameset.html" name="dynamic">
</frameset>

Method 2:

The second method for targeting multiple frames employs JavaScript’s "onClick" function. With this method, the initial frame (or frameset) is updated via the link’s href attribute, while the additional frame(s)/frameset(s) is updated via the link’s onClick attribute. This method requires JavaScript, but is much less convoluted than the method previously discussed. In the following example, when the link is activated, "first-frame" will be updated with first-frame.html, while "second-frame" will be updated with second-frame.html:

<a href="/path/first-frame.html" 
 target="first-frame" title="Update frames" 
 onClick="top.second-frame.location='/path/second-frame.html';">
   Click here to update both frames.
</a>

Method 3:

Our third method of opening/updating multiple frames with a single click utilizes a simple JavaScript function. This method operates through a function call placed in either the href or onclick attribute of the anchor (<a>) element. Upon activation, the JavaScript function proceeds to open simultaneously the specified links. Implementing this technique is straightforward. Given the following frameset:

<html>
 <head>
  <title>The Frameset</title>
 </head>
 <frameset cols="50%,50%">
  <frame src="page-01.html" name="frame-one" />
  <frame src="page-02.html" name="frame-two" />
 </frameset>
</html>

…with the following code present in page-01.html, which is displayed as frame-one:

<html>
 <head>
  <title>Frame One</title>
  <script type="text/javascript">
   <!--//--><![CDATA[//><!--
    function openframes() {
       parent.frame-one.location="page-03.html";
       parent.frame-two.location="page-04.html";
    }
   //--><!]]>
  </script>
 </head>
 <body>
  <p>
   <a href="javascript:openframes();" title="Open two links..">
    Open "page-03.html" into "frame-one" and "page-04.html" into "frame-two"
   </a>
  </p>
 </body>
</html>

With the previous code in place, the broswer window will display two frames of equal width. In the left frame, there will be a link that, when clicked, will open two links at the same time. Specifically, when the link is clicked, a file named “page-03.html” will replace the contents of the left frame (”frame-one.html”) while a file named “page-04.html” will replace the contents of the right frame (”frame-two.html”). To setup additional frames to open/update upon link click, simply add the corresponding lines to the openframes() function by emulating the existing code pattern. For example, to add another three frames to the function:

function openframes() {
   parent.frame-one.location="page-03.html";
   parent.frame-two.location="page-04.html";
   parent.frame-thr.location="page-05.html";
   parent.frame-for.location="page-06.html";
   parent.frame-fiv.location="page-07.html";
}

Finally, to account for users without JavaScript, we could call the function via onclick attribute, include an alternate frameset or page via the href attribute, and throw in a return false declaration for good measure:

<a href="../no-javascript.html" onclick="javascript:openframes();return false;">
   Open "page-03.html" into "frame-one" and "page-04.html" into "frame-two"
</a>

Beyond frames..

Using the onClick attribute within links, it is possible to target more than just frames. For example, Monzilla’s Information theme for WordPress features subpanels that "pop" open to reveal various types of content. To improve usability, we wanted certain panel links to open their panels while simultaneously repositioning the top of the panel with the top of the browser. This was easily accomplished with an onClick attribute in each of the panel links1.

References

  • 1 To check out the "popping" subpanels used in the Information theme, click here, scroll down near the bottom of the page, and click on either the "nonsense" or "details +" tabs. The single link click should result in two events happening simultaneously: the subpanel will pop open and the subpanel will align its top edge with the top of the browser window.

October 2006

Posted on October 4, 2006 in Textual, Timeline by Jeff Starr

tired, waiting and nursing a coldness while staring at the new reality
that awaits. dropped habits, spent time, and preparations for tomorrow.
make haste, oh most gracious and patient Lord, to grow my life according
to your perfect will.

Perishable Press Search Engine Optimization Library

Posted on October 2, 2006 in Optimization by Jeff Starr

Welcome to Perishable Press! This article covers a plethora of search-engine optimization resources. For more excellent SEO information, check out the Optimization category archive. If you like what you see, I encourage you to subscribe to Perishable Press for a periodic dose of online enlightenment ;)

Search-Engine-Related Websites

Continue Reading