1 (edited by Infinity99 2007-08-02 10:48)

Topic: Help integrating my site and punbb?????

Hi,i want to integrate punbb to my site so that my site has a forum
Now,my site already published and it have database for site's activity
I already install punBB to my server and then I'm confused.How can I use my existing user in punBB because it's 2 different database
And then I found someone's tips in this forum which look like this.I already tried it and it didn't work out.Can you please help me??

zalew wrote:

4 situations you must predict and solve the problem


1. user is logging from your site

in your login class, function, script, whatever, put after your operations this:

include("./forum/config.php");
include("./forum/include/functions.php");
setcookie($cookie_name, serialize(array($your_sent_login, pun_hash($your_sent_pass))), $expire, $cookie_path, $cookie_domain, $cookie_secure);

of course the forum directory path may be other in your case.
it sets the coookie for the forum.. as you can see, now when you logon on your site, the cookie is set and you're logged on the forum..


2. if the user logs on by forum

on the top of /includes/common.php put session_start();

in /login.php, find the lines below and put code before:

/ * your site login code in here, session data saving, maybe database update, etc... of course put it in a working way, don't blame the forum smile if it's included ok - it must work */
setcookie($cookie_name, serialize(array($db_username, $form_password_hash)), $expire, $cookie_path, $cookie_domain, $cookie_secure);
redirect($_POST['redirect_url'], $lang_login['Login redirect']);


3. user loggs out from your site

in your private  logging out code put this:

include("./forum/config.php");
include("./forum/include/functions.php");
setcookie($cookie_name, serialize(array('Guest', 'Guest')), time() + 31536000, $cookie_path, $cookie_domain, $cookie_secure);


4. user logging out from the forum

find these lines and put your logging out code

setcookie($cookie_name, serialize(array('Guest', 'Guest')), time() + 31536000, $cookie_path, $cookie_domain, $cookie_secure);
/* here your private logging out code */
redirect('index.php', $lang_login['Logout redirect'])

Re: Help integrating my site and punbb?????

Hi buddy, please do a search before you start a topic. I too have the same problem now.. you can see another guy also asking the same thing. if we are scattered, then we may not get the solution soon. check this topic...

http://punbb.org/forums/viewtopic.php?id=16393

http://punbb.org/forums/viewtopic.php?id=16526

And we ll wait for the help...

God wisely designed the human body so that we can neither pat our own backs nor kick ourselves too easily

Re: Help integrating my site and punbb?????

I did search for the answer,ameenullah.That's why i found the answer in my quote.I just want to know how to modify the code so that it can work in my site cos in my site,for password hashing,I used PASSWORD() function which is hashing function that came with mysql