Technology Tales

Adventures & experiences in contemporary technology

Online favicon.ico creation

21st January 2008

I recently updated the icon that appears beside this blog’s address in the address bar and bookmarks menus of some browsers. I gave it a go in GIMP but I seemed to get no joy. I pottered out on the web to discover what I might have done wrong only to find Dynamic Drive offering online favicon.ico creation. Out of curiosity, I decided to give the thing a whirl and download the result to upload onto my web server. GIF’s, JPG’s PNG’s and BMP’s with a size less than 150 KB are accepted and it did work for me.

A year in the making…

17th January 2008

It was a year ago that I set this blog in train. Then, I was exploring the possibilities offered by WordPress.com. After some months, I decided that I wanted to make my own decisions rather than have them so I went independent in June. Between those dates, some big launches took my attention: Windows Vista, Office 2007 & CS3 come to mind. All the while, my experience of UNIX, Oracle and other such matters kept growing more and more. In the latter half of the year, I finally made the leap from Windows to Linux on the home computing front, a decision that taught me a lot and one that I don’t regret. Other subjects featured from time to time as well and my musings on web development and blogging made their appearance too. 2007 was a packed year on the technology front and 2008 is only just getting under way. There’s a Vista laptop and I am already picking up ideas for posts, though I am not going to force them out like I might have tried to do last year. 2008 may be a spot more leisurely but I hope that it’s just as interesting.

A case of bad behaviour?

6th December 2007

On my blogs, I use the Bad Behaviour plugin to keep spammers at bay. It usually works very well so imagine my surprise when it started kicking me out when I tried logging into the system. I started to wonder what happened to my IP address… It now turns out that the repository being used by the plugin got moved by its author and that was the cause of my predicament (and his: he locked himself out of his own blog too!). A new version was duly released to fix the issue and all is well again. It is a tale that emphasises the important of regression testing to check that you don’t change anything that you shouldn’t.

Setting up Quanta Plus to edit files on your web server

3rd December 2007

On Saturday, my hillwalking and photo gallery website suffered an outage thanks to Fasthosts, the site’s hosting provider, having a security breach and deciding to change all my passwords. I won’t bore you with the details here but I had to change the password for my MySQL database from their unmemorable suggestion and hence the configuration file for the hillwalking blog. To do this, I set up Quanta Plus to edit the requisite file on the server itself. That was achieved by creating a new project, setting the protocol as FTP and completing the details in the wizard, all relatively straight forward stuff. I have a habit of doing this from Dreamweaver so it’s nice to see that an open source alternative provides the same sort of functionality.

New project using FTP protocol in Quanta Plus

Want attention? Just mention Ubuntu…

5th November 2007

According to Google Analytics, visitor numbers for this blog hit their highest level one day last week. I suspect that I might have been down to a mention of two of my posts on tuxmachines.org. Thanks guys. Feedburner activity has been strong too.

That brings me to another thought: the web seems a good place for Ubuntu users to find find solutions to problems that they might encounter. I certainly found recipes that resolved issues that I was having: scanner set up and using another hard drive to host my home directory, all very useful stuff. When I last played with Linux to the same extent that I am now doing, the web was still a resource but it wouldn’t have been as helpful as I found it recently. I suppose that there are people like me posting tips and tricks for computing on blogs and that makes them easier to find. That’s no bad thing and I hope that it continues. Saying that, I might still get my mits on an Ubuntu book yet…

WordPress update messages

27th October 2007

I have all sorts of messages littering my blog dashboard this morning telling me to upgrade to WordPress 2.3.1; I suppose that I’d better set to work with upgrading then. However, this is never something that I do without first testing on my offline blogs. And then, there’s the need to save some tweaks to WordPress source code ahead of time. I know that I could create my own plugins but that involves finding the correct hooks and it’s a subject for another time, anyway.

Changing the appearance of WordPress admin pages

15th October 2007

There seems to be a percolation of plugins that aim to change the appearance of WordPress administration pages from their day-glow blue to something more pleasing; Earthtones is the one that I use for this blog but I have also been known to use WP Tiger Administration as well. Both options work well, though the latter needs some adjustments to work as well with WordPress 2.3 as it does with the 2.2 line. One area that they both fail to influence is the appearance of the upload screen. It doesn’t help that upload.php, the underlying PHP script, is a dual purpose animal: used in an iframe in the post editing page and standalone for upload management. Curiously, you can only upload files on the post editing page and not on the upload management screen, a definite quirk. The thing that really stops these admin theme plugins gaining any sort of purchase with upload.php is that it also uses an auxiliary stylesheet, upload.css, that is called after the WordPress function hook has been defined; if it came before this, then the styles in upload.css could be overridden. You could edit upload.php and edit the replacement stylesheet but the former activity would require repeating at every WordPress upgrade. I chose to edit upload.css and will keep that is a safe place so that I can replace the file following an upgrade. If upload.php was treated like every other admin script, then this would be unnecessary. A useful suggestion for Automattic, perhaps?

Working ahead of time…

10th October 2007

Having had a pretty fallow summer when it came to ideas for this blog, I am now lucky to enjoy a flush of them. Also, because of the my now established one post per day rule, I am currently writing my posts ahead of time so that you can be assured of something new everyday rather than a load of stuff one day and nothing on the next. That works for me because I am largely a proactive blogger rather than a reactive one. As a result, I am not bothered by a need to break something before everyone else and I simply couldn’t do that anyway; I have learnt that there are many others who can make a much better job of it. Nevertheless, I do get inspired by what’s going on in the technology world and it’s just that I take my time over things before sharing with others; the chance for some additional consideration before post goes public is a very useful one. And then there are my own explorations that surely will turn up more ideas.

