Extension:WikiToWordPress

Purpose
Some people may have been using WordPress Comments, an extension that allows comments made in a Wordpress blog to be displayed in a Wiki page, and even allowing Wiki users to comment directly from the wiki, thus replacing the usual Talk Page system which is rather counter-intuitive for new users. The extension did a great job, but the problem for me was that I wanted not only wiki users to be able to add comments to WordPress, but I also wanted new pages created by wiki users to appear as new posts on the Word Press blog. The extension here does just that. I just made it yesterday, it's experimental, but it does the job for what I wanted it to do. If you want more features, just ask it in the Talk Page here and I'll see what I can do. For now it only looks for a new article in which it can find the following characters :. If it finds this sequence of characters in the wikitext of a newly created page, it publishes the new article to a Wordpress blog.

Usage
Can be used in combination with WordPress Comments, and CreateBox and optionally DynamicPageList to produce a complete free post & comment collective blog, similar to the news system of EmuWiki.com. As you will see in the installation proccess, this is a combined extension that needs to be installed both on the MediaWiki side AND on the Wordpress side.

Installation
1. Install Wordpress in any directory of your server (I use /wordpress/ from the main MediaWiki directory).

2. Copy the code in a file called WikiToWordPress.php and place that file in YOURWORDPRESSDIRECTORY/wp-content/plugins/.

3. I did not make it user-friendly because it's experimental. You will need to make 3 changes to the code:


 * First on Line 25 change YOURWORDPRESSDIRECTORY to the main directory where you have installed Wordpress.


 * Second, on Line 33, you can change to whatever you want the program to scan for. This is the string that the program will look for in new MediaWiki Articles to determine if it needs to be sent to the Wordpress blog. I used the News category because I only wanted articles from the News category to be included in the collective blog, but you can use any string of text.


 * Third, on Line 34, beside the 'flags', there is the number 7. This is a flag that indicates to only publish newly created articles, not articles that are just being edited. If you want any edited article to be republished in Wordpress everytime it is edited in MediaWiki, then change this number to 8.

4. You need to install the plugin in Wordpress. For this, log in as administrator in Wordpress and at the top right corner in your dashboard, you will see the Plugins option. Click on it and you should see WikiToWordPress listed as deactivated. Activate it.

5. Include the extension in MediaWiki by changing and adding this line to your LocalSettings.php:

6. WikiToWordPress is now installed, and it will publish in your Wordpress blog any newly created MediaWiki article that contains a given string. But I strongly encourage you to install WordPress Comments, and CreateBox and optionally DynamicPageList because WikiToWordPress was designed to be used with these extensions just like we did for the news system at EmuWiki.com. Sorry for crappy code, this is my first PHP program and I'm not a programmer.

Related extensions

 * WordPress Comments
 * CreateBox
 * DynamicPageList