PDA

View Full Version : phpnuke reg integration hack


09-11-2001, 10:00 PM
Before i post it i have to say 2 things

1) it is not my hack, it was made by those wonderful ppl from www.buffydownunder.com, I would like to give them all the credit and the thanks for hooking me up with this helpful hack

2) and this is the big one, the php-nuke and vbulletin databases have to be combined

I dont know if you want it if you have to combine databases, unless you have not installed one of them yet

hell maybe one of the great coders here could find a way for there to be 2 databases, i dunno

here she is

in the register.php file of vbulletin

-------------------------------------------------------------
FIND:

$DB_site->query("INSERT INTO user
(userid,username,password,email,".$newstylefield."parentemail,coppauser,
homepage,icq,aim,yahoo,signature,adminemail,showem ail,invisible,usertitl
e,joindate,cookieuser,daysprune,lastvisit,lastacti vity,usergroupid,timez
oneoffset,emailnotification,receivepm,emailonpm,op tions,birthday,maxpost
s,startofweek,ipaddress,pmpopup,referrerid,nosessi onhash) VALUES
(NULL,'".addslashes(htmlspecialchars($username))."','".addslashes($passw
ord)."','".addslashes(htmlspecialchars($email))."',".$newstyleval."'".ad
dslashes(htmlspecialchars($parentemail))."','$coppauser','".addslashes(h
tmlspecialchars($homepage))."','".addslashes(htmlspecialchars($icq))."',
'".addslashes(htmlspecialchars($aim))."','".addslashes(htmlspecialchars(
$yahoo))."','".addslashes($signature)."','$adminemail','$showemail','$in
visible','".addslashes($usertitle)."','".time()."','$cookieuser','".adds
lashes($prunedays)."','".time()."','".time()."','$newusergroupid','".add
slashes($timezoneoffset)."','$emailnotification','$receivepm','$emailonp
m','$options','".addslashes($birthday)."','".addslashes($umaxposts)."','
".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','"
.addslashes($testreferrerid['userid'])."','$nosessionhash')");
$userid=$DB_site->insert_id();
$user_regdate = date("M d, Y");
--------------------------------------------------------------
AFTER THAT PLACE:

//PHP-Nuke Registration Addition - by Matt Lyons matt@buffydownunder.com

$cryptpass=crypt($password);
mysql_query("insert into nuke_users (uname, email, url, user_regdate,
user_icq, user_aim, user_yim, user_viewemail, pass) values ('$username',
'$email', '$homepage', '$user_regdate', '$icq', '$aim', '$yahoo',
'$showemail', '$cryptpass')");

-------------------------------------------------------



in the user.php file of php.nuke

Find

user.php?op=COPPA

And just change it to

the url to the register.php file of vbulletin

easy hack, but ingenius, thanks again Matt and Russel

orca
09-12-2001, 01:27 PM
You can have it in 2 databases. Just edit the line for the mySQL-Query after where it says PHPNUKE registration from

insert into nuke_users

to

insert into yournukedbname.nuke_users


Worked for me.

Admin
09-12-2001, 01:42 PM
[QUOTE]Originally posted by orca
You can have it in 2 databases. Just edit the line for the mySQL-Query after where it says PHPNUKE registration from

insert into nuke_users

to

insert into yournukedbname.nuke_users


Worked for me.

orca
09-12-2001, 03:37 PM
You sure? I never got an error message.

Admin
09-12-2001, 03:41 PM
Well, unless you use root you can't have access to more than one database (I'm 99% sure).
What username are you using Orca?

And by the way, this:
$user_regdate = date("M d, Y");
is no where in register.php.

orca
09-12-2001, 06:59 PM
Well, it works at my site. I just checked it with a test account. Maybe I have root access but I need my own username, not 'root'.

What user_ragdate is concerne I need to have a look. I'm not sure anymore. I think the query is more important.

apollyon
09-12-2001, 08:17 PM
i think that hack is for a slightly older ver
the rest of it is there, just paste it after the rest of it (the part before the reg date)

N.B.
09-29-2001, 10:41 PM
You dunno need root access to mysql, but you have to have access to the other database as well ..
So if your hosting only gives you one database you have to mix, there is no other way, but yes, that?s the way it is ..
If you have root access for yourself you can change the access level with grant and revoke for every database itself ..
Giving root access to any config file is a security risc ..
Bcz with that password all dbs could be deleted !

But usually root login to mysql is only allowed from localhost so it isn?t that problem to use root, but I would sugeest to NOT use root for any PHP program ! ;)

Ángel
10-11-2001, 07:13 PM
I edited register.php like it says. When I view it as part of vBulletin there are no changes. Is it supposed to be like that?

