将phpbb完全整合到现有网站中 [英] Full integrate phpbb into existing website
问题描述
我有一个运行大约2-3年的网站,它拥有自己的论坛,但是最近我想使用phpbb3代替该论坛.我需要集成时遇到问题.
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 .
确切地说,我有一个现有的数据库,其中包含为我自己的网站设计的字段.我想做的是旧用户,无需再次注册,就可以使用其提供的所有功能登录phpbb论坛(例如,检查个人资料).有什么办法可以实现这种转换?
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']];
}
}
?>
推荐答案
您可以使用user_add
功能在新论坛中为所有用户创建一个帐户.有关如何执行此操作的详细信息,请参见phpbb Wiki:
https://wiki.phpbb.com/Add_users
https://wiki.phpbb.com/Function.user_add
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
这篇关于将phpbb完全整合到现有网站中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!