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 69 70 71 72 73 74 75 76 77 78 79
| <table width='100%' border='0'>
<?php
$cat=$_GET['c'];
$c=1;
function Sort_Directory_Files_By_Last_Modified($dir, $sort_type = 'descending', $date_format = "F d Y H:i:s.")
{
$files = scandir($dir);
$array = array();
$pages = array_chunk($array, 5);
foreach($files as $file)
{
if($file != '.' && $file != '..')
{
$last_modified = filemtime($dir.$file);
$array[] = array('file' => $file,
'timestamp' => $last_modified,
'date' => date ($date_format, $last_modified),
'time_passed' => $time_passed_array);
}
}
usort($array, create_function('$a, $b', 'return strcmp($a["timestamp"], $b["timestamp"]);'));
if($sort_type == 'descending')
{
krsort($array);
}
return array($array, $sort_type);
}
$dir = "music/$cat/";
$array = Sort_Directory_Files_By_Last_Modified($dir);
$info = $array[0];
$sort_type = $array[1];
foreach($info as $key => $detail)
{
$oujda = $detail['file'];
if ($c==1) {
echo "<tr>";
}
?>
<?php
if (file_exists("images/$oujda.png")) {
$img="images/$oujda.png";
} else {
$img="images/nophoto.jpg";
}
if ($c==1) {
echo "<tr>";
}
print("
<td><DIV align=center>
<a href='?p=show&g=$file&c=$cat'><img border='0' src='$img' width='140' height='150' alt='$oujda mp3'></a>
<TABLE cellSpacing=0 cellPadding=1 width='140' align=center
border=0>
<TBODY>
<TD dir=rtl align=center width=100% bgColor=#000000 height=25>
<a href='?p=show&g=$file&c=$cat'><small style='color: rgb(255, 255, 255);'><span
style='font-family: Segoe Print; font-weight: bold;'>$oujda</span></small>
</a>
</TD></TR>
<TR>
<tr>
<td>
</td>
</tr>
</tbody>
</table>
<br>
");
if($c==5) {
echo "</tr>";
$c=0;
}
$c++;
}
?> |
Partager