PDA

View Full Version : dateline


FreshFroot
01-10-2011, 02:58 AM
Hi there.

I am trying to grab the dateline when someone closes a thread. I am using the showthreadopenclose hook.

Would a variable such as "$post[dateline]" work in this case?

Converting a dateline timestamp is fine. I just don't really know how I would get the timestamp when closing a thread? I was thinking using the $post[dateline] variable, it would get me the timestamp at that moment the thread is closed?

I'm basically trying to store this dateline timestamp into a table in the database.

kh99
01-10-2011, 09:36 AM
I the case of closing it from the thread tools menu, I think hook location threadmanage_openclose would work and it looks like you can check for $threadinfo['open'] == 0 (because the same code opens and closes, and the hook's called after the field is set to 0), and use $threadinfo['dateline'].

If the inline moderation is used, there's hook location inlinemod_closeopen and you can check for $_POST['do'] == 'close'. The dateline's not available so you'd have to query that yourself using $thread['threadid'] (or edit inline.php and add dateline to the list of fields, around line 448).

I haven't tried any of this. Also, I don't know if these are the only two ways to close a thread.