PDA

View Full Version : In-Link User Integration


wajones
08-05-2001, 10:00 PM
Update, script now accomplishes an automatic login to Inlink. The link didn't attach properly so I'll add it in a later post.

This is a hack to allow In-link to be somewhat integrated with vBulletin, what it does is...

1. Creates a new pending Inlink user at the same time as a new user registers for vBulletin.
2. Validate's the Inlink user when the vBulletin user validates by e-mail.
3. For existing vBulletin Users it creates a new inlink user when their vBulletin profile is updated.
4. Updates Inlink user when vBulletin profile is updated.

Your users will still have to log into Inlink, but they will have the same username and password. They will only have to log in to add a link.

If you validate a new user manually, when he updates his profile he will be validated in the Inlink Table or you can manualy validate in the inlink admin if you wish.

This hack is assuming the vBulletin Tables and Inlink Tables are in the same database.

Let me know if you find any bugs or typo's

BradC
08-06-2001, 07:18 PM
Very nice wajones... as of yet I have not purchased in-link.. but if and when I do... this will rock :)

great job ! :)

RobAC
08-06-2001, 08:14 PM
What's Inlink?

wajones
08-06-2001, 08:20 PM
Originally posted by RobAC
What's Inlink?

It's a commercial links program Their Website (http://www.in-link.net)

BradC
08-06-2001, 11:11 PM
Rob.. it is a great links system, if I had $200 to spend I would purchase it also.

rockergrrl
08-07-2001, 10:38 AM
Would this work with their 1.x version? I don't have that kind of money for the 2.x version... But I have their free version (1.x)

wajones
08-07-2001, 10:56 AM
Originally posted by rockergrrl
Would this work with their 1.x version? I don't have that kind of money for the 2.x version... But I have their free version (1.x)

The concept will work, but I doubt the tables or the scripts are the same.

rockergrrl
08-07-2001, 11:07 AM
darn it all....

:)

Thanks anyways... :)

wajones
08-07-2001, 01:04 PM
Updated to accomplish an automatic login to Inlink.

Stephan Whelan
10-18-2001, 11:05 AM
Great hack however any plans to update it to handle the new 2.1.x versions of in-link?

orca
10-18-2001, 11:30 AM
Yep, really great hack.

orca
12-10-2001, 05:12 PM
I have some troubles with the new version of In-Link, 2.2.3. Mainly with the changes to in-links admin/config.php. This file doesn't exist anymore and I can't find code in any other file which I think it should go. Could give me a hand here?

Syphin
12-10-2001, 10:26 PM
Originally posted by orca
I have some troubles with the new version of In-Link, 2.2.3. Mainly with the changes to in-links admin/config.php. This file doesn't exist anymore and I can't find code in any other file which I think it should go. Could give me a hand here?

I need help on this too.. =/


-Syphin

fatcatz
01-29-2002, 07:22 AM
Originally posted by orca
I have some troubles with the new version of In-Link, 2.2.3. Mainly with the changes to in-links admin/config.php. This file doesn't exist anymore and I can't find code in any other file which I think it should go. Could give me a hand here?

I'm also have trouble at this part... where has it moved/changed to? Has anyone found the solution yet?

FatCatz

VAN
03-22-2002, 02:48 AM
Hate to keep bringing up an old thread, but is anyone even working on getting this to work with the latest version of In-Link (2.2.7) and vB 2.2.4?

This would make VAN very happy. :)

Neo
03-22-2002, 04:19 AM
Since I do have both, I just might.

Deska
09-10-2002, 10:23 AM
I hope someone can get to work for vB 2.2.7 and In-Link 2.2.10

Neo
09-10-2002, 04:44 PM
I dont know... I might have to update it myself since wj is no longer with us at VB.org

Darren Lewis
09-11-2002, 04:28 PM
Originally posted by Deska
I hope someone can get to work for vB 2.2.7 and In-Link 2.2.10

I've got this working on my site with vb 2.2.7 and In-Link 2.2.10. The hack is in the contributing members area over at www.phpportals.com
When I bought In-Link I used the affiliate link over there and emailed WA Jones to upgrade me to a contibuting member. Although I had to tweak the hack to get it working correctly, I can't release it here as 95% of the work was done by WA Jones.

Darren.

gmarik
11-15-2003, 10:45 AM
Darren Lewis

Could you? I use 2.3.2 - maybe it could work on it either?

Darren Lewis
11-15-2003, 02:03 PM
Yes, the hack at vbportal.com works with vbulletin V2.3.2 and In-Link V2.3.1 as can be seen in action at http://directory.thebookforum.com

Darren.

