You may have noticed a slight change to this site and for that I hate you, for this slight change was a shit load of work!

As I’ve mentioned before, this entire site has actually been two sites; the blog and the main site, they just looked identical.  To be honest, this was partly due to a sense of not wanting to part ways from having a site that was completely controlled and designed by myself.  But of course, a while ago, to make my blog fit in properly with the design of the main site I ended up create an entirely self written theme for wordpress.

Well, I got sick of having two separate sites that appeared as one and required changes done to them separately and in different ways to keep them looking the same and there really was no good reason for it, especially seeing as the blog part was the part that anyone actually looked at.

So last night I set to work copying the content from each of the pages on the main site into wordpress pages on my blog and changing the links at the top of the site to link to these new pages.  Once finished I copied all the files of the blog to the main site’s hosting space and created a duplicate of the database on this server.

After all this I killed off the old blog subdomain by removing the old database and files.  Now I discovered to my horror that all the images were killed off too.  The new copy of the blog didn’t have relative links to the images but in fact fully urls.  A quick find and replace throughout the database changed all references to the old domain name to the new one.

Now that all this was done, I had to include a 301 page redirect on the old subdomain so that all references to blog.andybarratt would permanently redirect here.  This was a must as Google is filled with links to the old version.  This was trickier than the standard redirect as I couldn’t just put a redirect to the new blog as if a url ended with something like “page321″ then I would have to make sure that the redirect would reflect that.  Luckily Apache servers have the ability to cope with this.

So it took a while but the entire site is now moved and from now on, this site will be centred on my blog.  When you go to you will land on the articles page, not a home page saying who I am.  For that, just click “About” at the top and you can read about the wonderous intellectual badass (A term we at the Dundee School of Computing have learnt to use instead of the terms Geek or Nerd) that I am.  Welcome, to the new

This WordPress has been failing to send email notifications of your comments to myself for some time now, the issue has been solved, let me explain how and probably more importantly, explain what was causing the issue.

First of all, I’ve fixed it using Callum Macdonald’s WP Mail SMTP plugin. This basically allows you to enter your own SMTP settings for sending mail rather than using the php mail() function.

Now I was unsure about using a third party plugin to do this but let me explain why it was necessary.

Like many people, I use Google Apps to host my emails, rather than my web hoster. This means that the MX records for the domain point to Gmail.

The problem I had was quite simple, everytime wordpress sent an email to my email address, it tried to send it through my web hoster. Well the server, trying to be a clever little server saw my domain name and immediately took that as meaning it didn’t need to leave the server, so it checked for my email address on the server, couldn’t find it and gave up. Now I have Macdonald’s Mail SMTP plugin to direct outgoing emails through Gmail’s server. Problem solved.

Hopefully this will help you, even though many had found this fix, I hadn’t seen many discuss this explanation, even though I could tell that many were using Google Apps for their emails.

Accessibility Module In Action

Accessibility Module In Action

Many users find it difficult to read black text on a plain white background, or indeed in other combinations. By changing the background colour and text size, they can enjoy an easier online experience.

While working at Tayside Police on my Summer Work Placement as a Student Intern, I have taken it on myself to improve the accessibility options of their website, in doing so, I have written a javascript that allows the user to change the page style and increases the text size of the site.

The script works by changing the ID or the text size attributes of the page body and storing this in a cookie on the clients browser. This way, the user’s options are reflected across the site, where ever the module is included and not just the page they selected it on.

Ok, the title may be a little deceptive, while you only need to insert one line of code to insert the module and get the text size options to work, you will need to type several lines of CSS into your spreadsheet, something that any good web designer will have no difficulty with.

The module requires you to add CSS Style IDs for the following five options which will be applied to the body tag of your page: whiteOnBlack, yellowOnBlack, blackOnYellow, blackOnPink.

This could be as simple as creating an ID for each one and specifying the text and background colours however, you’re likely to find that some elements of your page will require a little more tweaking. For instance, for this site, I also had to specify colours for links and to create different background images to fit in with the new themes.

#whiteOnBlack {background-color:#000000; background-image:url(images/Side-Banner-Inverse.png); color:#ffffff;}
#whiteOnBlack #twitter_feed {list-style-image:url(twitter-inverse.gif)};
#whiteOnBlack a {color:#ffffff;}
#whiteOnBlack a:link {color:#ffffff;}
#whiteOnBlack a:visited {color:#ffffff;}
#whiteOnBlack a:hover {color:#919396;}
#whiteOnBlack a:active {color:#ffffff;}
#whiteOnBlack a:visited:hover {color:#919396;}

