| Fichier source |
source.php
[ 0]
<?php
[ 1]require_once "include/global.php";
[ 2]require_once "include/preferences.php";
[ 3]require_once "include/menubar.php";
[ 4]
[ 5]$initialiser_preferences();
[ 6]$entete_html();
[ 7]afficher_top_bar();
[ 8]
[ 9]debut_mosaique_horizontale();
[ 10]afficher_standard_left_bar();
[ 11]fin_mosaique_gauche();
[ 12]
[ 13]///////////////////////////////////////////////////////////////////////////////
[ 14]function ScanRep($dir)
[ 15]{
[ 16] global $inserer_lien;
[ 17] global $source;
[ 18]
[ 19] $t = "";
[ 20] if (is_dir($dir))
[ 21] {
[ 22] $rep=opendir($dir);
[ 23] while ($file = readdir($rep))
[ 24] {
[ 25] $tmp = substr($file, -3);
[ 26] $tmp = strtolower($tmp);
[ 27] if (($tmp=="php") or ($tmp=="inc")or ($tmp=="css"))
[ 28] {
[ 29] $tmp = substr($file, 0,-4);
[ 30] $source=$dir."/".$file;
[ 31] $T .= "<LI>".$inserer_lien("source.php",$file)."</LI>";
[ 32] }
[ 33] }
[ 34] }
[ 35] return $T;
[ 36]}
[ 37]///////////////////////////
[ 38]// Begin of the main Bar //
[ 39]///////////////////////////
[ 40]
[ 41]if ($sourcefile=="")
[ 42]{
[ 43] ////////// Liste des Sources
[ 44] $T = "<DIV ALIGN=justify>";
[ 45] $T .= "Ce site a entièrement été créé en PHP. ";
[ 46] $T .= "Si vous désirez voir les sources cliquez sur les liens ci-dessous.";
[ 47] $T .= "</DIV>";
[ 48] $T .= "<H2>";
[ 49] $T .= "chrome.free.fr/";
[ 50] $T .= "</H2><UL>";
[ 51] $T .= ScanRep(".");
[ 52] $T .= "</UL><BR>";
[ 53]// $T .= "<H2>";
[ 54]// $T .= "chrome.free.fr/include/";
[ 55]// $T .= "</H2><UL>";
[ 56]// $T .= ScanRep("./include");
[ 57]// $T .= "</UL><BR><DIV ALIGN=justify>";
[ 58] $T .= "Si vous voulez en savoir plus sur les fonctions qui ce trouvent dans le répertoire include <a href='mailto:tbaud@ifrance.com'>envoyez moi un mail</A>.";
[ 59]}
[ 60]else
[ 61]{
[ 62] if (file_exists ($sourcefile))
[ 63] {
[ 64] $T = "<H1>$sourcefile</h1>\n<SMALL>\n";
[ 65] if ( !empty ( $_REQUEST['noline'] ) )
[ 66] {
[ 67] $noline = true;
[ 68] }
[ 69] // Turn on output buffering
[ 70] ob_start();
[ 71] // Show source of file
[ 72] show_source ( $sourcefile );
[ 73] // Get contents of buffer
[ 74] $raw = ob_get_contents();
[ 75] // Clean and end buffering
[ 76] ob_end_clean();
[ 77] // Split the source into lines
[ 78] $raw = explode ('<br />', $raw );
[ 79] // Insert the line number
[ 80] $ml = strlen (count($raw));
[ 81] for ( $i = 0; $i < count ( $raw ); $i++ )
[ 82] {
[ 83] if ( !isset ( $noline ) )
[ 84] {
[ 85] $gap = ( $ml - strlen ( sprintf("%u",$i) ) );
[ 86] $temp = "<FONT COLOR=black><CODE>[" . str_repeat(" ", $gap );
[ 87] $raw[$i] = $temp.$i."]</code></font>" . $raw[$i] . "<BR />";
[ 88] }
[ 89] else
[ 90] {
[ 91] $raw[$i] = "$raw[$i]<BR />";
[ 92] }
[ 93] }
[ 94] // Convert back to a string
[ 95] $T .= implode ( '', $raw );
[ 96] // Print source
[ 97] //echo "<html>\n <body>\n$raw\n </body>\n</html>";
[ 98]
[ 99] //$T .= highlight_file($sourcefile);
[100] $T .= "</small>\n";
[101] }
[102]}
[103]
[104]$encadre($T, $Largeur_Mainbar, $COL_bg_yellow, "Fichier source");
[105]
[106]fin_mosaique_horizontale();
[107]afficher_foot_bar();
[108]
[109]$ferme_html();
[110]?>
[111]
|
|
|