Page 1 of 1

How to change a user join date

Posted: Wed Feb 01, 2006 6:22 pm
by MCPB
I would like to change the join date of a user on my board. Is this possible??


Thanks!

Posted: Wed Feb 01, 2006 6:37 pm
by StefanL
Yes. It's a UNIX time stamp. If you got phpMyAdmin go to this user and look for 'user_regdate' and then get the time stap go to http://www.4webhelp.net/us/timestamp.php

Posted: Wed Feb 01, 2006 6:39 pm
by Wo1f
Hi MCPB,

This recent article contains a similar issue and also a link to an online human to Unix time converter, located here:
  • Last login time and date
[/url]

In your case though, you would have to modify the following field in the " Users " table --> " user_regdate ".

Hope this helps,
Wolf

Posted: Wed Feb 01, 2006 7:32 pm
by MCPB
Thanks, this works too:


update_regdate.php

Code: Select all

<?php

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

// Change ?? to the user_id of the user you wish to update
$user_id = ??;

// change the following ?? to date you want to show as the joined date
$the_day = ??;
$the_month = ??;
$the_year = ????;

$the_hour = ??;
$the_minute = ??;
$the_second = ?;

// create the unix timestamp
$the_date = mktime($the_hour, $the_minute, $the_second, $the_month, $the_day, $the_year);

// update the users table
$sql = "UPDATE " . USERS_TABLE . " SET user_regdate = " . $the_date . " WHERE user_id = " . $user_id;
if( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Could not set user reg date.', '', __LINE__, __FILE__, $sql);
}

message_die(GENERAL_MESSAGE, 'Updated reg date for user: ' . $user_id . '<br /><br />Set date to: <b>' . $the_date . '</b> which is: ' . date("d M Y", $the_date));

?>
This stand alone code will get the unix time for you and update the DB.

Thanks guys for the input!

HELP

Posted: Sat Jul 29, 2006 5:34 pm
by briano
ok everyone I just totally screwed up my reg_date field...

I have the joined date problem that shows unix time so I went into the nuke_users table and change the reg_date field to date instead of varchar..

now all my 2000 users have joined dates of 000000000..

WTF???

help, how do I restore that back to what it was? I have changed the field back, but they are still showing zeros!!

help help

thank you