我有一个运行了大约 2-3 年的网站,它有自己的论坛,但是,最近我想用 phpbb3 来替换那个论坛。当我需要进行集成时遇到问题。
准确地说,我有一个现有的数据库,其中包含为我自己的网站设计的字段。我想做的是老用户不需要重新注册,可以登录phpbb论坛,使用它提供的所有功能(例如检查个人资料)。有没有办法实现这种转换?
到目前为止,我已经获得了一些源代码来检查登录,但是要完全集成还有很多工作要做吗?例如为老用户创建论坛资料?有没有分步指南?感谢您的帮助。
<?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']];
}
}
?>