Daily Archives: Saturday, 20th January 2007

Life imitates art, or something

BBC NEWS | World | Americas | NY couple build wall through home

A bickering New York couple have had a dividing wall constructed inside their home as part of an acrimonious divorce. Chana and Simon Taub, both 57, have endured two years of divorce negotiations, but neither is prepared to give up their Brooklyn home. Now a white partition wall has been built through the heart of the house to keep the pair apart.

I’m sure I remember this being the plot of an episode of Steptoe and Son some time in the 70s. It seemed very silly at the time. It still seems silly now, come to think of it…

Tagged | Leave a comment

The Book of General Ignorance

It’s something of a modern tradition for quirky little books to be published in the months before Christmas. Publishers are always hoping for another runaway success like Eats, Shoots and Leaves[1], Lynne Truss’s delightful rant on punctuation, which I actually bought before it was a big success, so there. Most of these books don’t sell in any great numbers, and are doomed to be sold off at reduced prices in January. Which is where this little item comes in.

It’s a tie-in with the TV quiz QI, which is chaired by Stephen Fry and usually features Alan Davies as the least successful contestant. QI stands for “Quite Interesting”, and oddly enough, it is. I managed to miss it for the first series or three, but caught a few of the last one, and I’ll definitely be watching again. It manages to be very silly and, well, quite interesting at the same time.

The whole QI thing (which includes a website and a bar, bookshop, cafe and members’ club in Oxford, was thought up by John Lloyd, who has been involved with such things as Not the Nine O’Clock News, Blackadder and Spitting Image, not to mention helping Douglas Adams with the first series of The Hitch-hiker’s Guide to the Galaxy.

The book consists of a series of common and not so common questions, and attempts to provide definitive answers to them. Lots of entertaining corrections of popular misconceptions, and a few things I knew already, all presented in a nicely erudite style. It’s quite easy to imagine Stephen Fry reading it out loud.

Read this and you’ll learn where most of the world’s tigers live[2], where the Canary Islands got their name[3], and much more. Great for dipping into and picking questions out at random, or just reading straight through. Not worth the original cover price of £12.99, but it’s half price in Waterstone’s, and available at reduced prices elsewhere.

[1]


[2] Possibly not where you might think
[3] OK, I knew that one

Tagged , , , | Leave a comment

It seems to be working

Since I decided to make a new start on the weight and fitness thingy at the start of this month, I’ve made some progress. I’ve lost three pounds so far[1], and perhaps more significantly, the general trend is downwards, whereas this time last year, it was upwards. One of the figures I’m tracking in my spreadsheet[2] is the difference in my weight since the same date last year. That figure has dropped from about ten pounds to not much over four pounds as of today.

I’ve generally avoided setting specific weight targets before, but I’m going to break with tradition and do that. I want to get my weight below the psychologicackle 200 pounds level by the end of June. I haven’t been there since November 2005, so it’s a wee bit of a challenge.

I’d also like to get back into 34″ trousers. I’ve got lots of those :laugh:

No exercise today, which means I need to do some tomorrow, otherwise I’ll have to tell myself off. :rant:

[1] Subject to random daily variations, etc
[2] Hey, I’m a geek. :grin:

Tagged | Leave a comment

I may have to steal this…

This has to be the quote of the month, at the very least. In today’s Guardian Weekend magazine, Sue Townsend, best known for the Adrian Mole books, is subjected to the ritual humiliation they call “Q&A”. In response to the question “What is your most unappealing habit?”, Sue replies

Shouting “What fresh hell is this?” when the phone rings.

Wonderful. Anyone who’s ever done technical support will understand….

Tagged , | 1 Comment

WordPress 2.1 – Smilies!

Like a lot of WordPress users, I use the nifty WP-Grins plugin to make it easy to insert smilies like these :wave: :eek2: into my posts. It adds all my smilies in a row above the box where I type my posts, so I can click on them rather than remembering to type the code that makes them appear.

It was written for a much older version of WordPress, but with a minor change, it still works in much the same way for WordPress 2.0.x. There are excellent instructions here. But when I looked at WordPress 2.1, everything had changed. This morning, I had a search through the files, looking for the right place to insert the wp_grins() line, and after a fair bit of head scratching, I found it. Here’s what I did[1]

To get your clickable smilies into the edit page, you need to edit wp-includes/general-template.php. As of the latest RC code, look around line 825 for:

<script type="text/javascript">edToolbar()</script>

On a new line below this, add:

<?php if (function_exists('wp_grins')) wp_grins(); ?>

Save and upload the file, making sure you kept a copy of the unedited version.

That will get the row of smilies working, but you might find that smilies don’t always appear in your posts. This is because of some changes to how the code works. For technical reasons of some kind, there was a need to try to avoid characters being interpreted as smilies when that wasn’t what was intended. Unfortunately, for me, at least, this stopped a lot of intended smilies not appearing. The way to be sure that a smiley will appear is to make sure that the code you use has spaces around it. So, I made a change to the wp-grins.php file to ensure that any new smilies would have spaces around them, and so would definitely appear as images. Here’s what to do:

Edit wp-grins.php, so that it pads the smiley codes with spaces. Find line 34 and change it to this:

$grins .= '<img src="'.get_settings('siteurl').'/wp-includes/images/smilies/' .$grin.'" alt="'.$tag.'" onclick="grin(' '.$tag.' ');"/> ';

The only change (other than the same change of path needed for WP 2.0) is that this will insert spaces before and after the value of $tag.

Well, that fixes things for new posts. But what if you have hundreds or even thousands of old posts, which might have missing smilies? You might decide that you don’t really care, and let it go, or you might be like me and want to fix them all. But editing that many posts would take ages, and you’d be sure to miss a few.

What you need is a way to do a global replacement in your posts and comments. People who speak MySQL can probably do this in 0.005 seconds from phpMyAdmin, but for the code-challenged among us, something easier is needed. And fortunately, it exists! Enter the Search and replace plugin, which would have been useful to me previously if I’d found it at the time. It’s very simple to use. In one box enter the original text, and in the other the text you want to replace it with. Click the button and it very quickly runs through your posts and comments making the changes. As with anything that directly modifies the database, make sure you have a backup , and don’t blame me if it eats all your posts.

I found my list of smilies – depending on your setup, this will either be in wp-includes/vars.php, or if you have a lot of custom smilies, you may have done it the sensible way and put them in your wp-config.php file. Either way, you’ll have a list that looks like this, only longer:

‘;–)’ =>’icon_wink.gif’,
‘::–8:’ =>’icon_cool.gif’,
‘:hi:’ =>’icon_wave.gif’,
‘:agrin:’ => ‘icon_cheesy.gif’,

