How to integrate phpBB3 Core / Kernel / API into a CMS?

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
Wahooney
Registered User
Posts: 1
Joined: Wed Apr 06, 2005 6:10 am

How to integrate phpBB3 Core / Kernel / API into a CMS?

Post by Wahooney »

I want to integrate phpBB3 to a CMS, e107, but instead of just framing it or linking to it, I would like to rather wrap phpBB3's core / kernel / API / whatever so that it integrates properly with e107, using e107's themes, users, user management, etc.

Ideally I would like to leave the phpBB3 code untouched so that if there are any modifications / patches to phpBB3 I just need to unzip it to the correct place and have it work.

Has phpBB3 been written with something like this in mind or is the code too interwoven to allow it?

Any help or advice would be greatly appreciated.

Thanks.
zlisiecki
Registered User
Posts: 1
Joined: Fri Jan 25, 2002 1:38 pm
Location: Warsaw
Contact:

Re: How to integrate phpBB3 Core / Kernel / API into a CMS?

Post by zlisiecki »

Hi, I don't answere your question, but I add my own.
I need to integrate phpbb with another php software. Therefore I suppose we might think at least about some guidelines how to construct properly a general interface. What I need are three functions:

f1. check if a topic with a subject given as a string exists
f2. call viewtopic with this subject, or with a topic_id found in f1
f3. call posting editor window with fixed subject provided by caller

All of them should preserve as much as possible of subsystems, at least the subsystem of permitions. For the first function I must properly log in and keep the SID. The second one is trivial. For the third one I added:
$atitle = request_var('a', '');
parameter to posting.php and transfere the subject by GET from the url.

I suppose one may construct CMS interface also with functions of some common php interface to the phpbb. Could somebody give us an advice how to make this interface the simplest ? Has this been already discussed ?
zbyszek
Quantum P.
Registered User
Posts: 1
Joined: Fri Feb 11, 2005 2:14 am

Re: How to integrate phpBB3 Core / Kernel / API into a CMS?

Post by Quantum P. »

I've got a website that's running phpBB, and I would also like to know if there is an official way to integrate a PHP-based site with phpBB3. I mostly just want to be able to find out who the current user is, but permissions information would also be helpful.
Crise
Registered User
Posts: 4
Joined: Wed Aug 15, 2007 7:49 pm

Re: How to integrate phpBB3 Core / Kernel / API into a CMS?

Post by Crise »

Code: Select all

if(!defined('IN_PHPBB')) {
	die("<strong>Illegal Access!</strong>");
}

$phpEx = substr(strrchr(__FILE__, '.'), 1);
$phpbb_root_path = "path/to/phpbb/";

include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
This is almost directly from the index.php file of phpbb3 (note: the parameter passed to $user->setup(), affects things such as contents of $user->lang array) also as far as I know functions_display.php is not a requirement just contains functions for display purposes (hence the name ;))

Oh and above already alone gives you access to lot of phpbb functions (template engine being my personal favorite), but if you need more than what this gives, just look around the phpbb files, and learn from what you see...

ps: as for official way I have no Idea, but this works for my needs anyways, there is phpbb fetch all modification (or should I rather call it a wrapper of a kind), which has set of functions that makes integrating sites with phpbb easy (however a) phpbb3 update is not ready yet and b) I still advice you to write your own code)
TigerWolf
Posts: 18
Joined: Mon Jul 03, 2006 7:10 am

Re: How to integrate phpBB3 Core / Kernel / API into a CMS?

Post by TigerWolf »

Post Reply