Просмотр файла downs/new_day.php

Размер файла: 3.18Kb
  1. <?php
  2.  
  3. $title='Новые загрузки';
  4. require"../system/config.php";
  5. require"../system/func.php";
  6. require"../system/head.php";
  7. require"../system/error.php";
  8.  
  9. echo'<div class="i">'.$title.'<br></div>';
  10. switch($_GET['act']){
  11. case 'go':
  12. echo'<form action="new_day.php?" method="get">Скрипты за последние<br />
  13. <input name="day" type="text" size="2" maxleght="3" class="form" value="1"/>Дней<br />
  14. <input type="submit" value="Смотреть" class="but"></form>';
  15. break;
  16. default:
  17. $day=(int)$_GET['day'];
  18. if($day==0 or $day==""){echo'Не корректный ввод'; require"../system/foot.php"; exit;}
  19. $cif1=$day*24*60*60;
  20. $cif2=time()-$cif1;
  21.  
  22. if(isset($_GET['st'])){$st=cifry($_GET['st']);}else{$st=0;}
  23.  
  24. if(isset($_POST['str'])){$str=cifry($_POST['str']);}else{$str=0;}
  25.  
  26.  
  27. if(!empty($str)){$st=$str*10-10;}
  28.  
  29. if(empty($st) or $st<0){$st=0;}
  30. $num=10;
  31. $adata=mysql_query("select * from load_files where dobav>'$cif2'");
  32. $sdata=mysql_query("select * from load_files where dobav>'$cif2' order by id_file desc limit $st,$num");
  33. $kol=mysql_num_rows($adata);
  34.  
  35. if($st>$kol){echo'Не верный номер страници'; require"../system/foot.php"; exit;}
  36. if($kol==0){
  37. echo'<div class="p">
  38. За последние '.$day.' дня, не было новых загрузок...<br>
  39. </div>';
  40. }else{ echo'<div class="i">Результатов '.$kol.'<br></div>';
  41.  
  42.  
  43. while($ofile=mysql_fetch_array($sdata)){
  44. $dokuda='../down/'.$ofile['put'].'/'.$ofile['nastna'].'.'.$ofile['format']; #Путь до файла
  45. $vesma=round(filesize($dokuda)/1024); #Вес файла
  46. if($vesma==0){$vesma='Менее 1';}
  47. echo'<div class="p">';
  48. if(empty($ofile['name'])){
  49. $ofile['name']=$ofile['nastna'].'.'.$ofile['format'];
  50. }
  51.  
  52. echo'<b>Имя:</b> <a href="'.$ofile['id_file'].'.info">'.$ofile['name'].'</a> <br><b>Описание: </b>'; if($ofile['opis']==""){echo'нет';}else{ echo mb_substr($ofile['opis'],0,200,'UTF-8'); echo'<br>
  53. <small>Скачали: '.$ofile['loads'].' раз<br></small>
  54. <a href="load.php?id_load='.$ofile['id_file'].'&amp;'.$s.'">Скачать</a> ['.strtoupper($ofile['format']).'] ['.$vesma.'Кб]<br>
  55. ';
  56. $koments=mysql_num_rows(mysql_query("select * from koments where type='downs' and id_kogo='".$ofile['id_file']."'"));
  57.  
  58. $koments=mysql_num_rows(mysql_query("select * from koments where type='downs' and id_kogo='".$ofile['id_file']."'"));
  59. echo'<a href="../pages/koments.php?id_wm='.$ofile['id_file'].'&amp;type=downs&amp;'.$s.'">Комментарии</a> ['.$koments.']<br>
  60. </div>';
  61.  
  62.  
  63. }}
  64.  
  65.  
  66. if($st!=0){
  67. echo'<div class="p"><img src="../design/default/act.gif" alt="-"> <a href="new_day.php?st='.($st-$num).'&amp;day='.$day.'&amp;'.$s.'">Назад</a><br></div>';
  68. }
  69. if($kol>$st+$num){
  70. echo'<div class="p"><img src="../design/default/act.gif" alt="-"> <a href="new_day.php?st='.($st+$num).'&amp;day='.$day.'&amp;'.$s.'">Вперед</a><br></div>';}
  71.  
  72. if($kol>10){
  73. echo'<div class="p">
  74. <form action="new_day.php?day='.$day.'&amp;'.$s.'" method="post">
  75. На страницу (1-'.ceil(($kol/10)).'):<br>
  76. <input type="text" name="str" maxlength="4" class="form" size="3" value="'.ceil(($kol/10)).'">
  77. <input type="submit" value="ОК" class="but"><br>
  78. </form></div>';}
  79.  
  80. break;
  81. } require"../system/foot.php";
  82. ?>