Hi all ...
I have two sections in CMS builder both containing uploaded image files (home images & ipad home images).
I am trying to load a random one from each section into the same page ... is this possible?
Here's the step 1 load records code I've been trying to get working:
<?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('/home/sites/XXXXXXXXXXXX/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."); }
// load records from 'home_images'
list($home_imagesRecords, $home_imagesMetaData) = getRecords(array(
'tableName' => 'home_images',
'limit' => '1',
'orderBy' => 'RAND()',
'loadUploads' => true,
'allowSearch' => false,
));
// load records from 'ipad_home_images'
list($ipad_home_imagesRecords, $ipad_home_imagesMetaData) = getRecords(array(
'tableName' => 'ipad_home_images',
'limit' => '1',
'orderBy' => 'RAND()',
'loadUploads' => true,
'allowSearch' => false,
));
?>