Did you get any answers to this? I’m hunting for exactly the same thing!
Did you get any answers to this? I’m hunting for exactly the same thing!
I’m closer. I tried a PHP include in a WordPress template which threw up some variable conflicts. After thinking it through a little more, a page include would screw up MediaWiki’s URL and link structure I think.
What I’m working on now is having a MediaWIki theme call the WordPress header and footer wrapping all of the wiki in WordPress without toying with variables or link structure.
I’ll post the results when and if I get it working.
Did you get any answers to this? I’m hunting for exactly the same thing!
Just in case you or anyone else is following this and curious, I got it done and it was amazingly easy.
Add
require_once(dirname(__FILE__) . '/../wp-load.php');
to LocalSettings.php in Mediawiki. Make sure to change /../wp-load.php the the path to your WordPress install relative to Mediawiki’s root directory
Then, in your Mediawiki theme file, place somewhere near the top:
get_header( $name );
It needs some pretty intensive CSS hacks to get everything to line up, but this will add the WordPress header to every Mediawiki page.
Thanks HittingSmoke, this is great!
Note that I had to change $name to $this->name() for WP 3.x. Otherwise it was serving me the wordpress home page inside the wiki.
I’m using this in conjunction w/ WP-United. This integrates PHP forums inside of a WP install. I had to add another ‘require_once’ line :
require_once(dirname(__FILE__) . '/../forum/wp-united/functions-general.php');
I also had to hack one of the wp-united files that sets $phpEx. I just hardcoded it to .php for my system. And I had to add a symlink to wp-united inside the wiki directory
ln -s ../forum/wp-united .
Once I have all the kinks worked out, I’ll post the integration of the three.
Others, note that you can also add this in your wiki template :
<?php get_footer( $this->name ); ?>
To round-out the integration.
Cheers,
-m
Including wp-load.php in LocalSettings.php causes an error with Mediawiki 1.16 and WordPress 3.0.5:
PHP Fatal error: Call to undefined method user::newfromsession() in /var/www/htdocs/wiki/includes/StubObject.php on line 190
Including wp-load.php in LocalSettings.php causes an error with Mediawiki 1.16 and WordPress 3.0.5:
PHP Fatal error: Call to undefined method user::newfromsession() in /var/www/htdocs/wiki/includes/StubObject.php on line 190
This is because of phpBB/Wodpress integration. If you have Mediawiki AND WordPress using phpBB for auth, the user class loaded by the WordPress session with conflict with Mediawiki’s.
If you disable WordPress/phpBB integration it will fix the issue. I’m trying to find a way to make it work with WP/phpBB login integration but so for no luck.
I replaced Mediawiki with Wikka Wiki and all is good again.
Just place:
require_once(dirname(__FILE__) . '/../wp-load.php');
inside wikka.config.php and place:
get_header( $name );
inside /template/default/header.php
So is it possible to integrate MediaWiki with WordPress without using phpBB or WP-United?
Do any of you who got this working feel up to posting a link so we can see how it came out.