About this blog

Hi folks, Jamie here.

I'm a web developer at the Ionic Business Systems.
I blog about web development, content management systems, design, user experience and anything else that comes to mind.

Feeds

Create batches of Movable Type blogs using PHP script

UPDATE: This post is out of date. You can now use the web based MovableType AddOn to create batches, bunches or a multiple of user and blogs in one go with this addon.

This is a command line based script I wrote to create batches of Movable Type blogs. It works on Movable Type 3.34. Please note that before trying this you’ll need to backup you Movable Type database.

Download PHP files

You will need to create the directory on the web server for each blog you intend to create.

To run the script, run the following script on the command line:

php autoblog.php user_details1.txt

The script will insert blogs with the details given in user_details.txt file with templates given in insert_TSSGBlog_template.sql

When the new user logs into Mpvable Type for the first time he will need to click ‘Rebuild’ to load in our templates.

There are 4 files needed, they are:

user_details.txt

Information describing the blogs you wish to create.

common.php

The mysql database details needed to connect with the MYSQL database used by Movable Type.

autoblog.php

Processes the user_detalis.txt file and inserts the details for each blog into the Movable Type database.

insert_TSSGBlog_template.sql

This is the SQL statement this is used in autoblog.php to create the templates for the bog. To insert you own templates here you need to find the correct SQL statement required. One way to do this is to determine the changes made when to the Movable Type database when a blog is created. I found PHPMyAdmin useful to determine this.

To do:

  • Create a web-front to allow the creation of batches of blogs via a browser.
  • Currently the directory for each blog needs to be created before running the script. Considering sing the PHP exec command to create the directory as part of the script.
  • Kick of the ‘Rebuild’ Movable Type feature after a blog is inserted so the user does not need to do this.

If you would like to contribute/add/edit this script, feel free.

Need help? Contact me

One Response to “Create batches of Movable Type blogs using PHP script”

  1. Idetrorce

    December 15th, 2007 at 12:27 pm

    very interesting, but I don’t agree with you
    Idetrorce

Leave a Reply