Vbulletin + Pligg bridge co-op

Register an Account
Closed Thread
 
Thread Tools Display Modes
  #11 (permalink)  
Old 10-14-2006, 07:53 AM
athle's Avatar
Casual Pligger
 
Join Date: Oct 2006
Posts: 51
is there anyone found the method,hope
  #12 (permalink)  
Old 10-14-2006, 01:12 PM
New Pligger
 
Join Date: Sep 2006
Posts: 1
share the database?
  #13 (permalink)  
Old 10-15-2006, 04:29 PM
New Pligger
 
Join Date: Oct 2006
Posts: 8
Quote:
Originally Posted by paitken View Post
I think I'm going to go ahead and do this.

It will be for Pligg 8.1 and my version of vBulletin 3.5.4 but it should work with others as well.

You will be able to register with vBulletin AND Pligg.
You will also be able to login with both vBulletin and Pligg.

I will be done with this in 24 hours.

I will also more than likely be doing one for phpBB as well.
Any news about this?!

Regards,

Tobi
  #14 (permalink)  
Old 10-16-2006, 05:31 AM
New Pligger
 
Join Date: Jul 2006
Posts: 2
So from what i see this hack should allow you to signup and go between the pligg system and VB seemlessly....

Will there be further integration? Would it be possible, for example to 'pligg' posts? and have the posts with the most 'pliggs' be displayed on the homepage?

i would def be willing to pay for this hack as well..
  #15 (permalink)  
Old 10-19-2006, 05:53 AM
New Pligger
 
Join Date: Sep 2006
Location: Tampa, FL
Posts: 16
Send a message via AIM to paitken Send a message via MSN to paitken Send a message via Yahoo to paitken
I had started working on this. I got side tracked. Now, I'm back to working on it. It won't be free though.

If you're willing to pay for this, PM me with a price and I will come up with an average price.
  #16 (permalink)  
Old 11-10-2006, 09:56 AM
New Pligger
 
Join Date: Oct 2006
Posts: 8
Hi,

how's going?!

Tobi
  #17 (permalink)  
Old 11-10-2006, 11:34 AM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
We haven't seen Paitken in around a month so I don't think he's working on this nor is he a Pligg dev anymore.
  #18 (permalink)  
Old 01-18-2007, 11:58 PM
Casual Pligger
 
Join Date: Jan 2007
Posts: 53
i am desperate for this integration.

I'm crying as I type this
  #19 (permalink)  
Old 01-21-2007, 08:25 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
One possible way to achieve integration would be to switch the current pligg password setup to the vBulletin double md5'd password and salt combo: (using latest plgg and vB 3.64 code)

(1) Pligg database - in the pligg_users table, add 2 extra columns - 'user_pass_vb' and 'user_pass_salt'.

(2) vBulletin - register.php

FIND
Code:
// save the data
$vbulletin->userinfo['userid']
    = $userid
    = $userdata->save();
ADD BELOW
Code:
/* Pligg Registration */
$pligg_username = htmlspecialchars_uni($vbulletin->GPC['username']);
$user_data_query = @mysql_query("SELECT email,password,salt FROM " . TABLE_PREFIX . "user WHERE username='$pligg_username'");
$user_data = @mysql_fetch_array($user_data_query);
$pligg_email = $user_data['email'];
$pligg_password = $user_data['password'];
$pligg_salt = $user_data['salt'];
$pligg_ip = $_SERVER['REMOTE_ADDR'];
$pligg_connect = @mysql_connect('HOSTNAME', 'USERNAME', 'PASSWORD');
$pligg_database = @mysql_select_db('DBNAME', $pligg_connect);
$pligg_update = @mysql_query("INSERT into pligg_users (user_login,user_level,user_date,user_pass_vb,user_pass_salt,user_email,user_ip) VALUES ('$pligg_username','normal',now(),'$pligg_password','$pligg_salt','$pligg_email','$pligg_ip')");
$pligg_close = @mysql_close($pligg_connect);
/* Pligg Registration */
Remember to change the database values to match your pligg database.

(3) vBulletin - login.php

