afbeelding-uit-map-halen-netjes-in-table-plaatsen
Gesponsorde koppelingen
PHP script bestanden
Code (php)
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
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
<?php
echo '
<b>Emoticons: </b>
<table cellspacing="0" cellpadding="0" style="border:solid 2px #000000;">
<tr>
<td>
<table cellspacing="0" cellpadding="5" width="100%">';
$image_types = array("jpg","gif","bmp","png","jpeg");
$plaatjes_reeks = "";
$mapnaam = "/emoticon";
if ( ereg('..',$mapnaam) || ereg('//',$mapnaam) ){
$mapnaam = "/emoticon";
}
$map = opendir(".{$mapnaam}");
$count = 0;
while (false!==($bestand = readdir($map))) {
if ($bestand != "." && $bestand != "..") {
$ext = explode('.',$bestand);
$extl = sizeof($ext) - 1;
$ext = strtolower($ext[$extl]);
if ( in_array($ext,$image_types) ){
if($count%3 == 0) {
$plaatjes_reeks .= '</tr><tr>';
}
$plaatjes_reeks .= "<td><img src=\"emoticon/" . $bestand . "\" /></td>";
$count++;
}
}
}
if ( $plaatjes_reeks != "" ){
echo ($plaatjes_reeks);
}
closedir($map);
echo '
</table>
</td>
</tr>
</table>';
?>
echo '
<b>Emoticons: </b>
<table cellspacing="0" cellpadding="0" style="border:solid 2px #000000;">
<tr>
<td>
<table cellspacing="0" cellpadding="5" width="100%">';
$image_types = array("jpg","gif","bmp","png","jpeg");
$plaatjes_reeks = "";
$mapnaam = "/emoticon";
if ( ereg('..',$mapnaam) || ereg('//',$mapnaam) ){
$mapnaam = "/emoticon";
}
$map = opendir(".{$mapnaam}");
$count = 0;
while (false!==($bestand = readdir($map))) {
if ($bestand != "." && $bestand != "..") {
$ext = explode('.',$bestand);
$extl = sizeof($ext) - 1;
$ext = strtolower($ext[$extl]);
if ( in_array($ext,$image_types) ){
if($count%3 == 0) {
$plaatjes_reeks .= '</tr><tr>';
}
$plaatjes_reeks .= "<td><img src=\"emoticon/" . $bestand . "\" /></td>";
$count++;
}
}
}
if ( $plaatjes_reeks != "" ){
echo ($plaatjes_reeks);
}
closedir($map);
echo '
</table>
</td>
</tr>
</table>';
?>