gmarik
11-15-2003, 05:28 PM
A nice board you have, I'm hoing to make something like that in my native language as well... registering. Still some things could be changed ...

Darren Lewis
11-15-2003, 05:52 PM
Thanks for the compliment.

Suggestions are always welcome :)

gmarik
02-22-2004, 06:21 AM
Why have you the idea, is it working for vBulletin 3.0 integration as well,
or is there another hack (I guess) for this new integration?

pgowder
09-16-2004, 02:39 PM
Has this been updated for vB 3?

crocodile
11-30-2004, 09:28 AM
http://support.intechnic.com/forum/viewtopic.php?t=2881 (http://support.intechnic.com/forum/viewtopic.php?t=2881)

crocodile
11-30-2004, 09:31 AM
In-Link integration with vBulletin hack
=======================================

Works with vbulletin 2.3.2 and InLink 2.3.1

What this hack does is enable's In-Link to use vBulletin user security.
When new members register in vbulletin the info is stored in the In-link table as well.
Also when the vBulletin password is changed it is changed in inlink as well.

Note: This does not work in reverse, the vbulletin user table is too extensive to attempt an inlink update to it.
So if you make a administration username or password change in Inlink it will invalidate the integration on that users.
The next time the user manages his vbulletin user account it will create a new user account in inlink.

I have added hacks to allow user creation, modification and removal in the vBulletin admin user utility.

1. CHANGES TO IN-LINK

1.1 Change to inlinks index.php
#### At the very top of the script after the <? php add the following. The chdir paths should match those of your server.
Some servers require full paths eg /www/mysite.com/forums
// vBulletin integration
chdir( "../forums/");
include("global.php");
global $bburl, $bbuserinfo;
chdir( "../inlink");
// End vBulletin integration
1.2 Change to inlinks includes/init.php
#### Find the following #####

//initialize all variables
$rs =&$conn->Execute("select name,value from inl_config");
while ($rs && !$rs->EOF)
{ $c_name = $rs->fields[0];
$c_value = $rs->fields[1];
$$c_name = $c_value;
$rs->MoveNext();
}
##### insert this after ####
// Inlink to vBulletin integration hack
global $bbuserinfo,$DB_site;
// If not In-Link Admin
if ($admin != 1){
// If user is logged into vBulletin
if ($bbuserinfo['userid']!=0) {
$bbuserid = $bbuserinfo['userid'];
$username=$bbuserinfo['username'];
$password=$bbuserinfo['password'];
$email=$bbuserinfo['email'];

// If Logged in user has an existing InLink Account
if ($inlinkuser=$DB_site->query_first("SELECT user_name,user_pass,user_perm FROM inl_users WHERE user_name='$bbuserinfo[username]'")){

// Update the In-Link password if different than vBulletin
if ($inlinkuser['user_pass']!=$password){
$DB_site->query("UPDATE inl_users SET user_pass='$password' WHERE user_name='$bbuserinfo[username]'");
}
// Set user permissions per vBulletin usergroupid
if ($bbuserinfo['usergroupid']==6) {
// Admin
$user_perm=1;
}elseif ($bbuserinfo['usergroupid']==5 or $bbuserinfo['usergroupid']==7) {
// Editor
$user_perm=5;
}elseif ($bbuserinfo['usergroupid']==2) {
// Registered User
$user_perm=3;
}else{
// All other's Coppa, Waiting Email confirmation, etc...
$user_perm=0;
}

// Auto update user permissions if different than vBulletin usergroupid
// Comment this section out if you want to handle user permissions manually
if ($inlinkuser['user_perm']!=$user_perm){
$DB_site->query("UPDATE inl_users SET user_perm='$user_perm' WHERE user_name='$bbuserinfo[username]'");
}
// End of section to comment out if setting user permissions manually

// If user does not have In-Link user account, create one.
}else{

// Un-comment out the below line if you want to set user permissions manually
// $user_perm=3;
// Then comment out the next 9 lines if you want to set manually
if ($bbuserinfo['usergroupid']==6) {
$user_perm=1;
}elseif ($bbuserinfo['usergroupid']==5 or $bbuserinfo['usergroupid']==7) {
$user_perm=5;
}elseif ($bbuserinfo['usergroupid']==2) {
$user_perm=3;
}else{
$user_perm=0;
}
// End of lines to comment out to set user permissions manually

if ($user_perm!=0){
echo "Testing Not Found $username"; // Comment this out later once everything working OK.
mysql_query("INSERT INTO inl_users (user_name, user_pass, first, last, email, user_perm, user_date, user_status, user_pend, user_cust) values ('$username','$password','".addslashes(htmlspecialchars("vBulletin"))."','".addslashes(htmlspecialchars("User"))."','$email','$user_perm','".time()."','1','0','0')");
}
}

}

// auto log vBulletin User into inlink
if ($bbuserinfo['userid']!=0) {
$user = $bbuserinfo['username'];
$pass=$bbuserinfo['password'];
login($bbuserinfo['username'],$bbuserinfo['password']);

}
}

