April 2012 in the Life of Ben (Blog)

  1. January
  2. February
  3. March
  4. April
  5. May
  6. June
  7. July
  8. August
  9. September
  10. October
  11. November
  12. December

Forum Mobile User Journeys (29th April 2012)

What do people actually do on a web forum? Here’s my account of browsing my favourite 2 forums. They use phpBB and I viewed them on my Nokia N900 during a 1 hour train journey.

GTAMP Forums

  1. Opened from the Bookmarks home screen.
  2. 13 areas arranged in 3 sections.
  3. Could see 2 areas had replies thanks to icon being red.
  4. Clicked 2nd area in new tab. (It’s a more interesting area.)
  5. 2 topics had new replies thanks to icon being red and additional orange icon.
  6. Clicked 1st topic icon for First unread message. (15 in thread; context not needed.)
  7. Read the message.
  8. Closed window.
  9. Clicked 2nd topic as it was all new.
  10. Read messages. (5 in thread; all new, needed all in sequence.)
  11. Clicked Add Reply.
  12. Typed my reply. Clicked Submit.
  13. Saw my reply was added.
  14. Closed window.
  15. Closed window for area.
  16. Returned to forum home.
  17. Clicked 2nd area.
  18. Clicked the topic with new replies.
  19. Read the new message. (2 in thread; needed context as new message was badly written.)
  20. Closed window.
  21. End of session.

Accessify Forum

  1. Opened from the Bookmarks home screen.
  2. 10 areas arranged in 3 sections.
  3. Saw 1 area had new messages thanks to icon being orange.
  4. Clicked the area.
  5. Saw the topic with a new message thanks to icon being orange and additional orange icon.
  6. Clicked the topic.
  7. Read the new topic. (6 in thread; all new so needed sequence.)
  8. Clicked Add Reply.
  9. Typed my reply. Clicked Preview.
  10. Checked my reply and made a couple of corrections. Clicked Submit.
  11. Saw my reply was added.
  12. Closed the window.

Top 1% of Developers (28th April 2012)

When I won Most Accessible Website in Hampshire against nearly 100 other websites 2 years running, that was a fair indication that I was amongst the top 1% of developers. Later, I won Best Microsite in England for the internal communications sector with a team of other people. Again, that seemed to reinforce my credentials.

Since then, what can I point to as a demonstration of industry-leading work? Extremely robust HTML campaigns are about it. Being in the top 1% of newsletter developers is still an achievement but I want to push forward, like when I started out.

Learn, analyse, improve and get ahead of the mainstream once again. Demonstrate my abilities with unbeatable work, once again.

Haircut 14 (28th April 2012)

As part of a grand tour from the flat in London to the hairdressers in Fleet, then to the family home in Fleet, then finally back to the flat in London. Combination of cycling and train. Racked up about 20 miles by bicycle during the day!

Forum Design Stuck in the 1990’s (27th April 2012)

It’s been nearly 4 years since my radical forum interface mockups for Accessify Forum. Hardly any of it was implemented and it seems mainstream system are hardly better than they were 10 years ago. Slightly fewer layout tables and slightly nicer themes. That’s about it.

We should have multiple perfect forums by now – they’ve been popular for 15 years!

I now plan to choose and modify a forum system. It will start in my local server environment rather than publicly. Once there is something worth showing I’ll make it available in the /!dev/ area.

“If you want something done right, you have to do it yourself.”

This type of project takes a long time, speaking from experience. Many years ago I changed all the HTML produced by Ikonboard for a GTA forums theme. A couple of years later did a similar thing to Invision, when they switched over.

PunBB

They were open to change when I reviewed their code some years ago. The system is very much about providing the essentials and nothing beyond that, with a sensible architecture that is relatively lightweight.

The default HTML it produces has its heart in the right place, although some areas do strike me as a bit weird. The design is subtle and orderly, perhaps even a bit boring. Those are all good things for a forum, in my view, especially when it’s going to have unfamiliar task flows.

My web hosting has cPanel with a Softaculous area, in which there is a PunBB demo. So this might also be the easiest to deploy to my web hosting, thinking ahead?

phpBB

The most prevalent forum system around? Used by my current favourite hangout, GTAMP Forum. It’s also used by Accessify Forum, for whom I originally started these experiments.

This would produce the biggest impact, although I would most likely cut out loads of its features. Might be able to get database dumps to kick-start my local server environment with a large amount of real content and users. Would help to keep things real, right from the start.

This route also has the biggest potential for being deployed as a theme by one or other of the communities I’m already part of. Their members could opt into it, if they chose, to give real feedback.

Forum Deli

Sadly I can’t find any remaining installs or downloads for the interesting interface of Forum Deli. Is it worth contacting the original author?

Vanilla

By far the best-looking forum I’ve seen! Lots of intelligent features, maybe a bit over-engineered in fact. But the design arranges and decorates this deluge of clickable items in an orderly and pretty way.

With that said, the semantics of the HTML are totally absurd in places and some key task flows are not optimised. It’s available for download and tinkering, with some kind of themes system.

