connect_db(); if ((isset($_GET['cat_id'])) AND ($_GET['cat_id'] != "") AND (isset($_GET['id_download'])) AND ($_GET['id_download'] != "")) { if((is_numeric($_GET['id_download'])) AND (is_numeric($_GET['cat_id']))) { $query="SELECT * FROM downloads,cat WHERE id_download=".$_GET['id_download']." AND ".$_GET['id_download']."=".$_GET['id_download'].""; $result = mysql_query ($query); if (mysql_errno()!= 0) { echo "
"; } else { if (mysql_num_rows ($result) == 0) { echo ""; } else { $row = mysql_fetch_object($result); $downloads_file = $row->downloads_file; $download_file = $row->download_file; $category_file = $row->category_file; $downloads_file++; $query = "UPDATE downloads SET downloads_file=$downloads_file WHERE id_download=".$_GET['id_download'].""; mysql_query($query); header("Content-Type: ".filetype("file.rar")); header("Content-Length: ".filesize("file.rar")); header("Content-Disposition: attachment; filename=file.rar"); header("Content-type: application/force-download"); header("Content-type: application/octet-stream"); echo file_get_contents ("file.rar"); exit; } } } else { echo "ХАКЕР"; } } else { if((isset($_GET['cat_id'])) AND ($_GET['cat_id'] != "")) { if((is_numeric($_GET['cat_id']))) { //Отображаем файлы данной категории $query_download="SELECT * FROM downloads WHERE cat_id=".$_GET['cat_id']." AND ".$_GET['cat_id']."=".$_GET['cat_id'].""; $result_download = mysql_query ($query_download); if (mysql_errno()!= 0) { echo ""; } else { if (mysql_num_rows ($result_download) == 0) { echo ""; } else { ?> while ($row_download=mysql_fetch_object($result_download)) { ?>| echo "".stripslashes($row_download->download_file_name).""; ?> | ||
| $comment = stripslashes($row_download->description_file); $comment = htmlspecialchars($comment, ENT_QUOTES); $comment = nl2br($comment); $comment = str_replace("[u]","",$comment); $comment = str_replace("[U]","",$comment); $comment = str_replace("[i]","",$comment); $comment = str_replace("[I]","",$comment); $comment = str_replace("[b]","",$comment); $comment = str_replace("[B]","",$comment); $comment = str_replace("[sub]","",$comment); $comment = str_replace("[SUB]","",$comment); $comment = str_replace("[sup]","",$comment); $comment = str_replace("[SUP]","",$comment); $comment = str_replace("[/u]","",$comment); $comment = str_replace("[/U]","",$comment); $comment = str_replace("[/i]","",$comment); $comment = str_replace("[/I]","",$comment); $comment = str_replace("[/b]","",$comment); $comment = str_replace("[/B]","",$comment); $comment = str_replace("[/SUB]","",$comment); $comment = str_replace("[/sub]","",$comment); $comment = str_replace("[/SUP]","",$comment); $comment = str_replace("[/sup]","",$comment); $comment = eregi_replace("(.*)\\[url\\](.*)\\[/url\\](.*)","\\1\\2\\3",$comment); $comment = str_replace("\n"," ",$comment); $comment = str_replace("\r"," ",$comment); $comment = preg_replace("#\[color=([a-z]+)\](.*?)\[/color\]#is", '$2', $comment); $comment = preg_replace("#\[size=([0-9]+)\](.*?)\[/size\]#is", '$2', $comment); $comment = preg_replace_callback("#\[url=((?:http|ftp|https)://)?([^\]]+)\](.*?)\[/url\]#is", 'func', $comment); echo "".$comment.""; ?> | ||
| Сайт программы echo "".htmlspecialchars(stripslashes($row_download->url_programm), ENT_QUOTES).""; ?> | Версия echo "".htmlspecialchars(stripslashes($row_download->version_file), ENT_QUOTES).""; ?> | |
| Автор(добавивший): echo "".htmlspecialchars(stripslashes($row_download->author), ENT_QUOTES).""; ?> | Скачиваний: echo "".stripslashes($row_download->downloads_file).""; ?> | echo "id_download)."'>"; echo "Загрузить"; $file = $row_download->download_file; $category = $row_download->category_file; echo ""; $size = filesize("files/$category/$file"); if($size>1048576) { $size = round($size/1024/1024, 2); echo "(".$size." Мб)"; } else { $size = round($size/1024, 0); echo "(".$size." Кб)"; } ?> |