Log in

View Full Version : Date stamp?


Christine
10-15-2005, 04:46 PM
I have figured out the hooks I need to write a datestamp to the database when a signature is submitted, but the date is writing as 0.

Anyone know what the problem may be?


Hook: userdata_start
$this->validfields['sigdateline'] = array(TYPE_UNIXTIME, REQ_NO);
Hook: profile_updatesignature_complete
$vbulletin->input->clean_gpc('p', 'sigdateline', TYPE_UNIXTIME);

$userdata->usertextfield['sigdateline']= " . TIMENOW . ";

Andreas
10-16-2005, 08:02 PM
sigdateline is in which table usertextfield?

Then you need another Plugin

userdata_doset

if ($fieldname == 'sigdateline')
{
$tables = array('usertextfield');
}


Also, you should use $userdata->set('sigdateline', TIMENOW); rather tan directly setting the table fields :)

Christine
10-17-2005, 10:48 AM
Thanks Kirby!

I didn't see this post before trying something else: $userdata->usertextfield['sigdateline']=TIMENOW;
That worked with the original userdata_start addition.

Will that be OK, or is there a potential problem with it?

Andreas
10-17-2005, 11:14 AM
It will work, but by using this code you are effectively bypassing the Datamanager, therefore it is not recommended.

Christine
10-17-2005, 12:31 PM
Gotcha!

Thanks Kirby. Don't know what we would do without you. :)