I look in user.php of phpNuke, but there is not a single "user.php?op=COPPA" in the entire file!

Please help!

I am using vB 2.0.3 and phpNuke 5.2.

apollyon
10-12-2001, 12:42 AM
I feel like an ass, but i could not find it this time either m8, sorry

but here is the email of the guy who uses it on his site, his php programmer friend figured the heack out
russel@buffydownunder.com

orca
10-12-2001, 06:11 AM
Try looking for user.php?op=. May COPPA is replaced by add or similar.

Ángel
10-12-2001, 02:32 PM
There are tens of "user.php?op=" references in there... Also, the Buffy Down Under site never works for me now, it used to a few weeks ago when I came accross this hack.

Ángel
10-12-2001, 02:34 PM
LOL I just realised the link at the top of the page has a comma at the end of it... Silly me!

I installed phpNuke with integration being the prime directive. I've spent an age on my template and I really don't want to let it go! Thanks for your help so far guys. :D

Madison
10-15-2001, 08:39 AM
It also works fine with PostNuke.
Thanx to the ppl from www.buffydownunder.com

apollyon
10-15-2001, 05:27 PM
hey, is postnuke as good as php-nuke, would it be easy for me to switch my site to that?

Madison
10-16-2001, 06:51 AM
PostNuke is a fork of Francisco Burzi's PHP-Nuke. There are no big differences, but I like it more than PHP-Nuke because there are not so many big bugs included ;)
You can find PostNuke here (http://www.postnuke.com).

I don`t know if there are any problems to switch from PHP-Nuke to PostNuke. I made a clean installation of PostNuke.

Ángel
10-16-2001, 07:48 AM
What files did you edit on PostNuke?
Does the Who's Online work with the VB database?
Can I see an example of your site?

Thanks... :)

Madison
10-16-2001, 09:20 AM
Sorry, but you can`t see an example of my site because I`m still programming and so it`s running on my notebook. I don`t know if the Who`s Online hack is working because I haven`t integratet it yet. But you can mail it, then I`ll look if it`s working...

I only editeted the user.php file. Search for "user.php?op=" (without the ") and change them to the url of the register.php of vB.

Ángel
10-16-2001, 09:34 AM
So just replace every single user.php?op= with http://whatever.com/register.php ?

Madison
10-16-2001, 09:48 AM
Yes.
You can make it better, but I`ll tell you later how because I`ve a meeting now.

Ángel
10-16-2001, 09:50 AM
Thanks... This hack is confusing me a lot. I don't understand how simply changing a few links in 1 file can let phpNuke access the vbulletin database and use it for posting etc. I've looked at postNuke and it looks much better than phpNuke, and hence I expect I will change over - as soon as I understand how this whole thing works.

Ángel
10-17-2001, 08:07 AM
Forgotten about me Madison? :(

I emailed Russel, but I didn't understand his 1 line response.

Madison
10-17-2001, 08:11 PM
Sorry, but I`ve really forgotten about you. I had to do so much work today.... you know ;)

But tomorrow (10-18-2001) I`ll tell you. But before I have to try it out. Maybe it doesn`t work. But im sure it does...

