Spis plików

Wszystko o HTML, XHTML, XML, CSS.
thetuning
Posty: 18
Rejestracja: 20 maja 2006, 18:54:20
Płeć: Niewybrana
User Agent: Firefox Windows 1024x768

Spis plików

Post autor: thetuning »

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ć :P
www.thetuning.cba.pl - wszystko dla twojej komórki :] całkiem nowa ODS£ONA !!
Awatar użytkownika
zero
Posty: 420
Rejestracja: 26 sty 2006, 21:08:04
Płeć: Niewybrana
User Agent: Firefox Windows 1024x768

Post autor: zero »

chodzi ci o listowanie katalogów?

http://www.cms.rk.edu.pl/art_77.html
Obrazek
thetuning
Posty: 18
Rejestracja: 20 maja 2006, 18:54:20
Płeć: Niewybrana
User Agent: Firefox Windows 1024x768

Post autor: thetuning »

o właśnie to tylklo czemu PHP :( :(
www.thetuning.cba.pl - wszystko dla twojej komórki :] całkiem nowa ODS£ONA !!
Awatar użytkownika
fuma
Przyjaciel CBA
Posty: 11168
Rejestracja: 01 sie 2005, 14:57:56
Lokalizacja: z jajka niespodzianki :P
Płeć: Mężczyzna
User Agent: Firefox Linux 1024x768

Post autor: fuma »

automatycznego listowania katalogow nie zrobisz w html
thetuning
Posty: 18
Rejestracja: 20 maja 2006, 18:54:20
Płeć: Niewybrana
User Agent: Firefox Windows 1024x768

Post autor: thetuning »

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 !!
Awatar użytkownika
zero
Posty: 420
Rejestracja: 26 sty 2006, 21:08:04
Płeć: Niewybrana
User Agent: Firefox Windows 1024x768

Post autor: zero »

zero pisze:chodzi ci o listowanie katalogów?

http://www.cms.rk.edu.pl/art_77.html
!
thetuning
Posty: 18
Rejestracja: 20 maja 2006, 18:54:20
Płeć: Niewybrana
User Agent: Firefox Linux 1024x768

Post autor: thetuning »

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
www.thetuning.cba.pl - wszystko dla twojej komórki :] całkiem nowa ODS£ONA !!
robert051
Posty: 518
Rejestracja: 25 lip 2005, 12:06:56
Strona na CBA.pl: lokomotywa.cba.pl
Płeć: Niewybrana
User Agent: Opera Windows 1024x768

Post autor: robert051 »

artur123
Posty: 8
Rejestracja: 19 gru 2006, 17:28:51
Płeć: Niewybrana
User Agent: Firefox Windows 1024x768

Post autor: artur123 »

Odświeżam temat bo linki w nim podane są już nie aktualne. Gdzie można obecnie znaleźć skrypt automatycznego listowania plików w katalogu? ¯eby np. zwracał wynik do pliku index.php. Z góry dzięki :D
mlody007
Przyjaciel CBA
Posty: 826
Rejestracja: 21 maja 2006, 16:38:11
Lokalizacja: Oka
Płeć: Niewybrana
User Agent: Firefox Windows 1024x768
Kontakt:

Post autor: mlody007 »

Kod: Zaznacz cały

