Add some search option in the last paste list
This commit is contained in:
parent
7c15c88657
commit
ca8b5a0c3e
6 changed files with 32 additions and 11 deletions
|
|
@ -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 = "&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>';
|
||||
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))
|
||||
|
|
|
|||
Reference in a new issue