1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
// fonction open daily
function tep_opendir($path){
global $path;
$exclude_array = array('.', '..', '.DS_Store', 'Thumbs.db');
$result = array();
// if local
if ($handle = opendir($path)) {
while (false !== ($filename = readdir($handle))) {
if (!in_array($filename, $exclude_array)) {
$file = array('name' => $path . $filename,
'namefile' => $filename,
'is_dir' => is_dir($path . $filename),
'size' => filesize($path . $filename),
'last_modified' => strftime(DATE_TIME_FORMAT, filemtime($path . $filename)));
$result[] = $file;
}
}
closedir($handle);
}elseif ($fp = fopen($path , 'rb')) {
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
while (false !== ($filename = stream_get_contents($fp))) {
//echo $filename;
if (!in_array($filename, $exclude_array)) {
$result = preg_match('`HREF="\/Log_Quot_STD\/([0-9]+)\/"`', $filename, $matches);
echo $result;
//echo $result;
/*
$file = array('name' => $path . $matches[2],
'namefile' => $matches[2],
'is_dir' => is_dir($path . $matches[2])
//,
// 'size' => filesize($path . $filename),
//'last_modified' => strftime(DATE_TIME_FORMAT, filemtime($path . $filename))
);
$result[] = $file;
*/ }
}
}
fclose($fp);
//if directory environment not correct
}else{
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' .
' <td class="dataTableContent">'.$path.TABLE_DIRECTORY_ENVIRONMENT_ERROR.'</a></td>' .
' </tr>';
}
return $result;
} |
Partager