PHP Code:
while ($file = $DB_site->fetch_array($files))
{
$countcomments = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "dl_coms WHERE fileid='" . addslashes($file[id]) . "'");
$comments = mysql_num_rows($countcomments);
eval('$filebits .= "' . fetch_template('downloads_filebit') . '";');
}
If you have 25 files in a category you will run 50+ queries on this page... this will eat up a TON of cpu.
If you cache download_filebit you can knock out 25 queries, but they arent the important ones. (Note: im not 100% sure that it doesnt cache the template after fetching it once, but I had this problem with a hack I made last year)
The query to select the comments per file will take a long time unless you create an index by the file's id, and even then it will be very poor performance.
You have a lot of performance issues. If you want, I can help you. My download mod has virtually no performance issues except on upload/edit/delete (which occures infrequently that it is not a factor). It actually runs fewer queries than the average vB forum page. My msn it ronin at elitecoders dot org.