GFS News \n ") ;
// echo ("
\n ") ;
//
// echo ("View ACTIVE News Items | \n ") ;
// echo ("View ARCHIVED News Items\n ") ;
// echo ("
\n ") ;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Generate the Page
$artist = 'news';
// make sure input is escaped properly
$ndate = addslashes($ndate);
$artist = addslashes($artist);
$ntitle = addslashes($ntitle);
$ncontent = addslashes($ncontent);
$archived = addslashes($archived);
$ID= addslashes($ID);
// $query1="select * from gfsnews WHERE artist = 'News' archived ! 'Y' ORDER BY ndate ";
$query1="select * from gfsnews ";
$please_insert_an_AND=0;
$fields = array("ndate"=>$ndate,"artist"=>$artist,"ntitle"=>$ntitle,"ncontent"=>$ncontent,"archived"=>$archived,"ID"=>$ID);
while (list($k,$v)=each($fields)){
if ($v){
if ($please_insert_an_AND){
$query1 = $query1." AND $k LIKE '%$v%'";
}
else{
$query1=$query1." WHERE $k LIKE '%$v%'";
}
$please_insert_an_AND=1;
}
}
$query1=$query1." ORDER BY ndate DESC";
$result = mysql_db_query("$db","$query1",$connection);
$numrows = mysql_affected_rows($connection);
if (! $numrows) {
$server = getenv("SERVER_NAME");
$script = getenv("SCRIPT_NAME");
$qu = getenv("QUERY_STRING");
$uri="http://$server$script?$qu";
echo ("ERROR - Could not access:
$uri
Sorry, an error occured and I could not get the requested page from the database. Please check the link and try again, or use the Search form below to Search MartNet Support. Thank you.
\n ");
echo ("");
}
else {
// echo ("There are $numrows News Items:");
while($row = mysql_fetch_array($result)) {
// make sure output is un-escaped properly
$ndate = stripslashes($row[ndate]);
$artist = stripslashes($row[artist]);
$ntitle = ($row[ntitle]);
$ncontent = stripslashes($row[ncontent]);
$archived = ($row[archived]);
$ID = stripslashes($row[ID]);
// echo ("
");
//Use php date function and args' to print in more useable
// format
if (! $ndate ) { }
else {
ereg("([0-9]+)-([0-9]+)-([0-9]+)",$ndate,$regs);
$realndate=ereg_replace("([0-9]+)-([0-9]+)-([0-9]+)","$regs[2]/$regs[3]/$regs[1]",$ndate);
echo "
$realndate \n";
}
echo ("
$ntitle \n") ;
echo ("
$ncontent
\n") ;
} // end while statement
} // end if (! $numrows) statement
///////////////////////////////////////////////////////////////////////////////////////////////////
// Include the footer HTML:
include("news_footer.php4");
// end fetch the record and build the page and error check
?>