mt rebuild type mod
movable type April 27th, 2003after playing around with my previous mod i decided to take it to the next level. i had originally wanted to do it this way but i ended up hacking it and getting it working. anyhow, this mod has a bit more code, though still not a ton. it gives the mt user a lot of additional control over how their indexes are being rebuilt. i could also envision adding this rebuild type to other templates as well if people thought it would be useful.
first and foremost i must tell people that these changes are not supported by six apart and i don’t take responsibility for their effect on your installation.
now i guess your wondering what this mod even is. i added the ability to specify the rebuild type of a index template. in the typical installation when you create a new index template you can specify whether or not you want an index to rebuild when other indexes are rebuilt. you don’t have any additional control over when this rebuild may occur. it usually occurs when you rebuild your site, when you rebuild that template, when you add a new entry, or when someone adds a new comment. what if that template has nothing to do with comments or entries? what if you want it to rebuild when a trackback occurs? in short, you can’t … until now.
i’ve changed the list template and edit template screens to now allow the site editor to specify exactly when a template should be rebuilt. here are the new “rebuild types” that i’ve created:
- never — excluding a forced rebuild do not ever rebuild this template.
- entry — only rebuild this template when a new entry is entered or an entry is edited.
- comment — only rebuild this template when a new comment is submitted.
- trackback — only rebuild this template when a trackback occurs.
- entry, comment * — rebuild this template when a new entry or a new comment is submitted. this is the typical rebuild type that ships with movable type and is the default rebuild type for all new templates.
- entry, trackback — rebuild this template when a new entry or a new trackback occurs.
- comment, trackback — rebuild this template when a new comment or a new trackback occurs.
- all — whenever any change (new comment, new trackback, new or edited entry) occurs then rebuild this template.
important note : i recommend you backup the original files before placing my mod files in your mt installation.
what version of mt is supported? — 2.63, 2.65
what was changed? — quite a few things behind the scenes and in the user interface.
- the list templates screen now no longer has a rebuild? column. it has been replaced by a rebuild type column that specifies the type of rebuild for the associated index template.
- the edit screen for index templates no longer has a checkbox for rebuild. it now has a selector that allows you to select one of the rebuild types defined above.
- the default behaviour of trackbacks now rebuilds the associated entry, if it is an entry. in the past it never would rebuild an entry after it received a ping.
- all of the calls to the rebuild_indexes method take a rebuild type now. this enables me to determine whether or not a given template should be rebuilt based on it’s specified rebuild type. because i needed to add a new attribute type to the mt::template object a database change will be needed for those of you not using dbm files.
- as i said above, mt::template objects now have a rebuild_type attribute.
what did you do to integrate with mt blacklist? — i made the changes that they mentioned on their incompatibilities page and made those a part of my release. i don’t claim any credit for mt blacklist or the awesome job they have done with it. this is merely a convenience change for my users. any questions about mt blacklist should be directed to their website.
how do i install this mod? — it’s rather simple actually. first thing you need to do is backup the following files in your mt install:
- /mt/lib/mt.pm
- /mt/lib/mt/template.pm
- /mt/lib/mt/app/cms.pm
- /mt/lib/mt/app/comments.pm
- /mt/lib/mt/app/trackback.pm
- /mt/tmpl/cms/edit_template.tmpl
- /mt/tmpl/cms/list_template.tmpl
if your using mt blacklist you should back these files up:
- /mt/extlib/jayallen/mtblping.pm
- /mt/extlib/jayallen/mtblpost.pm
then just copy the files from the zip file (bottom of this entry) into the same location as the files you just backed up.
if you are using dbm files for your mt storage then your done installing the changes. if you aren’t using dbm and are instead using mysql or some other database your going to need to update your database scheme. i’ve added a new attribute to all mt::template objects so your going to need to add a rebuild_type column to the mt_template table. the sql update would look something like this:
alter table mt_template add column template_rebuild_type text
are patch files available? — you can download a patch for each file here:
- 2.63
- 2.65
- coming soon
what should the changes looks like? — i made 2 simple screen shots of what the user interface should look like. you can see the changes to the list templates and edit template views.
how do i test the changes? — if you goto the list templates view you should see a rebuild type column for each index template. if you select a template and goto the edit template view you should see a selector in place of the original checkbox in the user interface. from this selector you can choose the rebuild type for this template. once selected, save the change like you would any other change to a template. when you return to the list templates view you should now see the rebuild type you selected reflected in the interface.
how can i see what you changed — do a search on “sean willson” in the files, there are copious comments. you can also look at the patch files specified above.
are there any caveats to making these changes? — there are a few things i should caution you to. the first would be that these changes are not supported, but i already said that didn’t i? the second would be that you need to realize that any time anyone pings your entries they will get rebuilt. so, if you get those annoying 4-5 pings to one posting like some people do, it will update each time. you’ll likely then want to go back and remove those excess pings and then rebuild the entry. since most people don’t do that though, it’s not a big deal to me. i thought it appropriate to warn you ahead of time though.
finally, download the changes
- 2.63
- mt-2.63-mod-2-sean.zip (57 k)
- 2.65
- without mt blacklist — mt-2.65-mod-2-sean.zip (59 k)
- with mt blacklist v1.62 — mt-2.65-mod-2-mt-bl-1.62-sean.zip (66 k)
release history:
- 0.1 — 2003/04/27 — initial release
- 0.2 — 2003/12/30 — upgrade changes for movabletype v2.65 release
- 0.25 — 2003/12/30 — add support for the movabletype blacklist module v1.62
April 27th, 2003 at 8:52 pm
A Couple of New MT Goodies
Just catching up on reading the MT Forum and a couple of goodies caught my eye. First, from Gavin, the…
April 29th, 2003 at 1:48 am
Tuning the Rebuilding Process
Tuning the rebuilding process of MT is possible using Sean Willson patch. I have not tested it, but it makes…
April 29th, 2003 at 3:58 pm
Funs stuff
Sean Willson’s Rebuild Mod gives a ton of control of MT’s rebuild process. SharpMT - an off-line blog entry writer
May 10th, 2003 at 10:18 pm
this might be specific to my host’s mysql front-end, but i had to create a new field called ‘template_rebuild_type’ [not just 'rebuild_type'] in the mt_template table, otherwise my template list appeared empty.
other than that, things worked great. thanks for this; i mentioned this would be a good facility for mt to have about 3 months ago in the support forum!
May 10th, 2003 at 10:23 pm
it takes patience to do things quicker
all good things come to those who wait a while and then stumble across it accidentally whilst looking at something…
May 13th, 2003 at 1:01 am
mt.pm.patch is 404ed. Luckily, it didn’t matter to me, since I didn’t much trust patch to be able to mix your mods and my mods, so I just diffed them and did it by hand.
Sweet mod! I’m delighted not to have every comment rebuild my master archive index, getting the script killed by my host’s overaggressive reaper.
May 14th, 2003 at 1:10 pm
Faster MT Rebuilds
Zippy! [Tip \'o the hat to Phil Rignalda.]…
May 15th, 2003 at 12:37 am
Speeding things up
If all has gone well, I should have just sped up my site when processing new comments or trackback pings, thanks to Sean Willson’s mt rebuild type modification. Technical details follow (Kirsten, you’ll want to look at this one…)
May 16th, 2003 at 10:46 am
MT rebuild mod
Am attempting to install Sean Willson’s MT rebuild mod, so hopefully there won’t be any more errors when submitting comments. Hopefully. (Tip from that other…
May 16th, 2003 at 4:01 pm
MT rebuild type mod
It was fairly scary, but I did it. I installed the mt rebuild type mod [via Phil Ringnalda] It seemed…
May 20th, 2003 at 10:11 am
MT Rebuild Mod
Verily there is much sweetness in the land these days. Sean Willson’s MT rebuild mod lets you control how each index template gets rebuilt.
May 31st, 2003 at 12:13 am
Movable Type 2.64
Like Chris Laco I just completed the Movable Type 2.64 upgrade. And in my continuing effort to finally, eventually, make…
May 31st, 2003 at 4:15 pm
Excellent mod. I was wondering, though… is there a way to extend this to individual archives as well? What I wanted to do was split my comments and the entry file itself into two different files, and just PHP include the comments file on the fly. That way when someone left a comment it would only rebuild the comments template and not the entire thing.
Just wondering… regardless, this mod has helped speed things up quite a bit.
June 5th, 2003 at 9:17 am
Question: Is this mod compatible with MT2.64?
June 5th, 2003 at 10:39 am
Trackback-fiksing
Folk har jo nevnt dette for meg før: at ikke trackbackene blir synlig i et entry med en gang de…
June 5th, 2003 at 11:05 am
Better trackbacking
By now, trackbacks sent to this site should be immediatly available due to the installation of Sean Wilsons mt rebuild…
September 23rd, 2003 at 11:55 pm
get better control over your rebuilds
Adding new tricks to MT is fun, but after awhile, it can start slowing down your rebuilds, especially when comments and trackbacks are posted. Unfortunately, MT doesn’t offer a lot of rebuild options out of the box. Along comes Sean…
October 16th, 2003 at 11:37 am
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.
October 16th, 2003 at 11:37 am
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.
October 22nd, 2003 at 10:33 pm
I’m feeling kind of stupid here, but I’m not quite figuring out whether your script will help people post comments more quickly on my site; right now, the delay is painful as pages are rebuilt.
But if I want to have comment counts updated, don’t I have to update all pages?
November 22nd, 2003 at 3:48 pm
Trackmarklet templates
Laziness has refrained me from publishing the template for On Roll, my trackback-driven sidebar blog. Well, laziness no more. I’m…
January 2nd, 2004 at 1:43 pm
Performance Tuning Movable Type
Performance Tuning Movable Type with MTFastInclude MTOptimizeHTML MTMod
January 4th, 2004 at 5:42 am
Stopping trackback timeouts - at both ends
Ever sick and tired of having trackback pings timeout when you ping other people’s entries? Or do you hate having to clear up after people who inadvertently send you multiple pings? I may have some solutions for you.
January 11th, 2004 at 3:11 pm
MT Rebuilds
I’m working on the slowness issue around here. It takes forever to rebuild when I post and even longer to comment and it’s really becoming annoying. On top of that, I’m sure I’m losing readers because who wants to wait…
January 15th, 2004 at 7:11 am
Will you be creating file version for 2.66?
January 15th, 2004 at 8:22 am
No need, I recopied your changes into 2.66 files. As usual, use at your own risk. Sean, you might want to check this - I don’t have a clue about Perl - I simply searched for your changes and copied where needed.
http://www.aplus.co.yu/4ow/2.66-mod-2-sean-aleck.zip
January 22nd, 2004 at 2:05 pm
MT rebuild mod
MT rebuild mod
January 28th, 2004 at 6:59 am
Fast Rebuilds
As I mentioned in the previous post, comment posting has been a bit slow lately. I timed it at 35 seconds, which is much better than some other weblogs but I think is not acceptable. The problem lies with the…
February 20th, 2004 at 6:43 am
Niccceee pagee
February 21st, 2004 at 12:50 pm
I had this installed before 2.66 and mt-blacklist 1.63, but since the updates I have not replaced this. Can you tell me if this is safe to go ahead, or is there an update coming? I don’t really know much about it and don’t want to screw things up. =)
thank you. =)