Firstly, why does your code have unnecessary
<? and
?> tags in? You can have PHP code execute within a php file without having to open and close php tags constantly; The idea is to close them when you need to execute non-php code, and then open the tag again if needed...
Secondly:
Code:
<a href="http://www.siteaddress.com/forum/showthread.php?threadid=<? echo($row[threadid]); ?>" class="link">Comments</a>(<strong><? echo($row[replycount]); ?>
In the selected code above, you are echo'ing an id into a tag... "echo" is a command to display on screen, and removing this may help...
Finally, I can see no reference to "downloads.php" in any of your code...
Chris