The Lyceum Database Schema

Lyceum multi-blogifies WordPress and adds almost no other features. The Lyceum database schema, as one might expect, is very similar to the WordPress schema, only adding infrastructure to associate data with blogs. Below is an overview of the differences between the WordPress and Lyceum schemata.

The first thing to notice about the Lyceum schema is the addition of the blogs table. The blogs table has the following columns:

  • id (int) The id number of the blog.
  • slug (varchar) The string that is used in the blog’s base url. http://myslug.blogs.example.com/ or http://blogs.example.com/myslug
  • status (enum: active, deleted) Blogs in Lyceum can be deactivated by a system administrator (from http://example.com/system-admin/blog-management.php?b=system).

The following tables from the WordPress schema have a blog (int) column added to them, which are references to a row in the blogs table:

  • categories
  • linkcategories
  • options
  • usermeta

And lastly, a few additional columns have been added:

  • options: optiondomain (enum: system, blog)
    This keeps track of if an option is relevant to the entire Lyceum system, or just one blog.
  • usermeta: meta_domain (enum: system, blog)
    This column serves the same function as options.optiondomain, described above.
  • users: user_locked (enum: 0,1) and user_admin (enum: 0,1)
    user_locked keeps track of if a user has been restricted from logging into the system (managed from http://example.com/system-admin/user-management.php?b=system), and user_admin is a flag which denotes if a user is a Lyceum system administrator (of the entire system, and nothing to do with any individual blog).

The rest of the WordPress schema and code remain essentially unchanged. You may be wondering why there isn’t a blog column in more or all of the tables. This is because some of the tables are already associated with a blog through a table that does have a blog column. For example, all posts in WordPress must have a category. All categories in Lyceum may only be associated with one blog. Therefore, posts are associated with a blog through their categories, and the posts table does not need a blog column.

New version of Lyceum - 0.20

We’re happy to announce the release of a new version of Lyceum, 0.20. A lot of bugs have been squashed since Lyceum was initially released, and the system has been refined here and there in response to feedback from users on the mailing lists and IRC room.

Special thanks to Jim Groom for submitting a whole bunch of bug reports and to whatup who submitted some very helpful patches and bug reports, and to everyone in the IRC room and the mailing lists who gave me feedback.

You can download the code here, and take a look at the bugs that have been fixed and the features that have been added here.

Give it a try, and let us know what you think.

WordPress hackers needed

While coding Lyceum I often have questions about the WordPress code. It wouldn’t really be appropriate for me to seek help on the WordPress hackers list or IRC room, since my issues aren’t directly relevant to WordPress development.

Are there any WordPress developers/hackers out there who would like to help out Lyceum? If so, join the developer email list, and hang out in the IRC room. I can promise you fame and glory by way of props in trac tickets. :)

SXSW

I’m off to South by Southwest. Keep the bug reports and feedback coming, but I won’t be able to do any coding until I get back from Texas at the end of next week.

If any Lyceum fans out there are going to be at the conference, let me know. I’d love to hear feedback about what folks like about Lyceum, and what they’d like to see in the future.

I’m also going to be swinging by Bar Camp Austin, where I’m going to do at least one session, with my man Coté, on blogging for the enterprise (”inside the firewall”). Coté set up a skunkworks intranet blog system for BMC and has a lot of thoughts on the matter.

I also might do a session on developing an unofficial branch of an open source project. I don’t have a lot of material ready for this but since the sessions are only about 30 minutes, I think it might be worth it if there are enough interested folks.

Making a WordPress theme work with Lyceum

In the next few weeks I’m going to be writing a few articles about Lyceum, including how to make WordPress themes and plugins work with Lyceum.

I’ll throw out this bit of info now for those who want to make their themes work: the most crucial thing is adding one line in comments.php, right under the opening <form ... > tag:

//your theme's comments.php file will have a line that looks something like this
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php"
method="post" id="commentform">
//replace the entire <form … > tag with:
<?php formOpenTag(); ?>

Adding this line should make commenting work. If you have any problems, let me know in the comments below.

update: I updated the above code to fix redirection after comment submission with some themes.

update: I updated the code again. The mod is now much more simple and works with subdomains. Let me know if you experience any problems.

update: Most themes should now need NO modification. If a theme in its virgin state is having trouble, try using this line:

<form action="<?php echo LURL; ?>/wp-comments-post.php" method="post" id="commentform">

No more PHP short open tags

A few folks had trouble using Lyceum because their host does not allow short php open tags (php directive short_open_tag set to 0). This is something I’d been meaning to do for a while but it got lost in the shuffle. Now it’s done.

For those of you who don’t know, here is a short php open tag:

<?

And here is a full php open tag:

<?php

Short tags are bad because they can conflict with xml’s open tag:

<?xml

The nightly on the downloads page has the new code. Let me know if you have any problems.

Help improve the installation instructions

I’ve made a wiki page where folks can help improve the Lyceum installation instructions (found in doc/Installation.txt in the source). Did you have problems installing with a certain version of software, or with a particular shared host? Share what you’ve learned.

http://source.ibiblio.org/trac/lyceum/wiki/InstallationDocumentation

Go at it!

update: the page was deleted for a while, but now it’s back and it’s here to stay.

update: I’ve taken the page offline for now, I’m going to put up a proper wiki for documentation in the near future.

Lyceum launch

The Lyceum launch yesterday went well. It’s great to finally get the word out and get some feedback. The day started out low with a rejected Slashdot submission. But an hour later, the story was accepted on Boing Boing! Yes! Some other folks blogged us, including WordPress creator Matt Mullenweg, who talked about why they went with the N-tables-per-blog database architecture for WordPress MU. I got lots of feedback and questions via email, IRC, tickets, and the blog.

Something that became overwhelmingly obvious is that the installation instructions are a tad on the paltry side. Later today I’m going to throw up a wiki page where the Lyceum team and any interested folks can hash out a better document.