1
StarShaper
vBulletin-XOOPS Registration
  • 2006/5/19 5:31

  • StarShaper

  • Just popping in

  • Posts: 29

  • Since: 2005/7/25


Because there is no module/plugin to integrate a vBulletin 3.5.x Board into XOOPS I decided to write a registration and login bridge. If you want to do the registration only about your vBulletin form you can use the following plugin:

<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
    <plugin active="1" product="vbulletin">
        <title>XOOPS_Registration_First</title>
        <hookname>register_addmember_complete</hookname>
        <phpcode><![CDATA[// Define tables and database
define("XOOPS_TABLE_PREFIX", "xoops__");

$tmp_xoops_uid = "NULL";
$tmp_xoops_uname = $vbulletin->GPC['username'];
$tmp_xoops_loginname = $vbulletin->GPC['username'];
$tmp_xoops_name = "";
$tmp_xoops_email = $vbulletin->GPC['email'];
$tmp_xoops_user_avatar = "blank.gif";
$tmp_xoops_pass = $vbulletin->GPC['password_md5'];  // Since vB uses md5(md5(password . salt)),
                                                    // we have to do this and call a second plugin later!
$tmp_xoops_rank = 0;
$tmp_xoops_level = 1;

// Fill in data into XOOPS user table
$db->query_write("INSERT INTO " . XOOPS_TABLE_PREFIX . "users (uid, uname, loginname, name, email, user_avatar, pass, rank, level)
                  VALUES ('$tmp_xoops_uid',
                          '$tmp_xoops_uname',
                          '$tmp_xoops_loginname',
                          '$tmp_xoops_name',
                          '$tmp_xoops_email',
                          '$tmp_xoops_user_avatar',
                          '$tmp_xoops_pass',
                          '$tmp_xoops_rank',
                          '$tmp_xoops_level')");

// Data for XOOPS user_profile table
$tmp_xoops_profileid = "NULL";
$tmp_xoops_umode = "nest";
$tmp_xoops_uorder = 1;
$tmp_xoops_notify_method = 2;
$tmp_xoops_notify_mode = 0;
$tmp_xoops_user_regdate = 0;    // TODO: Add this variable later!
$tmp_xoops_posts = 0;
$tmp_xoops_attachsig = 0;
$tmp_xoops_timezone_offset = "0";
$tmp_xoops_user_mailok = 0; // TODO: Add this variable later!
$tmp_xoops_theme = "0";
$tmp_xoops_actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);    // This is from XOOPS source
$tmp_xoops_last_login = 0;    // TODO: Add this variable later!
$tmp_xoops_user_aim = "";
$tmp_xoops_user_icq = "";
$tmp_xoops_user_from = "";
$tmp_xoops_user_sig = "";
$tmp_xoops_user_viewemail = 0;
$tmp_xoops_user_yim = "";
$tmp_xoops_user_msnm = "";
$tmp_xoops_bio = "";
$tmp_xoops_user_intrest = "";
$tmp_xoops_user_occ = "";
$tmp_xoops_url = "";
$tmp_xoops_newemail = "";
$tmp_xoops_pm_link = "<a href="java script:openWithSelfMain(''{X_URL}/modules/pm/pmlite.php?send2=1&to_userid={X_UID}'', ''pmlite'', 550, 450);" title="Write a message to {X_UNAME}"><img src="{X_URL}/modules/pm/images/pm.gif" alt="Write a message to {X_UNAME}" /></a>";

// Fill in data into XOOPS user_profile table
$db->query_write("INSERT INTO " . XOOPS_TABLE_PREFIX . "user_profile
                  (profileid, umode, uorder, notify_method, notify_mode, user_regdate, posts, attachsig, timezone_offset,
                   user_mailok, theme, actkey, last_login, user_aim, user_icq, user_from, user_sig, user_viewemail,
                   user_yim, user_msnm, bio, user_intrest, user_occ, url, newemail, pm_link)
                   VALUES ('$tmp_xoops_profileid',
                           '$tmp_xoops_umode',
                           '$tmp_xoops_uorder',
                           '$tmp_xoops_notify_method',
                           '$tmp_xoops_notify_mode',
                           '$tmp_xoops_user_regdate',
                           '$tmp_xoops_posts',
                           '$tmp_xoops_attachsig',
                           '$tmp_xoops_timezone_offset',
                           '$tmp_xoops_user_mailok',
                           '$tmp_xoops_theme',
                           '$tmp_xoops_actkey',
                           '$tmp_xoops_last_login',
                           '$tmp_xoops_user_aim',
                           '$tmp_xoops_user_icq',
                           '$tmp_xoops_user_from',
                           '$tmp_xoops_user_sig',
                           '$tmp_xoops_user_viewemail',
                           '$tmp_xoops_user_yim',
                           '$tmp_xoops_user_msnm',
                           '$tmp_xoops_bio',
                           '$tmp_xoops_user_intrest',
                           '$tmp_xoops_user_occ',
                           '$tmp_xoops_url',
                           '$tmp_xoops_newemail',
                           '$tmp_xoops_pm_link')");]]></phpcode>
    </plugin>
    <plugin active="1" product="vbulletin">
        <title>XOOPS_Registration_Second</title>
        <hookname>register_activate_process</hookname>
        <phpcode><![CDATA[define("XOOPS_TABLE_PREFIX", "xoops__");

// Fetch data from vB user table
if ($tmpvbresults = $db->query_first("SELECT username, joindate, lastvisit FROM " . TABLE_PREFIX . "user WHERE userid = " . $vbulletin->GPC['u']))
{                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             $tmp_xoops_actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);    // This is from XOOPS source
    // Fetch data from XOOPS users table, insert into groups_users_link and update user_profile
    if ($xoopsresults = $db->query_first("SELECT uid FROM " . XOOPS_TABLE_PREFIX . "users WHERE uname = '" . $tmpvbresults['username'] . "'"))
    {
        $db->query_write("INSERT INTO " . XOOPS_TABLE_PREFIX . "groups_users_link (linkid, groupid, uid) VALUES ('NULL', '2', '" . $xoopsresults['uid'] . "')");                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            $tmp_xoops_actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);    // This is from XOOPS source
        $db->query_write("UPDATE " . XOOPS_TABLE_PREFIX . "user_profile SET user_regdate = " . $tmpvbresults['joindate'] . ", user_mailok = '1', last_login = " . $tmpvbresults['lastvisit'] . " WHERE profileid = " . $xoopsresults['uid']);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             $tmp_xoops_user_aim = "";
    }
}]]></phpcode>
    </plugin>
</plugins>


You have to set the prefix of your XOOPS tables (in this case it's set to "xoops__")! This simple instance assumes that the XOOPS tables are in the same database like the vBulletin tables. So we only have to do a simple query with an existing vB database object. If not, you have to create a new vB database instance and connect with the XOOPS database. vB 3.5.x uses a different User Hash (not a simple md5), so we have to call the plugin on two different Hook Locations. The first plugin will add a new XOOPS user when the vB registration process is complete. The second plugin will activate the user automatically in your XOOPS System as soon as the user sends his activation key via email.

Now you only have to insert a redirect to the vB Register form. Open the file register.php in your xoops/modules/profile/ directory and write something like this:

include '../../mainfile.php';
include_once 
'include/functions.php';

redirect_header(XOOPS_URL.'/forum/register.php'6"Please register on our forum.");


Fell free to change the values of the plugin. I'm using the vb connector.zip from vBulletin.org to handle a user login (session, cookies...). It acts as a bridge between vB and XOOPS. Thats all!

Regards
StarShaper

2
vickoh666
Re: vBulletin-XOOPS Registration
  • 2006/6/7 3:03

  • vickoh666

  • Just popping in

  • Posts: 2

  • Since: 2006/6/7 3


hi, congs.
but can u explaine, how to instal this?? where did the plugin goes????

3
tom
Re: vBulletin-XOOPS Registration
  • 2006/6/7 3:33

  • tom

  • Friend of XOOPS

  • Posts: 1359

  • Since: 2002/9/21


I thought http://www.bbpixel.com did this once?

4
vickoh666
Re: vBulletin-XOOPS Registration
  • 2006/6/7 4:27

  • vickoh666

  • Just popping in

  • Posts: 2

  • Since: 2006/6/7 3


noup, i think it's via plugin manager but where i have to place them??
Quote:

tom wrote:
I thought http://www.bbpixel.com did this once?

5
bumpeboy
Re: vBulletin-XOOPS Registration
  • 2013/2/21 10:35

  • bumpeboy

  • Friend of XOOPS

  • Posts: 170

  • Since: 2008/10/4


I really need this. I am ought to transfer a website with over 10K registered members from vBulletin to Xoops. At the moment what i need most is to migrate the login details that they dont have re-register again.

Any help will be appreciated.


Login

Who's Online

70 user(s) are online (43 user(s) are browsing Support Forums)


Members: 0


Guests: 70


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits