The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hey,
I am trying to alter my newly upgraded vBulletin Forum register.php file. All i want to do is insert the userid from that registered person and insert it into another table. In vB2 this was very easy. I am unsure how to do this in vB3 though. I have looked at vBulletin Data Documentation but didnt see anything relevant to this issue. Can anyone help me? Thanks in Advance. James |
#2
|
||||
|
||||
![]()
Don't edit the register.php file. Use a plugin on the register_addmember_complete hook, where $vbulletin->userinfo['userid'] will be the new userid.
-- hugh |
#3
|
||||
|
||||
![]()
or use a trigger.
|
#4
|
|||
|
|||
![]()
trigger?
![]() P.S. the id value is normally returned when the save() function is execute so... PHP Code:
|
#5
|
||||
|
||||
![]() Quote:
PHP Code:
|
#6
|
|||
|
|||
![]()
Sorry, have you got a link for more info on these hooks you are referring to?
EDIT - I have found the hook you are referring to. I will test my code and see if it works. Thanks. --------------- Added [DATE]1203427548[/DATE] at [TIME]1203427548[/TIME] --------------- Thanks that worked great! ![]() James |
#7
|
||||
|
||||
![]()
As of MySQL 5.02, you can add 'triggers' to tables. So you can specify things like "when data is inserted into table A, do such-and-such to table B". See:
http://dev.mysql.com/doc/refman/5.0/en/triggers.html The advantage of this approach is that you don't have to write any PHP code, it just happens automagically within MySQL. The disadvantage is that ... well, you don't have any PHP code and it happens automagically within MySQL. So you can't add any data which can't be derived from a select on existing MySQL data, and you can't handle errors gracefully. And of course it's MySQL version specific. If all you are doing is literally inserting data already present in your table(s) into another table, triggers are a useful shortcut. -- hugh |
#8
|
|||
|
|||
![]()
wow thats f***in sweet! Thx for pointing that out, too bad the company i work at still uses PHP 4 ><.
|
#9
|
||||
|
||||
![]()
MySQL... not PHP.
![]() |
#10
|
||||
|
||||
![]()
Still, most servers have MySQL 4.x installed
![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|