Просмотр файла modules/down/index.php

Размер файла: 2.57Kb
<?php
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
// Sitchi CMS - Mobile Content Management System //
// The author:  Nikoloz Sitchinava [sitchi]      //
// Link:        http://sitchicms.num.ge          //
// Skype:       SitchiCMS                        //
// License:     LICENSE.txt (see attached file)  //
// Version:     VERSION.txt (see attached file)  //
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
define('_SITCHICMS', 1);
$root_path='../../';
require $root_path.'includes/db_connect.php';
require $root_path.'includes/start.php';
require $root_path.'includes/header.php';
require $root_path.'includes/functions.php';
require $root_path.'includes/head.php'; // თავი
$lng_down = load_lng('down');
head(''.$lng_down['1_1'].'');
echo'<div class="hdr"><b>'.$lng_down['1_1'].'<a/></b></div>';
@$folder=$_GET['dir'];
@$n=$_GET['n'];
if($n=='') $n=0;
$tsize=0;
$cnt=0;
$ns=0;
if($folder)
{
$dir=opendir(''.$root_path.'files/down/'.$folder.'');
}
else
$dir=opendir(''.$root_path.'files/down/');
while($file=readdir($dir))
{
if($file!='.' and $file!='..' and $file!='.htaccess')
{
if($cnt<$n)
{
$cnt++;
continue;
}
if($ns<10)
{
if($folder and strpos($file,'-'))
$fname=strstr($file,'-');
else
$fname=$file;
if($folder)
{
$page=filesize(''.$root_path.'files/down/'.$folder.'/'.$file.'');
$file=$folder.'/'.$file;
}
else
$page=filesize(''.$root_path.'files/down/'.$file.'');
$size=round($page/1024,1);
if(strpos($file,'.'))
{
$fname=strtok($fname,'.');
echo'<div class="menu"><img src="'.$root_path.'images/icons/file.gif" alt=""/>  <a href="'.$root_path.'files/down/'.$file.'">'.$fname.'</a> ['.$size.'KB]</div>';
$ns++;
$tsize=$tsize+$page;
}
else
{
echo'<div class="menu"><img src="'.$root_path.'images/icons/folder.gif" alt=""/>  <a href="?dir='.$file.'">'.$fname.'</a></div>';
$ns++;
}}
$cnt++;
}}
closedir($dir);
if(!$ns<10 and $ns+$n!=$cnt)
echo'&lt;<strike>'.$lng['1_50'].'</strike> | <a href="index.php?dir='.$folder.'&amp;n='.($ns+$n).'">'.$lng['1_41'].'</a>&gt;<br />';
if($n!=0)
echo'&lt;<a href="index.php?dir='.$folder.'&amp;n='.($n-10).'">'.$lng['1_50'].'</a> | <strike>'.$lng['1_41'].'</strike>&gt;<br />';
if($folder){
echo'<a href="'.htmlspecialchars($_SERVER['HTTP_REFERER']).'"> '.$lng['1_50'].'</a><br />';}
$tsize=round($tsize/1024,1);
$pagean=round($cnt/10);
if(($cnt-$pagean*10)>0) $pagean++;
echo''.$lng_down['1_2'].' '.(($n+10)/10).' '.$lng_down['1_3'].' '.$pagean.'<br/>';
//Download Centr taken from the Internet author unknown
require $root_path.'includes/end.php'; // დასასრული
?>