On Blogrolling.com

6th October 2007

I was ambling around the web and came across a website that, while it appeared to be a blog, isn’t one in the vein of that to which we are accustomed. It does, however, have a blogroll and that is where Blogrolling.com comes into this piece. Blogrolls are very much a feature of the blogging (WordPress call them that anyway) world and act as a repository of useful links relevant to the subject of the blog. I also use them as a bookmarking station for myself and a way to return the favour when someone links to my blog. For a blogroll, you generally need a database sitting behind in the background or you end up creating a list of links in (X)HTML.

Blogrolling.com offer another option: placing your links at an external website and including them on your webpages using a piece of code to pull in the information. RSS, JavaScript and PHP are among the methods on offer from Blogrolling.com; I used PHP when I gave the service a whirl on one of my offline blogs and that really does give you a lot of customising power over and above using CSS. That’s not to say that there aren’t customisation functions on offer from Blogrolling.com, I found a few of these distinctly useful: ordering of links in a blogroll is just one. When it comes to categorising your links, you don’t get the category option but you do get to create as many blogrolls as you want so there is a workaround; moving links from one blogroll to another is mouse intensive but straightforward. Also, because you are reading each blogroll in turn, you have the ability to order the categories as you want them. With WordPress’ category approach, ordering categories involves widgets and plugins or getting your mits dirty with some code cutting. All in all, Blogrolling.com seems to offer an intriguing and useful service.

HennessyBlog theme update

12th February 2007

Over the weekend, I have been updating the theme on my other blog, HennessyBlog. It has been a task that projected me onto a learning curve with the WordPress 2.1 codebase. I have collected what I encountered so I know that it’s out there on the web for you (and I) to use and peruse. It took some digging to get to know some of what you find below. Any function used to power WordPress takes some finding so I need to find one place on the web where the code for WordPress is fully documented. The sites presenting tutorials on how to use WordPress are more often than not geared towards the non-techie rather than code cutters like myself. Then again, they might be waiting for someone to do it for them…

The changes made are as follows:

Tweaks to the interface

These are subtle with the addition of navigation controls to the sidebar and the change in location of the post metadata being the most obvious enhancements. “Decoration” with solid and dashed lines (using CSS border attributes rather than the deprecated hr tagset) and standards compliance links.

Standards compliance

Adding standards compliance links does mean that you’d better check that all is in order; it was then that I discovered that there was work to be done. There is an issue with the WordPress wpautop function (it lives in the formatting.php file) in that it sometimes doesn’t add closing tags. Finding out that it was this function that is implicated took a trip to the WordPress.org website; a good rummage in the wp-includes folder does a lot but it can’t achieve everything.

Like a lot of things in the WordPress code, the wpautop function isn’t half buried. The the_content function (see template-functions-post.php) used to output blog entries calls get_content function (also in template-functions-post.php) to extract the data from mySQL. The add_filter function (in plugin.php) associates the wpautop function and others with get_the_content function and the p tags get added to the output.

To return to the non-ideal behaviour that caused me to start out on the above quest, an example is where you have an img tag enclosed by div tags. The required substitution involves the use of regular expressions that work most of the time but get confused here. So adding a hack to the wpautop function was needed to change the code so that the p end tag got inserted. I’ll be keeping an eye out for any more scenarios like this that slip through the net and for any side effects. Otherwise, compliance is just making sure that all those img tags have their alt attributes completed.

Tweaks to navigation code

Most of my time has been spent on tweaking of the PHP code supporting the navigation. Different functions were being called in different places and I wanted to harmonise things. To do this, I created new functions in the functions.php for my theme and needed to resolve a number of issues along the way. Not least among these were regular expressions used for subsetting with the preg_match match that weren’t to my eyes Perl-compliant, as would be implied by the choice of function. I have since found that PCRE’s in PHP use a more pragmatic syntax but there remained issues with the expressions that were being used. They seemed to behave OK in their native environment but fell out of favour within the environs of my theme. Being acquainted with Perl, I went for a more familiar expression style and the issue has been resolved.

Along the way, I broke the RSS feed. This was on my off-line test blog so no one, apart from myself, that is, would have noticed. After a bit of searching, I realised that some stray white-space from the end of a PHP file (wp-config.php being a favourite culprit), after the PHP end tag in the script file as it happens, was finding its way into the feed and causing things to fall over. Feed readers don’t take too kindly to the idea of the XML declaration not making an appearance on the first line of the file. The refusal of Firefox to refresh things as it should caused some confusion until I realised that a forced refresh of the feed display was needed -- sometimes, it takes a while for an addled brain to think of these kinds of things.

  • All the views that you find expressed on here in postings and articles are mine alone and not those of any organisation with which I have any association, through work or otherwise. As regards editorial policy, whatever appears here is entirely of my own choice and not that of any other person or organisation.

  • Please note that everything you find here is copyrighted material. The content may be available to read without charge and without advertising but it is not to be reproduced without attribution. As it happens, a number of the images are sourced from stock libraries like iStockPhoto so they certainly are not for abstraction.

  • With regards to any comments left on the site, I expect them to be civil in tone of voice and reserve the right to reject any that are either inappropriate or irrelevant. Comment review is subject to automated processing as well as manual inspection but whatever is said is the sole responsibility of the individual contributor.