<?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 = ['','../','../../','../../../','../../../../']; // add if needed: '/home/tcfs/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 'classifieds'
  list($classifiedsRecords, $classifiedsMetaData) = getRecords(array(
    'tableName'   => 'classifieds',
	'orderBy'     => 'RAND()',
    'loadUploads' => false,
    'allowSearch' => false,
  ));

?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title></title>
  <style>
    body          { font-family: arial; }
    .instructions { border: 3px solid #000; background-color: #EEE; padding: 10px; text-align: left; margin: 25px}
  </style>
</head>
<body>

  <!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
    
    <?php foreach ($classifiedsRecords as $record): ?>
	<?php echo $record['ad_text']; ?>
	<?php endforeach ?>

    <?php if (!$classifiedsRecords): ?><?php endif ?>
  <!-- /STEP2: Display Records -->

</body>
</html>
