Hey Daniel -
Thanks for the help - well I don't know how to explain this but here are the debug results and i posted the whole page code below. Also I took a screenshot of the x_news table in the database and you can see there are records with blog_category = 1
Please let me know if you need anything else.
thanks!
craig
SELECT SQL_CALC_FOUND_ROWS `x_news`.*
FROM `cms_x_news` as `x_news`
WHERE ('blog_category' = 1)
ORDER BY `post_date` DESC
# records 0
++++++++++++++++++++++++++++++++++
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
// $blog_where = "";
// $blog_where = "1";
$blog_rec = "";
$libraryPath = 'cmsb/lib/viewer_functions.php';
$dirsToCheck = array('/home/xanitoshqadmin/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
list($x_sec_introRecords, $x_sec_introMetaData) = getRecords(array(
'tableName' => 'x_sec_intro',
'where' => "`sn` = 'bed'",
'loadUploads' => true,
'allowSearch' => false,
'limit' => '1',
));
$x_sec_introRecord = @$x_sec_introRecords[0]; // get first record
if (!$x_sec_introRecord) { dieWith404("Record not found!"); } // show error message if no record found
list($x_newsRecords, $x_newsMetaData) = getRecords(array(
'tableName' => 'x_news',
'loadUploads' => true,
'allowSearch' => false,
'where' => "'blog_category' = 1",
'orderBy' => "`post_date` DESC",
'debugSql' => true,
));
?><!DOCTYPE html>
<!--[if IE 8]> <html class="ie ie8"> <![endif]-->
<!--[if IE 9]> <html class="ie ie9"> <![endif]-->
<!--[if gt IE 9]><!--> <html> <!--<![endif]-->
<head>
<title><?php echo htmlencode($x_sec_introRecord['title']) ?><?php include("core-title-tag.php"); ?></title>
<meta name="description" content="<?php include("core-description-tag.php"); ?>">
<meta name="keywords" content="<?php echo htmlencode($x_sec_introRecord['keywords']) ?>">
<?php include("core-head.php"); ?>
<style>
.nav-tabs > li > a {
font-family: 'Raleway','Open Sans',Arial,Helvetica,sans-serif;
font-weight: 600;
}
.blog-post-item {
background-color: rgba(0,0,0,0.05);
padding: 10px;
}
</style>
<?php include("core-analytics.php"); ?>
<?php
$blog_rec = $x_newsMetaData['totalRecords'];
echo ' # records '. $blog_rec;?>
</head>
<body class="smoothscroll enable-animation">
<!-- wrapper -->
<div id="wrapper">
<!-- Top Bar -->
<?php include("core-top-navigation.php"); ?>
<!-- /Top Bar -->
<div id="header" class="sticky clearfix">
<!-- TOP NAV -->
<?php include("core-main-navigation.php"); ?>
<!-- /Top Nav -->
</div>
<section class="page-header page-header-xs shadow-after-3">
<div class="container">
<h1><?php echo htmlencode($x_sec_introRecord['title']) ?> | <span class="size-16"><?php echo htmlencode($x_sec_introRecord['slogan']) ?></span></h1>
<!-- breadcrumbs -->
<ol class="breadcrumb">
<li><a href="index.php">Home</a></li>
</ol><!-- /breadcrumbs -->
</div>
</section>
<!-- /PAGE HEADER -->
<!-- MAIN INFORMATION -->
<section>
<div class="container">
<?php // echo $GLOBALS["blog_cat"] ;?>
<div id="blog" class="clearfix blog-isotope blog-isotope-3">
<?php foreach ($x_newsRecords as $record): ?>
<!-- POST ITEM -->
<div class="blog-post-item">
<!-- IMAGE -->
<?php foreach ($record['photo'] as $index => $upload): ?>
<figure class="margin-bottom-20">
<img class="img-responsive" src="assets/images/cmsb/<?php echo htmlencode($upload['filename']) ?>" alt="<?php echo htmlencode($upload['info1']) ?> | www.xanitos.com">
</figure>
<?php endforeach ?>
<h2><a href="<?php echo $record['_link'] ?>"><?php echo htmlencode($record['title']) ?></a></h2>
<ul class="blog-post-info list-inline margin-bottom-0 padding-bottom-10">
<li>
<i class="fa fa-clock-o"></i>
<span class="font-lato"><?php echo date("F j, Y", strtotime($record['post_date'])) ?></span>
</li>
</ul>
<p><?php echo $record['summary']; ?></p>
<?php if(!empty($record['content'])): ?>
<a href="<?php echo $record['_link'] ?>" class="btn btn-reveal btn-default">
<i class="fa fa-plus"></i>
<span><?php echo htmlencode($record['link_text']) ?></span>
</a>
<?php endif ?>
</div>
<!-- /POST ITEM -->
<br/>
<?php endforeach ?>
</div>
</div>
</section>
<!-- / -->
<div class="container">
<?php // echo $GLOBALS["blog_cat"] ;?>
<div id="blog" class="clearfix blog-isotope blog-isotope-3">
<?php foreach ($x_newsRecords as $record): ?>
Record Number: <?php echo htmlencode($record['num']) ?><br/>
Title: <?php echo htmlencode($record['title']) ?><br/>
Blog Category (value): <?php echo $record['blog_category'] ?><br/>
Blog Category (label): <?php echo $record['blog_category:label'] ?><br/>
author: <?php echo htmlencode($record['author']) ?><br/>
<?php foreach ($record['photo'] as $index => $upload): ?>
Upload Url: <?php echo htmlencode($upload['urlPath']) ?><br/>
<hr/>
<?php endforeach ?>
<!-- STEP2a: /Display Uploads -->
<hr/>
<?php endforeach ?>
</div>
</section>
<!-- FOOTER -->
<?php include("core-footer.php"); ?>
<!-- /FOOTER -->
</div>
<!-- /wrapper -->
<!-- SCROLL TO TOP -->
<a href="#" id="toTop"></a>
<!-- PRELOADER -->
<div id="preloader">
<div class="inner">
<span class="loader"></span>
</div>
</div><!-- /PRELOADER -->
<!-- core bootstrap script -->
<?php include("core-bootstrap-script.php"); ?>
<!-- /core bootstrap script -->
<!-- PAGELEVEL SCRIPTS -->
<!-- /PAGELEVEL SCRIPTS -->
</body>