Daily Archives: Sunday, 5th Jun 2011

WordPress Cross-References – A quick edit

Update: This plugin, which is no longer being developed, appears to be broken in WordPress 3.3, so I’ve removed it again. Fixing it would be way beyond my minimal coding skills.

This is a quick and easy guide to fixing that slight annoyance I mentioned with the Cross-references plugin. While it was a minor cosmetic point, I wanted to change the text of the navigation buttons which you can see here:

Buttons

Buttons

So, I right-clicked on one of them and selected Chrome’s Inspect Element function. This told me that the link had a style called “last-page” assigned to it. It was then a matter of searching through the plugin’s files for that text. I found it in sys/table.class.php, where there was a block of code defining the navigation links. I changed the display values to First, Last, Next and Prev – it was obvious from the code which was which – and uploaded the saved file. Woo, hoo, it worked, as you can see here:

Fixed

Fixed

I’ve also made some minor text edits to some other parts of the plugin to make the wording make more sense to me. Nothing major, just minor usability tweaks.

WordPress Cross-References

Update: This plugin, which is no longer being developed, appears to be broken in WordPress 3.3, so I’ve removed it again. Fixing it would be way beyond my minimal coding skills.

I like to link to older posts when I’m writing new stuff. WordPress makes this really easy to do with a friendly linky box that lets you type in a search term to find the post you’re looking for:

This is pretty cool, but it would be nice if there was a way to see what posts are linking to the one you’re currently reading. There are a load of “related posts” plugins which work on various things like keywords, categories, the weather in Katmandu, the price of coal in Cleethorpes, and possibly some other things. That’s useful in a way, but not quite what I’m after.

Well, for a while I did use a Cross-references plugin. It worked by using a WordPress shortcode instead of a link, so you’d have [cref the-last-dragon The Last Dragon] in the editor, which would show up as a link in the post. And visitors to the post you linked to would see a list of linking posts at the end of the post, rather like this:

Links

Links

This was pretty good – it kept track of all the links in its own table in the WordPress database, and had a proper mechanism for removing itself if you decided you didn’t want to use it any more. But creating those links was a strictly manual process – you had to find the post you wanted to link to, copy its “slug” (the text at the end of the URL – the-last-dragon in the example I’ve used) and type or paste it in to the shortcode. Compared with the easy link insertion of the WordPress editor, this began to look like too much effort, so I stopped using the plugin, and converted all my [crefs] back into normal links.

But while I wasn’t paying attention, Wyatt Fang picked it up and added a useful feature – the ability to automatically create a link to an old post. It’s not quite as slick as the built-in WordPress link builder thingy, but it does the job.

Click on “Insert History Post Link”

Click the insert link

Click the insert link

Type in your search term – something that will be in the post you’re after, then click Submit

Type in your search term

Type in your search term

Find your post in the list of results and click on “Insert Post Link”

Select your post

Select your post

You can now type in the display text for the link. If you leave this blank, the plugin will use the post title, which may be just what you need. Either way, press insert.

Text to display

Text to display

Your shortcode has now been created

Shortcode
Shortcode

Issues

As you can see from the pictures, some of the buttons have text in what I guess is Chinese[1]. This doesn’t affect the operation of the plugin, and I don’t see it as a problem.

This worked perfectly on my test site, but at first the dialog box wouldn’t render properly here. This was caused by it trying and failing to produce a tag cloud at the bottom of the box. I had over 600 tags, and 5,000 posts, so it’s possible that this was just a bit too much for it. I’d already decided to dispense with tags anyway, so a removal operation made this plugin behave. Worth noting if you use tags and have a lot of them.

The plugin is in the WordPress repository, so you can either install it direct from your control panel (search for cross-reference, you should be able to identify it from the description), or download it in the old-fashioned way from the site:

WordPress › Cross-references « WordPress Plugins

Good, useful plugin. A bit of polish would be nice, but for now, it does exactly what I want.

[1] Corrections, as always, gratefully received

Doctor Who – The Rebel Flesh / The Almost People

OK, if you haven’t already seen these episodes, you might want to look away now, because here be spoilers. I’m not exactly going to run through the whole storyline, but I am going to drift around it and refer to some details. And as some of this inevitably ties into A Good Man Goes To War, if you haven’t seen that yet you may want to leave this post until later.

Continue reading

Newcastle Photographs – 31 May 2011

On Tuesday, I took my Canon 5D MkII and that new 70-200mm lens for a walk at lunchtime. I didn’t have an actual destination in mind, but Aaron[1] mentioned the castle keep, which is always a good venue, so I went there. Admission is now £4, but it’s worth it for the occasional visit – there are some good historical exhibits inside, and it’s a good example of a building of its kind – much adapted and restored over the centuries, with some silly bits added in the Victorian period. But for me, the main reason for a visit is to get up on the roof and enjoy the view. Once you’re up there, you can understand why the castle was originally built there – it occupies a superb commanding position with lines of sight along the river, and overlooking the position of the original river crossing, more or less on the site of the current Swing Bridge.

