Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 06-11-2007, 07:53 PM
vizitor vizitor is offline
 
Join Date: Jun 2007
Location: Germany
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Usersync vBulletin -> phpNUKE & Who is Online external

Hi community,

I've succesfully ported my phpNUKE phpBB Forum to vBulletin with all users & content. I also was able to include "Latest forum posts" on my phpNUKE index page.

There're two things where I need help...

1.) I want, that when a new user registers in the forum (vB), that this user is also put into the phpNUKE usertable (mySQL). I found an old code snipplet but unfortunately it's to old... it doesn't fit to my vBulletin Version (3.6.7-PL1).

Code:
[Release] phpnuke reg integration hack 
--------------------------------------------------------------------------------
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))."','$copp auser','".addslashes(h
tmlspecialchars($homepage))."','".addslashes(htmls pecialchars($icq))."',
'".addslashes(htmlspecialchars($aim))."','".addsla shes(htmlspecialchars(
$yahoo))."','".addslashes($signature)."','$adminem ail','$showemail','$in
visible','".addslashes($usertitle)."','".time()."' ,'$cookieuser','".adds
lashes($prunedays)."','".time()."','".time()."','$ newusergroupid','".add
slashes($timezoneoffset)."','$emailnotification',' $receivepm','$emailonp
m','$options','".addslashes($birthday)."','".addsl ashes($umaxposts)."','
".addslashes($startofweek)."','".addslashes($ipadd ress)."','$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')");
-------------------------------------------------------

If someone can tell me where to find the part in the vBulletin code (I think register.php is still correct, isn't it?) where the new user is put into the database (the code shown above I can't find in my register.php)... this would help me very much!


2.) Is there any chance to include/show the users which are online (into the forum) on a external page (my phpNUKE index page for example). Is there an option in vBulletin (which I have missed) which exports "Who is online" as a rss/xml/javascript feed? This would be okay/enough for me.


I hope someone can help me... I'm really happy with vBulletin... if I only could fix these last two problems .
Reply With Quote
  #2  
Old 06-15-2007, 07:17 PM
vizitor vizitor is offline
 
Join Date: Jun 2007
Location: Germany
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi again,

during the last days I figured out where to add the code to add a new vBulletin user also to a phpNUKE database.

But I've one (maybe stupid) problem... All informations (username, eMail address,...) will be stored as they should BUT the user password is not working if you want to login into phpNUKE (logon into the forum is working well).

If figured out, that my modfication just insert the MD5 value as plain text (not crypted)... I mean the numbers and letters.

So, my questions is how to read and insert the password as real MD5 hash value so that the phpNUKE login is also working?!? I think I've to read the password as MD5 hash or something like that and not in the way I try it... I hope you know what I mean .

Here's the code I use:

In "class_dm_user.php" I made these changes:
Code:
// INSERT NEW USER
		else
		{
			// fill in any registration defaults
			$this->set_registration_defaults();

			// insert query
			if ($return = $this->db_insert(TABLE_PREFIX, 'user', $doquery))
			{
				$this->set('userid', $return);
				$this->db_insert(TABLE_PREFIX, 'userfield',     $doquery);
				$this->db_insert(TABLE_PREFIX, 'usertextfield', $doquery);


// START - THIS IS MY NEW CODE
$username = $this->fetch_field('username');
$password = $this->fetch_field('password');
$email = $this->fetch_field('email');
$joindate = $this->fetch_field('joindate');
mysql_query("insert into nuke_users (username, user_email, user_website, user_avatar, user_regdate, user_icq, user_aim, user_yim, user_viewemail, user_password) values ('$username', '$email', '', 'gallery/blank.gif', '$joindate', '', '', '', '', '$password')");
// END - THIS IS MY NEW CODE

// Send welcome PM" string
.....
.....
PLEASE help me... I don't want to reactivate my old phpBB forum. I'm working since days to solve this problem.


PS: I still need help with the "Whos is Online display on a extern page/website" problem but the problem above has prio 100% .
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:44 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03292 seconds
  • Memory Usage 2,172KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete