View file loads/extra/last.php

File size: 4.93Kb
<?php

include_once "../inc/log.php";
include_once "../inc/func.php";
include_once "../css/index.php";

echo'<title>Последние файлы</title><div class="titlemenu"><b>
	'.ucfirst($_SERVER['HTTP_HOST']).' - последние файлы</b></div><div class="kletka">';
	echo'<center><b>'.vrem(date("j F G:i - l")).'</b></center><br>';





echo'Сортировать по: <a href="last.php?sort=name">имени</a> | <a href="last.php?sort=ves">весу</a> | <a href="last.php?sort=time">времени</a> | <a href="last.php?sort=star">популярности</a>';

if(isset($_GET['sort'])){
	if($_GET['sort']=='ves' || $_GET['sort']=='name' || $_GET['sort']=='time' || $_GET['sort']=='star'){}else{ exit('<br>Ошибка!'); }}


#  ВЫВОД ФАЙЛОВ
if (isset($_GET['start']) && is_numeric($_GET['start'])){$start = intval($_GET['start']);} else {$start = 0;}
if(eregi("[^0-9]", $start)){ echo'Неверная страница!'; exit;}

$conf_all=$_cnf_['b'];  //  количество на страницу


$q = "SELECT * FROM `last`"; 
$result = mysql_query($q) or die(mysql_error());
$total = mysql_num_rows($result);

if(isset($_GET['sort']) && $_GET['sort']=='name'){
$posts = mysql_query("SELECT * FROM `last` ORDER BY name ASC LIMIT ".$start.", ".$conf_all.";"); }
if(isset($_GET['sort']) && $_GET['sort']=='time'){
$posts = mysql_query("SELECT * FROM `last` ORDER BY time DESC LIMIT ".$start.", ".$conf_all.";"); }
if(isset($_GET['sort']) && $_GET['sort']=='ves'){
$posts = mysql_query("SELECT * FROM `last` ORDER BY ves DESC LIMIT ".$start.", ".$conf_all.";"); }
if(isset($_GET['sort']) && $_GET['sort']=='star'){
$posts = mysql_query("SELECT * FROM `last` ORDER BY dwns DESC LIMIT ".$start.", ".$conf_all.";"); }
if(!isset($_GET['sort'])){
$posts = mysql_query("SELECT * FROM `last` ORDER BY time DESC LIMIT ".$start.", ".$conf_all.";"); }

if($total>0){

if ($start < 0 || $start > $total){$start = 0;}
if ($total < $start + $conf_all){ $end = $total; }
else {$end = $start + $conf_all; }
if(isset($_GET['start']) && $_GET['start']>$end){ exit('Такой страницы не существует'); }
for ($i = $start; $i < $end; $i++){
$a=mysql_fetch_array($posts);



echo'<br><div class=bar><center><b><a href="../'.$a['id'].'/'.$a['forlast'].'">'.$a['name'].'</a></b>';
if($session==1){ echo' .. <a href="/loads/fl.php?del_fl='.$a['forlast'].'&id='.$a['id'].'"><font color="red">[DEL]</font></a> .. <a href="/loads/fl.php?rnm_fl&id='.$a['id'].'&dir='.$a['forlast'].'">[ИЗМ]</a>'; }
echo'</center></div>';



$dt = explode(".",$a['file']);
$op = explode(" ",clr($a['about']));
for($i3=0; $i3<$_cnf_['c']; $i3++){
echo @$op[$i3].' '; }

if($_cnf_['a1']=="y"){  // ПОКАЗАТЬ ЛИ ПРЕВЬЮ СКРИНШОТОВ
if($dt[1]=="jpg" || $dt[1]=="gif" || $dt[1]=="png"){
echo'<br><a href="/loads/image.php?image=base/'.$a['razd'].'/'.$a['pod_razd'].'/'.$a['pod_razd2'].'/'.$a['file'].'">
<img src="/loads/image.php?image=base/'.$a['razd'].'/'.$a['pod_razd'].'/'.$a['pod_razd2'].'/'.$a['file'].'&w_size=40&h_size=40" alt="Screen"></a>
 <a href="../base/'.$a['razd'].'/'.$a['pod_razd'].'/'.$a['pod_razd2'].'/'.$a['file'].'">увеличить</a> ';    }

if(!empty($a['scr_shot'])){
echo'<br><a href="/loads/image.php?image=base/'.$a['razd'].'/'.$a['pod_razd'].'/'.$a['pod_razd2'].'/'.$a['scr_shot'].'">
<img src="/loads/image.php?image=base/'.$a['razd'].'/'.$a['pod_razd'].'/'.$a['pod_razd2'].'/'.$a['scr_shot'].'&w_size=40&h_size=40" alt="Screen"></a>
 <a href="../base/'.$a['razd'].'/'.$a['pod_razd'].'/'.$a['pod_razd2'].'/'.$a['scr_shot'].'">увеличить</a> ';    }

}else{

if($dt[1]=="jpg" || $dt[1]=="gif" || $dt[1]=="png"){
echo'<br><a href="../base/'.$a['razd'].'/'.$a['pod_razd'].'/'.$a['pod_razd2'].'/'.$a['file'].'">Скриншот</a> 
(<a href="/loads/image.php?image=base/'.$a['razd'].'/'.$a['pod_razd'].'/'.$a['pod_razd2'].'/'.$a['file'].'">mini</a>)';    }
if(!empty($a['scr_shot'])){
echo'<br><a href="../base/'.$a['razd'].'/'.$a['pod_razd'].'/'.$a['pod_razd2'].'/'.$a['scr_shot'].'">Скриншот</a> 
(<a href="/loads/image.php?image=base/'.$a['razd'].'/'.$a['pod_razd'].'/'.$a['pod_razd2'].'/'.$a['scr_shot'].'">mini</a>)';    }
	}

	echo'<br>_________<br>';
	echo'Категория: <b>'.$a['category'].'</b><br>';
	echo'Размер: '.$a['ves'].'<br>';

echo'Скачали: <b>'.$a['dwns'].'</b> раз<br>
	<b><a href="/loads/d'.$a['id'].'/'.$a['forlast'].'">Скачать файл</a> (.'.$dt[1].')</b><br>';
echo'<b><a href="/loads/c'.$a['id'].'/'.$a['forlast'].'">Комментарии</a></b> ('.intval($a['comms']).')';


}

echo'<br><br>Стр: ';
if(isset($_GET['sort'])){
page_navigation('/loads/extra/last.php?sort='.$_GET['sort'].'&start=', $conf_all, $start, $total);
}else{
page_navigation('/loads/extra/last.php?start=', $conf_all, $start, $total);
}

	}else{ echo'Подраздел пуст.'; }





include_once "../css/foot.php";
?>