1 | 2 | 3 | 4 | 5

6 - 10   [22]

Simple Acronym Handler

Also relates to PHP

Many code snippets for handling acronyms seem to rely on <a href="http://www.php.net/preg_replace" title="PHP Doc for preg_replace">preg_replace()</a>. The problem with this method is ensuring that double replacements do not occur (e.g. with XHTML and HTML). A much better function to use is <a href="http://www.php.net/strtr" title="PHP Doc for strtr">strtr()</a> with two arguments:


$translation_array = array(
  'XHTML' => '<acronym title="eXtensible Hypertext Markup Language">',
  'HTML'  => '<acronym title="Hypertext Markup Language">'
                           );
$str = strtr($str, $translation_array);

It will always look for the longest pattern first and will not try to replace stuff it has already worked on. It is also really quick.

I have been test running the following function on this site to automate acronym handling:


function ss_fns_parse_acronyms($copy) {
  
  static $trans = array();
  
  if (empty($trans)) {
    $dat_file = SOME_PATH . '/data/acronyms.dat';
    $acronyms = parse_ini_file($dat_file);
    foreach($acronyms as $a => $d) {
      $trans[$a] = "<acronym title=\"$d\">$a</acronym>";  
    }    
  }
  
  return strtr($copy, $trans);        
}

The acronyms can be stored in php_ini format in a file, thus new acronyms can be added without interfering with this code. There are occassional limitations and gotchas - e.g. OS inadvertantly appearing in $_POST, but it is an efficient and clean alternative to preg_replace.

Posted on Aug 13, 2004 at 05:58:50. [Comments for Simple Acronym Handler- 0]

WCAG Working Draft Updates

Also relates to Accessibility and CSS Design

New Working Drafts of WCAG 2.0 and accompanying HTML and CSS techniques have recently been published:

Posted on Aug 03, 2004 at 21:16:59. [Comments for WCAG Working Draft Updates- 0]

GAWDS Cracks The Whip

Also relates to Accessibility

Yes, it is official! The Guild of Accessible Web Designers (GAWDS) makes its launch today, thanks to the dedicated work of Jim Bryne and the rest of the GAWDS members.

Accessibility goes far beyond preparing Web sites for disabled people. Accessibility is now shorthand for the adoption of core standards that benefit every user of the Internet and impact the bottom line of every business. GAWDS intends to promote these standards to instill in Web designers the high level of competence and professionalism required to unlock the full potential of the Internet. Jim Bryne, GAWDS Founder

While the public readily understands how inaccessible Web sites limit the flow of information to people with disabilities, many business owners fail to see the detrimental effects of inaccessible or non standards-based design on their bottom line. The number of user agents that still tolerate sloppy, invalid markup is shrinking. With the emergence of new technologies and devices, this means that client and consumer audiences are also shrinking for businesses that rely on old-style, idiosyncratic Web sites that make it difficult to parse content for re-use.Derek Featherstone, GAWDS Founding Member

Read the full press release to gain an insight into the objectives of GAWDS to bring Web Standards and Accessibility to the forefront of web design and development, and peruse the opinions of a number of members on the future and importance of accessibility. Then, once you have got a feel for the Guild, why not have a go at the site redesign competition to win a great prize and ultimate kudos!

Posted on May 26, 2004 at 05:00:33. [Comments for GAWDS Cracks The Whip- 0]

Next Link Misleads Logs

Also relates to Accessibility and Apache, Firefox and Co

This is a very annoying quirk that took me far too long to track down! When calling pages on my test platform using a new caching system and a package of builder classes for parsing XML based metadata a second call for a page was being made to the server. In short, the page in question was that defined as next in the relative links:

<link rel="next"
           href="/uri_of_page/"
           title="Description of the page/>

At first I thought this was down to a coding error in one of the PHP classes. Fortunately browsing the HTTP headers and a timely flick through the HTML 4.01 Specification abated my growing frustration. The specification states the following for the next link type:

Refers to the next document in a linear sequence of documents. User agents may choose to preload the "next" document, to reduce the perceived load time. http://www.w3.org/TR/html401/types.html#type-links

Well it is the second sentence that is clearly significant here. The second call for a page to the server abides to the above recommendation. In fact on further scrutiny I discovered this problem is distinctive to Mozilla family which utilise the link toolbar (I did not take further time out to test on Opera).

I see a major conflict in this. The relative links have been adopted as important elements for accessible navigation and are a recommended technique for achieving several guidelines in the WCAG at level 2 and 3. Yet, as long as user-agents abide to the above statement regarding the next link type, there is a conflict of interest between attaining accessibility and maintaining reliable web server logs! This is especially so with Webalizer, the most popular open source software for producing tabular and graphical statistics from Apache's Common Logfile Format. For each pre-loading call to the webserver will register an additional page hit for that page in the access log. If the user actually visits the page via the next link a second page impression will be registered!

Fortunately for once, Exploder is beneficial here, since it has no idea whatsoever about relative links, and therefore the above over-logging will not occur. Sadly this may explain why on a number of my clients sites (this site included) Mozilla and co are falsely striving into the lead on the browser stakes! One solution may be to flush out the pre-loading entries by looking for calls for two separate pages from the same IP address within a second or two of each other. If I can find a minute may call for some Awk and Sed.

Posted on May 22, 2004 at 00:42:26. [Comments for Next Link Misleads Logs- 0]

New GAWDS Member

Also relates to Accessibility

I feel privileged to announce my application to join the Guild of Accessible Web Designers (GAWDS) has been accepted. The Guild, originally founded by Jim Byrne is still in development and has an admirable member community with some of the finest and most reputed accessibility developers in the world. A principle objective of the Guild is to

…promote a vision of the future that assumes accessible web design to be relevant, obtainable and not at odds with successful business practice or good visual and usable design.

With the official opening of the Guild set for the middle May, I hope I can find considerable time beyond client commitments to contribute extensively to the community.

Posted on Apr 24, 2004 at 15:13:08. [Comments for New GAWDS Member- 0]

Breadcrumbs Trail

[ Home ] -> TW Blog -> Web Standards
Site Map

The Severn Solutions website achieves the following standards:

[ XHTML 1.0 ] [ CSS 2 ] [ WAI AA ] [ Bobby AA ]

Page compiled in 0.010 seconds