2014-10-17, 02:01 PM
I am working on a plugin that will return threads which have been replied to within the last 24 hours by I have issue?
Issue #1. Don't understand why p.dateline >= $timesearch is working instead of p.dateline <= $timesearch
I mean post date-line has to be lower than the time-search?
Issue #2.
Trying to add NEW: prefix to new posted thread but it juts won't show?
$timesearch = TIME_NOW - 86400;
$query = $db->query("
SELECT p.dateline, p.tid, t.tid, t.replies, t.views, t.fid, t.subject AS threadsubject, t.lastpost AS threadlastpost, t.lastposter, t.dateline AS threadage, t.lastposteruid, f.name AS name, u.username, u.usergroup, u.displaygroup
FROM ".TABLE_PREFIX."posts p
LEFT JOIN " . TABLE_PREFIX . "threads t ON (t.tid = p.tid)
LEFT JOIN ".TABLE_PREFIX."forums as f ON (f.fid = t.fid)
LEFT JOIN " . TABLE_PREFIX . "users AS u ON (t.lastposteruid = u.uid)
{$fids}
WHERE p.dateline >= $timesearch
group BY p.tid DESC
LIMIT 100
");
Issue #1. Don't understand why p.dateline >= $timesearch is working instead of p.dateline <= $timesearch
I mean post date-line has to be lower than the time-search?
Issue #2.
Trying to add NEW: prefix to new posted thread but it juts won't show?
$cutoff = TIME_NOW - 86400;
if($row['threadage'] <= $cutoff)
{
$newprefix = "<span title=\"Thread posted within the last 24 hours\" class=\"newprefix\">NEW: </span>";
}