Forums | Mahara Community

Developers /
Need to add registration date to usr table


Stephen C's profile picture
Posts: 117

11 June 2009, 7:23 PM

I need to keep track of when a user registered, so I added a field in the usr table called "joindate".  Unfortunately, I can't seem to integrate it into the registration code.

Looking at the code for register.php, it seems like I would be able to just add the following line to the "create_registered_user" function:

$user->joindate = db_format_timestamp(time()); 

right above "create_user($user, $profilefields);".  However, doing this doesn't work and I receive an error when trying to activate the user.  I've tried several other ways, but none have worked. 

Any suggestions? 

Thanks

Nigel's profile picture
Posts: 1643

11 June 2009, 10:02 PM

Hi - is the joindate columnn the right type? It'll need to be whatever a timestamp is represented as on your database (in postgres it's timestamp without time zone).

If you're getting any errors it would help to see them.

Stephen C's profile picture
Posts: 117

12 June 2009, 12:37 AM

Yes, the joindate column is a MySQL datetime column type, just like lastlogin, lastaccess, etc.

I'm just getting one of those generic Mahara error messages that doesn't say exactly what the error is. I don't see any error log for Mahara, so I have no idea what the problem is.

Heinz Krettek's profile picture
Posts: 480

12 June 2009, 12:53 AM

Hi Stephen,

try to look into your host errorlog file in order to see what´s going wrong with your code Wink

greetings from Germany

Heinz 

Heinz Krettek's profile picture
Posts: 480

12 June 2009, 1:56 AM

Hi Stephen,

did you modify the USER class ?

HTH Heinz 

Stephen C's profile picture
Posts: 117

12 June 2009, 4:15 AM

Ah ha!  That was it, Heinz.  I forgot to modify the user class.  All is working now.

Thanks!

6 results