session_start();
$pageID='news';
$ID=$_GET['ID'];
if (!isset($ID)) { header('Location:news.php'); exit;}
if(empty($_SESSION['eliqToken'])){
$_SESSION['eliqToken'] = bin2hex(random_bytes(16));
}
include 'obfsemail.php';
include 'xss.php';
include 'vars.php';
## increase no of views
if ($stmt = $mysqli->prepare("UPDATE blog SET blogViewed=blogViewed+1 WHERE ID=?"))
{
$stmt->bind_param('i',$ID);
$stmt->execute();
$result = $stmt->get_result();
}
## get the current post
if ($stmt = $mysqli->prepare("SELECT * FROM blog WHERE ID=?"))
{
$stmt->bind_param('i',$ID);
$stmt->execute();
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()){
if (strpos($row['tag'],'Blog')===false) {
$blog[] = $row;
}
}
}
## Get the blog Categories
if ($stmt = $mysqli->prepare("SELECT tag FROM blogTags ORDER BY tag ASC"))
{
$stmt->execute();
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()){
if (strpos($row['tag'],'Blog')===false) {
$blogTags[] = $row;
}
}
}
## Get the 5 most popular (most viewed) Posts not including this post
if ($stmt = $mysqli->prepare("SELECT ID,blogTitle,blogPublishDate,blogImage,MAX(blogViewed),blogViewed FROM blog WHERE blogVisible='Y' AND blogCategory=? GROUP BY blogViewed DESC LIMIT 5"))
{
$stmt->bind_param('s',$blog[0]['blogCategory']);
$stmt->execute();
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()){
###create one array of reward names and values
$blogRealted[] = $row;
}
}
if(!empty($blog[0]['blogTags'])){
$tagArray = explode(',',$blog[0]['blogTags']);
}
/*
echo "
";
print_r($blogPopular);
echo "
";
*/
include 'searchBlog.php';
?>
include 'meta.php'; ?>
Kintrye Property Company - echo $blog[0]['blogCategory'].", ".$blog[0]['blogTitle']; ?>
include 'favicon.php'; ?>
include 'metaTwitter.php'; ?>
include 'metaFB.php'; ?>
include 'fbCanvas.php'; ?>
include 'headerPage.php'; ?>
include 'searchForm.php'; ?>