Daily Archives: Tuesday, 25th December 2012

Get some bargain ebooks!

Tuesday 25 December 2012 21:33

If you have a Kindle, you should have a look at Amazon’s current The Twelve Days of Kindle promotion. There’s a nicely large selection of books with prices starting at 99p – and some of those were around £6.99 previously, so there are some actual bargains on offer.

For instance, I just bought The Horologicon, Mark Forsyth’s follow-up, or companion volume, or something to his excellent Etymologicon, which I enjoyed enormously. I’d been thinking of buying it anyway, and the 99p offer made my mind up for me. I also got a Neal Stephenson novel for 99p, also nicely reduced.

Standard disclaimer applies – I get a cut if you buy anything via an Amazon link from this site.

Doctor Who – The Snowmen – First Impressions

Tuesday 25 December 2012 18:23

OK, this is the spoiler-free version. A more detailed post will follow when I’ve watched it again with extreme use of the pause button.

So, all good fun. Lots of running around, more Victorian atmosphere than a tank full of London air circa 1895, loads of gags and an unexpected return.

But the expected return of Jenna-Louise Coleman as Clara was the high point. Steven Moffat had dropped a few hints relating to Jenna’s appearance as Oswin Oswald, the soufflé-obsessed, err, well, Dalek[1], actually, in Asylum of the Daleks, and how obviously she couldn’t possibly be the same character, right? And err, that’s all I’m going to say about that, other than we still have a lot to learn about Clara.

More about this will follow…

[1] Eggs, stir, minute….

My Title Has Been Restored

Tuesday 25 December 2012 12:36
Update: some helpful advice from OllieJones on the WordPress forum helped me improve the plugin – it now checks that there isn’t already a title, and if there is it won’t add it again. It also deals with any HTML tags that might be in the title. The original version didn’t do that, which could have led to some very mangled image tags. The revised version is now available from the WordPress Plugin Directory.

It seems like only a couple of days ago[1] that I was muttering about how WordPress 3.5 had stopped inserting the title attribute of images inserted into posts. While this was only a minor inconvenience, it irritated me enough to (a) moan about it and (b) try to change it.

I’d done a fair amount of reading, which led me to believe that a simple function (and it would have to be simple, given my coding skill level) should be able to do what I needed. One of the great things about WordPress is that it’s designed to be fiddled with. It offers numerous “hooks” and “filters”, which, put in the basic terms that a non-programmer like me can understand, allow you to change almost everything it does. Want to insert some extra text? Want to stop something displaying? Chances are that there’s a hook or filter you can use.

In this particular case, it seemed that what I needed to play with was the

media_send_to_editor

filter. And after much googling, and much trial, and and even more error, I came up with a function that does exactly what I needed. As I didn’t want to break things, rather than adding it to my general purpose Functionality plugin, I created it as a shiny new plugin all to itself. And sure enough, with this plugin activated, when I insert an image, the title attribute is inserted. This ensures that the tooltip appears, and lightbox plugins no longer get confused.

It’s such a short and simple thing[2], that I can include the whole of it here:

Download the plugin from the WordPress Plugin Directory

This has only been tested on my own sites, where it didn’t appear to break anything. Use at your own risk. If you happen to be a real programmer, you may point and laugh as much as seems appropriate. Or if you’re a real programmer and you have advice or suggestions to improve what I’ve done, I’d be happy to receive them.

[1] Probably because it was
[2] It would have to be, for reasons previously mentioned

Stuff Report – 25 December 2012

Tuesday 25 December 2012 12:17
Weight: Quite a lot, probably
Steps taken: Not many
Exercise: Seems unlikely

Merry Christmas[1] to all my regular[2] readers[3]!

I thought I’d better get today’s report in before the turkey, wine and other such things make me even less coherent than usual. Here’s a cool pressie I got from my niece Rachel:

It's a mug

It’s a mug

Camera: iPhone 4S
Aperture: ƒ/2.4
Shutter speed: 1/20s
Focal length: 4.28mm
ISO: 160
Location: 51° 31.08′ 0″ N 3° 29.7′ 0″ W
Taken: 25 December, 2012

No, it’s not an actual shiny new lens for my 5D Mark III, it’s a mug in the form of a Canon lens, which is a cool thing to have. I’ve seen these on sale in various places, but never got round to buying myself one, so I was especially pleased to have it. Thanks, Rachel :wave: [3]

[1] Or whatever you’d like to call it
[2] Or irregular
[3] Not that Rachel probably reads this nonsense much