Page 1 of 1

Get user_lastpost_time with $event in submit_post_end event?

Posted: Fri Apr 28, 2017 1:06 pm
by aster59
I performed a

Code: Select all

die(print_r($event))
for the core.submit_post_end. I can't get this though.

Code: Select all

[user_lastpost_time] => 1493384056
I see it about halfway down the page.
How would I access this? Tried the $event['data'] but not there. It is such a big event!

Thanks.

Re: Get user_lastpost_time with $event in submit_post_end event?

Posted: Fri Apr 28, 2017 1:16 pm
by david63
Just a guess - but try $user_lastpost_time = $event['data']['user_lastpost_time'];
or you could use

Code: Select all

$data = $event['data'];
$user_lastpost_time = $data['user_lastpost_time'];

Re: Get user_lastpost_time with $event in submit_post_end event?

Posted: Fri Apr 28, 2017 2:21 pm
by aster59
That appears to not work either.

Code: Select all

$user_lastpost_time = $event['data']['user_lastpost_time'];
returns blank upon a

Code: Select all

die(print($user_lastpost_time))
statement in the event.

It is right around here in the giant die(print($event)); file:

Code: Select all

[user_lastmark] => 1459725671 [user_lastpost_time] => 1493384056 [user_lastpage] => ucp.php?mode=login [user_last_confirm_key]
what sub array is this?

Re: Get user_lastpost_time with $event in submit_post_end event?

Posted: Fri Apr 28, 2017 2:48 pm
by kasimi
$event['data'] contains information about the post itself. user_lastpost_time is a field in the $user object:

Code: Select all

$user_lastpost_time = $this->user->data['user_lastpost_time'];

Re: Get user_lastpost_time with $event in submit_post_end event?

Posted: Fri Apr 28, 2017 4:33 pm
by aster59
kasimi wrote:
Fri Apr 28, 2017 2:48 pm
$event['data'] contains information about the post itself. user_lastpost_time is a field in the $user object:

Code: Select all

$user_lastpost_time = $this->user->data['user_lastpost_time'];
Oh wow I didn't even look there. Thanks so much.

Re: Get user_lastpost_time with $event in submit_post_end event?

Posted: Fri Apr 28, 2017 4:34 pm
by aster59
kasimi wrote:
Fri Apr 28, 2017 2:48 pm
$event['data'] contains information about the post itself. user_lastpost_time is a field in the $user object:

Code: Select all

$user_lastpost_time = $this->user->data['user_lastpost_time'];
Oh wow I didn't even look there. Thanks so much.

Sorry this posted twice for some reason.