Announcements

[insert_php]
date_default_timezone_set(“America/New_York”);

$con=mysqli_connect(“localhost”,”cp33819_thomas”,”AaZzUUur8B”);
mysqli_select_db($con,”cp33819_wp736″);
if ($con->connect_error)
{
die(“Connection failed: ” . $con->connect_error);
}

global $wpdb;
$results = $wpdb->get_results( “select * from ANNOUNCEMENTS where ACTIVE=’Active’ and ” . date(“U”) . “>NDATE and ADATE>” . date(“U”) . ” order by NDATE desc” );

if(!empty($results))
{
foreach($results as $row)
{
$id=$row->ID;
$adate=$row->ADATE;
$ndate=$row->NDATE;
$acategory=$row->ACATEGORY;

//TOKENS FOR APOS AND DOLLAR
$atext=stripslashes(trim($row->ATEXT));
$atext=str_replace(“–dollar-|-token–“,”$”,$atext);
$atitle=stripslashes($row->ATITLE);
$atitle=str_replace(“–dollar-|-token–“,”$”,$atitle);
$active=$row->ACTIVE;

$active=$row->ACTIVE;

echo “

“;
echo “Announcement Title: ” . $atitle . “

“;
echo “Announcement Text: ” . $atext . “

“;
//echo “Announcement Created: ” . date(“F j, Y”,$ndate) . “
“;
echo “Announcement Expires: ” . date(“F j, Y”,$adate) . “
“;
echo “

“;
}
}
else
{
echo “

There are no announcements to show at this time.

“;
}

[/insert_php]