<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php

  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('/var/www/html/osga.com/','','../','../../','../../../');
  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($articlesRecords, $articlesMetaData) = getRecords(array(
    'tableName'   => 'articles',
    'limit'       => '1',

  ));

?>








<table width="250">
<tr><td>
  <span style="font-family: arial">
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
    <?php foreach ($articlesRecords as $record): ?>
  
     <span style="font-size:14px"><b>  <?php echo $record['title'] ?></b></span><br/>
     <span style="font-size:12px"> <?php echo $record['summary'] ?><br/>
       <a href="<?php echo $record['_link'] ?>" target="_new"><b>Read More Here...</b></a><br/>
        <?php foreach ($record['images'] as $upload): ?>
          <?php if ($upload['hasThumbnail']): ?>
            <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

          <?php elseif ($upload['isImage']): ?>
            <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>


          <?php endif ?>
        <?php endforeach ?>
        
        <br/>
        <?php header('Content-type: text/html; charset=utf-8'); ?>
<?php

  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('/var/www/html/osga.com/','','../','../../','../../../');
  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($articlesRecords, $articlesMetaData) = getRecords(array(
    'tableName'   => 'articles',
    'limit'       => '3',

  ));

?>

        
        
        <?php foreach ( $articlesRecords as $record): ?>
  <?php $isFirst = ($record == reset($articlesRecords )); ?>

    <a href="<?php echo $record['_link'] ?>" target="_new"><?php echo htmlencode($record['title']) ?></b></a><br/><br />

  <?php if ($isFirst):?>  <?php endif ?>
  

<?php endforeach ?>
      <!-- STEP2a: /Display Uploads -->


    <?php endforeach ?>

    <?php if (!$articlesRecords): ?>
      No records were found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records -->
    

</td></tr></table>