#yellowOnBlack {background-color:#000000; background-image:url(images/Side-Banner-Inverse.png); color:#ffff66;}
#yellowOnBlack #twitter_feed {list-style-image:url(twitter-inverse.gif)};
#yellowOnBlack a {color:#FFFF00;}
#yellowOnBlack a:link {color:#ffff66;}
#yellowOnBlack a:visited {color:#ffff66;}
#yellowOnBlack a:hover {color:#FFFF00;}
#yellowOnBlack a:active {color:#ffff66;}
#yellowOnBlack a:visited:hover {color:#ffff00;}

#blackOnYellow {background-color:#FFFF66; background-image:url(images/Side-Banner-Transparent.png);}

#blackOnPink {background-color:#ffdddd; background-image:url(images/Side-Banner-Transparent.png);}

In the case of the much more complex Tayside Police site, nearly 100 lines of CSS were required for each colour scheme.

One thing to remember is that absolute text sizes cannot be changed by the module, so if you’re wanting a text size to change properly, make sure you specify it’s normal size in your css as em or percentages, not at points or pixel sizes. That said, this can work to your benefit. I didn’t want the module to change the large title text at the top of my site so I’ve set these with absolute pixel values.

Once you’ve created your new styles, download the package linked below, which includes the script as well as the images for the buttons, then all you need to do is insert the one line below to add the javascript to the pages where ever you want it to appear.

<script type="text/javascript" src="/Accessibility/Accessibility.js"></script>

Good luck and please comment if you’ve used this script, I’d love to hear how it’s being used.

Click to download accessibility module.

No Need To Register

13th January 2011

You know what I hate? I hate arriving on some obscure little blog and wanting to leave a comment and being told I have to register to do so.

Why the hell should I register, when I’m never going to their site again. You know what? From now on, you can leave a comment, on this here site, without registering, because why the hell should you have to?!

Photos Page Added

3rd January 2011

Nothing special really, just a brief introduction to my photography, a couple of photos and a link to the flickr page.

Also, i’ve noticed that it’s not exactly obvious how to register an account on this blog to leave comments, I’ll get on that before starting on the videos page. Though… right now, I’m hungry, I’m off to McDonald’s.

Website Redesign

1st January 2011

I’ve been keeping notes on the front page of the website about how the redesign is going. I’m going to continue these notes here, on the blog, instead.

Here’s what I’d written so far:
Hello World
I’m doing a redesign of my website, it’s awfully exciting but if you get bored of waiting, the blog button up there is working ;)
No repeating Code
I’ve made a template which, with php include statements, every page on this site can use. That includes the title and navigation menu at the top and the fancy typography down the left hand side.
CV Page added
I’ve made the CV page active, my CV is actually what this site’s design is based on. Originally, the pretty design you see here was for my CV. It doesn’t look as good on screen due to the limitations of html and css but it’s pretty good and it sets the standard for headings, sub-headings and paragraphs throughout the rest of the site.
AXD Broke It :(
Well I’ve woken up this morning to find that my web hosts, AXD hosting, have moved all of my data to a new server. Unfortunately, they didn’t feel it neccessary to move all my extra domain names and sub domains, meaning all my extra websites are down… including the blog which I showed off earlier. -sigh-
Switched Web Hosts
Well although AXD got it fixed quickly, I’m afraid I’ve become tired of AXD faults so have switched hosts. I’m now with Unlimited Web Hosting UK let me list a few improvements I’m noticing.

  • They say on their website they’re in Manchester, I had no idea where AXD was
  • 24 Hour Telephone Support, compared with no telephone support from AXD
  • Fast set up, it was online the moment i paid
  • no contract – it’s a monthly payment and i can leave any time
  • All Inclusive Standard, they only have one web hosting package that includes everything, unlimited.
  • Cheaper! About £20 less a year
  • Testimonials from big companies such as NHS and 4oD
  • Transparency, they show off their uptime reports on their website

New WordPress Theme
If you click “Blog” you’ll see that the page style looks no different to this one. That’s because of a brand new WordPress theme I’ve been working on all day :-D.
It used to be that my blog was very seperate to the rest of my website. Now it feels much more like it is a part of this site.