Technology Tales

Adventures in consumer and enterprise technology

TOPIC: WORDPRESS

Open source CMS options

18th March 2007

After reading an article in the latest issue of PC Plus, I got curious about the world of content management systems again. I went over to OpenSourceCMS to sample the CMS demos that they have got on there. Mambo and Joomla! (I wish they dropped that exclamation mark; it messes up automated grammar checking) are fully fledged CMS’s and look impressive too, though how they would fit into my online presence is something of an open question. Since I spied that PHP-Nuke uses themes, that is an attraction; I am already used to that mindset thanks to WordPress. While Drupal is seemingly less slick than the others, that could be an attraction in itself; it does offer themes but no rich text editing is available.

Though all of the above are built on top of PHP/MySQL, I ignored them for some reason when I last looked at open-source content management systems. That does seem a strange thing to do, but this was a while ago and the moderate cost of adding database functionality to my website was not something that I was willing to pay, though I have done so since for HennessyBlog.

Therefore, I ended up seeing what Plone (built on Zope and using the Python programming language) could do. What I was had in mind at the time was a replacement for Perl-powered photo gallery, and a CMS was never going to fit the bill; it still doesn’t. In any case, Plone left me with the impression that it was an all or nothing affair when I like coexistence of website components on a single server. Things may have changed since then, so giving it another go remains an option.

Now that I have decided to have a look at Drupal, the emphasis this time is not on using it as a photo gallery platform; if I wanted that, I’d go with the API for something like Flickr or Zooomr. This time, the emphasis on using a CMS to manage the visitor information directories on my website. It does coexist with the other website components, including WordPress and the aforementioned bespoke built photo gallery. Interestingly, Drupal does offer blogging functionality if I wanted it.

Set up involved a spot of work with MySQL before moving onto other things:

mysql -u adminuserid -p /* logging in*/
create database drupal; /*creating new database*/
grant ALL on drupal.* to adminuser identified by “**********”; /* granting access to new database */
quit; /* exiting */

Because it is easier to see what’s going on (not wrong, hopefully), I prefer command line working with MySQL. For some reason, Drupal comes only in tar.gz archives, so I extracted this into the web server directory and opened up the site in Firefox. Installation only requires the set-up of database access and is soon completed. A few things turned up in the status report that needed attention: cron, this can be run manually; activation of PHP Unicode and GD library (PHP’s gd_info function is a real help in testing this) extensions, editing of php.ini to remove commenting semicolons activated them and restarting Apache made them available; having a place to store uploads, the directory called files got created.

Since then, I have set about bending it to my will, not always an easy thing to do with software. The first thing to do was to give it a static home page. By default, Drupal places tasters for any nominated pages and stories on its home page and shows configuration instructions until you allow some content to filter through. However, adding the Front Page module allows you to override this behaviour and have something more static. It was an entry on Kehan’s Blog that set me heading in the right direction.

The next steps were to persuade the thing to allow external links to exist in menus (though patches exist, I have yet to learn how to apply them other than finding the nefarious piece of code and replacing, a considerable challenge that makes me wonder if there is not a better way to do it: with a module, perhaps?) and carry on the theme editing until it ties in with the rest of my site. Then, I’ll make the decision whether to replace my current workflow (Perl-powered pre-processing of XML into PHP/XHTML using XSLT and the Saxon parser followed by FTP upload to the web server) with this one. The automation of the former argues in its favour. We’ll see how things pan out…

The scurge of comment spam

7th March 2007

My other blog is experiencing what feels like a deluge of comment spam. All that I can say is thank goodness for Askimet. And that is with visitors having to subscribe in order to post comments. It seems that a way has been found around that. I did have a spurious user with obdolbin.com as their website address and got rid of them but the flow still continues. Blogger does seem to have a way around this: entering the letters from an image to stop bots from doing their thing. Maybe we'll see WordPress doing the same?

Update: It seems that the torrent has now slowed to a trickle. Maybe getting rid of the spurious user has worked after all and it just took a while for the effect to kick in.

Extra WordPress editor options

24th February 2007

Solo Technology has posted about a nice extra available in the Visual Editor in WordPress 2.1. Hit ALT+SHIFT+V in Firefox and ALT+V in IE, gets you an extra row of buttons adding more editing options. He is currently trying to add a button to the main bar for doing the toggling.

P.S. While on the subject of blog post management, I have been playing around with w.bloggar, and I have to say that it works well; with a spot of persuasion, it even edits WordPress blog pages. The only things attempting to spoil the experience are the odd instances where odd characters get added to blog posts or characters in posts get misinterpreted. I'll try to add more in time.

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. Thus, 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. Since any function used to power WordPress takes some finding, I need to find one place on the web where the code for WordPress is more fully documented. The sites presenting tutorials on how to use WordPress are more often than not geared towards non-techies 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; while a good rummage in the wp-includes folder does a lot, it can’t achieve everything.