I got some pictures of the station, the site of a new hotel and some bridges. I spotted an interesting bit of roof structure, which I don’t recall having seen before[2]. I think it’s on the Theatre Royal, but I’d welcome any corrections on that. All that in the gallery below, where you can also see how the demolition of Tyne Bridge Tower is coming along.

After leaving the Keep, I walked past the Cathedral, paid a visit to the Vampire Bunny, and got some detail shots of buildings on Mosley Street and Grey Street.

Oh, and I’m sure the keep didn’t have so many stairs last time I went there. My knees were still moaning days afterwards…

[1] Hi Aaron!  :wave:
[2] Though with my memory, who knows…

The Somme Stations – Andrew Martin

Jim Stringer’s back, and he’s in more trouble than ever before. Well, that’s not unusual – in his previous adventures, most recently The Last Train to Scarbourough, it seems that somebody is always trying to kill him. Well, this time, it’s the whole German army trying to do the job, though in their case it’s nothing personal, they’re trying to kill everyone on his side. Yes, Jim has joined the army, it’s World War One, and as if the Germans weren’t enough, he’s got a problem that’s followed him from England, where one of his battalion was killed in slightly mysterious circumstances.

As usual, most of the story is related from Jim’s point of view, which means that he doesn’t always know what’s going on, and puts things together in his own time. Some key points are provided in letters written by his wife Lydia to a friend, which adds a certain something.

There’s a good mix of characters, a good mystery, and despite the horros of the trenches, written in Andrew Martin’s usual light style, which made this a quick and enjoyable read, just like the others in the series.

Primeval – Series 5, Episode 2

I don’t know why, but I can’t seem to fix the 8pm on Tuesdays slot in my mind, so I seem doomed to watching Primeval an hour or two after it’s been on. Good job the TiVo has a better memory than me, really.

Anyway, this week’s monster fun involved Matt, Abby and Connor taking a ride on a Royal Navy submarine[1] following reports of strange interference and something colliding with the boat[2]. Sure enough, there’s a nice underwater anomaly, and Connor’s Cunning Plan is to load an anomaly-closing device into a torpedo and fire it, despite previous devices needing to be carefully aligned and computer controlled to do the same job. Must be a version 2 device, or something. Either that, or the requirement to carefully point things has gone to the same bit of continuity hell as James Lester’s knighthood, which I mentioned last week.

This being the kind of show it is, you can’t have your characters in a submarine without some Voyage to the Bottom of the Sea fun. My memory of watching Voyage as a kid was that there was always a big monster colliding with, or trying to eat the Seaview, and that at the slightest touch, sparks would fly, water would come in, and you’d be wondering why this incredibly advanced submarine was, well, a bit crap. It was indeed a bit like that, which was nicely amusing.

Problems always multiply in Primeval. Not only does the body of the little dinosaur they collided with earlier prove to be not quite, or in fact at all, dead, but it also does an Alien-stlye gradual picking off of the skeleton crew, leaving the ARC team and an inexperienced officer in charge. This is also traditional, of course. And as if that wasn’t bad enough, a collision trips out the electrics, which requires Connor to reset a series of fuse boxes. Quite why your electrical system would require you to do that is a mystery. Possibly it’s an old Navy tradition. Or not.

And as the sub has no power, it’s not possible to steer it, which results in it drifting through the anomaly accompanied by some quite large pliosuars.

More fun follows at the ARC, where a senior Admiral turns up, declares the whole problem to be under military control and decides that the appropriate action is to nuke the anomaly. Lester, still peeved about his missing knighthood, is even more peeved by this and tries to derail the conversation with silly things like facts and logic, which obviously doesn’t help at all.

The sub-based team manage to avoid the pliosaurs by firing the alien little dinosaur out of a torpedo tube, then get the power on just in time to return through the anomaly where they’re warmly greeted by an oncoming torpedo (the nuclear warhead being a courtesy detail[2]). They dodge that, close the anomaly and head off home.

The only unanswered question is whether the torpedo was actually disarmed before it went through the anomaly…

All good fun. More of the ongoing friction caused by Connor working secretly for Philip, Abby tells Matt what she’s learned about Emily’s fate – you remember Emily, nice lady from Victorian England, went home at the end of the last series. Well, it seems her husband had her committed, which is a bit upsetting for Matt. If only there was some way he could see her again. Oh, wait…

As usual, Lester got some of the best lines, particularly when dealing with the psycho Admiral:

Have a good apocalypse

and when the Admiral leaves the ARC…

I’ve got Doctor Strangelove on Blu-Ray if that helps…

And more. Yes, it’s all very silly, quite possibly formulaic and predictable, but I really don’t care. It’s fun, and that’s all I want from it, so there.

[1] Carefully specified as one of an old, non-nuclear type, because apparently while they will let you on a nuclear submarine, they to have to fire you out of a torpedo tube to make sure you don’t tell anyone about it.
[2] If memory serves, in the Royal Navy, submarines are “boats” not “ships”, for reasons that probably similar to surgeons being called “Mr” not “Dr”, or something. Tradition, that’s the thing.