sCSS Board

Elxx made it, a friend from way back on the Gouranga! Forums. It’s on SourceForge but there are no websites running it.

All I could find was one website which removed it, for reasons unknown.

Iceyboard

The system which Gouranga! Forums has used for some years. It was made by Icey, another old friend from that community. It was made exclusively for that community and nowhere else is allowed to run it.

The functionality had the essentials and nothing more. Knowing Icey, most likely programmed neatly within a straightforward architecture.

Simple Machines Forums

Eww, it’s just a yucky clone of phpBB. I thought they used to make a nice one?!

The WAP 2.0 version is somewhat interesting. It gives a live demo of how minimal a forum could be, in theory. The absence of new message indicators and having to click through even more pages than the standard theme to find relevant content makes it almost useless, in practice.

Now, here’s a pet peeve of mine. They provide WAP for extremely resource-starved devices. But they go and include the full domain name in every href, wasting 841 bytes – that’s 17.6% of the HTML size! Stupid.

(Furthermore, WAP was always a stupid format. The code is identical to HTML, just with some XML cruft (which almost nothing ever parsed as XML, btw). You can do exactly the same thing more efficiently in HTML! Especially if they optimised the href and cured the clasitis with semantic markup.)

MyBB

Nested layout tables! ’Nuff said.

Why Cyclists Slow But Don’t Stop (26th April 2012)

It hurts to start after stopping. Getting 50–100kg moving from 0–15mph in a short time takes a lot of effort. If they do that every 30 seconds (typical for a new rider in London rush-hour) it would become excrutiating. They’d simply grind to a halt.

Slowing a little, to ~10mph, then building back up to 15mph is much more comfortable.

F = ma

The pain comes from lactic acid building up near the muscles being used the most, in the legs. If you drive a car in stop-start traffic, you’ll know how it takes a lot more energy because you’ve seen how much more fuel the car burns per mile.

It isn’t motivated by aggression or a sense of superiority. They’re just trying to get from A to B like everyone else – minimising the pain of their effort along the way.

Bill Bailey Qaulmpeddler (26th April 2012)

Saw this with Fiona and one of her connected friends at Leicester Square Theatre. Apparently it’s a favourite haunt of comedians for trying out newer material.

Could not believe how funny this was in person! Very easy and kind crowd but every other line had me giggling with glee.

The Simpsons and Futurama have a high density of comic material, in their best episodes. The opening movement of this was even beyond that.

It slowed down at times but his clever silliness and inimitable mannerisms soon got things going again. There is a musical finale at the end of the show, although I shaln’t spoil its exact nature for you.

New Front Light for Bicycle (7th April 2012)

Went to Hadron Cycles just down the road from us to fix the broken front brake on Fiona’s bicycle. While we were in there I spotted a front light for £25 which takes 3× AAA batteries. Much like the Cateye light I lost when I visited Mum and Dad the other week.

New Forest for Easter (6th April 2012)

Mum, Dad, myself and Fiona trekked down to the New Forest for a peaceful day in the countryside. Front brake cable broke on Fiona’s bicycle just before we left. Better to happen then than at the first junction she needed to stop at! There was no way to repair it quickly since brake cables must withstand a lot of leverage. So we scrapped the cycling to Waterloo and stared walking to the Tube.

Called Dad and he suggested going to Fleet and we’d all drive the rest of the way together. It was a good idea, as we wouldn’t be able to cycle the 10 miles from Brockenhurst to Exbury Gardens.

Once we got to Fleet we all piled in Mum’s Hyundai i30 and set off for the motorway. It was a gentle drive which didn’t take too long. It was really cold so there was no Bank Holiday mass exodus to the beach!

Exbury Gardens

Has a ~1 foot guage railway running around part of its grounds. The scale makes everything seem like a half-sized Welsh narrow-guage railway. The open-sided carriages were quaint and gave uninterrupted views of the many plants, trees and sculptures which line the route.

Unexpected Apache Upgrade (4th April 2012)

The data centre which supplies my host, D&S Hosting, decided to upgrade our Apache 1.3 to a newer version without telling us in advance. This website was a 500 Internal Server error for several hours and Site Surgeon was not processing its PHP.

Adjusting the AddHandler in the .htaccess got PHP working in both places. But the .htaccess for Project Cerbera also had a couple of syntax issues and a couple of deprecated features. Which I’ve had to re-code on the spot.

Good thing I wasn’t on holiday! Broken websites aren’t the best selling tool for a website developer.

Fixing AddHandler to run PHP in .html Files

Before, I used a list of file extensions:

AddHandler application/x-httpd-php .html .htm .php

Now I use one per line:

# Process <?php ... ?> as PHP in HTML but not <? ... ?>:
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php .html
AddHandler application/x-httpd-php .htm
AddHandler application/x-httpd-php-source .phps

Easy enough, after deducing it from recent samples online. Didn’t notice people saying the list approach had become obsolete.

.htaccess Syntax Gremlins

