Future dates only...

3 posts by 2 authors in: Forums > CMS Builder
Last Post: September 16, 2013   (RSS)

By HDLLC - September 16, 2013

Hi there -

I first did some searching to find a solution, but so far, nothing seems to work/apply.

http://www.interactivetools.com/forum/forum-posts.php?postNum=2218781

Discusses something similar.  I'm using a calendar type display, along with a text display version as well.

I only want that text version to display events that are in the future.  Sort of make it a little more self-managing so we don't have old stuff on there every day, and can edit as we have time.

This is my code:

// load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('/home/warsaw/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."); }

//Get the current date in SQL date format
  $date = date('Y-m-d 00-00-00');

  // load records from 'events'
  list($eventsRecords, $eventsMetaData) = getRecords(array(
    'tableName'   => 'events',
    'perPage'     => '10',
    'loadUploads' => true,
    'allowSearch' => false,
    'orderBy'     => 'start_date ASC',
//  'where'       => "date >= '$date'",
  ));

That where clause is commented out because it's throwing an error.

If anyone has ideas, please let me know!

Thanks much!

--Jeff

By HDLLC - September 16, 2013

That was it - oversight on my part I think...

=^)

I'll chalk that up to Monday...  Thanks!

--Jeff