Half-forgotten projects

Last week, I put in this very slick 404 redirect to a Movable Type search, and then promptly forgot all about it until I just noticed all the usual 404s from really poorly written bots that do things like treat mailto: as a relative link (“/blog/2002/05/mailto”) or chop off URLs at an arbitrary number of characters, all showing up in my MT Activity Log as searches. I suspect it’ll be more useful for me than for you, but if you add search terms to philringnalda.com/blog/, you’ll either be taken to the search results page (for zero or more than one result), or directly to the entry (for a single match). For example, philringnalda.com/blog/half forgotten projects should take you right to this entry. It’s a system that’s incredibly useful to me at php.net, though I’m not sure how useful it really is for a weblog. More useful if I remember it exists, and remember to tell you about it, though.

Also from the forgotten projects files, when Luke was wondering how to get the entry number for a TrackBack ping in a SimpleComments container I started off to see how I did it in my comments feeds, was temporarily halted by my worthless host’s failure to write a script that would actually tell them when a MySQL server was down, and when I remembered to look again, was shocked to find that I don’t actually include TrackBacks in comment feeds. I can clearly remember wanting to, finding that it didn’t work outside entry-context, being lazy and waiting until Mark fixed that, and then including them. I can picture the template code, but it’s not there. Maybe it was in a test weblog, or maybe I hit Luke’s problem and backed it out. Luckily, my laziness patience payed off, and Adam revved SimpleComments, adding a container for the entry that the comment or TrackBack went to, along with tags for comment numbering, and odd-or-even, for alternating backgrounds, along with moving the bulk of the code to an external module, so that MT doesn’t have to load it all every time it loads the plugin directory, only loading it when it’s needed. Back to the top of the todo list.


Comment by Mark Paschal #
2003-04-24 15:47:26

Apparently I’ve been using:

<div class="comment" id=" <MTSimpleCommentIfComment> c<$MTCommentID$> </MTSimpleCommentIfComment> <MTSimpleCommentIfTrackback> p<$MTPingID$> </MTSimpleCommentIfTrackback>"> ...

without so many spaces. But then, I’d looked in the code and knew the comment/ping stuff was in scope, I guess.

Comment by Phil Ringnalda #
2003-04-24 19:56:15

Even though both he and I put it unclearly, the problem isn’t getting the comment/ping ID, it’s getting the URL for the entry which was pinged: for SharpReader to thread a ping in a comments feed back to the entry that was pinged, it needs the permalink to be in the entry (”Ping from Foo on <a href=””>Entry Title</a>”). That’s a problem, because although an entry knows its tb-id, and the tb-id table knows what pings went to that tb-id, a ping doesn’t know much of anything to let you backtrack to the entry. I’ll have to look at what Adam did, because now my vague memory of why I stopped was that, given a ping object, I couldn’t figure out how to find what entry it was a ping for.

Comment by Paul #
2003-04-25 07:30:48

There wasn’t an easy way I could see. I spent an age looking at the mysql tables for tb-id, not getting anywhere before using the mtsql plugin to do it, as here.
Cool, looks like I can ditch this code now.

Comment by Mark Paschal #
2003-04-25 14:34:09

Oh, OK. Weird! Guess I really ought to upgrade now.

Comment by Bill Kearney #
2003-04-25 06:42:40

It’s not that hard. I have an HTML page that shows recent trackbacks:
and it’s template is:

I did have to make a plug-in that provides an MTPings container. You can find it here:


I’m working on a feed that indicates all this info for items. But meanwhile I’ve added a .xml page for the entries. This is chock-full of per-item metadata including comment and trackback threading.

Using the SQL plug-in would work, of course, but is probably overkill for most folks.

Comment by Phil Ringnalda #
2003-04-25 07:50:03

Looks like I quit watching for answers to your question a little too soon (and didn’t watch in the right thread at all). The odd thing is, since that’s the only way you could get back from a ping to an entry, you’d think I would have tried it. Dunno, I’ve barely got enough brain cells to keep track of what’s happening with MT objects most of the time, so the whole MT:TBPing/MT:Trackback/App:Trackback thing is just too much for me. And then the stuff down close to the metal, what will get loaded when you pass which parameter to load, is a complete mystery to me. Just glad to see there’s plugin code I can copy-n-paste when I need it out there.

Comment by Luke Hutteman #
2003-04-25 22:21:42

Maybe this is because you are working on it at this very moment, but your rss2 comments feed currently consists of all empty items. The rss1 feed seems fine.

Comment by Phil Ringnalda #
2003-04-25 22:35:56

Could be worse, you could have caught it a few minutes earlier, when I accidently cut out the lastn=”15”, and built it with all 1900-odd comments (all blank, but still a hefty file).

Yeah, I thought I could SimpleComments it live, but things aren’t quite working right. Finally got past the way 1.11 silently fails if you have an MTEntryLink tag outside an MTSimpleCommentEntry (oops, that’s where the blanks came from), but now I’m getting just one particular (wrong) entry from MTEntryLink on a TrackBack. Comments get the right entry, but pings just get that one wrong one. Hrm.

Comment by Phil Ringnalda #
2003-04-25 23:34:53

Right, looks fixed now. Apparently Murphy thought it would be funny if I failed to actually upload simplecomments.pm v. 1.11.

Now, can we talk about SharpReader’s support for pubDate? Unless I’m just confusing myself, it looks like you are parsing dates with -0800 timezones (despite the fact that they aren’t in -0800, because it’s Daylight Savings Time now), but not parsing the TLA timezones. Sure, I’m a bit of a crank to be using PDT/PST just because it’s legal, but RSS 2.0 uses RFC822 dates, where it’s clearly legal, and even in RFC2822 they are legal, though they stuffed the description down in the Obsolete formats section at the end. Push comes to shove, I can actually do -0800/-0?00, but I’m so bad with timezones that I can’t remember now whether PDT is -0700 or -0900, which is why I use PDT.

Comment by Luke Hutteman #
2003-04-26 20:21:11

Support for EDT, CDT, MDT and PDT will be added to SharpReader – thanx for bringing this up.

By the way, why don’t you just use <$MTBlogTimezone$>? it would save you from manually having to update your templates when you go from or to DST. Of course you would have to remember that you’re in UTC-7 right now, but didn’t you have to update that in your MT config anyway?

Comment by Phil Ringnalda #
2003-04-26 21:57:31

No manual updating for me: that’s what I keep computers around for. In fact, every few changeovers it’s just my computer changing that reminds me to change everything else. So I’m using MTDaylightOrStandard for my timezones. I can pass in daylight=”-0700” standard=”-0800” (now that you told me which way it goes), but I think I’ll just keep it as a test case.

Comment by Luke Hutteman #
2003-04-27 11:00:44

cool – i think i may have to look into that plugin…

2003-04-25 22:06:01

Trackbacks integrated in comments feed

I finally got around to integrating trackbacks into my comments feed. I initially followed Paul Freeman’s suggestion of using Brad Choate’s MTSQL plugin. This is an extremely powerful plugin, though it added a level of complexity to my template that I …

Name (required)
E-mail (required - never shown publicly)
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.