Quelltext der Datei: http://www.michaelster.ch

Dateigrösse: 12.6 kb

[Anzeige ohne Zeilennummern]


  1 <?php
  2 //require_once "/home/httpd/vhosts/michaelster.ch/httpdocs/testFolder/auth/authinc.php";
  3 ?>
  4 
  5 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  6 <html>
  7 <head>
  8     <title>Verzeichnis</title>
  9     
 10     <meta content="width=device-width,initial-scale=1.0" name="viewport">
 11     <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
 12     <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 13     <!--
 14     <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
 15       -->
 16     
 17 <script type="text/javascript">
 18     
 19 function BlurLinks() {
 20     lnks=document.getElementsByTagName("a");
 21     for(i=0;i<lnks.length;i++) {
 22         lnks[i].onfocus=new Function("if(this.blur)this.blur()");
 23     }
 24 }
 25 
 26 window.onload=BlurLinks
 27 
 28 </script>
 29 
 30 <style type="text/css">
 31     body            { font-family:verdana,sans-serif; font-size:12px; padding:0; margin:0; background-color:#f8f8ff; background-image:none; }
 32     h4                { font-size:14px; padding-left:3px; }
 33     img                { margin-top:4px; }
 34     blockquote        { margin:1em 0 0 2.5em; line-height:24px; border:0px solid grey; }
 35       a span.pp        { font-family:arial,sans-serif; font-size:14px; color:green; vertical-align:text-bottom; }
 36       a:hover span.pp    { color:#c9c9e5; } 
 37     a                { text-decoration:none; display:inline-block; }
 38     a.dirUp            { width:100%; }
 39     a.dirUp:hover    { background-color:#c9c9e5; }
 40       a.adress         { font-family:verdana,sans-serif; font-size:12px; font-weight:normal; color:#000; padding:0 1em; width:calc(100% - 25px); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
 41     a.dir             { font-weight:bold; }
 42       a.src             { margin-left: -2px; }
 43       a.adress:hover  { color:#f5f5ff; background-color:#000; }
 44     a img.js        { margin-top:5px; border:0px solid #f00; }
 45     a:hover img.js     { background-color:transparent !important; }
 46     a img.up        { padding:1px; margin-top:2px; margin-left:1em; border:1px solid #e6e6fa;  }
 47     a:hover img.up     { border:1px solid transparent; background-color:#fff; margin-right:3px; }
 48     
 49     span.aktuell    { font-family:"Lucida Handwriting",arial,sans-serif; font-size:16px; font-weight:bold; }
 50     #schlussstrich    { clear:left; width:calc(100% - 40px); border-top:1pt solid #333; height:1px; }
 51     .zero            { clear:both; margin:0; padding:0; }
 52     
 53     #DIVleft, 
 54     #DIVmidle,
 55     #DIVright        { float:left; width:calc(100% - 40px); height:24px; }
 56     #DIVmidle        { text-align:center; width:48px; font-weight:bold; margin:0 1px; display:none; }
 57     #DIVright        { text-align:right; display:none; margin-right:5px; }
 58  
 59 @media screen and (min-width : 320px) {
 60     
 61     #DIVleft { 
 62         width: 200px;
 63     }
 64     
 65     #DIVmidle { 
 66         display: inline-block;
 67     }
 68     
 69     #schlussstrich { 
 70         width: 250px; 
 71     }
 72 }
 73 
 74 @media screen and (min-width : 360px) {
 75     
 76     #DIVleft { 
 77         width: 220px;
 78     }
 79     
 80     #schlussstrich { 
 81         width: 270px; 
 82     }
 83 }
 84 
 85 @media screen and (min-width : 410px) {
 86     
 87     body {
 88         background-color:        #f8f8ff; 
 89         background-image:        url(http://www.michaelster.ch/img/avatar33.jpg); 
 90         background-repeat:        repeat-y; 
 91         background-position:    top left; 
 92         background-attachment:     fixed; 
 93     }
 94     
 95     blockquote { 
 96         margin: 1em 0 0 10em; 
 97     }
 98 }
 99  
100 @media screen and (min-width : 550px) {
101     
102     #DIVleft { 
103         width: 270px;
104     }
105     
106     #schlussstrich { 
107         width: 320px; 
108     }
109 }
110  
111 @media screen and (min-width : 680px) {
112     
113     blockquote { 
114         margin: 2em 0 0 12em; 
115     }
116     
117     #DIVright { 
118         display: inline-block;
119         width:      170px;
120     }
121     
122     #schlussstrich { 
123         width: 490px; 
124     }
125 }
126  
127 @media screen and (min-width : 780px) {
128     
129     #DIVleft { 
130         width: 350px;
131     }
132     
133     #schlussstrich { 
134         width: 570px; 
135     }
136 }
137  
138 @media screen and (min-width : 840px) {
139     
140     #DIVright { 
141         width: 250px;
142     }
143     
144     #schlussstrich { 
145         width: 650px; 
146     }
147 }
148  
149 @media screen and (min-width : 980px) {
150     
151     body {
152         background-color:        #f8f8ff; 
153         background-image:        url(http://www.michaelster.ch/img/wp-overlay-body-bg6.png); 
154         background-repeat:        repeat-y; 
155         background-position:    top left; 
156         background-attachment:     fixed; 
157     }
158     
159     .borderline {
160         position:        absolute;
161         top:            0;
162         left:            0;
163         width:            150px;
164         height:            99.8%;
165         border-right:    1.5pt solid #d99e4e;
166     }
167     
168     blockquote { 
169         margin: 4em 0 0 18em; 
170     }
171     
172     #DIVright { 
173         width: 300px;
174     }
175     
176     #schlussstrich { 
177         width: 700px; 
178     }
179 }
180  
181 </style>
182 </head>
183 
184 
185 <body>
186 <?php
187 /* 
188 ini_set('error_reporting', E_ALL); 
189 */
190 
191 $srcViewPfad     = $_SERVER['HTTP_HOST'];
192 $absoluterPfad     = @dirname($_SERVER['SCRIPT_FILENAME']);
193 $phpself        = @dirname($_SERVER['PHP_SELF'])=='/' ? '' : @dirname($_SERVER['PHP_SELF']); //im root-directory ein MUSS!!!
194 $imgPfad         = 'http://www.michaelster.ch/img/';
195 
196 /* @return        $file_data_array        Array mit Dateien, die nicht angezeigt werden sollen */
197 require_once '/home/httpd/vhosts/michaelster.ch/httpdocs/get_array_data.php';
198 /* Array mit files und directories, die nur in diesem Verzeichnis unsichtbar sein sollen */
199 $piuArray = array();
200 /* beide Arrays vermengen */
201 $excludeDataArray = @array_merge($file_data_array, $piuArray);
202 
203 /**** directory auslesen ****/
204 $data_file            = array();
205 $data_dir             = array();
206 $filepfad             = $absoluterPfad . '/';
207 $verzeichniszugriff = dir($filepfad);
208 
209 while ($datei = $verzeichniszugriff->read())
210 {
211     /* Files lesen und im array $data_file ablegen */
212     if (@is_file($datei) && @!in_array($datei, $excludeDataArray))
213     {
214         $data_file[@filesize($datei)] = $datei;
215     }
216     /* Directories lesen und im $data_dir ablegen */
217     if ($datei != "." && @is_dir($datei) && @!in_array($datei, $excludeDataArray))
218     {
219         $data_dir[@filemtime($datei)] = $datei; // wenn zwei oder mehrere Dateien zur exakt gleichen filemtime gespeichert wurden, ueberschreiben sich die Dateien. Deshalb nochmals indexieren, als nummerischen Array[].
220     }
221 }
222 $verzeichniszugriff->close();
223 
224 
225 function arraySort(&$array, $sort='arsort')
226 {
227     return @$sort($array);
228 }
229 arraySort($data_dir, 'natcasesort');
230 arraySort($data_file, 'asort');
231 
232 $zeile1  = '';        
233 $zeile2  = '';        
234 $bgcolor = "#fff";    
235 
236 /*
237 echo '<pre class="left">';
238 print_r($data_file);
239 echo '</pre>';
240 
241 echo '<pre class="left">';
242 print_r($data_file_name);
243 echo '</pre>';
244 
245 echo '<p class="clear"></p>';
246 */
247 
248 // directories
249 foreach($data_dir as $key_dir => $value_dir)
250 {
251     $bgcolor = $bgcolor == "#fff" ? "#e6e6fa" : "#fff";
252     
253     $zeile2 .= "<div style='background-color:" . $bgcolor . "' id='DIVleft'>";
254     $zeile2 .= "<a " . css_class($value_dir) . "  href='http://" . $srcViewPfad . $phpself . "/" . $value_dir . "'>" . dirUp_icon($value_dir) . "</a>";
255     $zeile2 .= "</div>";
256     $zeile2 .= "<div style='background-color:" . $bgcolor . ";' id='DIVmidle'>" . dir_icon($value_dir) . "</div>";
257     $zeile2 .= "<div style='background-color:" . $bgcolor . ";' id='DIVright'>" . datum($value_dir, $key_dir) . "&nbsp; &nbsp;</div>";
258     $zeile2 .= "<div class='zero'></div>";
259 }
260 
261 
262 // files
263 if(!empty($data_file))
264 {
265     foreach($data_file as $key => $file)
266     {
267         $nb_size = $key . " Bytes"; // in Bytes
268         $kb_size = round($key / (1000),2) . " KB"; // in KB
269         $mb_size = round($key / (1000*1000),2) . " MB"; // in MB
270         $sizeTmp = $key > 1000000 ? $mb_size : $kb_size;
271         $size      = $key < 1000       ? $nb_size : $sizeTmp;
272         
273         $bgcolor = $bgcolor == "#e6e6fa" ? "#fff" : "#e6e6fa";
274         
275         $zeile1 .= "<div style='background-color:" . $bgcolor . ";' id='DIVleft'>";
276         $zeile1 .= "<a class='adress' href='http://" . $srcViewPfad . $phpself . "/" . $file . "'>" . $file . "</a>";
277         $zeile1 .= "</div>";
278         $zeile1 .= "<div style='background-color:" . $bgcolor . ";' id='DIVmidle'>" . weiche_endung($file) . "</div>";
279         $zeile1 .= "<div style='background-color:" . $bgcolor . ";' id='DIVright'>" . $size . "&nbsp; &nbsp;</div>"; //  - ". $key ."
280         $zeile1 .= "<div class='zero'></div>";
281     }
282 }
283 
284 /*************************** OUTPUT ********************************/
285 echo '<div class="borderline">&nbsp;</div>';
286 echo '<blockquote>';
287 echo '<h4><span class="aktuell">~</span>' . $phpself . '</h4>';
288 
289 echo $zeile2 . $zeile1;
290 
291 echo '<div id="schlussstrich">&nbsp;</div>';
292 echo '</blockquote>';
293 
294 
295 function weiche_endung($datei)
296 {
297     global $srcViewPfad, $absoluterPfad, $imgPfad;
298     
299     $endung = array('jpg'    => '<img src="' . $imgPfad . 'icon_jpeg_small.gif" height="16" width="18" alt="" />',
300                     'jpeg'    => '<img src="' . $imgPfad . 'icon_jpeg_small.gif" height="16" width="18" alt="" />',
301                     'png'    => '<img src="' . $imgPfad . 'icon_jpeg_small.gif" height="16" width="18" alt="" />',
302                     'ico'    => '<img src="' . $imgPfad . 'icon_jpeg_small.gif" height="16" width="18" alt="" />',
303                     'jpg'    => '<img src="' . $imgPfad . 'icon_jpeg_small.gif" height="16" width="18" alt="" />',
304                     'gif'    => '<img src="' . $imgPfad . 'icon_gif.gif" height="16" width="16" alt="" />',
305                     'cur'    => '<img src="' . $imgPfad . 'icon_cur.gif" height="16" width="16" alt="" />',
306                     'js'    => '<img src="' . $imgPfad . 'icon_js.gif" height="16" width="16" alt="" class="js" />', 
307                     'mp3'    => '<img src="' . $imgPfad . 'icon_mp3.gif" height="18" width="20" alt="" class="js" />', 
308                     'css'    => '<img src="' . $imgPfad . 'icon_css.gif" height="16" width="16" alt="" />',
309                     'swf'    => '<img src="' . $imgPfad . 'icon_swf.gif" height="18" width="16" alt="" />',
310                     'pdf'    => '<img src="' . $imgPfad . 'icon_pdf.gif" height="16" width="16" alt="" />',
311                     'zip'    => '<img src="' . $imgPfad . 'icon_zip.gif" height="16" width="16" alt="" />',
312                     'rar'    => '<img src="' . $imgPfad . 'icon_rar.gif" height="16" width="16" alt="" />',
313                     'tar'    => '<img src="' . $imgPfad . 'icon_rar.gif" height="16" width="16" alt="" />',
314                     'gz'    => '<img src="' . $imgPfad . 'icon_zip.gif" height="16" width="16" alt="" />',
315                     'ttf'    => '<img src="' . $imgPfad . 'icon_ttf.gif" height="17" width="14" alt="" />',
316                     'avi'    => '<img src="' . $imgPfad . 'icon_vlc.png" height="16" width="16" alt="" />',
317                     'divx'    => '<img src="' . $imgPfad . 'icon_vlc.png" height="16" width="16" alt="" />',
318                     'doc'    => '<img src="' . $imgPfad . 'icon_word.gif" height="16" width="16" alt="" />',
319                     'dot'    => '<img src="' . $imgPfad . 'icon_dot.gif" height="16" width="16" alt="" />',
320                     'ppt'    => '<img src="' . $imgPfad . 'icon_ppt.png" height="16" width="16" alt="" />',
321                     'pdf'    => '<img src="' . $imgPfad . 'icon_pdf.gif" height="16" width="16" alt="" />',
322                     'psd'    => '<img src="' . $imgPfad . 'icon_psd.gif" height="16" width="16" alt="" />',
323                     'xls'    => '<img src="' . $imgPfad . 'icon_excel.gif" height="16" width="16" alt="" />',
324                     'docx'    => '<img src="' . $imgPfad . 'icon_wdocx.gif" height="16" width="16" alt="" />',
325                     'dotx'    => '<img src="' . $imgPfad . 'icon_dotx.gif" height="16" width="16" alt="" />',
326                     'pptx'    => '<img src="' . $imgPfad . 'icon_ppt.png" height="16" width="16" alt="" />',
327                     'xlsx'    => '<img src="' . $imgPfad . 'icon_xlsx.gif" height="16" width="16" alt="" />'
328                    );
329     
330     $ende     = explode('.', $datei);
331     $doctype = array_pop($ende); 
332     $doctype = strtolower($doctype); 
333     
334     if($endung[$doctype] && $doctype!='js')
335     {
336         return $endung[$doctype];
337     }
338     else
339     {
340         $src = $doctype == 'js'  ? $endung['js'] : 'src';
341         $css = $doctype == 'js'  ? '' : ' class="adress src"';
342         $src = $doctype == 'mp3' ? $endung['mp3'] : 'src';
343         $css = $doctype == 'mp3' ? '' : ' class="adress src"';
344         
345         return '<a href="http://' . $srcViewPfad . '/src_viewer.php?datei=' . $absoluterPfad . '/' . $datei . '" ' . $css . ' target="_blank">' . $src . '</a>';
346     }
347 }
348 
349 function css_class($datei)
350 {
351     if ($datei == "..")
352     {
353         return "title='directory up' class='dirUp'";
354     }
355     else
356     {
357         return "class='adress dir'";
358     }
359     
360 }
361 
362 function dirUp_icon($datei)
363 {
364     global $imgPfad;
365     if ($datei == "..")
366     {
367         return '<img class="up" src="' . $imgPfad . 'level_up.png" alt="directory up" width="16" height="16" border="0" /><span class="pp">..</span>';
368     }
369     else
370     {
371         return $datei;
372     }
373 }
374 
375 function dir_icon($datei)
376 {
377     global $imgPfad, $datum;
378     if ($datei == "..")
379     {
380         return '<img src="' . $imgPfad . 'blind.gif" alt="" width="1" height="1" border="0" />';
381         $datum = '';
382     }
383     else
384     {
385         return '<img src="' . $imgPfad . 'folder_s.gif" alt="" width="18" height="17" border="0" />';
386         //return '<img src="' . $imgPfad . 'icon_folder_small.gif" alt="" width="16" height="15" border="0" />';
387     }
388 }
389 
390 function datum($datei, $filemtime)
391 {
392     global $imgPfad;
393     if ($datei == "..")
394     {
395         return '<img src="' . $imgPfad . 'blind.gif" alt="" width="1" height="1" border="0" />';
396     }
397     else
398     {
399         return date("d. m. Y | H:i", $filemtime);
400     }
401 }
402 
403 ?>
404 
405 </body>
406 </html>
407