<div class="commonMain">
<div class="commonCaption">Search AROS stuff</div>
<div class="commonContent">
<form action="?content=search" method="post">
<fieldset>
Search string: <br /><br />
<input type="text" name="sstr"
value="<?= isset($_POST["sstr"]) ? $_POST["sstr"] : ""; ?>" />
<input type="submit" value="Search" /><br /><br />
You can search using regular expressions, for example: "Slack|fnord",
will show all entries matching `Slack' <strong>and</strong> all entries matching
`fnord'; the search is case insensitive.
</fieldset>
</form>
</div>
</div>
<?
if(isset($_POST["sstr"]))
{
$sstr = $_POST["sstr"];
?>
<div class="commonMain">
<div class="commonCaption">Searching for "<?= $sstr; ?>"</div>
<div class="commonContent">
<?
include_once("$INCLUDE_DIR/xml.inc");
$files = array("rss/software.rss", "rss/news.rss");
for($ff = 0; $ff < count($files); $ff++)
{
$file = str_replace("rss/", "", $files[$ff]);
$file = str_replace(".rss", "", $file);
$found = 0;
$parsed = get_items($files[$ff]);
echo "<h4>Searching in `" . $files[$ff] . "'</h4>\n";
for($i = 0; $i < count($parsed["title"]); $i++)
{
$title = $parsed["title"][$i];
$desc = unhtmlentities($parsed["description"][$i]);
if(preg_match("'$sstr'si", $desc, $dmy) ||
preg_match("'$sstr'si", $title, $dmy) )
{
$found++;
$id = get_ID($parsed, $i);
if(preg_match("'slack\|fnord'si", $sstr, $dmy))
$desc = preg_replace("'<!--(.*?)-->'", "<-- \$1 -->", $desc);
$desc = preg_replace("'($sstr)'i", "<strong class=\"highlight\">\$1</strong>", $desc);
$title = preg_replace("'($sstr)'i", "<strong class=\"highlight\">\$1</strong>", $title);
echo "<p></p><a href=\"/?content=parse&file=$file&id=$id#$id\">$title</a><br />";
echo "$desc<br /></p>";
}
}
if(!$found) echo "<p>No matches.</p>";
else echo "<p>Found $found matches.</p>";
}
?>
</div>
</div>
<?
}
?>
Latest News
Latest Software
read 0.3.6
kal, 2004/04/30 07:14:24.
nroff 1.10
kal, 2004/04/22 08:29:10.
Nenscript 1.13.3
kal, 2004/04/22 08:23:53.
necho 0.2.3
kal, 2004/04/19 10:58:47.
dgrep 0.1.4
kal, 2004/04/19 10:49:42.
kal, 2004/04/30 07:14:24.
nroff 1.10
kal, 2004/04/22 08:29:10.
Nenscript 1.13.3
kal, 2004/04/22 08:23:53.
necho 0.2.3
kal, 2004/04/19 10:58:47.
dgrep 0.1.4
kal, 2004/04/19 10:49:42.
Select Theme
Links