Forums | Mahara Community

Developers /
Need to add registration date to usr table


anonymous profile picture
Account deleted
Posts: 117

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. 

Any suggestions? 

Thanks

anonymous profile picture
Account deleted
Posts: 1643

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.

anonymous profile picture
Account deleted
Posts: 117

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.

Heinz Krettek's profile picture
Posts: 480

12 June 2009, 0:53

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

Hi Stephen,

did you modify the USER class ?

HTH Heinz 

anonymous profile picture
Account deleted
Posts: 117

12 June 2009, 4:15

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

Thanks!

6 results