Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have WordPress, set to multisite with subdirectories, installed at /, and a phpBB forum at /forum.

Both sites are visually integrated, and share a common login process. I'd now like to integrate them further, for my ease of administratio; I want to use WordPress' header image, menu, footer and a few other theme related functions on my phpBB forum.

  1. Is it even possible to embed WordPress in other pages?
  2. How would one use them in the phpBB template files? (bonus question)

(this question isn't fully tagged, since I don't have enough rep to make new ones yet).

share|improve this question
add comment

3 Answers

You could simply include the WordPress main file that it loads, wp-load.php or wp-blog-header.php at the very top of your forum's header file.

If I'm correct, that should allow you to use WordPress functions inside your forum theme.

Example, at the top of your header, assuming the forum folder is in the root WP folder:

<?php include '../wp-load.php'; ?>

share|improve this answer
    
I believe this would work as well. I've used this technique to pull WP data into a non WP page before. There's a good Write up on CSS Tricks about it. –  Jason Bahl Jan 30 '12 at 2:18
    
I seem to just get a blank page when adding it into my phpBB theme. No idea why (the path is correct). –  rikkit Feb 5 '12 at 1:57
add comment

This is possible to do in many few ways. How I would do it (I'm not suggesting it's the best way, it's just the way I think is the path of least resistance) is going to be to setup a page on your WordPress site and use a custom page template. That template can include everything you want to include, and then you can use curl, file_get_contents, or another method to grab it over http. I would recommend making this template output XML and wrapping your elements appropriately. For instance,

<elements>
   <siteheader>...</siteheader>
   <sitemenu>...</sitemenu>
</elements>

When you download the XML file, you'll want to cache it so that every phpBB page hit doesn't also require a hit to your WP site. In your phpBB code, you would parse the XML and use the parts as needed.

I would do it this way for three reasons:

  1. By loading the file over your domain, you'll always retrieve the correct content from the correct blog and not have to worry about setting the global blog_id, etc.
  2. This affords you the ability to scale horizontally and put phpBB on one server and WP on another someday.
  3. Your system will be more orthogonal, which makes it easier to maintain and test, as well as being generally more agile.

I hope this is clear enough; I can provide more examples if needed.

Cheers~

share|improve this answer
add comment

Why not make the entire site run on WordPress? Import the phpBB into WordPress and you have one common platform. Use http://wordpress.org/extend/plugins/forumconverter/ & http://wordpress.org/extend/plugins/bbpress/ .

share|improve this answer
    
Aye, I might look into this future. I just don't have the time to do anything like this now, and I don't want to annoy my userbase with potential downtime either. –  rikkit Jan 30 '12 at 0:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.