Forums | Mahara Community
Need to add registration date to usr table
11 June 2009, 19:23
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.
11 June 2009, 22:02
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.
12 June 2009, 0:37
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.
12 June 2009, 0:53
try to look into your host errorlog file in order to see what´s going wrong with your code
greetings from Germany
12 June 2009, 1:56
did you modify the USER class ?
12 June 2009, 4:15
Ah ha! That was it, Heinz. I forgot to modify the user class. All is working now.