Multi-Blogging Update
I know that Stephen Rider is coming out with an update soon, but I needed another feature that I felt was useful enough to release publicly. I was using the Exec-PHP plugin to embed a call to the print_virtual_sites_list() function in a post on my root site (http://DPotter.net/), like this:
<ul><?php print_virtual_sites_list(); ?></ul>
This worked great, displaying the list of virtual sites. However, on that site my user has the visual editor enabled, so whenever I would edit that post the editor would convert that line to this:
<ul><!--p print_virtual_sites_list();--></ul>
Not good! The solution to this is to use keywords like I’ve seen in other plugins. This also required some changes to the functions provided in the mb-functions.php file.
Here are the keywords that are implemented in the DRP-Multi-Blog Keywords plugin:
- [virtual_sites_list] - Displays a list of sites defined in the wp-config.php file. This is a simple wrapper around the
print_virtual_sites_listfunction. - [virtual_site_name] - Displays the name of the current site as specified in the wp-config.php file.
- [virtual_site_url] - Displays the URL of the current site as specified in the wp-config.php file.
- [virtual_site_config_file] - Displays the name of the configuration file.
- [virtual_site_db] - Displays the name of the database. Could be nothing if not specified.
- [virtual_site_table_prefix] - Displays the table prefix string. Could be nothing if not specified.
The result of these changes is that I can now specify the following line in my post:
<ul>[virtual_sites_list]</ul>
By the way, I previously released my last version as MultiBlog2. That wasn’t a very nice thing to do as I don’t own the name, and when I read that Stephen was going to be releasing v2 of his solution I immediately felt bad. In fact, the more I thought about it, I really should have named my solution something different so that I could version it independently. As a result, I have renamed my solution as DRP-Multi-Blogging. The previous release is now called DRP-Multi-Blogging v1.0 and this one is called DRP-Multi-Blogging v1.1. My apologies, Stephen. Hopefully there won’t be too much confusion out there.
Resources
DRP-Multi-Blog-1.1.zip (7.9 KiB, 1,250 hits)- Stephen Rider’s page on multiblogging




October 30th, 2007 at 7:12 am
My system is somewhat ambiguously named — something I hope to fix in the impending update. However, thank you for thinking of that issue. It would crete confusion.
Question: Am I correct in believing that the keyword functionality you’ve added only works in tandem with the exec-php plugin?
In other words, your main change is that you’ve added compatibility with a particular plugin. Is that correct?
Steve
P.S. — http://txfx.net/code/wordpress/subscribe-to-comments/
October 30th, 2007 at 11:57 am
I developed the keyword plugin because without it you have to have something like Exec-PHP installed so that you can execute PHP code in a post or page, e.g.:
With the keyword plugin you can add the following in visual mode:
While adding this functionality, I figured it might be handy to be able to display other pieces of the site configuration using keywords.
The other main feature I’ve added (mostly in my previous release) is to be able to use a single config file by specifying all the config info in the $vsites array.
Thanks for the reference to the Subscribe to Comments plugin. I was wondering how you implemented that but hadn’t gotten around to investigating it yet. Unfortunately (in this case) I am using Windows Server for my web server and that plugin doesn’t allow you to specify a different mailer (e.g. SMTP, which works for me). I sent email to Mark (the author) and if he doesn’t want to, I’ll look into adding the ability to specify a different mailer.
Thanks,
David