| Fichier source |
documentations.php
[ 0]
<?php
[ 1]require_once "include/global.php";
[ 2]require_once "include/preferences.php";
[ 3]require_once "include/menubar.php";
[ 4]require_once "include/xml_historique.php";
[ 5]
[ 6]
[ 7]$initialiser_preferences();
[ 8]$entete_html();
[ 9]afficher_top_bar();
[ 10]
[ 11]debut_mosaique_horizontale();
[ 12]
[ 13]$rep=opendir('./docs');
[ 14]unset($liste);
[ 15]unset($descripteur);
[ 16]
[ 17]while ($file = readdir($rep))
[ 18]{
[ 19] if (($file <> ".") and ($file <>".."))
[ 20] {
[ 21] $tmp = "./docs/" . $file;
[ 22] if (is_dir($tmp))
[ 23] {
[ 24] $repertoire[] = $tmp;
[ 25] }
[ 26] }
[ 27]}
[ 28]
[ 29]//Doc's left Bar
[ 30]$T = "<B>Il y a " . sizeof($repertoire) ." themes en ligne</B>";
[ 31]$encadre( $T, 140, $COL_bg_yellow, "Documentations" );
[ 32]echo "<BR>\n";
[ 33]
[ 34]
[ 35]// Standard Left Bar
[ 36]afficher_standard_left_bar();
[ 37]fin_mosaique_gauche();
[ 38]
[ 39]// Begin of the main Bar
[ 40]for ($nb_desc=0; $nb_desc<sizeof($repertoire); $nb_desc++)
[ 41]{
[ 42] // Display the descriptions of the theme
[ 43] $T = "";
[ 44] $path = $repertoire[$nb_desc] ."/desc.txt" ;
[ 45] $fd = fopen($path, "r");
[ 46] $contents = fread($fd, filesize ($path));
[ 47] fclose($fd);
[ 48] $T .= $contents;
[ 49]
[ 50] // Display images
[ 51] $rep = opendir($repertoire[$nb_desc]);
[ 52] while ($file = readdir($rep))
[ 53] {
[ 54] if (($file <> ".") and ($file <>".."))
[ 55] {
[ 56] $dir = $repertoire[$nb_desc]."/";
[ 57] $path = $dir . $file;
[ 58] $prefixe = substr($file, 0, -4);
[ 59] $suffixe = substr (strrchr($file, "."), 1);
[ 60] $suffixe = strtolower($suffixe);
[ 61] if ($suffixe=="jpg")
[ 62] {
[ 63] if (substr($file,0,4)!='tmb.')
[ 64] {
[ 65] $tmp = $dir.'tmb.'.$file;
[ 66] if (!file_exists($tmp))
[ 67] {
[ 68] echo 'fabrication du thumbnail pour '.$file.'<BR>';
[ 69] $src_img = imagecreatefromjpeg($dir.$file);
[ 70] $file_width = 100;
[ 71] $file_eight = imagesy($src_img) / imagesx($src_img) * 100;
[ 72] $dst_img = imagecreate($file_width,$file_eight);
[ 73] imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $file_width, $file_eight, imagesx($src_img), imagesy($src_img));
[ 74] imagejpeg($dst_img, $tmp);
[ 75] }
[ 76] else
[ 77] {
[ 78] $T .= "<A href=\"$path\">\n";
[ 79] $T .= "<IMG border=0 src=\"$tmp\" width=100 alt=\"$file\">\n";
[ 80] $T .= "</a>\n";
[ 81] }
[ 82] }
[ 83] }
[ 84] else if ($suffixe=="xml")
[ 85] {
[ 86] $source = $path;
[ 87] $T .= $inserer_lien( "mes_documents.php", $prefixe ). " <BR />\n";
[ 88] }
[ 89] }
[ 90] }
[ 91]
[ 92] // Display the files
[ 93] $T .= "<H3>Fichiers à télécharger: </H3>\n";
[ 94] $T .= "<UL>\n";
[ 95] $rep = opendir($repertoire[$nb_desc]);
[ 96] $nbfiles = 0;
[ 97] while ($file = readdir($rep))
[ 98] {
[ 99] if (($file <> ".") and ($file <>".."))
[100] {
[101] $dir = $repertoire[$nb_desc]."/";
[102] $path = $dir . $file;
[103] $suffixe = substr (strrchr($file, "."), 1);
[104] $suffixe = strtolower($suffixe);
[105] if (($suffixe=="zip") or
[106] ($suffixe=="pdf") or
[107] ($suffixe=="wmv") or
[108] ($suffixe=="mp3") or
[109] ($suffixe=="mpg"))
[110] {
[111] $nbfiles +=1;
[112] $T .= "<LI>";
[113] $T .= $inserer_lien( $path, $file );
[114] $T .= " : " . DownloadSize($path) . "</LI>\n";
[115] }
[116] }
[117] }
[118] if ($nbfiles == 0)
[119] {
[120] $T .= "<LI>Aucun fichier.</LI>";
[121] }
[122] $T .= "</UL>\n";
[123] $i = $nb_desc +1;
[124] $encadre($T, $Largeur_Mainbar, $COL_bg_yellow,
[125] "Theme $i/".sizeof($repertoire));
[126] echo "<BR>\n";
[127] unset($fd);
[128] unset($contents);
[129]}
[130]
[131]fin_mosaique_horizontale();
[132]afficher_foot_bar();
[133]
[134]$ferme_html();
[135]?>
[136]
|
|
|