2014-11-06, 05:34 PM
I don't understand why this query doesn't work. It suppose to always fetch the latest 10 threads but instead is only shows the ones that were posted in the last 24 hours.
How to make it so that it will just show 10 threads starting at the top with the most recent one?
I tried adding:
But makes no difference !
I have a forum that can only be viewed by admin how to make it not to fetch threads from the forum that is hidden from guest view?
How to make it so that it will just show 10 threads starting at the top with the most recent one?
$max = 10;
$query = $db->query("
SELECT t.tid, t.fid, t.subject, t.dateline,
t.lastposter, t.lastposteruid, f.name,
u.usergroup, u.displaygroup, p.displaystyle AS threadprefix, l.displaygroup AS ldisplaygroup, l.usergroup AS lusergroup
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix)
INNER JOIN ".TABLE_PREFIX."forums f
ON (f.fid = t.fid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
LEFT JOIN ".TABLE_PREFIX."users l ON (l.uid=t.lastposteruid)
WHERE $unviewwhere t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.dateline DESC LIMIT $max");
I tried adding:
$datecut = TIME_NOW-(172800);
WHERE t.dateline >='".$datecut."' $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
But makes no difference !
I have a forum that can only be viewed by admin how to make it not to fetch threads from the forum that is hidden from guest view?