can't believe couldn't find answer to this list viewer question

3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 4, 2011   (RSS)

By Codee - December 4, 2011 - edited: December 4, 2011

I scoured the forums for over an hour, then the CMS Cookbook...so I was stunned I didn't see the answer. I want to have a list viewer only load records meeting 2 certain conditions: if a text field is non-blank (that part was easy) AND if an upload field is non-blank. I started with this but it's not correct for the upload field because that's a complex field:
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php


// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('//','','../','../../','../../../');
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($modelsRecords, $modelsMetaData) = getRecords(array(
'tableName' => 'models',
'perPage' => '11',
'where' => " (model_testimonial != '') && (image != '')",
));

?>

Someone PLEASE tell me how to correct this so that records load which have the testimonial field non-blank AND have at an image uploaded.
Thanks!

Re: [Jason] can't believe couldn't find answer to this list viewer question

By Codee - December 4, 2011

perfectamente bien Jason! Thank you!