Hi Adrian,
On your new page that will combine and list from both sections, place the function in the top of your page. Then place each of your standard listing getRecords calls as you normally would.
<?php
function cmp($a, $b){
$ad = strtotime($a['date']);
$bd = strtotime($b['date']);
return ($bd-$ad);
}
// load your records from the "whats on" and "live events" tables
// load records from 'yourtable_listings'
list($yourtable_listingsRecords, $yourtable_listingsMetaData) = getRecords(array(
'tableName' => 'yourtable_listings',
'loadUploads' => true,
'allowSearch' => false,
));
// load records from 'yourtable2_listings'
list($yourtable2_listingsRecords, $yourtable2_listingsMetaData) = getRecords(array(
'tableName' => 'yourtable2_listings',
'loadUploads' => true,
'allowSearch' => false,
));
// merge the arrays returned from each getRecords call
$recordsMerged = array_merge($yourtable_listingsRecords, $yourtable2_listingsRecords); // merge arrays
usort($recordsMerged, 'cmp'); // sort articles by date
?>
Then in the body, place your foreach loop to display:
<?php foreach ($recordsMerged as $index => $record): ?>
Record Info Here
<?php endif ?>
Hope this helps.
Cheers,
Steve