Topic: Using PunBB with an existing community website?

Hi,

I have been browsing around PunBB and this forum and I like the style of it. I would like to integrate a similar BB to my existing community website.
However, after reading few posts, it seems that PunBB cannot re-use an existing user database.
All members on my site already have a username/pwd.

I would like to do the following:
- Members who have logged into the site, can go to the forum section and won't need to log in again
- Visitors who didn't log in, can go to the forum section but won't be able to post and so on. The regisration/login will be done by the site, not the forum.
- Post author information (username, picture, ...) will come from their profile on my community site.

Is it something feasible or I should look for another BB?
I cannot change my existing login/authentication (session based) process in the community website to be replaced by the one of the forum.

Thanks,
Julien

Re: Using PunBB with an existing community website?

Well, the way I would suggest is to integrate PunBB's registration/login system into yours. So when someone registers, it inserts a row in the table you use and PunBB's table. When a user logs in, it sets a PunBB cookie for them as well. When a person updates their profile, it updates the appropriate field in PunBB as well.
For existing users, you can either write a script to insert them as users in the forum or you could modify your login process so that if the person doesn't have a valid forum account it will be created for them at login
You should probably disable some features (like editing your profile in PunBB, logging in/registering in PunBB, etc) so that everything stays in sync.

3

Re: Using PunBB with an existing community website?

We made a Nucleus CMS to PunBB bridge plugin that does some of the things you'd like to do.

Have a look at the plugin and you can use some of the code for your own purposes.

http://www.punres.org/desc.php?pid=295

Re: Using PunBB with an existing community website?

Let's see if I understood right.
I modify my site registration code to create members in both my site DB and punBB DB with the same username and pwd.
When a member log into the site, I create a punBB cookie containing that username so punBB thinks he registered in the forum already.
Ok, then how do I replace the login box and register button in punBB to be the one pointing to my community site?

Can I disable the profile function in punBB?
Also, I would like to change the code in the author box on the left.
E.g. when I click on "Smartys", it would make a request to my community site to retrieve that profile.
And there would also be more fields showing in that box retrieved from my community DB (profile image, ...)

I will look into that bridge code as well.

Thanks for your help so far.

Re: Using PunBB with an existing community website?

KangooSin wrote:

Let's see if I understood right.
I modify my site registration code to create members in both my site DB and punBB DB with the same username and pwd.
When a member log into the site, I create a punBB cookie containing that username so punBB thinks he registered in the forum already.
Ok, then how do I replace the login box and register button in punBB to be the one pointing to my community site?

I believe the links are in include/functions.php

KangooSin wrote:

Can I disable the profile function in punBB?

No, but you could certainly delete profile.php and replace it with a proper redirect to your profiles.

KangooSin wrote:

Also, I would like to change the code in the author box on the left.
E.g. when I click on "Smartys", it would make a request to my community site to retrieve that profile.
And there would also be more fields showing in that box retrieved from my community DB (profile image, ...)

Modify viewtopic.php smile


For all of this, keep in mind that you might be able to simply things by adding a column to PunBB's user table. The column would store the user ID from your main site. That way, joins (like the viewtopic.php joins you were talking about) would be quicker and more efficent.