CODE (htmlphp):
скопировать код в буфер обмена
скопировать код в буфер обмена
- <? include("includes/connect-mysql.php");
- $num = 5;
- $page = $_GET['page'];
- $result = mysql_query("SELECT COUNT(*) FROM files WHERE files_cat = $cat");
- $files = mysql_result($result,0);
- $total = intval(($files - 1) / $num) + 1;
- $page = intval($page);
- $start = $page * $num - $num;
- $result = mysql_query("SELECT * FROM files WHERE files_cat = $cat ORDER BY files_id DESC LIMIT $start,$files",$db);
- while ( $postrow[] = mysql_fetch_array($result));
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
- <meta http-equiv='refresh' content='9999999999'>
- <title>Файлы</title>
- <link href="template/styles/style.css" rel="stylesheet" type="text/css" />
- <link href="template/styles/files.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <!-- Шапка -->
- <table width="1200px" height="325px" border="0" align="center" cellpadding="0" cellspacing="0" background="template/img/header.png">
- <tr>
- <td>
- </td>
- </tr>
- </table>
- <!-- Меню -->
- <? include("includes/menu.php"); ?>
- <!-- Контенты -->
- <table class="contents" cellpadding="0" cellspacing="0">
- <!-- Контент 1 -->
- <? include("includes/content1.php"); ?>
- <!-- Контент 2 -->
- <!-- Контент 2 -->
- <tr>
- <td class="content-top" align="center">Категории файлов:</td>
- </tr>
- <tr>
- <td class="content" align="center">
- <h6 id="files-link">
- <a href="files.php?page=1&cat=1">Плагины SourceMod</a>
- <a href="files.php?page=1&cat=2">Плагины EventScripts</a>
- <a href="files.php?page=1&cat=5">Готовые сервера</a>
- <a href="files.php?page=1&cat=3">Модели</a><br>
- <a href="files.php?page=1&cat=4">Карты</a>
- </h6>
- </td>
- </tr>
- <tr>
- <td class="content-footer"></td>
- </tr>
- <tr><td height="50px"></td></tr>
- <!-- Контент 3 -->
- <? include("includes/content3.php"); ?>
- <!-- Основной контент -->
- <table cellpadding="0" cellspacing="0" class="general-table">
- <!-- Топ -->
- <tr>
- <td class="table-top"></td>
- </tr>
- <!-- Центр -->
- <tr>
- <td class="table" align="center">
- <h5>
- <?
- if($page - $total != 0){$res = 5;}else{$res = $files - $num*($page - 1);}
- for($i = 0; $i < $res; $i++){
- $cat = $postrow[$i]['files_cat'];
- "<table border='0' cellpadding='0' cellspacing='0' class='table-files'>
- <!-- Топ -->
- <tr>
- <td class='files-top' id='files'>
- <div class='files-title'>Название:%s</div>
- </td>
- </tr>
- <!-- Содержание -->
- <tr>
- <td class='files' id='files' align='center'>
- <h5>
- <img src='%s' widtch='300px' height='300px'><br><br>
- %s
- </h5>
- </td>
- </tr>
- <!-- Футер -->
- <tr>
- <td class='files-footer' align='center'>
- <div id='files-load'><a href='%s'>Скачать</a></div>
- </td>
- </tr>
- </table>",
- $postrow[$i]['files_name'],
- $postrow[$i]['files_img'],
- $postrow[$i]['files_desc'],
- $postrow[$i]['files_link']
- );
- echo "<br><br><br>";
- }
- $cat = $_GET['cat'];
- if ($page != 1) {$pervpage = '<a href= ./files.php?page=1><<</a> <a href= ./files.php?page='. ($page - 1) .'><</a> ';}
- else{$pervpage = "";}
- if ($page != $total) {$nextpage = '<a href= ./files.php?page='. ($page + 1) .' > ></a> <a href= ./files.php?page=' .$total. '> >> </a>';}
- else{$nextpage = "";}
- if($page - 2 > 0) {$page2left = ' <a href= ./files.php?page='. ($page - 2) .'>'. ($page - 2) .'</a> | ';}
- else{$page2left = "";}
- if($page - 1 > 0) {$page1left = '<a href= ./files.php?page='. ($page - 1) .'&cat='. $cat .'>'. ($page - 1) .'</a> | ';}
- else{$page1left = "";}
- if($page + 2 <= $total) {$page2right = ' | <a href= ./files.php?page='. ($page + 2) .'>'. ($page + 2) .'</a>';}
- else{$page2right = "";}
- if($page + 1 <= $total) {$page1right = ' | <a href= ./files.php?page='. ($page + 1) .'>'. ($page + 1) .'</a>';}
- else{$page1right = "";}
- echo "<div id=\"files-link\">";
- if($files != 0){
- echo $pervpage.$page2left.$page1left.'<b>'.$page.'</b>'.$page1right.$page2right.$nextpage;
- }
- echo "</div>";
- ?>
- </h5>
- </td>
- </tr>
- <!-- Футер -->
- <tr>
- <td class="table-footer" align="center">
- <? include("includes/copyright.php"); ?>
- </td>
- </tr>
- </table>
- </body>
- </html>