What do I need to change in these bits of code in articles.php make it where the "Most Read" and "Most Commented" so that the modules only list the top articles in the last "X" amount of days?
PHP Code:
if (in_array('mostread', $af_modules))
{
$row = 0;
$af_mrpp = $vbulletin->options[af_mrpp];
$threads = $db->query_read("
SELECT thread.threadid,thread.title AS threadtitle
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "post AS post
ON (post.postid = thread.firstpostid)
WHERE thread.forumid IN ($forumids)
$visiblethreads $authorids $condition
ORDER BY views DESC
LIMIT 30, $af_mrpp");
while($thread = $db->fetch_array($threads))
{
$row++;
$thread = process_thread_array($thread, $lastread, $foruminfo['allowicons']);
$thread[threadtitle] = substr($thread[threadtitle], 0, $vbulletin->options[af_maxtitle]);
eval('$a_most_read .= "' . fetch_template('af_articlesmallbit') . '";');
}
}
PHP Code:
if (in_array('mostcommented', $af_modules))
{
$row = 0;
$af_mcpp = $vbulletin->options[af_mcpp];
$threads = $db->query_read("
SELECT thread.threadid,thread.title AS threadtitle
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "post AS post
ON (post.postid = thread.firstpostid)
WHERE thread.forumid IN ($forumids)
$visiblethreads $authorids $condition
ORDER BY replycount DESC
LIMIT 30, $af_mcpp");
while($thread = $db->fetch_array($threads))
{