Re: [CBLX] cacher plusieurs fichiers en ligne |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/carrefourblinux Archives
]
- To: carrefourblinux@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [CBLX] cacher plusieurs fichiers en ligne
- From: Emmanuel COUTRIS <emmanuel.coutris@xxxxxxxxx>
- Date: Thu, 3 Jun 2010 02:13:38 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=AZIbQndbj+fZxZHb/jTm77WssqjKmZwFF7R5az9Cm54=; b=H2+6S0sksXJGqA4rj+7t3swEbkMosUceM7uWTaJyoQqQp7BRcgpqyt92hrG0F3UJSl sIgFCxkEF/irsnJ5OJc4WKgw3dATTsKYqL+wqFdj0llt6IV6nb7bqVVD+qtWsqAoHQD3 sMO8r/7m8uK8jQiipZkuX9LkkBYqApY0ZUnZ8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=G9WNkCY5ATiDxg4mB+jqxnz9nd+JFOQeLbi7t7mRHtLTot51LkLhTSvNuA7JeLl8QO XaTQ5QcqpOH3EYCBrlRBRoLG2zRELaLZ2EVYaLA1V1QYWIeGm9g+G3YXbW8EC7h7G8Px eywfoPATnr0GaR6qT0K8LXJijvLz4RjR+HM0g=
Salut Aldo et tous,
On Wed, Jun 02, 2010 at 08:06:58PM +0200, Aldo wrote:
> Si j'oublies pas de refermer le if( par un ) derrière ton dernier ) ça
> marche nickel!
Dans ton template il y a un petit souci (mais est-ce volontaire...?):
dans la ligne du if, tu exclus le répertoire ".." mais dans le corps
du HTML, tu testes s'il y a ".." pour affiché "parent directory"... le
cas de l'affichage de "parent directory" n'arrive jamais.
A plus,
Manu
> <?php
> $rep = dirname(__FILE__);
> $tb_rep = array();
>
> if($rep_handle = opendir("$rep"))
> {
> while (false !== ($ligne = readdir($rep_handle)))
> {
> if($ligne != "." && $ligne != ".." && $ligne != "style.css"
> && $ligne != "index.php" && $ligne != ".htaccess"
> && $ligne != "tmp" && $ligne != "orig_door_Etienne_Demeyer"
> && !fnmatch("DSC_*.JPG",$ligne))
> {
> $tb_rep[$ligne]['taille'] = filesize($ligne);
> $tb_rep[$ligne]['date_c'] = filectime($ligne);
> $tb_rep[$ligne]['date_m'] = filemtime($ligne);
> $tb_rep[$ligne]['date_a'] = fileatime($ligne);
> }
> }
> closedir($rep_handle);
> }
> //print_r($tb_rep);
> foreach($tb_rep as $key => $ligne)
> {
> $nom[$key] = $key;
> $taille[$key] = $ligne['taille'];
> $date_c[$key] = $ligne['date_c'];
> $date_m[$key] = $ligne['date_m'];
> $date_a[$key] = $ligne['date_a'];
> }
> array_multisort($nom, SORT_ASC, SORT_STRING, $taille, $date_c, $date_m,
> $date_a);
> ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html lang="en-US">
> <head>
> <base href="http://50ste.nietteke.be/">
> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
> <meta name="author" content="OSvaLdo:~# La Rosa">
> <meta name="keywords" content="verjaardagsfotos">
> <meta name="description" content="Anita's Verjaardagalbum Home Page">
> <link href="style.css" rel="stylesheet" type="text/css" title="default">
> <title> Index van http://50ste.nietteke.be/ </title>
> </head>
> <body>
>
> <center><big><b>Anita's 50ste <i>MEGA</i> VerjaardagsFeest<br>
> DE Fotos!</b></big></center><br><br>
>
> <?php
> //echo "<h1> Index van $rep</h1>\n";
> echo "<h1> Index van 50ste.nietteke.be </h1>\n";
> ?>
> <table>
> <th>Type</th>
> <th>Naam</th>
> <th>Grootte</th>
> <th>Gemaakt</th>
> <th>Gewijzigd</th>
> <th>Laatst bekeken</th>
> <?php
> foreach($nom as $value)
> {
> $tmp = $value;
> $ch="<td> - </td>\n";
> if($value == "..") $value = "Parent directory";
> if(is_dir($value) || $tmp == "..")
> $type = "D";
> else
> $type = "F";
> echo "<tr>\n";
> echo "<td>$type</td>\n";
> echo "<td><a href=\"$tmp\">$value</a></td>\n";
> if($tmp == "..")
> echo $ch;
> else
> echo "<td align=right>".$taille[$value]." bytes</td>\n";
> if($tmp == "..")
> echo $ch;
> else
> echo "<td>".date("d/m/Y H:i:s", $date_c[$value])."</td>\n";
> if($tmp == "..")
> echo $ch;
> else
> echo "<td>".date("d/m/Y H:i:s", $date_m[$value])."</td>\n";
> if($tmp == "..")
> echo $ch;
> else
> echo "<td>".date("d/m/Y H:i:s", $date_a[$value])."</td>\n";
> echo "</tr>\n";
> }
> ?>
> </table>
> <hr>
> </body>
> </html>
---
--
CarrefourBLinuX MailingListe
Pour obtenir de l'aide, envoyez le sujet help à:
carrefourblinux-request@xxxxxxxxxxxxxxxxxxx
Archives:
http://listengine.tuxfamily.org/lists.tuxfamily.org/carrefourblinux