file-info-gd-downloadinfo-knop
Gesponsorde koppelingen
PHP script bestanden
----------------------------------------------------
index.php
----------------------------------------------------
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
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
<HTML>
<HEAD>
<TITLE>
File -> Infoknop
</TITLE>
</HEAD>
<BODY>
<b>Files on-the-fly aangeven met een infoknop:</b><br><br>
<?php
$map=opendir('./files');
while (false!==($bestand = readdir($map))) {
if ($bestand != "." && $bestand != "..") {
$filesize = filesize('files/'.$bestand) / 1024;
if(round($filesize,1) < '1'){
$filesize_afgerond = round($filesize,2).' KB';
}else{
$filesize = filesize('files/'.$bestand) / 1024 / 1024;
$filesize_afgerond = round($filesize,2).' MB';
}
echo '<a href="files/'.$bestand.'"><img src="btn.php?txt2='.$bestand.' ('.$filesize_afgerond.')" border="0"></a><br>';
}
}
closedir($map);
?>
</BODY>
</HTML>
<HEAD>
<TITLE>
File -> Infoknop
</TITLE>
</HEAD>
<BODY>
<b>Files on-the-fly aangeven met een infoknop:</b><br><br>
<?php
$map=opendir('./files');
while (false!==($bestand = readdir($map))) {
if ($bestand != "." && $bestand != "..") {
$filesize = filesize('files/'.$bestand) / 1024;
if(round($filesize,1) < '1'){
$filesize_afgerond = round($filesize,2).' KB';
}else{
$filesize = filesize('files/'.$bestand) / 1024 / 1024;
$filesize_afgerond = round($filesize,2).' MB';
}
echo '<a href="files/'.$bestand.'"><img src="btn.php?txt2='.$bestand.' ('.$filesize_afgerond.')" border="0"></a><br>';
}
}
closedir($map);
?>
</BODY>
</HTML>
----------------------------------------------------
btn.php
----------------------------------------------------
Code (php)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
<?php
header ("Content-type: image/png");
$img = imagecreatefrompng("downloadbutton2.png");
$kleur = imagecolorallocate($img, 255, 255, 255);
imagettftext($img, 12, 0, 15, 26, $kleur, 'trebucbd.ttf', 'Download');
imagettftext($img, 8, 0, 15, 40, $kleur, 'trebuc.ttf', $_GET['txt2']);
imagepng($img);
imagedestroy($img);
?>
header ("Content-type: image/png");
$img = imagecreatefrompng("downloadbutton2.png");
$kleur = imagecolorallocate($img, 255, 255, 255);
imagettftext($img, 12, 0, 15, 26, $kleur, 'trebucbd.ttf', 'Download');
imagettftext($img, 8, 0, 15, 40, $kleur, 'trebuc.ttf', $_GET['txt2']);
imagepng($img);
imagedestroy($img);
?>