Get user_lastpost_time with $event in submit_post_end event?

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
aster59
Registered User
Posts: 82
Joined: Sun Jun 26, 2016 1:47 pm
Location: United States

Get user_lastpost_time with $event in submit_post_end event?

Post by aster59 » Fri Apr 28, 2017 1:06 pm

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.

User avatar
david63
Registered User
Posts: 16416
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Get user_lastpost_time with $event in submit_post_end event?

Post by david63 » Fri Apr 28, 2017 1:16 pm

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'];
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

aster59
Registered User
Posts: 82
Joined: Sun Jun 26, 2016 1:47 pm
Location: United States

Re: Get user_lastpost_time with $event in submit_post_end event?

Post by aster59 » Fri Apr 28, 2017 2:21 pm

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?

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3800
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Get user_lastpost_time with $event in submit_post_end event?

Post by kasimi » 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'];

aster59
Registered User
Posts: 82
Joined: Sun Jun 26, 2016 1:47 pm
Location: United States

Re: Get user_lastpost_time with $event in submit_post_end event?

Post by aster59 » Fri Apr 28, 2017 4:33 pm

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.
Last edited by aster59 on Sat Apr 29, 2017 11:22 am, edited 4 times in total.

aster59
Registered User
Posts: 82
Joined: Sun Jun 26, 2016 1:47 pm
Location: United States

Re: Get user_lastpost_time with $event in submit_post_end event?

Post by aster59 » Fri Apr 28, 2017 4:34 pm

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.

Post Reply

Return to “Extension Writers Discussion”