exmob, classes/pclzip.lib.php
перезалей:-)
$req = mysql_fetch_array(mysql_query("SELECT * FROM `downfiles` WHERE `status` = '1' LIMIT 1;"));
$new_comm = mysql_result(mysql_query("SELECT COUNT(*) FROM `downkomm` WHERE `userid` = '" . $login . "' AND `read` = '0'"), 0);
if ($new_comm)
echo '<div class="greenmenu"><img src="' . $set['homeurl'] . '/images/lenta.gif" alt=""/> <a href="' . core::$system_set['homeurl'] . '/download/komm.php?id='.$req['id'].'">Новые комменты к файлу</a></div>';
mysql_query("INSERT
INTO `downkomm` SET
`read`='0';");
if(core::$user_id == $user['id'] && $arr['read'])
mysql_query("UPDATE `downkomm` SET `read` = '1' WHERE `id` = '$id' LIMIT 1");
$query = mysql_query("select * from `downkomm` where fileid='" . $id . "' ORDER BY `time` ASC LIMIT " . $start . "," . $kmess);
while($arr = mysql_fetch_array($query)){
$req = mysql_query("SELECT COUNT(*) FROM `forum`
LEFT JOIN `cms_forum_rdm` ON `forum`.`id` = `cms_forum_rdm`.`topic_id` AND `cms_forum_rdm`.`user_id` = '" . core::$user_id . "'
WHERE `forum`.`type`='t'" . (core::$user_rights >= 7 ? "" : " AND `forum`.`close` != '1'") . "
AND (`cms_forum_rdm`.`topic_id` Is Null
OR `forum`.`time` > `cms_forum_rdm`.`time`)");
$file = mysql_fetch_assoc(mysql_query("SELECT * from `downfiles` where `user_id` = '".$res['userid']."'"), 0);
где while ($res = mysql_fetch_assoc($req)) а $req = mysql_query("SELECT * FROM `downkomm` ORDER BY `time` DESC LIMIT $start, $kmess");