<?php
//========eFileBrowser v1.0.6========
// Autor: Emdek <emdek@epf.pl>
// Licencja: GPL
error_reporting &#40;0&#41;;
session_start &#40;&#41;;
$ImagesPath = 'icons/'; // Ã‚¦cieżka dostępu do katalogu plików graficznych
$Hidden = array &#40;'fb.config.php'&#41;; // Lista plików i katalogów ukrywanych w każdym katalogu
function file_type &#40;$Name&#41; &#123;
         $Ext = explode &#40;'.', $Name&#41;;
         $Ext = strtolower &#40;end &#40;$Ext&#41;&#41;;
         if &#40;in_array &#40;$Ext, array &#40;'html', 'htm', 'shtml'&#41;&#41;&#41; $FileExt = 'html';
         else if &#40;in_array &#40;$Ext, array &#40;'php', 'php3', 'phtml'&#41;&#41;&#41; $FileExt = 'php';
         else if &#40;in_array &#40;$Ext, array &#40;'zip', 'rar', 'tar', 'gz', 'bz2', 'tgz'&#41;&#41;&#41; $FileExt = 'archive';
         else if &#40;in_array &#40;$Ext, array &#40;'avi', 'mpg', 'mpeg'&#41;&#41;&#41; $FileExt = 'movie';
         else if &#40;in_array &#40;$Ext, array &#40;'vaw', 'mp3', 'ogg'&#41;&#41;&#41; $FileExt = 'sound';
         else if &#40;in_array &#40;$Ext, array &#40;'bmp', 'gif', 'png', 'jpg', 'jpeg'&#41;&#41;&#41; $FileExt = 'image';
         else if &#40;in_array &#40;$Ext, array &#40;'txt', 'css', 'js', 'sql'&#41;&#41;&#41; $FileExt = 'txt';
         else if &#40;in_array &#40;$Ext, array &#40;'doc', 'rtf'&#41;&#41;&#41; $FileExt = 'document';
         else if &#40;in_array &#40;$Ext, array &#40;'xls', 'xlw', 'sxc'&#41;&#41;&#41; $FileExt = 'spreadsheet';
         else if &#40;in_array &#40;$Ext, array &#40;'ppt', 'pps', 'sxi'&#41;&#41;&#41; $FileExt = 'presentation';
         else if &#40;in_array &#40;$Ext, array &#40;'mid', 'midi'&#41;&#41;&#41; $FileExt = 'midi';
         else if &#40;in_array &#40;$Ext, array &#40;'iso', 'img'&#41;&#41;&#41; $FileExt = 'cdimage';
         else if &#40;$Ext == 'pdf'&#41; $FileExt = 'pdf';
         else if &#40;$Ext == 'exe'&#41; $FileExt = 'exe';
         else if &#40;$Ext == 'swf'&#41; $FileExt = 'swf';
         else if &#40;$Ext == 'svg'&#41; $FileExt = 'svg';
         else if &#40;$Ext == 'deb'&#41; $FileExt = 'deb';
         else if &#40;$Ext == 'rpm'&#41; $FileExt = 'rpm';
         return &#40;$FileExt?$FileExt:'unknown'&#41;;
         &#125;
if &#40;$_GET['id']&#41; &#123;
   $Path = substr &#40;$_SERVER['PATH_INFO'], 1&#41;;
   include &#40;pathinfo &#40;$Path, PATHINFO_DIRNAME&#41;.'fb.config.php'&#41;;
   if &#40;$_GET['id'] == $ID&#41; &#123;
      header &#40;'Content-Type: application/force-download'&#41;;
      readfile &#40;$Path&#41;;
      &#125;
   else echo 'Brak uprawnień!';
   exit &#40;&#41;;
   &#125;
$_GET['path'] = str_replace &#40;array &#40;'../', './', '//'&#41;, '', $_GET['path']&#41;;
if &#40;$_GET['path']&#123;0&#125; == '/'&#41; $_GET['path'] = substr &#40;$_GET['path'], 1&#41;;
$Path = explode &#40;'/', $_GET['path']&#41;;
unset &#40;$Path[count &#40;$Path&#41; - 1]&#41;;
if &#40;!file_exists &#40;'./'.$_GET['path']&#41;&#41; $Page = '<div>Niewłaściwa ścieżka dostępu!</div>'."\n";
else &#123;
     @include &#40;$_GET['path'].'fb.config.php'&#41;;
     if &#40;$HiddenFiles&#41; $Hidden = array_merge &#40;$Hidden, $HiddenFiles&#41;;
     for &#40;$i = 0; $i < &#40;count &#40;$Path&#41; - 1&#41;; $i++&#41; $Up.= $Path[$i].'/';
     foreach &#40;$Path as $Dir&#41; &#123;
             $Link.= $Dir.'/';
             $Menu.= ' <a href="?path='.$Link.'">'.$Dir.'</a> /'."\n";
             &#125;
     if &#40;$_GET['path']&#41; $Up = '<div><a href="'.&#40;$Up?'?path='.$Up:$_SERVER['PHP_SELF']&#41;.'"><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 &#40;glob &#40;$_GET['path'].'*'&#41; as $File&#41; if &#40;is_dir &#40;$File&#41; && !in_array &#40;basename &#40;$File&#41;, $Hidden&#41;&#41; $Page.= '<div class="file"><div>'.date &#40;'d.m.Y H:i:s', filemtime &#40;$File&#41;&#41;.'</div><div>-</div><a href="'.$_SERVER['PHP_SELF'].'?path='.$File.'/"><img src="'.$ImagesPath.'dir.png" alt="dir" /> '.basename &#40;$File&#41;.'</a></div>'."\n";
     foreach &#40;glob &#40;$_GET['path'].'*'&#41; as $File&#41; if &#40;is_file &#40;$File&#41; && $File !== basename &#40;$_SERVER['PHP_SELF']&#41; && !in_array &#40;basename &#40;$File&#41;, $Hidden&#41;&#41; $Page.= '<div class="file"><div>'.date &#40;'d.m.Y H:i:s', filemtime &#40;$File&#41;&#41;.'</div><div>'.&#40;&#40;filesize &#40;$File&#41; > 1024&#41;?&#40;&#40;filesize &#40;$File&#41; > 1048576&#41;?round &#40;filesize &#40;$File&#41; / 1048576, 2&#41;.' MB':round &#40;filesize &#40;$File&#41; / 1024, 2&#41;.' KB'&#41;:filesize &#40;$File&#41;.' B'&#41;.'</div><a href="'.&#40;$ID?basename &#40;$_SERVER['PHP_SELF']&#41;.'/'.$File.'?id='.$ID:$File&#41;.'"><img src="'.$ImagesPath.file_type &#40;$File&#41;.'.png" alt="'.file_type &#40;$File&#41;.'" /> '.basename &#40;$File&#41;.'</a></div>'."\n";
     if &#40;!$Page&#41; $Page = '<div>Brak plików oraz katalogów.</div>'."\n";
     if &#40;$AccessDenied&#41; &#123;
        if &#40;$_POST['password']&#41; $_SESSION[$ID.'_password'] = $_POST['password'];
        if &#40;$_GET['logout']&#41; unset &#40;$_SESSION[$ID.'_password']&#41;;
        if &#40;$Password && $_SESSION[$ID.'_password'] !== $Password&#41; $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 &#40;!$Password&#41; $Page = '<div>Brak uprawnień!</div>'."\n";
        else $Page = '<a id="logout" href="?path='.$_GET['path'].'&logout=1">Wyloguj się</a>'."\n".$Page;
        &#125;
     &#125;
