Forums

Copying joomla user id to antoher table column

roarjohansen 01 May, 2010
HeyπŸ™‚

I am about to integrate joomla and mylittle forum into eachother. By using the registration plugin I have bin able to make a form that creates a new joomla user and creates a new mylittle forum user by inserting infomation to the forum table via the Database connection possibility.

It works fine, with just a slight problem.


The actual problem:

I would like relationship between the joomla usertable and then forum user table.

My first idea was to catch the automatic created joomla ID and copy it into the forum table USER_ID. I tried using this:

JRequest::setVar('user_id', $user->id); //Inserted into the joolma registration plugin extra code area. Tried both before registration area and after registration area.

It doesnt really work. :/

Any suggestions ?πŸ™‚
GreyHead 08 May, 2010
Hi roarjohansen,

As you've found you can't get the user-id that way. I think that you can get it after registration from the Joomla User Object
$user = JFactory::getUser();
then $user_.id will give you what you need.

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger