Tutorials

WordPress: How to use MySQL to replace the URL in your posts

WordPress logoIf you've ever moved your WordPress site to another location, you'll find that all your images end up broken because they all point to the old domain.

The problem is, all the image paths stored in the database are static, so you've got to update them to the new location.

Usage case: My usage case is that I'm moving an old WordPress site to my local computer to use as a sandbox for theme design. So all the references to myolddomain.com need to be changed to localhost/sandbox (the directory on the server that my WordPress installation is on).

Caveats: What I'm about to show you will not only update the image paths, but it'll also update the internal links on the site. As long as your permalinks setup is the same as before, everything should be fine!

Tools: This procedure can be easily carried out using either PHPMyAdmin if you've got it installed. You can also use a simple MySQL command line prompt if you're familiar with that.

Ubuntu: How to share a wired internet connection

Ubuntu logo

Ever been stuck with a single, wired internet connection, but needing to connect more than one computer to the internet?

You'll be glad to know that with Ubuntu, it's easy to share an internet connection by creating an ad-hoc wireless network. It happened us recently on holiday - we had a single wired network connection, but two laptops. Both machines were wireless enabled.

Here's how to set up the connection:

How to grab a vanity URL for your Facebook fan page

Facebook logoWe maintain a couple of Facebook fan pages for Unreality TV and its sister site, Unreality Shout.

Now, I knew that it was possible to set up a vanity URL for your own account on Facebook (mine's facebook.com/gerardmcgarry - don't stalk me, I won't follow you), but I just discovered today that it's quite simple to set up a vanity URL or username for your Facebook fan pages. If you're a publisher this is a godsend, because it makes the URL more concise and easy to share.

Give your Drupal site an SEO makeover

Drupal's currently my content management system of choice. But like virtually any CMS, Drupal needs some SEO tuning to make it more attractive to search engines.

I've set up a number of websites using Drupal, and this post will gather together some of my standard actions for optimizing. I'll try to be as exhaustive as possible on this post, starting with the basics and moving toward more complex optimization techniques.

This post, for the most part, looks at Drupal modules that can automate the SEO process for you. None of this negates the need to have an accessible theme design and to do the usual SEO activities such as building backlinks to your site. Let's get started...

Essential Keyboard Shortcuts for Ubuntu

In the Windows environment, keyboard shortcuts help us get things done more efficiently, without wasting time using the mouse to navigate. Part of the difficulty in migrating to Ubuntu is that many of the old Windows shortcuts don't work anymore. In this post, I've hunted out some useful keyboard shortcuts to help you navigate Ubuntu more professionally.

1. Lock the screen

You'll want to lock your screen when you're away from your machine for any length of time - it's common sense security. Simply press CTRL+ALT+L and the screensaver will activate, requiring your password to unlock.

If another user wants to use the machine, they can log on without affecting your session.

2. Flip between workspaces

Ubuntu allows you to use virtual workspaces, so you can arrange different applications between these workspaces. Possibly most useful whenever you want to work on something confidential or you want to keep your web browser/IM tools seperate from your wordprocessing and office applications.

Drupal: Get a comma-separated list of categories (taxonomy)

Drupal's default way of displaying categories really bugs me. They compile all the categories into an unordered list, which adds a lot of pointless complexity to the theme.

Coming from the WordPress school, I'd much prefer to have a comma-separated list of categories. Well, after an epic battle with my node.tpl.php file and much searching on the Interwebs, I've come up with a solution. It's based heavily on a code snippet used in this Lullabot article.

Essentially, what we need to do is parse through all the terms, build a link for each taxonomy term and then use the implode function to build the comma separated list. Here's a sample of the code I'm using:

What version of Ubuntu am I using?

Because Ubuntu is a free operating system, they don't feel the need to shove the version in your face in quite the same way their commercial counterparts do. So, when you're on the threshold of doing an upgrade, it's nice to know what version you're upgrading from.

There's a quick, command based way to discover what version of Ubuntu you're using:

<?phpcat /etc/issue?>

Alternatively, for a more detailed output, try this command:

<?phpcat /etc/lsb-release?>

This will return the version of Ubuntu that you're currently using. I used it prior to upgrading, and also after the upgrade to verify that everything had been successful.

How to quickly upgrade to Ubuntu 9.04 (Jaunty Jackalope)

Sweet! A new version of Ubuntu is always an exciting occassion: the release schedule is always way more frequent than Windows, and there's always some fascinating development that makes the upgrade worth your while.

So, tonight I'm upgrading my older version of Ubuntu from 8.10 to the latest release, which is 9.04. Otherwise known as Jaunty Jackalope, although the emphasis on animal names seems to be significantly played down on this version.

With this edition, the upgrade process is its easiest ever. Here's a quick step-by-step showing you how to upgrade your version of Ubuntu over the Internet:

Drupal 6: Get notification emails when modules are updated

Here's another quick Drupal 6 tip: if you have the Update Status module enabled, you can get notifications by email when updated modules for your site are available.

This is a handy thing to have, particularly for security updates. As I understand it, the Update Status module periodically checks against the Drupal website (on each cron run) and will notify you if updates are available. I think it only checks activated modules though, so if there are updates to inactive modules, it won't notify you.

Drupal: How to increase the default font size in TinyMCE

If you've ever installed the TinyMCE module for Drupal (or indeed the WYSIWYG module which seems to be the preferred way forward), you'll have noticed that the default font size is miniscule. My first concern as a web designer is usability. How hard is it to read and edit?

Syndicate content