2012-01-20 17:41:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("../common.php");
|
|
|
|
|
2012-11-05 18:45:20 +00:00
|
|
|
$srch_title = $srch_author = $srch_lang = "";
|
|
|
|
if (!empty($_GET["title"]))
|
|
|
|
$srch_title = $_GET["title"];
|
|
|
|
if (!empty($_GET["author"]))
|
|
|
|
$srch_author = $_GET["author"];
|
|
|
|
if (!empty($_GET["lang"]))
|
|
|
|
$srch_lang = $_GET["lang"];
|
|
|
|
|
2012-01-20 17:41:56 +00:00
|
|
|
if ($dh = opendir(DESTINATION))
|
|
|
|
{
|
|
|
|
$list = array();
|
|
|
|
while (($file = readdir($dh)) !== false)
|
|
|
|
$list[] = array(filemtime(DESTINATION.$file), $file);
|
|
|
|
closedir($dh);
|
|
|
|
|
|
|
|
array_multisort($list, SORT_DESC);
|
|
|
|
?>
|
2012-01-20 19:04:04 +00:00
|
|
|
<h1>Dernières publications</h1>
|
2012-01-20 17:41:56 +00:00
|
|
|
<ul id="list">
|
|
|
|
<?php
|
|
|
|
if (empty($_GET["s"]))
|
|
|
|
$_GET["s"] = 0;
|
|
|
|
$s = intval($_GET["s"]);
|
|
|
|
$i = 0;
|
|
|
|
foreach($list as $f)
|
|
|
|
{
|
|
|
|
if ($s > 0)
|
|
|
|
{
|
|
|
|
$s--;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2012-11-05 18:45:20 +00:00
|
|
|
if ($i > 23)
|
2012-01-20 17:41:56 +00:00
|
|
|
{
|
2012-11-05 18:45:20 +00:00
|
|
|
$GT = $GA = $GL = "";
|
|
|
|
if (!empty($srch_title)) $GR = "&title=".$srch;
|
|
|
|
if (!empty($srch_author)) $GR = "&author=".$srch;
|
|
|
|
if (!empty($srch_lang)) $GR = "&lang=".$srch;
|
|
|
|
print '<li><a href="./?s='.(intval($_GET["s"])+23).$GR.'#list">Plus anciens ...</a></li>';
|
2012-01-20 17:41:56 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (preg_match("#^([a-zA-Z0-9]{".RGXP_NB."}).xml$#", $f[1], $fout))
|
|
|
|
{
|
|
|
|
$paste = new Paste($fout[1]);
|
2012-11-05 18:45:20 +00:00
|
|
|
if ($paste->is_private ()
|
|
|
|
|| !preg_match("#".$srch_title."#i", $paste->title)
|
|
|
|
|| !preg_match("#".$srch_author."#i", $paste->author)
|
|
|
|
|| !preg_match("#".$srch_lang."#i", $paste->language))
|
2012-02-29 13:41:00 +00:00
|
|
|
continue;
|
2012-01-20 17:41:56 +00:00
|
|
|
|
|
|
|
if (empty($paste->title))
|
|
|
|
$title = "Sans titre";
|
|
|
|
else
|
|
|
|
$title = htmlentities($paste->title);
|
|
|
|
|
|
|
|
if (empty($paste->author))
|
|
|
|
$author = "<em>un anonyme</em>";
|
|
|
|
else
|
|
|
|
$author = htmlentities($paste->author);
|
|
|
|
|
|
|
|
print '<li><a href="./?'.$paste->fileref.'">'.$title."</a> par ".$author.", le ".date("d/m/Y H:i:s", $paste->date)."</li>";
|
2012-02-29 13:41:00 +00:00
|
|
|
$i++;
|
2012-01-20 17:41:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|