Post imported by Google+Blog for WordPress.
Tag: wordpress
Posting to WordPress MU by Email Part 2
THIS POST IS OBSOLETE
Warning: This post contains material of a technical nature, if you start reading and feel dizzy or nauseous then stop reading immediately and go and lie down.
This is a follow up to my previous post where I outlined a prototype of an extension for WPMU which allowed posting to multiple blogs from one centralised POP3 account which collected all posts from all users of all blogs. This is very different from the usual way of doing it where you either go out to get the emails from external email addresses or you have multiple local accounts.
Well the prototype has, like Frankenstein’s Monster, come alive and it’s now got configuration screens and lots of rich techy goodness to it.
I’m not going to go over the instructions on how to configure the MTA again, those are documented on my last post, and in the notes in the downloadable archive :
Post by Email-v1.zip – file removed
The Archive also contains instructions on where the TWO files need to be placed for the system to work.
What I’m going to cover here is the new features that I’ve added since the last post. Yes I have way too much time on my hands, but this is keeping my brain sharp so its all good at the end of the day.
These can be broken down into to distinct groups which are reflected in the two new options that will appear on the Settings menu:
Blog Level Options
These are options which are set by the blog administrator or blog owner:
Default Category for posts : This is a drop down of all categories and you select one to be the default category for posts without a category override
Optional Categories: This is a tick box list of all other categories in your blog, Toggle the ones you want users to be able to use in their category override.
Allow Posting By: This is a tick box list of all the user who are members of your blog. Toggle the ones you want to be able to use the post by email. This will include YOUR address and by default no-one of them are checked (which basically deactivates the system for your specific blog).
User Level Options
These are options which are set on a user by user basis.
Personal Identifier : This is a optional text string which allows users to “secure” their posts. If this has been set then posts from them will be rejected outright. So set this to something good but memorable as you’ll have to provide it for each post.
Alternative Email: This allows you to nominate a secondary email address which the system will accept emails from. If you do not set this then posts will only be accepted from the email address registered to your account.
Additional Posting options
To support the “new” features there are now some additional posting options which you set at the top of your email.
wppbm-categories: A comma separated list of category names for this post. NOTE: This is names not numbers which makes it easier to remember (or are you so sad that you know the underlying IDs of your categories). You’ll find a list of the available categories on your user settings page. So assuming that the Administrator has enabled them you could do something like: wppbm-categories : computing,witterings which would post your post with those categories. If you do not specify this line then the default category set by the Administrator will be applied.
wppbm-pid: Your PID. If you’ve set your PID then you have to provide it here. If you’ve set it and don’t include it (or get it wrong) then your post is toast!
Tweaking a Calendar for WPMU.
NOTE: Kieran has made a newer version of his plugin which works with WordPress MU and integrates by using an embedded Calendar tag to display the calendar.
So basically I’m abandoning this plug in and suggest you get Kieran’s new version instead. That is what I’ve put on this site.
This is basically Kieran O’Shea’s WP Calendar plugin for WordPress tweaked to work with WPMU with a couple of additional features.
1) Calendar table created for each user
2) The Calendar is wrapped to work in multiple templates without needing a file in each template. See the section below for more on this
3) Input and Display date formats on the Admin screen can be changed by the administrator.
Installation.
1) Drop the files from the archive into the matching folders in your WPMU installation
2) Edit the edit-calendar file and change the $eddateformat and $eddatesep variables to match your date format (by default it they are set to d/m/Y and / as I’m in the UK).
3) Enable the Plugin
4) Edit your .htaccess file and add the lines in the add.htaccess file towards the top
5) If you want to use my template wrapping then you need to use the wp-calendar.php file that I have provided along with the two tag files (edited to support your templates). If you dont want to use it then you need to install the calendar file manually into each template (but you dont need the tag files)
Template Wrapping.
I use Template Wrapping a lot – it allows me to easily drop cross blog functionality into the blogs without having to create a new page template in each blog. For example the calendar page only exists at the top level – there are NO files in any of the templates for the calendar, the structure of the page round the calendar is created using the two tag files and a couple of calls in the file containing the call to the calendar code
To enable template wrapping you need to do the following:
1) Drop the wp_opentags.php and wp_closetags.php files into the top level of your WPMU installation
2) Create a new file from the empty_page.php file
3) The new page can now be accessed from each blog.
You will find that you need to edit the wp_opentags and wp_closetags files to work with your templates. This can take a while due to the way different people build their templates and no hard and fast rules on opening and closing DIVs in the header,page and footer.
A Zip file of the various files including my wrapper files is available for download
If you have any comments, suggestions etc then please post them as comments.
You can see the calendar in action here
Last.FM Widgets Plugin
Well I’ve got version 1.0 of my Last.FM Widgets Plugin working. I’ve trimmed some of the extra bits out that Last.FM include in their plugs (just to make things tidy) but retained about 95% of what was there.
It supports all the standard lists and the two standard “Quilts”. One of more of the Widgets can probably be found in the side bars on this blog.
The options page allows you to configure your Last.FM ID, Select the colour (from Last.FM’s limited list) of the plugin and the size of the quilt.
I’ve tweaked it so that the plugin has a transparent background and should always be the same width as your side bar.
Its a normal Plugin so if you are using WPMU you can put it in the plugins folder. I’ve not tested it against standard WP but I can’t believe there is anything odd in there that would stop it working.
Please feel free to try it and let me know if there is anything obviously wrong with it:
You can download the latest version here
Update: Its now V1.6 – I’ve tidied up some of the code and removed some stuff that was no longer used! I’ve also added two Radio Widgets (artist like and Genre) and put these two options onto the general configuration page. At V1.6 I added a playlist widget
Combining blogs
Well today I decided to pull over all my old posts from the blog on Camsigh.
Using the export and import features of WordPress made it a breeze.
Now all I have to do is go through all the posts, remove a few that are now redundant, put each post into the correct categories and then tag the posts with appropriate tags.
Was it all Worth it?
Well I sat down the other day and decided that I wasn’t happy with how Camsigh looked. I’d bolted a Blog mod onto the PHPBB forum and it was having problems with spammers and the code was rather messy. I’d also got functionality in the main board that I didn’t actually use – basically because it had been superceded by RSS feeds.
So I looked around and found that I liked WordPress and someone actually did a plug in that integrated it into PHPBB.
So some hacking around of WordPress and PHPBB and some tidying up and it all looked good.
To finish it all off I moved the board. Camsigh had been sitting in /board/ on one of my domains and I wanted to tidy things up so I registered another domain through DynDNS and made the appropriate adjustments inside the Board to get it working. I then put a rewrite command in the .htaccess file in the original directory to do forced re-writes to the new domain. Finally as I’d been doing all the reconfiguration work in a new database I had to export the user posts and private messages, search and replace any domain references (I use a PHPBB mod that allows you to upload and insert pictures) which had got buried in the posts.
Did I say that was it? Well it wasn’t: I then moved the posts from the old Blogging system into WordPress. Its not 100% correct but its near enough. There also seem to be a few navigational issues… which I’m looking into