Like many 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 the 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 the get_the_content function to add the p tags 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. Because different functions were being called in different places, I wanted to harmonise things. To accomplish 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 function; these were not Perl-compliant to my eyes, as would be implied by the choice of function. Now that I have found that PCRE’s in PHP use a more pragmatic syntax, there appeared to be issues with the expressions that were being used. These 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. Some confusion was caused by the refusal of Firefox to refresh things as it should before 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.

Blogging with Word 2007

1st February 2007

Though it seems strange to say it, I am making good use of Word’s blogging capabilities. Having had WordPress.com’s blog editor mangle one of my posts – incidentally while using Opera as my browser - is the cause of this turn of events.

When setting up new accounts, there are a number of presets available to be used to work with major blogging providers such as Blogger, WordPress, and Typepad. This is not all, though, as it is possible to hook up to other blogs in a more generic fashion. In fact, I have able to hook up to my other WordPress-powered blog; hosted on the same server as my personal website and with all the associated programming and scripting handled by myself. Where you have a number of accounts set up in the application, a drop-down menu appears in the post so that you can select the account to be used.

Speaking of dropdown menus embedded in the post, you can add categories to a post from the blog server’s own collection, and you can have more than one in any post. This feature is a boon, as is the ability to edit posts that are already on there, yet Word only seems to show a subset of all the posts on the server, about 20 I think, rather than each one. Another caveat is that you need to use a separate window for each post, or you’ll end up overwriting posts in error. Whether this is a result of RSS feed settings or is intrinsic to Word itself remains something that I have yet to discern. As it is Word, formatting, insertion of objects such as hyperlinks and images is very much part of the package. That said, uploading images via this route was not something that I tested until I was writing this post, but it seems to work well.

Apart from the irritations discussed above, I did find Word crashing a few times, but no data got lost thanks to its seemingly excellent file recovery capabilities, a definite counterpoint to some of my experiences with Word’s file recovery feature in previous versions. Eventually, the Office Diagnostics tools kicked in to see if all was well and, after carrying out both hardware (memory, hard drive, etc.) and software checks, an installation repair was performed. Let’s see if this resolves the issue. Even so, the crash repair and diagnostics were not something that I had seen to the same extent in previous versions of Office, and they did look pretty impressive.

In summary, Word does seem to be a good blogging tool, but I wouldn’t use it on its own because of its inability to download a full list of posts for editing. A blog’s own interface will remain necessary for that. Also, Word is far from being the only “offline” blog editor out there, and I am tempted to have a look at the likes of BlogJet and w.bloggar.

Post titles on Technorati

28th January 2007

I have had a look at how the posts from this blog are listed on Technorati and most if not all the titles are coming through as "Permalink". I was going to try WordPress.com support, but they are off for the weekend. A trip to the WordPress.com forums was then in order and a few helpful folk put me right on this one: apparently Technorati uses the permalink titles when extracting post summaries from WordPress.com blogs and in the Andreas04 theme that I am using, these are all hard-coded as "Permalink". I have left the theme's author in on this and going to try WordPress.com feedback tomorrow. In technical terms and from what I can see, the fix needed is as follows: change title="Permalink" totitle="Permanent Link: " in the single.php, page.php and index.php files in the theme.

New domain name

25th January 2007

I have registered the domain technologytales.com for this blog yesterday and have since got the DNS configuration completed. I used Easily.co.uk for the registration; they also host my other domain name and have done so since I first registered it. Easily allowed me to transfer to the WordPress.com namespace servers and $10 secured the rest of the setting up and $10 every year at renewal time with keep things in place. There is more about doing all of this on the WordPress FAQ.

  • The content, images, and materials on this website are protected by copyright law and may not be reproduced, distributed, transmitted, displayed, or published in any form without the prior written permission of the copyright holder. All trademarks, logos, and brand names mentioned on this website are the property of their respective owners. Unauthorised use or duplication of these materials may violate copyright, trademark and other applicable laws, and could result in criminal or civil penalties.

  • All comments on this website are moderated and should contribute meaningfully to the discussion. We welcome diverse viewpoints expressed respectfully, but reserve the right to remove any comments containing hate speech, profanity, personal attacks, spam, promotional content or other inappropriate material without notice. Please note that comment moderation may take up to 24 hours, and that repeatedly violating these guidelines may result in being banned from future participation.

  • By submitting a comment, you grant us the right to publish and edit it as needed, whilst retaining your ownership of the content. Your email address will never be published or shared, though it is required for moderation purposes.