Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 01 Dec 2013, 20:40
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
add new lines to a table, when user register

Hi guys, i am looking for a product or thread about this, but still cant found it yet

so when user register, i need to add new line to a table, for example
i have a customtable in database
the user is register & the userid is 10
i need to add this line in customtable :

userid : 10
friendid : 1 (this is constant value that i set)



maybe using a plugin, with register_addmember_complete hook?

please help if you can, GBU for replying

--------------- Added 02 Dec 2013 at 17:38 ---------------

update, i already get the code for the plugin, its like this


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


the problem now is only what hook i need to use?

- using global_start is working, but its inserting more than one lines for each member, only need 1 line for each member

- using register_start, the line is created, but userid is still not created yet, still get 0 value

- using register_addmember_complete, not working at all



please help guys, only which hook question i need to choose now
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #2  
Old 02 Dec 2013, 23:53
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I think you would want to use register_addmember_complete, but I don't know why it won't work for you. I think you'd want to use $userid for the new user's id instead of $vbulletin->userinfo['userid'].
Reply With Quote
  #3  
Old 03 Dec 2013, 18:33
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
already tried this code


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

or this


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


with hook register_addmember_complete, but nothing new line created in the table, is it i already right write the code?







btw my first code

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

work created new line & get the userid, with hook global_start, maybe this is alternative way, but only need 1 line for each member, that is after registering,
i try wrap with these if conditional but its still not right :

if ($show['member'])
{
if (THIS_SCRIPT == 'register')
{

// above my first code

}
}




please give suggestion any hook or methode that will work like i need above
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #4  
Old 03 Dec 2013, 18:40
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

$userid should work for the actual userid if the person who just registered. So, you should define $friendid and use that as the $friendid.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #5  
Old 03 Dec 2013, 19:19
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Originally Posted by basketmen View Post
already tried this code


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

or this


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


with hook register_addmember_complete, but nothing new line created in the table, is it i already right write the code?







btw my first code

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

work created new line & get the userid, with hook global_start, maybe this is alternative way, but only need 1 line for each member, that is after registering,
i try wrap with these if conditional but its still not right :

if ($show['member'])
{
if (THIS_SCRIPT == 'register')
{

// above my first code

}
}




please give suggestion any hook or methode that will work like i need above
ah its already working with hook register_addmember_complete, so its need Execution Order 1, instead 5








Originally Posted by Lynne View Post
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

$userid should work for the actual userid if the person who just registered. So, you should define $friendid and use that as the $friendid.
thank you for answering, in my case i need the new registered member as friendid, but i can change to the opposite if needed later




thank you very much & GBU for kh99 & Lynne
hope this thread can help others that need similar information too
__________________
I am SEO specialist and forum coordinator
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 01:25.

Layout Options | Width: Wide Color: