Archive for the 'Articles' Category:


The Summer House


As The Lounge is becoming full (464+ comments) and summer is pretty much here, I think we should move conversation outside into the sunshine. Hence, The Summer House. Feel free to talk about anything, as before…

Jump to the last reply!

Updating WordPress Permalinks


After ironing out all of the bugs with my latest theme release, I decided to update the permalinks used throughout slickhouse.com

Thanks to WordPress’ intuitive admin interface, this is a simple process:

admin

Most WordPress users opt for the Day and name Permalink structure, which would appear as 2008/05/04 for today. However, to a search-engine spider, this already looks like the links is 3 directories deep, before it even gets to the post title itself.

To counter this, I’ve amended the permalink structure to mirror the ISO 8601 standard for date (minus the time) - so today reads as 2008-05-04. To a search-engine spider, this would appear as just the one directory, within which the post title is situated.

There is a downside to amending permalinks to a WordPress blog that has been live for several months (even years) - all of the current links will effectively be broken. You could use a redirect script, that detects the user is trying to visit an older page - which would redirect them with a 301 (permanently moved) redirect to the amended url. However, this would still mean that your older links are present in your data.

To resolve this, you can amend all occurences of the older permalink to the new format. So, you’d look for 2008/05/04 and replace it with 2008-05-04.

sql

Using MySQL Administrator Query Browser, you can query the WordPress database, as above. The first step is to ensure you’re querying the correct database (essential if you have multiple databases on the one server):

Use [database-name]

Where [database-name] is the name of your WordPress database. A standard install usually prefixes the database name with wp_. Execute the above and you’ll see the correct database highlighted in the right-pane. Next, you want to begin searching for posts which contain the old permalinks within the content:

Select ID, post_title
From wp_posts
Where post_content
Like ‘example.com/2008/%’
Order By ID Desc

If your WordPress database is fairly small (<500 posts), then you should find that the above query executes almost instantly - leaving you with a list of all posts that use the older permalink structure. You’ll need to replace example.com with your domain name and run the query several times - once for each year your WordPress blog has been active, amending the year each time (2007, 2006 etc.).

Once you’ve got your list, you can start editing the posts to update the permalinks used. This could be achieved using SQL, but I would recommend doing it post-by-post to save any headaches if your update query goes horribly wrong!

Using the WordPress admin (Manage > Post) you can edit each post using the HTML view:

post

After editing a few, you’ll soon quickly spot the a tags, ready to update them. In my case, it was simply a case of replacing the / with -, so 2008/05/04 became 2008-05-04.

There was a reason the SQL query brought back both the ID and post_title - as you’ll soon find out when trawling through the admin. The admin orders (by default) the posts by ID, which means ordering the results of the Select query should make finding the offending posts a lot easier. To make things even simpler, you can amend the URL each time you have finished editing the one post and are moving onto the next:

url

As you’ll see - the post.php references the posts by their IDs.

Once you’ve updated both your permalink structure and your content of each post, you’ll be left with a fully working site. However, you may also want to notify the major search engines of your recent update. For this, I can highly recommend the XML Sitemap plugin for WordPress. After setting it up, it will generate an XML Sitemap of your WordPress blog and simultaneously notify each of the search engines of the updated sitemap.

Then, it’s just a case of sitting back and awaiting the spiders as they begin to crawl your new, friendlier (in theory) permalink structure. If you haven’t already setup Google’s Webmaster Tools, then now is a good time - as it will help diagnose any issues with your new permalink structure.

Finally, if you don’t have direct access to your WordPress database, then you could try using the built-in search facility, as seen in use on many themes. Simply search for your older permalink structure and it should disply all relevant posts.

No More Magazines


After reading several articles today about the demise of magazines as a medium for Games, I’ve decided to come to a decision on my usage of magazines, as a whole.

Bit-tech’s Joe Martin wrote Games magazines on their way out, which prompted me to scour my RSS feeds for similar articles. Sure enough, Digg picked up a story about the Games For Windows magazine ceasing print and going 100% online (which you can read more about from the Editor himself).

It’s something I’ve wondered for a while now - how much longer will the magazine last in this digital era? The internet has become one of (if not) the most popular sources of news and articles for many people. I spend far longer these days reading through RSS feeds and various technology news sites to get my fix of information.

However, at this point in time, the demise of magazines might only be limited to a few genres:

  • Computers and Technology
  • Auto
  • Games
  • Pornography

I had to throw the last one in there, to enhance the debate!

Let’s start with Computers and Technology - I’ve purchased Custom PC since issue one (with a year as a subscriber) and have noticed their online presence has evolved substantially over the past 12 months, with a site re-design and new features, including staff and community blogs. I’m only guessing here, but surely the growth of their site is due to a drop in magazine sales - or at least a realisation that the internet is becoming the dominant medium. And the reason for this? How many times, in the past few years, have you read a news piece within a magazine, that you’ve not already heard about online?

Auto - perhaps not as obvious as the others here, but Simon made a very good point yesterday, whilst reading this month’s copy of Top Gear magazine - it’s full of adverts. Sure, advertisements have been a staple part of a magazine’s diet, but they now far outweigh articles. Again, this could be due to the rise of the internet and the decline of monthly readers. The Top Gear website is full of great content too, including video clips of previous episodes - which suggests they’re ensuring that if the magazine does go, it will still be left with a great site for its readers.

Games - the genre that kick-started this article. Gamers want news on future releases as soon as possible. They want demos as quick as possible and they may want video clips too. All of this is possible with a magazine, but can be delivered instantly over the internet, especially with the rise of online connectivity with games consoles. Take Grand Theft Auto IV as an example - I (and some of you) have been religiously following the updates from Rockstar’s official site, to keep me occupied on the run-up to release. With previous GTA’s, there were official sites, but none as content rich as the latest. And yet, I’ve not purchased a single Games magazine to read about it all.

Pornography - I guess there will always be a market for the magazines, as many American truckers don’t have internet access en-route. But many would argue - why pay for it when it’s available online for free? The internet’s growth and popularity is often said to be due to pornography.

Don’t forget, I’m only speculating here - though I see magazines being a very niche medium within 5 years. Anneka pointed out that she would still continue to read ‘Pick Me Up‘ held in her hands, rather then viewed on the internet. But, I don’t see many people reading about the latest games or technology in a magazine.

Will we see many more Games magazines switch to solely online delivery? Will there be an influx of magazine journalists to the internet, as Joe mentions?

To do my bit, I’ve decided to completely give up on magazines. Don’t take this the wrong way though - I’m trying to speed up the decline of magazines, just end my addiction with them. I’ve purchased copies of Top Gear, Max Power, Fast Car, PC Pro, Custom PC, Official [console] magazine, MBUK, .NET along with many others over the years. The content of all of these hasn’t suffered, in terms of quality - just quantity.

Whilst browsing the aforementioned sites for these magazines, I’ve noticed that Future Publishing have amalgamated their bike magazines into the one site. According to an old article (2001), they briefly suspended some of their sites, whilst cut backs took place. This suggests that magazines have been forced to re-consider their operations for a good few years now, with the rise of the internet.

From this day forward (14th April 2008), I plan to:

  1. Never purchase another magazine
  2. Rely solely on the internet for news and articles
  3. Save money by completing 1.
  4. Read books to fill the void that would have previously required a magazine

The last point (4.) is the most important, as I have a growing collection of books that friends and family (and I) have purchased for me recently. There’s 3 or so Bill Bryson books, a few autobiographies (Richard Hammond, Chris Moyles’ 2nd) and a handful of Jeremy Clarkson’s to get through. If I carry on with the magazine reading, I’ll end up never getting the time to sit down and read the books.

Currently, I purchase around 4 magazines a month, all of which are around the £4.99 mark. That equates to £259.48 a year! If I don’t buy another magazine, but instead read one of the many books I have lying around, I could better spend the money on something useful, that I’d read about online. Any time I would normally grab a magazine to occupy me (bed time, train journey, sofa, holiday), I’ll reach for the paperback. Besides, books tend to be a lot cheaper word-per-£ these days, compared to a magazine.

The few magazines that I still have lying around will make their way to the recycling bin - including the issues I’ve kept for nostalgia, like a 1996 edition of AutoCar, which unveils the McLaren F1; or a 1999 edition of Top Gear, with an article on the R34 Skyline.

Lastly, if I stop buying magazines I’ll be doing my bit for the environment - after all, I’ve probably read through a forest in the past 10 years.

Let me know if you still read magazines; if you’ve never read them; or if you’ll never stop reading them…

New Hosting!


For the past 5 or so years, slickhouse.com has been hosted on a shared Linux server, provided by UKHost4U.

While the hosting has been good, I’ve grown out of using a shared web server and all of the limitations that go with it. So, over the past year I’ve developed my own dedicated web server, with a twist - a) it’s Windows and b) it’s hosted at slickhouse itself.

For those of you interested in running your own web server, it’s actually a fairly straightforward, albeit time-consuming thing to do. And it proved successful - as you are reading this served up by the new server!

The hardware:

  • AMD Athlon 3000XP (Barton core)
  • 2 x 1GB PC3200 DDR
  • MSI K7N2 consumer motherboard
  • 4 x 250GB data drives, 1 x 120GB O/S drive
  • Yeong Yang cube case

The software:

Alongside the web server itself I used the following:

As slickhouse.com uses WordPress, I found Keyboard Face very useful to ensure the permalinks worked correctly within IIS. The script itself is very simple and works well with most of the posts/pages on the site. The only issue I’ve encountered so far is with inTouch, which I use for the AJAX contact form, hence it now being reference via its Page ID. The article Installation Issues on Microsoft IIS is also a good read for those wanting to get WordPress up and running on Windows. DSL/Cable Webserver is another good resource, which documents the whole process to run your own web server from home.

I chose to use Microsoft’s Virtual Server 2005, as it allows me to run several operating systems on the same machine. Currently the server only has the host and virtual operating systems, but I’ll be expanding it with a development server soon. Another advantage to going virtual, is that I can easily copy the whole server from one physical hardware platform to the next. So if a catastrophic failure occurs, I can quickly transfer the image of the server to another hard-drive, or Virtual Server.

This configuration has so far proved to be a lot more beneficial to my previous shared hosting solution with UKHost4U. For a start, I’m in complete control of the whole solution - from domain registration, to configuration of the server itself. Also, it means I’m not limited by the assigned disk space and bandwidth provided with my shared hosting package. My ISP at home is Virgin Media, who over the last week has upgraded me from 4MB/400KB Cable broadband, to 10MB/500KB - they still have an unlimited bandwidth policy too!

So what’s required then? I’ll start in order of what you see as a visitor:

  1. Domain registration - to get yourself a name on the ‘net
  2. DNS - to point your domain to an IP address
  3. Dynamic DNS - to update your DNS with your dynamic IP address
  4. Firewall/Router - to block and route traffic around your LAN
  5. Web server (IIS 6.0) - to serve web pages
  6. Mail server (POP3/SMTP) - to send and receive email
  7. PHP/ASP - to server dynamic web pages
  8. MySQL - to provide database(s)

The following domains are currently hosted on the web server:

With more to follow. Slickhouse.homeip.net is provided by DynDNS and the remaining domains have their DNS controlled by ZoneEdit.com

Let me know if you encounter any issues with the new hosting, as I’ve moved ~500MB from the Linux server across to the Windows server and have most likely missed something from my testing! If anyone is interested in having a site hosted on the new server, then get in touch - as a ZoneEdit account, along with a Domain of your choice is all you’ll need. Uptime is currently 39 days and counting…

AddThis


Today I was tasked with adding several Social Bookmarking sites to a client’s website, at work. Whilst reading through the various APIs for each site, I decided to look at AddThis that I had come across over the weekend.

AddThis saved me 2 days (estimated) development time, by combining all of the popular Social Bookmarking sites in one easy-to-integrate solution. I was so impressed that I decided to add AddThis to slickhouse!

AddThis provides a WordPress plugin from the outset, but I often find plugins to be too restrictive. AddThis is also available as a standard button or a dropdown menu, displaying several options. All 3 options use a new window to display the various Social Bookmarking sites.

I decided to opt for the dropdown, but hard-coded into the WordPress theme files. Firstly, to display AddThis on the main pages, open index.php and add the AddThis code. However, as you’ll most likely be calling this code several times on the page, you need to define the URL and Title for each instance of AddThis:

addthis_url = ‘<?php the_permalink() ?>’;

addthis_title = ‘<?php the_title(); ?>’;

Use the above to replace the default Javascript location.href and document.title respectively. This uses WordPress’ dynamic variables for each instance of AddThis.

On a single WordPress page (single.php), you can use the default code provided by AddThis easily enough, or use the above alterations - either way will work fine, as you should only be calling AddThis once.

And hey presto - AddThis has been added to WordPress! Feel free to use AddThis to add slickhouse posts to your preferred Social Bookmarking site. Personally, I’m a Digg/Google user.