SOFTWARE

MT_Workbench: Movable Type PHP Library

MT_Workbench is a PHP class library that adds administrative capabilities to a Movable Type 3 weblog.

It offers the following features in version 0.1 (beta):

  • close_feedback.php: Automatically close comments and trackback entries for all weblog entries older than one week on all weblogs

Links:

This software was developed by Rogers Cadenhead, publisher of the Workbench weblog and author of Movable Type 3 Bible, Desktop Edition. It has been released under the GNU General Public License.

Warning: Before using the software or any other third-party enhancement for Movable Type, you should make sure that your Movable Type database is being backed up regularly.

The first time you run close_feedback.php, it will close comments and trackback for all entries older than 14 days, rebuilding the archive for each entry. As you would expect, rebuilding an entire site can be a time consuming process, but it only occurs once.

On all runs of the script, feedback will be closed for entries that are from 8 to 14 days old and these entries will be rebuilt. Only the entries that have changed will be rebuilt, so you can run the script daily without unnecessarily rebuilding the same entries over and over.

I'm running the software on MT 3.121, PHP 4.3.2, and MySQL 4.0.20. I think it should work with MT 3.0 or higher, PHP 4 or higher, and MySQL 4 or higher, but that's only a guess.

Copyright 2004 Rogers Cadenhead

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Installation instructions
  • Download the MT_Workbench archive in either tar.gz or zip format and unpack the archive.

  • Save the Perl script mt-rebuild.pl anywhere you like on the Web server. You can store it in the same directory as Movable Type's scripts if you prevent others from running it by using the command chmod 700 mt-rebuild.pl.

  • Save the PHP script close_feedback.php anywhere also.

  • Save the PHP class library mt_workbench_core.php in a directory where it will be accessible to PHP Web pages. I put it in the software's include_path directory, which is often /usr/local/lib/php on new installations.

  • Save the PHP file mt_workbench.php in the same directory as close_feedback.php.

  • The file mt_workbench.php contains configuration settings that must be edited for the script to work. Open the file with a text editor and provide the username and password of the weblog's database, the location of Perl on your server, and the location of mt-rebuild.pl.

  • Because this file contains a MySQL database login, for security reasons it must be readable only by the user running the script. On Linux, I protect it with the commands chown rcade mt_workbench.php and chmod 600 mt_workbench.php.

The close_feedback.php script can be run at the command line:

/usr/bin/php -q /path_to_script/close_feedback.php

The script does not produce any output, routing errors to the PHP error log. On my server, I created a cronjob entry that runs this command each morning at 3:45 a.m.