Rebuilding individual archives when pinged

I’ll be breaking my TrackBack pretty thoroughly for a bit, and then possibly breaking it for some people for a while, trying to persuade MT to rebuild my individual archive page for an entry when it gets pinged.

Update: unless I’m missing something, that didn’t take long.

The problem: when you receive a TrackBack ping, Movable Type needs to do everything it does with the ping before it sends a reply to the person who pinged you, so that it can tell them whether or not the ping worked. That sets a time limit on how much it can do, before their program decides that the ping has taken too long and gives up. So MT adds the ping to your database, rebuilds the RSS file for that entry’s pings, rebuilds all your index templates in case they have TrackBack counts in them, mails you a notification, and calls that good enough. It doesn’t try to rebuild archives, in case it takes too long to get that done, which is a problem for those of us who don’t like popups, and display our TrackBack pings on the individual archive page with the comments.

So far, the three solutions I’ve see are: my solution, which involves using PHP to include the output from the CGI program the popup calls, with the template stripped down to just the stuff I want included in the page; the direct solution of having PHP get the TrackBack data from your MySQL database without going through MT at all; one I haven’t seen done, using PHP to parse the RSS file of pings and include that in the page; or the manual solution of rebuilding yourself when you get an email TrackBack notification. The first three solutions are tolerable, but not very slick; the fourth is too much trouble to suit me, and is likely to get you pinged multiple times, if you aren’t there to rebuild when someone thinks their ping didn’t go through since they don’t see it on the page.

If you have a fair amount of faith in the speed of your rebuilds (or in your TrackBackers’ willingness to keep trying, or to let you know that there’s a problem), you can hack in support for rebuilding archives, or just rebuilding the individual entry page for the entry that was pinged. Fairly obviously, this isn’t a hack for the faint of heart.

First, you might want to save a backup copy of {your MT directory}/lib/MT/App/, to save yourself the trouble of redownloading it when things go south. Then, look for the lines (starting at 199 in my copy):

    $app->rebuild_indexes( Blog => $blog )
        or return $app->_response(Error =>
            $app->translate("Rebuild failed: [_1]", $app->errstr));

and directly below that add:

    if ($tb->entry_id) {
      $app->rebuild_entry( Entry => $entry, BuildDependencies => 0 )
          or return $app->_response(Error =>
            $app->translate("Archive rebuild failed: [_1]", $app->errstr));

That will rebuild all the archive files for the entry that was pinged, individual, date-based, and category, so if you have TrackBack counts in all of your archive types that’s probably what you want, but that’s the sort of rebuild that Ben expected would take long enough that pings would time out. If all you want is to rebuild the individual archive page for the entry, use:

    if ($tb->entry_id) {
      $app->_rebuild_entry_archive_type( Entry => $entry, ArchiveType => "Individual")
          or return $app->_response(Error =>
            $app->translate("Archive rebuild failed: [_1]", $app->errstr));

and then post a message along the lines of:

I’m experimenting with rebuilding individual archives when an entry gets a TrackBack ping. If you have trouble pinging me, please let me know about it. Also, you might try setting a longer value for PingTimeout in your mt.cfg file.

and let me know how it works for you, and feel free to ping this entry mercilessly to see how it works for me.


Trackback by mamamusings #
2003-08-22 15:01:04

mt courseware documentation and templates

Okay, I think I’ve “gone about as fur as ah c’n go” for this first version of the courseware. I’m ready to call it version 1.0, I guess, with all the caveats that go along with that. You can see it in action on my fall cou…

Trackback by This Chick #
2003-09-23 06:21:57

I love MT even more!

I’ve been playing again. Obviously the layout has changed again. Lets see how long this three column thing lasts! I know it looks OK in the versions of Mozilla, IE6 and Opera that I have. Don’t know about Netscape. Don’t…

Trackback by #
2003-09-28 17:57:32


In case the long silence wasn’t a clue, and just in case the new burgundy color wasn’t a tip, has been given a new shiny layout! There is a small list of things I have left to do, including

Trackback by swirlspice #
2003-10-13 23:14:21

Don’t Mind Me

Just mucking with the comments and trackbacks. UP

Trackback by redsugar muse #
2003-10-14 07:17:34

more mt manipulation

i just installed phil ringnalda’s mt hack to make individual archives automatically rebuild when pinged. it’s currently set to rebuild the date-based and category pages…

Trackback by PromoGuy dot Net #
2003-10-16 09:36:53

Blacklisted and Tweaked

MT-Blacklist appears to supercede any mods you’ve made to comment notifications. Here are a few links to work-arounds, plus a few other Comment Notifcation Mods you may want to try, and some nifty hacks I found along the way.

Trackback by Ones and Zeros #
2003-11-15 11:16:04

Plug-ins, hacks, and production code

I just finished a flurry of behind-the-scenes MT hacks and changes. The fruits of these efforts will become more apparent later, but MT should be faster, stronger, better than before…

Trackback by spravodaj #
2004-01-05 11:54:46

Trackback vylepšenie pre MT (update)

MT má pre Trackback samostatné okienko, kde pingy vypisuje skript. Akonáhle však výpis pingov na váš príspevok zahrniete do šablóny príspevku, neobjavia sa tam, kým príspevok znovu nerebuildujete. Preto si chcem preštudova? nasledovné príspevky: In MT,…

Trackback by spravodaj #
2004-01-05 12:02:41

Ešte jeden návrat k Poohu a Marigoldu

Takže Marigoldov Autotrackback a Poohý ”Trackback” sa volí Referrals. Nájdete to napríklad aj v príspevku na phil ringnalda dot com a úplne naspodu Súvislosti: spravodaj o trackbacku…

Trackback by Population: One #
2004-01-09 10:33:27

Rebuilding times

As per Phil Ringnalda’s advice — I’m experimenting with rebuilding individual archives when an entry gets a TrackBack ping. If…

Trackback by Procrastination #
2004-01-26 04:59:39

Further Weblog Maintenance

When I changed the way trackbacks appear, I broke something as well. It turns out that when someone pings you, only the index templates are rebuilt automatically. Since I had the trackbacks in the individual entry pages, those were not…

Trackback by #
2004-03-30 23:57:19


Just adding a new entry for testing purposes… since I’ll probably just delete it when done. Edit: Ok, I’m mostly happy with how I have trackbacks being displayed in individual archive pages, I just need to get it automatically rebuilding it when it g…

2004-04-25 14:04:23

Movable Type MT-Blacklist Hack: Rebuild after Ping

I recently modified my blog to put the trackback information on the entry page, thus eliminating the separate pop-up. On…

Trackback by Sillybean #
2004-05-14 09:03:41

Blog stuff

Reading the 300-odd comments on Mena’s MT 3.0 post has led me to a lot of new blogs. Among other things, I learned how to include TrackBacks inline with the comments on individual post archives. Step 1: Grab and install…

Trackback by mamamusings #
2004-08-01 16:30:32

mt courseware, step-by-step

Templates for my MT-based courseware, and step-by-step instructions on how to implement it. Not for the technically fainthearted; basic MT template and plug-in installation knowledge is assumed.

Trackback by Wingie's Cradle #
2005-06-16 01:56:35

The power, of blog

Finally I got DrLiew to play Trackback with me. Reading from various side that MT do not rebuild the entries when a ping is received, and I accidently bumped on this link. Now that I have discovered that w.bloggar does…


Sorry, the comment form is closed at this time.