Clemens T
|
Thursday 03 November 2005 1:04:39 pm
Hey all, I'd like to set the last_visit variable of a user. But, do I need to setAttribute on the eZUser.. on the eZContentObject.. or is it a contentObjectAttribute? Ofcourse I'd like to do this in PHP.
Thanks for helping out, Clemens
|
Clemens T
|
Friday 04 November 2005 2:39:24 am
rewrote it, for my own purposes:
function updateLastVisit( $userID , $time)
{
$userVisitArray = $db->arrayQuery( "SELECT 1 FROM ezuservisit WHERE user_id=$userID" );
if ( count( $userVisitArray ) == 1 )
{
$db->query( "UPDATE ezuservisit SET last_visit_timestamp=current_visit_timestamp, current_visit_timestamp=$time WHERE user_id=$userID" );
}
else
{
$db->query( "INSERT INTO ezuservisit ( current_visit_timestamp, last_visit_timestamp, user_id ) VALUES ( $time, $time, $userID )" );
}
}
|
Clemens T
|
Tuesday 08 November 2005 3:53:52 am
well, if you look closely. the updateLastVisit generates the current time. And to make my extension un-dependant of the ezpublish install. I rewrote the function in my extension :). Thanks. (ps: now I can set the time to any time i'd like. not just current time)
|