include "/home/nirs/db/minimal_connect.php";
function press_query($year, $where) {
$query = "SELECT * FROM pressgen_releases $where";
$result = mysql_query($query);
if (!$result)
die("Failed: ". mysql_error());
return $result;
}
if (!$sortby) {
$sortby = "year";
}
$title = "Alerts";
$category = "home";
$offer_print = "y";
$rss_file = "/alerts/v2.rss";
include "/home/nirs/public_html/include/top-inst.htm";
$year = date("Y",time());
$currenttime = time();
?>
// stops mySQL injection exploits
function dmyhtmlentities($str,$key) {
$tbl["<"]="!L!";
$tbl[">"]="!G!";
$tbl[";"]="!C!";
$tbl["&"]="!A!";
$tbl["="]="!E!";
$tbl["#"]="!H!";
$tbl["--"]="!2!";
$tbl["..."]="...";
$tbl["—"]="!M!";
$tbl["or"]="!WR!";
$tbl["Or"]="!Or!";
$tbl["oR"]="!oR!";
$tbl["OR"]="!OR!";
$tbl["|"]="!1!";
$tbl["SELECT"]="!QS!";
$tbl["DROP"]="!QD!";
$tbl["UPDATE"]="!QU!";
$tbl["DELETE"]="!QT!";
$tbl["INSERT"]="!QI!";
$tbl["WHERE"]="!QW!";
$tbl["'"]="!S!";
$tbl['"']="!Q!";
$tbl["alter"]="!ALl!";
$tbl["Alter"]="!ALt!";
$tbl["ALTER"]="!ALu!";
$tbl["select"]="!QSl!";
$tbl["Select"]="!QSt!";
$tbl["SELECT"]="!QSu!";
$tbl["drop"]="!QDl!";
$tbl["Drop"]="!QDt!";
$tbl["DROP"]="!QDu!";
$tbl["update"]="!QUl!";
$tbl["Update"]="!QUt!";
$tbl["UPDATE"]="!QUu!";
$tbl["delete"]="!QTl!";
$tbl["Delete"]="!QTt!";
$tbl["DELETE"]="!QTu!";
$tbl["insert"]="!QIl!";
$tbl["Insert"]="!QIt!";
$tbl["INSERT"]="!QIu!";
$tbl["where"]="!QWl!";
$tbl["Where"]="!QWt!";
$tbl["WHERE"]="!QWu!";
if ($key == "description") {
$tbl['"']="!Q!";
$tbl[''']="!S!";
}
else {
$tbl["'"]="!S!";
$tbl['"']="!Q!";
}
return str_replace(array_values($tbl),array_keys($tbl),$str);
}
if ($sortby == "year") {
while ($year >= "1996") {
echo "$year
\n\n";
$where = "WHERE (type = '3' && year = '$year' && (status = 'p' || (status = 'd' && (stamp < '$currenttime')))) ORDER BY stamp DESC";
$result = NULL;
$result = press_query($year, $where);
$line = NULL;
$all_prs = NULL;
while ($line = mysql_fetch_array($result))
$all_prs[] = $line;
$pr_pos = 0;
while ($all_prs[$pr_pos] != NULL) {
$db_prs = $all_prs[$pr_pos];
foreach ($db_prs as $key => $val) {
$db_prs[$key] = dmyhtmlentities($val,$key);
}
echo "- ". date("F j", $db_prs[stamp]) .": ". $db_prs[title] ."
\n";
++$pr_pos;
}
echo "\n
\n";
$year = $year - 1;
}
}
?>
include "/home/nirs/public_html/include/bottom-inst.htm";
?>