Hi, I have a 3 column page for real estate, the left hand side column features latest properties by date, the right hand column features latest price movers (so far so good), however, I cannot get the (single) featured property in the centre column to load. In fact, when I added the centre column code (and attendant header code) the whole page failed to load, but when I strip out that code, it loads.
This is going to be a new index (php) page to replace the current (html) index page, with all the rest of the site going in a new folder (property_sales/). I'm about 95% there, just stalled on this featured property issue. I think a new pair of eyes is required, its probably something i'm just missing, like a '?'...thanks in advance.
(I've cut out most of the non essential code for the page (styles, text etc etc), its the 3 columns' content code thats the main issue.)
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/sites/mywebsite.com/public_html/property_sales/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
// load records
list($propertyRecords, $propertyMetaData) = getRecords(array(
'tableName' => 'property',
'perPage' => '3',
'orderBy' => 'date DESC, price',
'allowSearch' => '1',
));
// load latest movers records
list($moverspropertyRecords, $moverspropertyMetaData) = getRecords(array(
'tableName' => 'property',
'perPage' => '3',
'orderBy' => 'updatedDate DESC, new_price',
'allowSearch' => '0',
));
//load featured record
list($featuredpropertyRecords, $propertyMetaData) = getRecords(array(
'tableName' => 'property',
'where' => 'featured = 1',
'orderBy' => 'date'
'perPage' => '1',
));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
</head>
<body>
<div id="wrap">
<!--left side content-->
<div id="leftside">
<h2>LATEST PROPERTIES:</h2>
<?php foreach ($propertyRecords as $record): ?>
<?php if (!$record['featured']): ?>
<div align="center">
<?php foreach ($record['property_images'] as $upload): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="140px" height="80px alt="" />
<?php break ?>
<?php endforeach ?></div>
<h2>£<?php echo number_format($record['price']); ?></h2>
<h2> <?php echo $record['address'] ?><br/>
Listed: <?php echo date("D, M jS, Y ", strtotime($record['date'])) ?><br/>
Read Full Details:</h2> <a href="<?php echo $record['_link'] ?>"><?php echo $record['address'] ?> -> -></a><br/>
<hr style="color:#840000; background-color:#840000;height:1px;border:none;" />
<?php endforeach ?>
<?php if ($propertyMetaData['invalidPageNum']): ?>
Results page '<?php echo $propertyMetaData['page']?>' not found, <a href="<?php echo $propertyMetaData['firstPageLink'] ?>">start over >></a>.<br/><br/>
<?php elseif (!$propertyRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
<!-- /STEP2: Display Records -->
</div>
</div>
<!--right side content-->
<div id="extras">
<h2>LATEST PRICE MOVERS</h2>
<?php foreach ($moverspropertyRecords as $record): ?>
<?php if (!$record['featured']): ?>
<h2>£<?php echo number_format($record['price']); ?></h2>
<?php if($record['new_price']) : ?>
<h4> New Price! £<?php echo number_format($record['new_price']) ?></h4>
<?php endif; ?>
<?php echo $record['address'] ?>
<p> </p>
<!--display a single thumbnail image -->
<div align="center">
<?php foreach ($record['property_images'] as $upload): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="140px" height="80px alt="" />
<?php break ?>
<?php endforeach ?>
</div>
<!--end thumbnail area-->
<h5><a href="<?php echo $record['_link'] ?>">View Details -> -></a></h5>
<?php endforeach ?>
</div>
<!--main content area-->
<div id="content">
<h2>FEATURED PROPERTY</h2>
<?php foreach ($propertyRecords as $record): ?>
<?php if ($record['featured']:>
<h2>£<?php echo number_format($record['price']); ?></h2>
<?php if($record['new_price']) : ?>
<h2> New Price!:£<?php echo number_format($record['new_price']) ?></h2>
<?php endif; ?>
<h3> <?php echo $record['address'] ?></h3> (<?php echo $record['type'] ?>)<br/>
Featured: <?php echo $record['featured'] ?><br/>
Listed: <?php echo date("D, M jS, Y g:i:s a", strtotime($record['date'])) ?> // Updated: <?php echo date("D, M jS, Y g:i:s a", strtotime($record['updatedDate'])) ?><br/><br/>
<?php echo $record['teaser'] ?><br/>
Council Tax Band: <?php echo $record['council_tax_band'] ?> // Bedrooms: <?php echo $record['bedrooms'] ?> //
Read Full Details: <a href="<?php echo $record['_link'] ?>"><?php echo $record['address'] ?> -> -></a><br/>
<?php endforeach ?>
<?php if ($propertyMetaData['invalidPageNum']): ?>
Results page '<?php echo $propertyMetaData['page']?>' not found, <a href="<?php echo $propertyMetaData['firstPageLink'] ?>">start over >></a>.<br/><br/>
<?php elseif (!$propertyRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
<h3>You Are Viewing Property List Page: <?php echo $propertyMetaData['page'] ?>
<!-- STEP3: Display Page Links (Paste anywhere below "Load Record List") -->
<?php if ($propertyMetaData['prevPage']): ?>
<a href="<?php echo $propertyMetaData['prevPageLink'] ?>"><< prev</a>
<?php else: ?>
<< Prev
<?php endif ?>
- page <?php echo $propertyMetaData['page'] ?> of <?php echo $propertyMetaData['totalPages'] ?> -
<?php if ($propertyMetaData['nextPage']): ?>
<a href="<?php echo $propertyMetaData['nextPageLink'] ?>">next >></a>
<?php else: ?>
Next >>
<?php endif ?>
<!-- /STEP3: Display Page Links -->
</div>
</div>
</body>
</html>