Source de affiche_script.php
<?
require ("page.inc");
require ("toolbox.inc");
$currentPage = new Page();
if (isset($_GET["script"]))
{
$basefilename = strip_tags(basename($_GET["script"]));
}
else
{
$basefilename = " ";
}
$currentPage->setKeywords("boîte, boite, outils, script, utile, télécharger, telecharger, source, $basefilename");
$currentPage->setDescription("Le script $basefilename de la boîte à outils.");
$currentPage->setTitle($basefilename);
$currentPage->setHomePage("Retour à la boîte à outils","/boite.php");
$currentPage->setSectionContent("Boîte à outils", getScriptsTopics());
$currentPage->setContent('');
$currentPage->setPageTitle($basefilename);
$filename = $_SERVER["DOCUMENT_ROOT"].SCRIPTS_DIR.$basefilename;
@ $fp = fopen($filename, "r");
if ($fp && ($basefilename[0]!='.') && (strlen($basefilename) > 0))
{
$size = filesize($filename);
if ($size >= 1024)
{
$size = floor($size / 1024);
$size .= ' <acronym title="Kilo-octets">Ko</acronym>';
}
else
{
$size .= ' octets';
}
$downloadLink = '<div class="download"><a href="'.SCRIPTS_DIR.$basefilename.'">Télécharger</a> ('.$size.')</div>';
$content = '';
while (!feof($fp))
{
$line = htmlspecialchars(fgets($fp, 200));
if ($line)
{
$i = 0;
$indent = "";
while ($line[$i] == ' ')
{
$i++;
$indent .= " ";
}
$line = $indent.substr($line, $i);
$pos = strpos($line, "#");
if (($pos === false) || (($pos != 0) && ($line[$pos - 1] == '$')))
{
$content .= "$line<br />";
}
else
{
if ($pos != 0)
{
$content .= substr($line, 0, $pos);
}
$content .= "<span class=\"comment\">";
$content .= substr($line, $pos);
$content .= "</span><br />";
}
}
}
fclose($fp);
$currentPage->setIntroduction($downloadLink);
$currentPage->addChapter('', '', '
<div class="source">
'.$content.'
</div>
');
}
else
{
@ fclose($fp);
$currentPage->setPageTitle('Script introuvable');
$currentPage->setIntroduction('<p>Le script '.$basefilename.' n\'existe pas</p>');
}
$currentPage->setExtra('<div id="forum-link">Si avez des problèmes avec ce script, vous pouvez utiliser le <a href="/forums/scripts/">Forum Scripts</a></div>');
$currentPage -> display();
?>
require ("page.inc");
require ("toolbox.inc");
$currentPage = new Page();
if (isset($_GET["script"]))
{
$basefilename = strip_tags(basename($_GET["script"]));
}
else
{
$basefilename = " ";
}
$currentPage->setKeywords("boîte, boite, outils, script, utile, télécharger, telecharger, source, $basefilename");
$currentPage->setDescription("Le script $basefilename de la boîte à outils.");
$currentPage->setTitle($basefilename);
$currentPage->setHomePage("Retour à la boîte à outils","/boite.php");
$currentPage->setSectionContent("Boîte à outils", getScriptsTopics());
$currentPage->setContent('');
$currentPage->setPageTitle($basefilename);
$filename = $_SERVER["DOCUMENT_ROOT"].SCRIPTS_DIR.$basefilename;
@ $fp = fopen($filename, "r");
if ($fp && ($basefilename[0]!='.') && (strlen($basefilename) > 0))
{
$size = filesize($filename);
if ($size >= 1024)
{
$size = floor($size / 1024);
$size .= ' <acronym title="Kilo-octets">Ko</acronym>';
}
else
{
$size .= ' octets';
}
$downloadLink = '<div class="download"><a href="'.SCRIPTS_DIR.$basefilename.'">Télécharger</a> ('.$size.')</div>';
$content = '';
while (!feof($fp))
{
$line = htmlspecialchars(fgets($fp, 200));
if ($line)
{
$i = 0;
$indent = "";
while ($line[$i] == ' ')
{
$i++;
$indent .= " ";
}
$line = $indent.substr($line, $i);
$pos = strpos($line, "#");
if (($pos === false) || (($pos != 0) && ($line[$pos - 1] == '$')))
{
$content .= "$line<br />";
}
else
{
if ($pos != 0)
{
$content .= substr($line, 0, $pos);
}
$content .= "<span class=\"comment\">";
$content .= substr($line, $pos);
$content .= "</span><br />";
}
}
}
fclose($fp);
$currentPage->setIntroduction($downloadLink);
$currentPage->addChapter('', '', '
<div class="source">
'.$content.'
</div>
');
}
else
{
@ fclose($fp);
$currentPage->setPageTitle('Script introuvable');
$currentPage->setIntroduction('<p>Le script '.$basefilename.' n\'existe pas</p>');
}
$currentPage->setExtra('<div id="forum-link">Si avez des problèmes avec ce script, vous pouvez utiliser le <a href="/forums/scripts/">Forum Scripts</a></div>');
$currentPage -> display();
?>
Si avez des problèmes ou des questions concernant ce fichier source, vous pouvez utiliser le Forum Sources du site