Pesky Directory Alphabet Filters Made Easy (PHP)

I have built quite a few directory systems in my years as a web developer and one thing that has always annoyed me is building letter filters to return results depending on the first letter of a title.

Normally I would waste a lot of time actually typing out the entire alphabet string:

$alphabet = 'abcdefghijklmnopqrstuvwxyz';

which can take a lot of time (Go on try it, I’ll bet no matter how fast you can type, typing out the alphabet quickly will be tricky!) then looping through the string like so:

for($i = 0; $i < strlen($alphabet); $i++)
{
  echo substr($alphabet, $i, 1);
} 

However there are 2 other much simpler methods:

Method 1 – Loop through the ASCII numbers

for($i = 65; $i <= 90; $i++)
{
  echo chr($i);
}

or my new personal favourite using PHP’s range() function:

Method 2 – Using range()

foreach(range('A', 'Z') as $i)
{
  echo $i;
}

Then all you have to do is add in any code to make sure you set the right CSS selectors and highlight which letter you are currently viewing and add the ability to filter by first letter to your list function.

Simple.

The RSS Cloud – Real Time Blogging

As with any WordPress Blog and pretty much any other blog or news website projectroon.co.uk has an RSS Feed and if you look closely at the source of this RSS feed you may notice a new element

<cloud>

What is this? Well currently most Feed Aggregators will poll selected RSS feeds and check if there are any new items. This can be slow and resource heavy especially for someone like Google who has to check millions of feeds many times every day with their reader technology

The cloud element has always been available in RSS 2.0 however most have ignored it or failed to appreciate its possible uses.

Anyone who is familiar with a Blackberry mobile phone will know just how much money they save in data charges by using the Blackberry’s Push technology. Push technology means that the phone doesn’t have to keep connecting to it’s mail server and asking if there are any new emails available. Instead the server waits until it has a new email and then contacts the phone to deliver it. This results in far less load on the mail server and means you don’t have to wait to receive your email.

The RSS cloud works in the same way, feed readers that support the cloud element will be informed every time a blog owner publishes a new post, meaning readers using that reader will be able to start reading instantly after posting.

Find out more from the Official Announcement by WordPress or add support for the RSS cloud for your wordpress blog here

Advertising is damaging the Internet experience

In my humble little opinion the original intention of the web was to be a worldwide free medium to share documents and discuss idea. So far this ideal has been somewhat achieved but there is something that is threatening the ideal.

I have recently stopped following some blogs and websites, not because I find their content irrelevant or or lackluster, but because my experience whilst on these sites has become so tarnished by advertising that I can’t read the content. Some of these sites are industry leaders in breaking news for the technology and IT worlds, but if I cannot read the content I am not going to bother coming back.

Now I am not saying that advertising is all bad, most of these blogs and websites depend on it to remain publishing. However as the average user learns to automatically and involuntarily tune out the distractions, advertisers keep coming up with new innovative methods of annoyance.

I am at breaking point.

First we had JavaScript pop ups loading advertising pages up continually in your face and these were easily stopped by blocking JavaScript. These were soon replaced by flash banners normally at the top or sides of a website, which flash, scream or try to get you to shoot a duck.

Oh yes the ones that really drive me mad are the holding page adverts, where if you don’t have a cookie for a particular site you have to sit and wait for 10 seconds while several adverts are paraded in front of your face.

Now we have the CSS/Ajax pop up windows asking stupid questions like

“As a valued visitor please take a moment to tell us what you think about our site, and then if you wouldn’t mind visiting one or two of our sponsors…”

So I am quite certain that the vast majority of Internet users will agree with me here, but by charging less and less for more intrusive adverts, the only long term success that will be gained will be in driving readers away, not wealth.

The web is now one of the most powerful mediums on the planet, surely there is a better way of generating revenue whilst still maintaining a meaning?

Why do IT Pros have so much free time?

Why do IT Pros seem to have so much free time?

Why do IT Pros seem to have so much free time?

eviljaymz.com