
equinox69
User
Dec 4, 2011, 1:59 AM
Post #1 of 3
(990 views)
Shortcut
|
|
can't believe couldn't find answer to this list viewer question
|
Can't Post
|
|
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 /* 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('//','','../','../../','../../../'); 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!
(This post was edited by equinox69 on Dec 4, 2011, 12:43 PM)
|