Sorry for my bad english, but I`m a german.

Ángel
10-18-2001, 02:31 PM
Nothing to aplogise for mate! Your English is 100% better than my German! ;)

Ángel
10-20-2001, 01:31 AM
STILL don't understand this hack. :(

Madison
10-22-2001, 06:39 AM
Do you have ICQ? I think its easier to tell you with ICQ... :)

My number is 102461327, but maybe I`ll connect with a nother number, so it will be better if you`ll give me your number.

BramT
10-22-2001, 10:14 PM
don't know postnuke...

have to look into that.... for what i've seen... it's just a modified version of phpnuke...

meaning:
both version need a LOT of tweaking before it does what you want it to do... but when you do.... OH MAMMA!!!

maybe postnuke is getting more attention now (www.nukeaddons.com), but i'll stick to 'my' phpNuke till postnuke *really* becomes better.....(!)

Robert9
10-27-2001, 09:46 PM
Nice idea to post data in both dbs; but what i fsomeone wants to change his stuff?

With this solution you have to find every mysql-update in both scripts. Cant be the right way!?

Im sitting here for two days now, melting both databases into one;
the idea is to add every extra feield from PN (table users) into table user (VB); then change the PN-Files to use password instead pass, homepgae instead url and so on.
Most of the thing is ready here; some problems will solved this night (registering VB with mail and activation-code, PN with made passwort) and some more.

Its a f*cking work, and im afraid of the next update of pn; but the only way i see...

Robert

Russell
10-28-2001, 02:39 AM
ps. my email's russell@buffydownunder.com ... there's TWO L's :)

And the new version of PHPNuke5.2, the user.php page changed, basically all that line did was to get rid of the click here to register, and change it to a link to the vBulletin rego.

Lionel
01-05-2002, 02:31 AM
This is great code, but how do you deal with password changes for the guy who changes his vb password? And how do you transfer 500 existing users into nuke's database?

BabyU
01-23-2002, 10:04 PM
I imagine that you would need to modify your forums member.php file. I found the statement that controls the password change:

$DB_site->query("UPDATE user SET password='".addslashes($newpassword)."',usergroupid='$bbuserinfo[usergroupid]' WHERE userid='$bbuserinfo[userid]'");

but for the life of me, can't figure out how to have it change the password in the nuke_users table also.

Any ideas guys? I'm sure it's much simpler than I'm making it!

PS -- Thank your Russell for posting the info to integrate the two databases!

wakawaka
01-24-2002, 12:08 AM
ok ppl, here is the new and refined hack for ting the 2 scripts together. Got the bulk code from Dontom's hack (but this gets around the cron messiness)

here it is enjoy ppl.

mkilty
01-24-2002, 05:54 AM
Will this script work for post-nuke 7.03 and VB? If not where can I go to ask as this would be great to get it working.

Thanks for any help....

BabyU
01-24-2002, 04:54 PM
Hmmm ... can't figure out what I did wrong. I assume it's working for you wakawaka. It transferred over all of my existing VB members and their current info, (which was an unexpected bonus!) but it doesn't immediately update when they change user info or if a new member is added. It waits until the next new member is added -- therefore it's always one member behind. So if I originally had 3001 members, only 3000 were pulled over. Then when I added #3002, it brought over #3001, but not #3002. Then I updated a profile, but it didn't take effect until I added #3003 (at which time it also copied over #3002). Make sense?

Any ideas on what the problem might be? Other than this little glitch, it's great!

wakawaka
01-24-2002, 07:15 PM
I have it setup so it copies the info as soon as someone follows the activation link from the email, but ill look into it to see if i can find a place to make it copy as soon as someone changes their info.

BabyU
01-24-2002, 08:30 PM
Ahhh .... well that makes sense. I copied the new portion of the code you suggested for Activate Form to Start Add Member and it automatically added the new member. Now that just leaves the Update Profile. I'm guessing I'd need different code in member.php since the query is so different. I'll play with it a bit, but I don't hold out high hopes that I'll figure it out.

FYI -- This hack DOES work with two separate databases by doing just what was suggested earlier in this thread (putting your database name and a period prior to nuke_users).

Thanks for your help!

wakawaka
01-24-2002, 11:14 PM
thanx for the tip about the 2 diff db's

also i'll try and make it so the profile changes actually work right away

mkilty
01-26-2002, 07:39 PM
Hi,

First thanks for the above script.

Running: vb 2.03 and Post-Nuke 7.03 (Rogue)

After following the above I went and try adding a new member. I went throught the registration and it worked great until I open the activation e-mail. Where it wanted me to click to activate my new account it came back with the standard vb error page.

The error that MySql generated was this:
============
Database error in vBulletin: Invalid SQL: SELECT activationid FROM useractivation WHERE userid='5197' AND type=0
mysql error:
mysql error number
Date: Saturday 26th of January 2002 09:14:33 PM
Script: /forums/register.php?a=act&u=5197&i=1012079601
============
I took a look at the nuke_user file and it had been populated with all my vb users except the latest one as a previous post talked about.

Also Table 'vbullet.useractivation' doesn't exist. Is this new for the latest version of vb? What would be the equivelent for 2.03vb.

Can I substitute the mysql call in register.php with the 2.03 vb version if different?
==========
$user=$DB_site->query_first("SELECT activationid FROM useractivation WHERE userid='$userinfo[userid]' AND type=0");
==========

Any idea's ???????

Thanks,

Michael

mkilty
01-26-2002, 09:16 PM
Also I noticed that the nuke_users password table is unencrypted while the Post_Nuke codewants to compare it against an encrypted version.

Hence the compare passwd call does not match and it won't login users.

Anyone get around this? I guess now is a good time for me to start learning how to code...:)

Thanks....

wakawaka
01-26-2002, 11:06 PM
this hack is for php-nuke m8.

wakawaka
01-26-2002, 11:10 PM
i guess i could try and get this to work on post_nuke, but i never really thought of trying it since i dont like post nuke. But i might try it soon

-=dm=-
01-29-2002, 02:58 PM
Originally posted by Madison
It also works fine with PostNuke.
Thanx to the ppl from www.buffydownunder.com

can you please whic file to edit in postnuke?

wakawaka
01-29-2002, 03:22 PM
i dunno, but i dont think my hack works for postnuke

FleaBag
02-28-2002, 07:47 PM
Is anyone still working on this. I'm no techy and from what I've heard there are still problems with the latest versions? I paid for vBPortal, but a situation with the caching in use by my server means that it cannot work. I was Ángel earlier in this post, back when the forums were on vb.com, this hack would be of great use to me.

Ig@r
03-05-2002, 06:28 PM
Did anyone try to do this with postnuke?

v0nreagan
03-10-2002, 01:34 PM
For those of you who couldn't get this script to copy users...

the lines should read

$query=mysql_query("delete from nuke_users");
$query=mysql_query("INSERT INTO nuke_users (uid,uname,email,url,user_sig,pass,user_icq) select userid,username,email,homepage,signature,password, icq from your_vB_database.user");
$query=mysql_query("update nuke_users set umode='nested', theme='YourTheme' ");

fantom
04-11-2002, 07:52 AM
Ok, anyone tried this with PHP-Nuke 5.5 and VB 2.2.5???

And did anyone test this with 2 separate databases? Since I don't feel like installing VB's tables in the same database as PHP-Nuke's, because it's gonna be really messy!

DemiNeo0101
05-05-2002, 12:24 PM
So does this work with 2.2.5 and phpnuke? I really need this very much. Thanks :)

robin1233
05-28-2002, 06:34 PM
This hack works for me on Vbulletin 2.2.5 and Php-nuke 5.5

Is there a way to modify the cookies sent by each so that when a user logs in, in either php-nuke or vbulletin, they will automatically be logged in on the other one?

WonderBoy
05-29-2002, 12:19 AM
I cant get this hack to work for vbb 2.2.6 and postnuke at all has anyone else got this to work??

WonderBoy
05-29-2002, 03:08 AM
with some editing I got this one to work just fine

https://vborg.vbsupport.ru/showthread.php?s=&threadid=36531&highlight=postnuke

countryboy713
05-29-2002, 03:36 AM
I dont understand why you dont just use vBportal?

ManagerJosh
06-06-2002, 08:01 AM
Because some of us are too stingy to purchase vBportal.

Lethal
06-18-2002, 11:29 AM
My php nuke didn't come with a user.php file to edit.... now what?

wakawaka
06-19-2002, 12:18 AM
postnuke is way better

TECK
06-19-2002, 06:01 AM
postnuke, php-nuke... i found them huge. most of users only need few modules-segments from it. i tested postnuke recently. is 6mb in size (the zip content). i simply freaked when i saw the size...

ManagerJosh
06-20-2002, 05:23 AM
Originally posted by nakkid
postnuke, php-nuke... i found them huge. most of users only need few modules-segments from it. i tested postnuke recently. is 6mb in size (the zip content). i simply freaked when i saw the size...

I found PHP-Nuke perfect nakkid. It is small on TAR.GZ format, but also it is reliable and doesn't need a patch every other day.

ManagerJosh
06-20-2002, 05:37 AM
I wonder which hack is better for integrating phpnuke and vbulletin. This one or the one at https://vborg.vbsupport.ru/showthread.php?s=&threadid=36531

On a side note, is there anyway I can keep all my existing users? I don't want to loose a few thousand members on PHP Nuke and a few hundred at vBulletin. If i had a choice on which members to loose, I'd loose the vBulletin members simply because I have less. Though that means I'd have to flush my vBulletin Database from threads and stuff.

I'm using PHP-Nuke 5.6 + vB 2.2.6

Lethal
07-16-2002, 04:11 AM
yea that would suck losing all those members.

BladesM3
09-23-2002, 06:22 PM
say if i have phpnuke with over 1000 users.. and i just installed vbull 2.2.7 how do i do this? i am totally lost.. icq# 2541353

www.cthreeracing.com is my site

thebigboss
11-20-2002, 12:10 AM
Originally posted by ManagerJosh
Because some of us are too stingy to purchase vBportal.

vbportal is a free download !

Spacey
06-21-2004, 01:02 PM
I think that it will only work if you're using the root user. Otherwise you don't have access to another database.


Yea but if you are not using the root user to your db just add the forum user to your nuke db and it will work...

Eagle Creek
08-11-2004, 10:27 AM
Does this work on Vbulletin 3.0.3 and PHPnuke 7.4 too?

Sovereign
08-14-2004, 08:22 PM
No, this code is for older versions of vB. Off the record, I may do something like "vB Nuke", but don't quote me on it. (or expect much of anything)