
11-26-2012, 02:21 AM
|
|
|
Join Date: Jan 2006
Posts: 717
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by Ov3rrun
hey Blueman, try this (its working for me), we just need to format current date with the days we want minus thread dateline. We create $datecut variable and a condition the query
This for most read:
PHP Code:
if (in_array('mostread', $af_modules))
{
$row = 0;
$af_mrpp = $vbulletin->options[af_mrpp];
// Change the first 90* for the days you want
$datecut = TIMENOW - (90*24*60*60);
$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.dateline > $datecut AND thread.forumid IN ($forumids)
and this for most comment:
PHP Code:
if (in_array('mostcommented', $af_modules))
{
$row = 0;
$af_mcpp = $vbulletin->options[af_mcpp];
// Change the first 90* for the days you want
$datecut = TIMENOW - (90*24*60*60);
$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.dateline > $datecut AND thread.forumid IN ($forumids)
Enjoy it.
|
I tried this and it didn't work for me:
Quote:
if (in_array('mostread', $af_modules))
{
$row = 0;
$af_mrpp = $vbulletin->options[af_mrpp];
// Change the first 90* for the days you want
$datecut = TIMENOW - (7*24*60*60);
$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.dateline > $datecut AND 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') . '";');
}
}
if (in_array('mostcommented', $af_modules))
{
$row = 0;
$af_mcpp = $vbulletin->options[af_mcpp];
// Change the first 90* for the days you want
$datecut = TIMENOW - (7*24*60*60);
$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.dateline > $datecut AND thread.forumid IN ($forumids)
$visiblethreads $authorids $condition
ORDER BY replycount DESC
LIMIT 30, $af_mcpp");
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_commented .= "' . fetch_template('af_articlesmallbit') . '";');
}
|
|