Here is a little feature I created for my site. It shows all comments, created for the last 24 hours.
Use on your own risk.
1. Edit file download.php: find
PHP Code:
else if ($_GET['do'] == 'manfiles')
Add BEFORE it:
PHP Code:
// LAST COMMENTS
else if ($_GET['do'] == 'lastcomments')
{
$hr = "";
$result = $vbulletin->db->query_read("SELECT * FROM `" . TABLE_PREFIX . "dl2_comments` WHERE date > ". (TIMENOW - 86400) . " ORDER BY id DESC");
while ($query = $db->fetch_array($result))
{
$message = strip_bbcode($query['message']);
if (strpbrk($message, '*') == false )
{
$hr = $hr . "<a href=member.php?" . $query['authorid'] . ">". $query['author'] .
"</a>: <br>" . $message . " <a href=downloads.php?do=file&id=" . $query['fileid'] . "> >> <i>visit file</i> >></a><hr>";
}
}
eval('$dmain_jr .= "' . fetch_template('downloads_lastcomments') . '";');
$templater = vB_Template::create('downloads2_panel_side');
$templater->register('dlstats', $dlstats);
$dpanel = $templater->render();
$templater = vB_Template::create('downloads2_wrapper_side');
$templater->register('dmain_jr', $dmain_jr);
$templater->register('dpanel', $dpanel);
$dmain = $templater->render();
}
// END LAST COMMENTS
2. Create a template
downloads_lastcomments:
That's it. Now to see the last comments, just open *****/downloads.php?do=lastcomments
If you don't want some comments to be visible (moderator's notes), put * in front of it.
Reminder: always back up the file before editing it. I rename it to downloads1.php and do the testing first, then rename it back to downloads.php.