Quote:
Originally Posted by brandon515
Is there a way to create a web query that would list the last x number of threads for a forum for a specific date?
Thanks,
Brandon
|
Its possible. You can customize default webqueries named "
$WQ_last10threadfromforum2" OR "
$WQ_last5threadcontentsfromforum2".
Eg.
Code:
SELECT t.threadid, t.title, t.firstpostid, t.lastpost, t.replycount, t.postusername, t.postuserid, t.lastposter, t.dateline, t.views, p.pagetext
FROM " . TABLE_PREFIX . "thread t
LEFT JOIN " . TABLE_PREFIX . "post p ON p.postid = t.firstpostid
WHERE t.forumid = '2'
AND t.open = '1'
AND t.visible = '1'
ORDER BY t.dateline DESC
LIMIT 0 , 5
can become:
Code:
SELECT t.threadid, t.title, t.firstpostid, t.lastpost, t.replycount, t.postusername, t.postuserid, t.lastposter, t.dateline, t.views, p.pagetext
FROM " . TABLE_PREFIX . "thread t
LEFT JOIN " . TABLE_PREFIX . "post p ON p.postid = t.firstpostid
WHERE t.forumid = '2' AND t.dateline < UNIX_TIMESTAMP('2010-03-27 03:00:00')
AND t.open = '1'
AND t.visible = '1'
ORDER BY t.dateline DESC
LIMIT 0 , 5
OR
Code:
SELECT t.threadid, t.title, t.firstpostid, t.lastpost, t.replycount, t.postusername, t.postuserid, t.lastposter, t.dateline, t.views, p.pagetext
FROM " . TABLE_PREFIX . "thread t
LEFT JOIN " . TABLE_PREFIX . "post p ON p.postid = t.firstpostid
WHERE t.forumid = '2' AND t.dateline < UNIX_TIMESTAMP('2010-03-27 03:00:00') AND t.dateline > UNIX_TIMESTAMP('2010-01-01 03:00:00')
AND t.open = '1'
AND t.visible = '1'
ORDER BY t.dateline DESC
LIMIT 0 , 5