Had the idea to validate my .htaccess file and immediately found the easy-as-pie .htaccess checker by Lynxx. A quick Copy and Paste into its text box followed by a click on check it » and I had a neat report.

Below is a syntax-highlit version of the errors it found.

Lyxx found 4 problems in the code segment(s) below.

line 15: (3)
php_value short_open_tag Off
line 37: (10)
# http://www.accessifyforum.com/viewtopic.php?p=49758#49758
line 284: (12)
Redirect permanent /gta/3/tutorials/handling/definition.cfg  http://projectcerbera.com/gta/3/tutorials/handling
line 405: (201)
RedirectMatch gone ^/web/study/2007/tables/clark2006\guis\.*$

No idea what the numbers in brackets mean, possible the internal error codes it uses? Anyway, here are the fixes by line number:

  1. Short tags are obsolete in new PHP so this line isn’t needed.
  2. Wasn’t actually. The 1st # character comments out the 2nd # character.
  3. Two spaces instead of one. (Ouch, new Apache is strict!)
  4. Should be a forward slash before guis as it’s part of a URL. (Using \g in a RegEx isn’t valid because there is no special character abbreviated to \g.)

Rewriting my RewriteRules

Zcorpan figured out extensionless URLs for me many moons ago. It wasn’t quite working in some situations now, though.

Specifically, requesting a .html file which no longer existed would simply produce the 404 Not Found error. What should happen is:

  1. The .html gets stripped anyway,
  2. My forest of Redirect statements eventually matches the broken URL;
  3. You are taken to the new URL.

So I searched for a while and tried to untangle the samples which would do what I want. Eventally pieced together the solutions from jdMorgan’s RewriteRule samples on Webmaster World to get what I needed. This isn’t safe for query strings; since I don’t use any I have left them out.

# Canonical clean URLs
# Query string support by zcorpan: http://www.accessifyforum.com/viewtopic.php?t=7443#49789
Options +MultiViews
#
# They got broken on 2012-04-05 after an unexpected major Apache server upgrade by data centre.
#
# Combined with code by jdMorgan: http://www.webmasterworld.com/apache/3480555.htm
RewriteEngine ON
RewriteBase /
#
# If direct client request for .html files
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /[^.]+\.html\ HTTP/
# Redirect to URL without extension
RewriteCond %{THE_REQUEST} !\?.*\.html
RewriteRule ^([^.]+)\.html$ $1 [R=301,L]
#
# Redirect index files to their directory name, so "foo/index" becomes "foo/"
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\ HTTP/
RewriteCond %{THE_REQUEST} !\?.*\index
RewriteRule ^(([^/]+/)*)index\.html$ $1 [R=301,L]

Coolest thing is that now, I don’t need the domain name on the ‘corrected’ side of my rewrites or redirects! Awesome! I can finally run the exact same .htaccess locally and remotely.

Newer and better, in this case.

And Again…

We changed to a new host, which provides a much more beefy server. But PHP was broken again. Why?!

The fix seemed so simple at first, after immediately discovering a value has changed in PHP5:

AddHandler application/x-httpd-php-5 .php .html .htm
AddHandler application/x-httpd-php-source .phps

The final line makes PHP5 syntax highlight .phps files automatically. (Same as previous code.)

That got PHP working but it didn’t have access to a function my code uses:

Fatal error: Call to undefined function apache_lookup_uri() in [secret/folder/location] on line 8.

So I started cooking lunch, with my site still broken. After I returned (and a few more Google searches later) I found the solution. Here’s how I used to calculate the Last-Modified HTTP response header:

// Get information about requested page:
$file_info = apache_lookup_uri($_SERVER['SCRIPT_NAME']);
$filespec = $file_info->filename; // complete path after any MultiView operations
$last_modified = gmdate(DATE_RFC2822, filemtime($filespec)); // RFC 2822

Here’s how I do it now:

// Updated for SuPHP: http://uk3.php.net/manual/en/function.getlastmod.php#46613
$filespec = $_SERVER['SCRIPT_FILENAME'];
$last_modified = gmdate(DATE_RFC2822, filemtime($filespec)); // RFC 2822
$modified_date = gmdate('l j', filemtime($filespec))
                 . '<sup>' . gmdate('S', filemtime($filespec)) . '</sup> '
                 . gmdate('F Y', filemtime($filespec))
                 . ' at ' . gmdate('g:ia', filemtime($filespec))
                 . ' <acronym title="Universal Coordinated Time">UTC</acronym>';

So the live site now works. But now the local site wasn’t processing PHP! For some bizarre reason, it only works with the old AddHandler value. So, to keep parity between my local .htaccess and the live one, I added a conditional directive:

# Local WAMP server doesn't recognise: application.x-httpd-php5
# Requires enabling "mod_version.c" which WAMP calls "version module".
<IfModule mod_version.c>
 <IfVersion = 2.2.21>
  AddHandler application/x-httpd-php .php .html .htm
 </IfVersion>
</IfModule>

Since the live version is already more recent and the local will only change if I choose to change it, this should be an adequate check. Still bizarre, though.