// End Inlink to vBulletin integration hack

1.3 Change to inlinks includes/functions_lib.php
#### Find the following
$password=md5($password);

#### Replace it with the following

// Inlink to vbBulletin integration hack
global $admin;
if ($admin == 1){
$password=md5($password);
}
// End Inlink to vbBulletin integration hack

1.4 Change to inlinks header.tpl template
#### Add this to the top of header.tpl
Remember to change the chdir paths to those of your server.
<?php
// Inlink to vbBulletin integration hack
chdir( "../forums");
global $bburl, $bbuserinfo;
chdir( "../inlink");
// End Inlink to vbBulletin integration hack
?>
1.5 Change to inlinks index.tpl template to disable user login and registration.
You want to force registration and login to vbulletin.
#### Find the following and comment out the <%insert_login%> ####
<TD width="350" valign="top">
<%insert_login%>
<%include:box_subscribe%>
<%include:box_suggest%>
</TD>
#### or just replace the above with this. ####
<!-- Inlink to vbBulletin integration hack -->
<TD width="350" valign="top">
<!-- <%insert_login%> -->
<%include:box_subscribe%>
<%include:box_suggest%>
</TD>
<!-- Inlink to vbBulletin integration hack -->
1.6 You will also want to go through the templates and comment out, remove all the links to the in-link
registration and login or change them to point to the vBulletin registration.
In particular you will need to change the menu_user.tpl template to remove the inlink login/registration/profile links.

################################################## ################################################## ##############
2. THIS NEXT PART HAS BEEN ADDED TO ALLOW UPDATING AND DELETING USERS FROM THE VBULLETIN ADMIN.
This is completely optional as you can use the inlink admin to delete and change inlink users.
Additionally the user oassword will be updated when a user enters inlink if it has been changed.

2.1 Open the vBulletin admin/user.php
#### find the following ####
$DB_site->query("INSERT INTO user (userid,usergroupid,username,password,email,stylei d,parentemail,coppauser,homepage,icq,aim,yahoo,sig nature,adminemail,showemail,invisible,usertitle,cu stomtitle,joindate,cookieuser,daysprune,lastvisit, lastactivity,lastpost,posts,timezoneoffset,emailno tification,receivepm,emailonpm,ipaddress,pmpopup,o ptions,birthday) VALUES (NULL,'$usergroupid','".addslashes(htmlspecialchars($ausername))."','".addslashes(md5($apassword))."','".addslashes(htmlspecialchars($email))."','$userstyleid','".addslashes(htmlspecialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepage))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."','$adminemail','$showemail','$invisible','".addslashes($usertitle)."','$customtitle',$joindate,'$cookieuser','$dayspru ne',$lastvisit,$lastactivity,$lastpost,'$posts','$ timezoneoffset','$emailnotification','$receivepm', '$emailonpm','".addslashes($aipaddress)."','$pmpopup','$options','birthday')");
$userid=$DB_site->insert_id();
##### insert this after ####
// inlink
$DB_site->query("INSERT INTO inl_users
(user_name, user_pass, first, last, email, user_perm, user_date, user_cust, user_status, user_pend)
values
('".addslashes(htmlspecialchars($ausername))."','".addslashes(md5($apassword))."','".addslashes(htmlspecialchars("vBulletin"))."','".addslashes(htmlspecialchars("User"))."','".addslashes(htmlspecialchars($email))."','3','".time()."','0','1','0')");
//inlnk
#### find the following ####
$pwinclude="";
if ($apassword!="") {
$pwdinclude=",password='".addslashes(md5($apassword))."'";

}
#### replace it with the following ####
$pwinclude="";
if ($apassword!="") {
$pwdinclude=",password='".addslashes(md5($apassword))."'";
//Inlink
$pwdinclude2 =",user_pass='".addslashes(md5($apassword))."'";
}
#### find the following ####
$DB_site->query("DELETE FROM session WHERE userid='$userid'");
##### insert this after ####
// Inlink to vbBulletin integration hack
$DB_site->query("DELETE FROM inl_users WHERE user_name='$user[username]'");
// End Inlink to vbBulletin integration hack
That's it!
http://support.intechnic.com/forum/viewtopic.php?t=2881