Andy's Blog » » OSC与IPB2.0.4的整合代码

OSC与IPB2.0.4的整合代码

这里贴出的是INVISION POWER BOARD 2.0.4的连接代码,步骤及相关修改参考“OSC与Discuz2.5F的整合代码

ipb.php代码

<?php
 
if($forum_nick!='') {
 
require (DIR_WS_IPB . 'conf_global.php');
 
require(DIR_WS_IPB . 'ips_kernel/class_converge.php' );
 
mysql_connect($INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass']);
 
mysql_select_db($INFO['sql_database']);
 
$md5_once = trim(md5($password));
 
$converge = new class_converge( $DB );
 
$salt = $converge->generate_password_salt(5);
 
$key = $converge->generate_auto_log_in_key();
 
$rpass = $converge->generate_compiled_passhash($salt, $md5_once);
 
$salt = str_replace( '\\', "\\\\", $salt );
 
$time = time();
 
$title = 'member';
 
$query_name = mysql_query("SELECT COUNT(*) FROM ".$INFO['sql_tbl_prefix']."members WHERE name='$forum_nick'");
 
if(mysql_result($query_name, 0)) {
 
mysql_close();
 
} else {
 
mysql_query("INSERT INTO ".$INFO['sql_tbl_prefix']."members (name, mgroup, email, joined, ip_address, posts, title, last_visit, last_activity, member_login_key) VALUES ('$forum_nick', ".$INFO['member_group'].", '$email_address', '$time', '', '', '$title', '$time', '$time', '$key')");
 
mysql_query("INSERT INTO ".$INFO['sql_tbl_prefix']."members_converge (converge_email, converge_joined, converge_pass_hash, converge_pass_salt) VALUES ('$email_address', '$time', '$rpass', '$salt')");
 
mysql_query("INSERT INTO ".$INFO['sql_tbl_prefix']."member_extra (signature, vdirs) VALUES ('', '')");
 
}
 
}
 
?>

注意:需要改数据库member字段的ID为自动增加

感谢radnows分享.

Tags:

本文地址: http://blog.21andy.com/20050831/34.html

1 评论 to “PHP开源CMS之MODx”

  1. John 于 2011-02-10 18:00:09 发表:

    Hi, Andy, 可否帮我弄个osc 2.3.1 和 ipb 3.1.4 的整合代码?非常感谢。

    我的QQ:65016198