Add search bar to index and pkg details pages

Also changed it around a little bit so it's not tied down the search results function

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
Callan Barrett 2008-12-23 00:52:09 +09:00 committed by Loui Chang
parent 3288805d2d
commit d62baaecf0
3 changed files with 12 additions and 7 deletions

View file

@ -12,6 +12,8 @@ include_lang('pkgfuncs_po.inc');
html_header( __("Home") ); html_header( __("Home") );
include('pkg_search_form.php');
$dbh = db_connect(); $dbh = db_connect();
?> ?>

View file

@ -64,6 +64,7 @@ if ($output):
endif; endif;
if (isset($_GET["ID"])) { if (isset($_GET["ID"])) {
include('pkg_search_form.php');
if (!intval($_GET["ID"])) { if (!intval($_GET["ID"])) {
print __("Error trying to retrieve package details.")."<br />\n"; print __("Error trying to retrieve package details.")."<br />\n";
} else { } else {

View file

@ -1,3 +1,5 @@
<?php include_once('pkgfuncs.inc') ?>
<form action='packages.php' method='get'> <form action='packages.php' method='get'>
<input type='hidden' name='O' value='0'> <input type='hidden' name='O' value='0'>
<center> <center>
@ -13,7 +15,7 @@
<label><?php print __("Keywords"); ?></label> <label><?php print __("Keywords"); ?></label>
<input type='text' name='K' size='20' value="<?php print stripslashes(trim(htmlspecialchars($_REQUEST["K"], ENT_QUOTES))); ?>" maxlength='35' /> <input type='text' name='K' size='20' value="<?php print stripslashes(trim(htmlspecialchars($_REQUEST["K"], ENT_QUOTES))); ?>" maxlength='35' />
<?php if (!$_GET['detail']): ?><input type='submit' style='width:80px' class='button' name='do_Search' value='<?php print __("Go"); ?>' /><?php endif; ?> <?php if (!$_GET['detail']): ?><input type='submit' style='width:80px' class='button' name='do_Search' value='<?php print __("Go"); ?>' /><?php endif; ?>
<a href="packages.php?<?php print mkurl('detail=' . (($_GET['detail']) ? 0 : 1) ) ?>">Advanced</a> <a href="?<?php print mkurl('detail=' . (($_GET['detail']) ? 0 : 1) ) ?>">Advanced</a>
<?php if ($_GET['detail']): ?> <?php if ($_GET['detail']): ?>
<div id="advanced"> <div id="advanced">
<input type="hidden" name="detail" value="1" /> <input type="hidden" name="detail" value="1" />
@ -23,15 +25,15 @@
<select name='L'> <select name='L'>
<option value=0><?php print __("Any"); ?></option> <option value=0><?php print __("Any"); ?></option>
<?php <?php
while (list($id, $loc) = each($locs)): foreach (pkgLocations() as $id => $loc):
if (intval($_REQUEST["L"]) == $id): if (intval($_GET["L"]) == $id):
?> ?>
<option value="<?php print $id; ?>" selected="selected"><?php print $loc; ?></option> <option value="<?php print $id; ?>" selected="selected"><?php print $loc; ?></option>
<?php else: ?> <?php else: ?>
<option value="<?php print $id; ?>"><?php print $loc; ?></option> <option value="<?php print $id; ?>"><?php print $loc; ?></option>
<?php <?php
endif; endif;
endwhile; endforeach;
?> ?>
</select> </select>
</li> </li>
@ -40,15 +42,15 @@
<select name='C'> <select name='C'>
<option value='0'><?php print __("Any"); ?></option> <option value='0'><?php print __("Any"); ?></option>
<?php <?php
while (list($id, $cat) = each($cats)): foreach (pkgCategories() as $id => $cat):
if (intval($_REQUEST["C"]) == $id): if (intval($_GET["C"]) == $id):
?> ?>
<option value="<?php print $id ?>" selected="selected"><?php print $cat; ?></option> <option value="<?php print $id ?>" selected="selected"><?php print $cat; ?></option>
<?php else: ?> <?php else: ?>
<option value="<?php print $id ?>"><?php print $cat; ?></option> <option value="<?php print $id ?>"><?php print $cat; ?></option>
<?php <?php
endif; endif;
endwhile; endforeach;
?> ?>
</select> </select>
</li> </li>