View file Spiderwap.in File Hosting/panel/myfile.php

File size: 1.09Kb
<?
require('../sys/set.php');

$all = $sql->result('SELECT COUNT(*) FROM `files` WHERE `user_id`="'.$user['id'].'"');

if($all==0){
$smarty->assign('title','My Files');
$smarty->assign('error','You did not upload the files');
$smarty->assign('back','index.php');
$smarty->display('header.tpl');
$smarty->display('error.tpl');
$smarty->display('footer.tpl');
}

$page = abs(intval(@$_GET['page']));
if(empty($page)){$page = 1;}

$onp = $sql->query('SELECT `onp` FROM `config` LIMIT 1')->fetch_assoc();
$onp = $onp['onp'];


$allp = ceil($all/$onp);
if($page>$allp){$page=$allp;}

$ff = $sql->query('SELECT `id`,`name` FROM `files` WHERE `user_id`="'.$user['id'].'" ORDER BY `id` DESC LIMIT '.intval($page*$onp-$onp).','.$onp);

while($file = $ff->fetch_assoc()) $files1[] = $file;


$smarty->assign('all',$allp);
$smarty->assign('one',$onp);
$smarty->assign('page',$page);
$smarty->assign('vse',$all);

$smarty->assign('title','My Files');
$smarty->assign('files',$files1);


$smarty->display('header.tpl');
$smarty->display('ank.file.tpl');
$smarty->display('footer.tpl');

?>