make continuing a news search a little easier by preserving old search parms

This commit is contained in:
Bill Currie 2001-10-31 22:54:39 +00:00
parent 44584e9b91
commit 0d581938a4
3 changed files with 26 additions and 9 deletions

View file

@ -54,7 +54,7 @@
'</TR>';
}
function monthForm ()
function monthForm ($month, $year)
{
?><FORM name="bymonth" method="get" action="/old_news.php"><?
tableBoxHeader ('black', tableHeadColor);
@ -70,7 +70,7 @@
<SELECT name="month">
<?
for ( $i = 1 ; $i < 13 ; $i++ ) {
printf ("<OPTION>%02d</OPTION>", $i);
printf ("<OPTION%s>%02d</OPTION>", $i == $month ? " selected" : "", $i);
}
?>
</SELECT>
@ -80,8 +80,13 @@
</TD>
<TD align="center">
<SELECT name="year">
<OPTION>2000</OPTION>
<OPTION selected>2001</OPTION>
<?
if ($year == "")
$year = 2001;
for ( $i = 2000 ; $i <= 2001 ; $i++ ) {
printf ("<OPTION%s>%04d</OPTION>", $i == $year ? " selected" : "", $i);
}
?>
</SELECT>
</TD>
</TR>
@ -98,7 +103,7 @@
<?
}
function keywordForm ()
function keywordForm ($string)
{
?><FORM name="bystring" method="get" action="/old_news.php"><?
tableBoxHeader ('black', tableHeadColor);
@ -111,7 +116,9 @@
<STRONG>String:</STRONG>
</TD>
<TD align="center">
<INPUT name="string" type="text" size="25">
<?
printf ("<INPUT name=\"string\" type=\"text\" size=\"25\" value=\"%s\">", $string);
?>
</TD>
</TR>
<TR vAlign="middle">

View file

@ -10,12 +10,12 @@
<TABLE width="50%" cellSpacing="2" cellPadding="0" border="0">
<TR vAlign="top">
<TD align="center">
<? monthForm (); ?>
<? monthForm ("", ""); ?>
</TD>
</TR>
<TR vAlign="top">
<TD align="center">
<? keywordForm (); ?>
<? keywordForm (""); ?>
</TD>
</TR>
</TABLE>

View file

@ -2,11 +2,21 @@
$pageName = 'News Archives';
$focused = "none"; // Dock icon name to get a border
require "parts/preamble.php"; // Load most of document
need ("news");
?>
<TABLE width="100%" cellSpacing="2" cellPadding="0" border="0">
<TR vAlign="top">
<TD align="center" width="50%"><?
monthForm ($month, $year);
?></TD>
<TD align="center" width="50%"><?
keywordForm ($string);
?></TD>
</TR>
</TABLE>
<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0">
<TR vAlign="top">
<TD align="center"><?
need ("news");
tableBoxHeader (featureBgColor, featureHeadColor);
tableTitle ($pageName, 1, featureHeadColor);
if ($month || $year) {