Full integrate phpbb into existing website

旧城冷巷雨未停 提交于 2019-12-31 17:35:32

问题


I have a website that runs for around 2-3 years before, it has its own forum, however, recently I would like to use the phpbb3 to replace that forum. I encounter the problem when I need to do integration .

To be precise, I have an existing database that have fields designed for my own website. What I would like to do is the old user do not need to register again and can login to the phpbb forum, using every functions it provided (e.g. check profile) . Are there any way to implement such conversion?

So far I have got some source code to check login, but there are a lots of works should be done for full integration ? e.g. create forum profile for old user? Are there any step-to-step guide? Thanks for helping.

<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../phpBB3/'; //the path to your phpbb relative to this script
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include("../phpBB3/common.php"); ////the path to your phpbb relative to this script
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

$username = request_var('username', 'john');
$password = request_var('password', '123');

if(isset($username) && isset($password))
{
  $result=$auth->login($username, $password, true);
  if ($result['status'] == LOGIN_SUCCESS) {
    echo "You're logged in";
  } else {
    echo $user->lang[$result['error_msg']];
  }
}

?>


回答1:


You can create an account in the new forum for all your users with the user_add function. Details on how to do that can be found in the phpbb wiki:
https://wiki.phpbb.com/Add_users
https://wiki.phpbb.com/Function.user_add

To authenticate the users against the new forum you can use External Logins



来源:https://stackoverflow.com/questions/19241385/full-integrate-phpbb-into-existing-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!