FIND
Code:
// init user data manager
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($userinfo);
$userdata->set('password', $newpassword);
$userdata->save();
ADD BELOW
Code:
/* Pligg Password */
$pligg_id = $vbulletin->GPC['userid'];
$user_data_query = @mysql_query("SELECT username,password,salt FROM " . TABLE_PREFIX . "user WHERE userid='$pligg_id'");
$user_data = @mysql_fetch_array($user_data_query);
$pligg_username = $user_data['username'];
$pligg_password = $user_data['password'];
$pligg_salt = $user_data['salt'];
$pligg_connect = @mysql_connect('HOSTNAME', 'USERNAME', 'PASSWORD');
$pligg_database = @mysql_select_db('DBNAME', $pligg_connect);
$pligg_update = @mysql_query("UPDATE pligg_users SET user_pass_vb='$pligg_password',user_pass_salt='$pligg_salt' WHERE user_login='$pligg_username'");
$pligg_close = @mysql_close($pligg_connect);
/* Pligg Password */
Again, remember to change the database values to match your pligg database.

(4) vBulletin - profile.php

FIND
Code:
($hook = vBulletinHook::fetch_hook('profile_updatepassword_complete')) ? eval($hook) : false;
// save the data
$userdata->save();
ADD BELOW
Code:
/* Pligg Profile Update */
$pligg_username = unhtmlspecialchars($vbulletin->userinfo['username']);
$user_data_query = @mysql_query("SELECT email,password,salt FROM " . TABLE_PREFIX . "user WHERE username='$pligg_username'");
$user_data = @mysql_fetch_array($user_data_query);
$pligg_email = $user_data['email'];
$pligg_password = $user_data['password'];
$pligg_salt = $user_data['salt'];
$pligg_connect = @mysql_connect('HOSTNAME', 'USERNAME', 'PASSWORD');
$pligg_database = @mysql_select_db('DBNAME', $pligg_connect);
$pligg_update = @mysql_query("UPDATE pligg_users SET user_pass_vb='$pligg_password',user_pass_salt='$pligg_salt', user_email='$pligg_email' WHERE user_login='$pligg_username'");
$pligg_close = @mysql_close($pligg_connect);
/* Pligg Profile Update */
Again, remember to change the database values to match your pligg database.

(5) Pligg - libs/login.php

FIND
Code:
$user=$db->get_row("SELECT user_id, user_pass, user_login FROM " . table_users . " WHERE user_login = '$dbusername'");
$saltedpass = generateHash($pass, substr($user->user_pass, 0, SALT_LENGTH));
if ($user->user_id > 0 && $user->user_pass === $saltedpass) {
REPLACE WITH
Code:
$user=$db->get_row("SELECT user_id, user_pass, user_pass_vb, user_pass_salt, user_login FROM " . table_users . " WHERE user_login = '$dbusername'");
$saltedpass = md5(md5($pass).$user->user_pass_salt);
if ($user->user_id > 0 && $user->user_pass_vb === $saltedpass) {
That should sync the vBulletin registrations with Pligg's, as long as users signup via the forum registration page. It will also sync password changes, if made through the vBulletin interface. The other thing to consider is whether to add the pligg user data upon initial registration (as done here), or if using the forum confirmation e-mail, to put the registration code in only when the account is activated, when the confirmation email link is clicked.

Using this method, users would still need to login to the pligg portion of the site when logged into the forum, but the login details would be identical, and no separate signups required. There may well be many better ways to do it, and it is probably possible to use the hooks system to make this into a vBulletin plugin file, but i was just messing around with the source code and thought i'd share.

Last edited by Simon; 01-21-2007 at 09:24 PM. Reason: added password syncing
  #20 (permalink)  
Old 01-21-2007, 10:59 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Added the above code (and a few extra options like cookie sharing) into a product file.

EDIT: the latest version can now be found here

PS. since there have been some requests, if you would like to make a small donation for this mod, my paypal address is: admin[at]oioplus[dot]com

Last edited by Simon; 01-22-2007 at 03:42 PM.
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pligg Donation Drive 2009 chuckroast Questions and Comments 0 03-23-2009 05:42 PM
Vbulletin user : Pligg ? frack Questions and Comments 8 12-20-2007 03:16 AM
Vbulletin + Pligg bridge built in as option pipin Questions and Comments 0 02-20-2007 03:28 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development