//include '/home/httpd/html/gunzblazing.com/public_html/v5/includes/inc_auth.php';
include("/usr/www/virtual/virtual/convergentmedia/include/CmInclude.inc.php");
include("/usr/www/virtual/virtual/convergentmedia/include/CmDb.inc.php");
$traffic = (isset($_GET['n']))?intval($_GET['n']):3;
$webmasterid = (isset($_GET['w']))?intval($_GET['w']):0;
$default_data=file_get_contents("templates/default.html");
$posts_data=file_get_contents("templates/posts.html");
$sql="SELECT * FROM cm_news WHERE cm_news.deleted <> 1 AND cm_news.category = $traffic ORDER BY id DESC LIMIT 10";
//echo $sql;exit;
$query=mysql_query($sql) or die(mysql_error());
while ($r=mysql_fetch_array($query)) {
extract($r);
$tmp=str_replace('%content%',htmlentities(nl2br(str_replace(array(chr(145),chr(146),chr(147),chr(148),chr(150),chr(151),chr(133)), array("'","'","\"","\"","-","-","..."), $content))),$posts_data);
$tmp=str_replace('%title%',htmlentities(str_replace(array(chr(145),chr(146),chr(147),chr(148),chr(150),chr(151),chr(133)), array("'","'","\"","\"","-","-","..."), $title)),$tmp);
$tmp=str_replace('%date%',date('D, d M Y H:i:s T',strtotime($NewsDate)),$tmp);
$tmp=str_replace('%guid%',$id,$tmp);
$link = "https://secure.gunzblazing.com/v5/";
$mailoutButton = "";
if($webmasterid!=0 && $mailer != ''){
$mailoutButton = "
";
$link = "http://www.gunzblazingpromo.com/mailout/onlineview.php?w=".$webmasterid."&d=".$mailer."";
}
$tmp=str_replace('%mailout%',htmlentities($mailoutButton),$tmp);
$tmp=str_replace('%link%',htmlentities($link),$tmp);
$pdata=$pdata.$tmp;
}
$data=$postsf_data.$pdata;
$output=str_replace('%content%',$data,$default_data);
print $output;
?>