I am in the midst of converting Wordform’s architecture into supporting multiple weblogs. The procedure I worked out, over coffee at Border’s, is the following:
Pull the SQL statements out of all the application files and incorporate them into one file. The reason for this is to help me identify all of the SQL bits the application is using, and make sure none are missed. This also makes it easier to make changes to the underlying SQL in the future — as all of the database accesses will be in one spot.
Update the database. I’m adding blog identifier to most of the tables, but I’m also splitting the options table into a weblog information table and an options table, and adding some foreign key relationships. At this time, I’m using a default weblog identifier until the program pieces are in place to add weblogs.
Modify the program to set a default blog identifier, and then adjust all the functions accordingly.
Once the backend components are in place, I’ll front end pieces. The first will be to add a section to pick a weblog from an existing list, or choose to create a weblog in the what used to be Dashboard. Picking an existing weblog will set the globally accessible weblog identifier within the administration tool.
Creating a new weblog is a bit tricky with PHP, because the application doesn’t have general write permissions. A new .htaccess file, index.php, and word-contents subdirectory need to be created in the new location of the weblog. Either the create weblog routine will provide the how-tos, or more likely, have the person make the subdirectory writeable temporarily.
Other than the tricky bits, the rest of the weblog creation is simple — just data collection.
The base installation of Wordform is very simple, meeting the needs of most users. The multiple weblog capability is being added to the code, but the actual front-end pieces are being create as a Wordform extension — pages that can be dropped into the tool’s administrative interface. The capability for this also requires several backend code changes.
First, the post status and comment status are being pulled in from the database, to make these adjustable via extension or plugin. Next, the menu data that runs the top navigation tags for the application is also being pulled in from a database, again so these can be easily updated with administration extensions. Finally, the former dashboard is being modified in a couple of different ways.
First, the list of extensions is displayed, with an option to uninstall each. (Unlike plugins, administration extensions can be installed or unintalled, but can’t be turned on and off). Next, the main area of the page is dynamic, just like the weblog posts themselves. With this, extension developers can create content for this area for hooking their extension in as needed. For instance, with the multi-weblog extension, the extension will add code to list the weblogs, allowing the person to select from the list. This list will be filtered to just those who have been given access to the weblog.
The multiple weblog extension itself will consist of a couple of files that are copied to the administration subdirectory, and loading one page that makes the appropriate database updates. Refreshing the admin site in the browser will then show the new extension in place, with all the appropriate backend goodies in place to use it.
My plan is to have these bits in place by New Years and then release a first cut of the code. All of this should be sufficient enough to make Wordform a unique product by that time.