Add some search option in the last paste list

This commit is contained in:
Némunaire 2012-11-05 19:45:20 +01:00
commit ca8b5a0c3e
6 changed files with 32 additions and 11 deletions

View file

@ -2,6 +2,14 @@
require_once("../common.php");
$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"];
if ($dh = opendir(DESTINATION))
{
$list = array();
@ -26,16 +34,23 @@ if ($dh = opendir(DESTINATION))
continue;
}
if ($i > 10)
if ($i > 23)
{
print '<li><a href="./?s='.(intval($_GET["s"])+10).'#list">Plus anciens ...</a></li>';
$GT = $GA = $GL = "";
if (!empty($srch_title)) $GR = "&amp;title=".$srch;
if (!empty($srch_author)) $GR = "&amp;author=".$srch;
if (!empty($srch_lang)) $GR = "&amp;lang=".$srch;
print '<li><a href="./?s='.(intval($_GET["s"])+23).$GR.'#list">Plus anciens ...</a></li>';
break;
}
if (preg_match("#^([a-zA-Z0-9]{".RGXP_NB."}).xml$#", $f[1], $fout))
{
$paste = new Paste($fout[1]);
if ($paste->is_private ())
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))
continue;
if (empty($paste->title))