$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 &#123;margin:0;padding:0;background:#eeeeee;font-family:sans-serif;font-size:12px;color:#FF8011;&#125;
a &#123;color:#A8ACB0;text-decoration:none;&#125;
a:hover &#123;color:#FF8011;&#125;
img &#123;border:0;&#125;
#body &#123;background:color:#0000;margin:10px;border:0px solid #1C5A8E;padding:5px;font-size:10px;cursor:default;&#125;
#header &#123;margin-bottom:1px;background:cccccc;padding:0px;border:1px solid #1C5A8E;font-size:10px;&#125;
#footer &#123;margin-top:1px;&#125;
#header, #footer &#123;background:#00;padding:3px;border:0px solid #A8ACB0;text-align:center;&#125;
#login div, .menu &#123;background:#00;padding:3px;margin:0px 0;border:1px dashed #D2D5D7;&#125;
#login div &#123;margin:5px auto;width:3px;text-align:left;&#125;
#login div input &#123;margin:0px;&#125;
#login div label &#123;float:right;&#125;
#logout &#123;width:20px;display:block;text-align:center;border:1px solid #02356F;padding:2px;margin:4px 0;background:#F4FAFF;&#125;
.file div &#123;float:right;width:100px;&#125;
</style>
<base target="_self">
</head><body leftmargin="7" style="background-color: #000000; color:#A8ACB0">
<div id="body">
<div id="header">
    &nbsp;</div>
<font color="#666666">
<?= $Menu.       &#40;$Text?'<div>'.$Text.'</div>'."\n":''&#41;.$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>
artur123
Posty: 8
Rejestracja: 19 gru 2006, 17:28:51
Płeć: Niewybrana
User Agent: Firefox Windows 1024x768

Post autor: artur123 »

Dzięki, pozmieniam trochę Twój skrypt i będzie idealny :D Przyznałbym Ci punkt ale to nie mój topic :lol:
Awatar użytkownika
fuma
Przyjaciel CBA
Posty: 11168
Rejestracja: 01 sie 2005, 14:57:56
Lokalizacja: z jajka niespodzianki :P
Płeć: Mężczyzna
User Agent: Firefox Linux 1152x864

Post autor: fuma »

aby nie bylo nieporozumien jak widac w naglowko skryptu

Kod: Zaznacz cały

// Autor: Emdek <emdek> 
autorem skryptu jest nikt inny jak Emdek ;)
artur123
Posty: 8
Rejestracja: 19 gru 2006, 17:28:51
Płeć: Niewybrana
User Agent: Firefox Windows 1024x768

Post autor: artur123 »

A no tak nie zauważyłem, ale mogę go dostosować do moich potrzeb i napisać że skrypt napisał Emdek a zmodyfikował Artur :wink:
ODPOWIEDZ