This returned only today's events in my test and returned the correct values for the variables
<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/hsphere/local/home/apbcweb/artistsofpalmbeachcounty.org/','','../','../../','../../../');
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($nmsinc_testRecords, $nmsinc_testMetaData) = getRecords(array(
'tableName' => 'nmsinc_test',
'where' => "YEAR(date) = YEAR(NOW()) AND DAYOFYEAR(date) = DAYOFYEAR(NOW())", // limit to today's events
));
?>
<h1>nmsinc test - List Page Viewer</h1>
<?php foreach ($nmsinc_testRecords as $record): ?>
<?PHP
$eventdate = strtotime($record['date']);
$dateplus0 = strtotime(date('Y-m-d', strtotime("+ 0 day")));
$dateplus1 = strtotime(date('Y-m-d', strtotime("+ 1 day")));
$dateplus2 = strtotime(date('Y-m-d', strtotime("+ 2 day")));
?>
Record Number: <?php echo $record['num'] ?><br/>
Date: <?php echo date("D, M jS, Y g:i:s a", strtotime($record['date'])) ?><br/>
<!-- For date formatting codes see: http://www.php.net/date -->
title: <?php echo $record['title'] ?><br/>
event date: <?php echo $eventdate ?><br/>
event date +0: <?php echo $dateplus0 ?><br/>
event date +1: <?php echo $dateplus1 ?><br/>
_link : <a href="<?php echo $record['_link'] ?>"><?php echo $record['_link'] ?></a><br/>
<hr/>
<?php endforeach ?>
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php