PDA

View Full Version : Previous thread in this forum by current user


Alphawolf83
11-19-2007, 08:08 PM
Hey there,

I just had an idea and am now wondering if it's possible. Let's say a member creates a thread in forum a. When he does, my idea was to display something like "The last created thread by this user was x days ago".

Is that possible? Thanks in advance!

greetz

Alphawolf83
11-23-2007, 05:44 PM
Okay, I made it myself. Solution follow:
$lastcreatedthread_get = $this->registry->db->query("SELECT dateline
FROM " . TABLE_PREFIX . "thread
WHERE forumid = " . $forum[forumid] . "
AND postuserid = " . $this->thread[postuserid] . "
ORDER BY dateline DESC
LIMIT 1 OFFSET 1;");

$lastcreatedthread_array = $this->registry->db->fetch_row($lastcreatedthread_get);

$lastcreatedthread = date("d.m.Y H:i", $lastcreatedthread_array[0]);
Created as a plugin, Hook "postbit_display_complete".

Insert the variable $lastcreatedthread into the postbit template to display the date.

Where's the applause? :) :p