website/parts/news_search.inc
Jeff Teunissen 9e6f75ccbd Update for PHP 7.x
PHP 7 doesn't like the old short tags we were using (it's possible to re-enable
them, but won't be for version 8, so we might as well switch now), and the old
MySQL APIs are now gone entirely, replaced with something different.

This should make everything work at least as well as it used to.

Also, one file used to be checked in with CRLF line endings. ??
2022-04-27 13:14:47 -04:00

65 lines
1.3 KiB
PHP

<?php
// local vars
$string = $_GET['string'];
$month = $_GET['month'];
$year = $_GET['year'];
function monthForm ($month, $year)
{
need ('feature');
// suppress warnings
@featureOpen ('Date Search');
?>
<FORM name="bymonth" method="get" action="<?=thisURL?>">
<P align="center">
<SELECT name="month">
<?php
for ( $i = 1 ; $i < 13 ; $i++ ) {
printf ("<OPTION%s>%02d</OPTION>", $i == $month ? " selected" : "", $i);
}
?>
</SELECT><STRONG> / </STRONG><SELECT name="year">
<?php
if ($year == "")
$year = date ('Y');
for ($i = 2000; $i <= date ('Y'); $i++ ) {
if ($i == 2005 || $i == 2006)
continue;
printf ("<OPTION%s>%04d</OPTION>", $i == $year ? " selected" : "", $i);
}
?>
</SELECT>
<BR>
<BR>
<INPUT type="submit" value="Search">
</P>
</FORM><?php
featureClose ();
}
function keywordForm ($string)
{
need ('feature');
// suppress warnings
@featureOpen ('Keyword Search');
?>
<FORM name="bystring" method="get" action="<?=thisURL?>">
<P align="center">
<?php
printf ('<INPUT name="string" type="text" size="16" value="%s">', $string);
?>
<BR>
<BR>
<INPUT TYPE="submit" VALUE="Search">
</P>
</FORM><?php
featureClose ();
}
monthForm ($month, $year);
keywordForm ($string);
?>