Spis plików
Spis plików
witam!
zna ktoś jakiś program który by zrobił spis plików ? bo mam dużo midi i nie chce mi sie aż tyle pisać
zna ktoś jakiś program który by zrobił spis plików ? bo mam dużo midi i nie chce mi sie aż tyle pisać
www.thetuning.cba.pl - wszystko dla twojej komórki całkiem nowa ODS£ONA !!
o właśnie to tylklo czemu PHP
www.thetuning.cba.pl - wszystko dla twojej komórki całkiem nowa ODS£ONA !!
mam prośbe zrobił by ktoś ten szablon na taki spis ? w php a ja późiej zmienie co trzeba
www.thetuning.cba.pl - wszystko dla twojej komórki całkiem nowa ODS£ONA !!
no tak oto mi chodzi:
mam w folderze ok 300 plików i chce żeby były do ściągnięcia ale to jest za dużo pisania ręcznie a może jest jakiś program do tego ale jak jest możliwość przez PHP to spox
mam w folderze ok 300 plików i chce żeby były do ściągnięcia ale to jest za dużo pisania ręcznie a może jest jakiś program do tego ale jak jest możliwość przez PHP to spox
www.thetuning.cba.pl - wszystko dla twojej komórki całkiem nowa ODS£ONA !!
-
- Przyjaciel CBA
- Posty: 826
- Rejestracja: 21 maja 2006, 16:38:11
- Lokalizacja: Oka
- Płeć:
- User Agent:
- Kontakt:
Kod: Zaznacz cały
<?php
//========eFileBrowser v1.0.6========
// Autor: Emdek <emdek@epf.pl>
// Licencja: GPL
error_reporting (0);
session_start ();
$ImagesPath = 'icons/'; // ¦cieżka dostępu do katalogu plików graficznych
$Hidden = array ('fb.config.php'); // Lista plików i katalogów ukrywanych w każdym katalogu
function file_type ($Name) {
$Ext = explode ('.', $Name);
$Ext = strtolower (end ($Ext));
if (in_array ($Ext, array ('html', 'htm', 'shtml'))) $FileExt = 'html';
else if (in_array ($Ext, array ('php', 'php3', 'phtml'))) $FileExt = 'php';
else if (in_array ($Ext, array ('zip', 'rar', 'tar', 'gz', 'bz2', 'tgz'))) $FileExt = 'archive';
else if (in_array ($Ext, array ('avi', 'mpg', 'mpeg'))) $FileExt = 'movie';
else if (in_array ($Ext, array ('vaw', 'mp3', 'ogg'))) $FileExt = 'sound';
else if (in_array ($Ext, array ('bmp', 'gif', 'png', 'jpg', 'jpeg'))) $FileExt = 'image';
else if (in_array ($Ext, array ('txt', 'css', 'js', 'sql'))) $FileExt = 'txt';
else if (in_array ($Ext, array ('doc', 'rtf'))) $FileExt = 'document';
else if (in_array ($Ext, array ('xls', 'xlw', 'sxc'))) $FileExt = 'spreadsheet';
else if (in_array ($Ext, array ('ppt', 'pps', 'sxi'))) $FileExt = 'presentation';
else if (in_array ($Ext, array ('mid', 'midi'))) $FileExt = 'midi';
else if (in_array ($Ext, array ('iso', 'img'))) $FileExt = 'cdimage';
else if ($Ext == 'pdf') $FileExt = 'pdf';
else if ($Ext == 'exe') $FileExt = 'exe';
else if ($Ext == 'swf') $FileExt = 'swf';
else if ($Ext == 'svg') $FileExt = 'svg';
else if ($Ext == 'deb') $FileExt = 'deb';
else if ($Ext == 'rpm') $FileExt = 'rpm';
return ($FileExt?$FileExt:'unknown');
}
if ($_GET['id']) {
$Path = substr ($_SERVER['PATH_INFO'], 1);
include (pathinfo ($Path, PATHINFO_DIRNAME).'fb.config.php');
if ($_GET['id'] == $ID) {
header ('Content-Type: application/force-download');
readfile ($Path);
}
else echo 'Brak uprawnień!';
exit ();
}
$_GET['path'] = str_replace (array ('../', './', '//'), '', $_GET['path']);
if ($_GET['path']{0} == '/') $_GET['path'] = substr ($_GET['path'], 1);
$Path = explode ('/', $_GET['path']);
unset ($Path[count ($Path) - 1]);
if (!file_exists ('./'.$_GET['path'])) $Page = '<div>Niewłaściwa ścieżka dostępu!</div>'."\n";
else {
@include ($_GET['path'].'fb.config.php');
if ($HiddenFiles) $Hidden = array_merge ($Hidden, $HiddenFiles);
for ($i = 0; $i < (count ($Path) - 1); $i++) $Up.= $Path[$i].'/';
foreach ($Path as $Dir) {
$Link.= $Dir.'/';
$Menu.= ' <a href="?path='.$Link.'">'.$Dir.'</a> /'."\n";
}
if ($_GET['path']) $Up = '<div><a href="'.($Up?'?path='.$Up:$_SERVER['PHP_SELF']).'"><img src="'.$ImagesPath.'up.png" alt="up" /> Katalog wyżej</a></div>';
$Page = '<div class="file"><b><div>Data dodoania</div><div>Rozmiar</div>Nazwa pliku</b></div>';
foreach (glob ($_GET['path'].'*') as $File) if (is_dir ($File) && !in_array (basename ($File), $Hidden)) $Page.= '<div class="file"><div>'.date ('d.m.Y H:i:s', filemtime ($File)).'</div><div>-</div><a href="'.$_SERVER['PHP_SELF'].'?path='.$File.'/"><img src="'.$ImagesPath.'dir.png" alt="dir" /> '.basename ($File).'</a></div>'."\n";
foreach (glob ($_GET['path'].'*') as $File) if (is_file ($File) && $File !== basename ($_SERVER['PHP_SELF']) && !in_array (basename ($File), $Hidden)) $Page.= '<div class="file"><div>'.date ('d.m.Y H:i:s', filemtime ($File)).'</div><div>'.((filesize ($File) > 1024)?((filesize ($File) > 1048576)?round (filesize ($File) / 1048576, 2).' MB':round (filesize ($File) / 1024, 2).' KB'):filesize ($File).' B').'</div><a href="'.($ID?basename ($_SERVER['PHP_SELF']).'/'.$File.'?id='.$ID:$File).'"><img src="'.$ImagesPath.file_type ($File).'.png" alt="'.file_type ($File).'" /> '.basename ($File).'</a></div>'."\n";
if (!$Page) $Page = '<div>Brak plików oraz katalogów.</div>'."\n";
if ($AccessDenied) {
if ($_POST['password']) $_SESSION[$ID.'_password'] = $_POST['password'];
if ($_GET['logout']) unset ($_SESSION[$ID.'_password']);
if ($Password && $_SESSION[$ID.'_password'] !== $Password) $Page = '<form method="post" action="" id="login"><div>Aby móc przeglądać ten katalog musisz podać hasło.<br /><br /><label for="password">Hasło</label> <input type="password" name="password" id="password" /><br /><label for="submit">OK</label> <input type="submit" value="OK" id="submit" /></div></form>'."\n";
else if (!$Password) $Page = '<div>Brak uprawnień!</div>'."\n";
else $Page = '<a id="logout" href="?path='.$_GET['path'].'&logout=1">Wyloguj się</a>'."\n".$Page;
}
}
$Menu = '<div class="menu">'."\n".'<a href="'.$_SERVER['PHP_SELF'].'">Katalog główny</a> /'.$Menu.'</div>'."\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">
<head>
<title>Przeglądarka katalogów</title>
<style type="text/css">
body {margin:0;padding:0;background:#eeeeee;font-family:sans-serif;font-size:12px;color:#FF8011;}
a {color:#A8ACB0;text-decoration:none;}
a:hover {color:#FF8011;}
img {border:0;}
#body {background:color:#0000;margin:10px;border:0px solid #1C5A8E;padding:5px;font-size:10px;cursor:default;}
#header {margin-bottom:1px;background:cccccc;padding:0px;border:1px solid #1C5A8E;font-size:10px;}
#footer {margin-top:1px;}
#header, #footer {background:#00;padding:3px;border:0px solid #A8ACB0;text-align:center;}
#login div, .menu {background:#00;padding:3px;margin:0px 0;border:1px dashed #D2D5D7;}
#login div {margin:5px auto;width:3px;text-align:left;}
#login div input {margin:0px;}
#login div label {float:right;}
#logout {width:20px;display:block;text-align:center;border:1px solid #02356F;padding:2px;margin:4px 0;background:#F4FAFF;}
.file div {float:right;width:100px;}
</style>
<base target="_self">
</head><body leftmargin="7" style="background-color: #000000; color:#A8ACB0">
<div id="body">
<div id="header">
</div>
<font color="#666666">
<?= $Menu. ($Text?'<div>'.$Text.'</div>'."\n":'').$Up.$Page.$Menu; ?>
</font>
<div id="footer">
<font color="#000000"><a href="http://emdek.[regulamin forum: punkt 2.13]/">Powered by </a> </font> <a target="_blank" href="http://emdek.[regulamin forum: punkt 2.13]/"><b>
eFileBrowser 1.0</b>
</a>
</div>
- fuma
- Przyjaciel CBA
- Posty: 11168
- Rejestracja: 01 sie 2005, 14:57:56
- Lokalizacja: z jajka niespodzianki :P
- Płeć:
- User Agent:
aby nie bylo nieporozumien jak widac w naglowko skryptu
autorem skryptu jest nikt inny jak Emdek
Kod: Zaznacz cały
// Autor: Emdek <emdek>