Your own values will vary. All you have to do is replace every ;–) with ;–) [2]. And so on for every smiley. It won’t take too long, and it should make all your smilies work. Have fun. :wave:

[1] I posted the same thing on the WordPress support forums
[2] That’s a space before and a space after the ;–)[3]
[3] I’m using a code that’s not in my list to stop it being smilified [4]
[4] I hope :rolleyes:

Tagged , , , | 4 Comments

WordPress 2.1 – Coming Soon

WordPress 2.1 is due to be released in the next few days. It’s the first major update in just over a year, and has lots of entertaining changes. I’ve been working on a test copy of Losing it[1], keeping up to date with the frequent updates to the code using SVN[1], and seeing just how well it’s going to work.

The main issue isn’t so much the core of WordPress itself as the numerous plugins I use to make the site do what I want it to. As with previous major releases, a Plugin Compatibility list is being maintained. In fact, I added a few entries to it myself, as I gradually added more plugins to my test site.

Unfortunately for me, two of the most important plugins I use have problems with WordPress 2.1:

  • Ultimate Tag Warrior, which adds all the tags to my posts[2] has a problem when comments are approved: all the tags attached to that post get deleted. Christine, the developer, knows about the issue, and I hope there will be a fix soon
  • WPG2, which links WordPress with Gallery2 is a wee bit broken. The main plugin works, but the popup window which lets you pick images to insert into posts doesn’t pop up. A new release of the plugin for 2.1 is coming soon.

The only other problem for me is that WP-AddQuickTag doesn’t work, but that just means I have to edit a file instead of using a form. Moderately inconvenient, but not a big deal.

I did have a problem with smilies. :eek2: In particular, with being able to click on smilies to insert them into posts. But I fixed that. Yes, me! All by myself! I still have no idea what I’m doing with PHP, but I found what I was looking for. It’s a moderately long story, so I’ll put it in a separate post.

I’ll continue testing WordPress 2.1, but I won’t be switching over until I’m sure everything works the way I need it to.

[1] If you know what that is, you’ll be nodding your head. If you don’t know what it is, you quite likely don’t want to. :tongue:
[2] You might have guessed that :duh:

Tagged | Leave a comment