<?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/marlinaus/domains/marlinfishingaustralia.com.au/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
  list($google_analyticsRecords, $google_analyticsMetaData) = getRecords(array(
    'tableName'   => 'google_analytics',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $google_analyticsRecord = @$google_analyticsRecords[0]; // get first record

  // load records
  list($home_pageRecords, $home_pageMetaData) = getRecords(array(
    'tableName'   => 'home_page',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $home_pageRecord = @$home_pageRecords[0]; // get first record

  // load records
  list($captain_crewRecords, $captain_crewMetaData) = getRecords(array(
    'tableName'   => 'captain_crew',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $captain_crewRecord = @$captain_crewRecords[0]; // get first record

  // load records
  list($captain_metaRecords, $captain_metaMetaData) = getRecords(array(
    'tableName'   => 'captain_meta',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $captain_metaRecord = @$captain_metaRecords[0]; // get first record
  
  // load records
  list($galleryRecords, $galleryMetaData) = getRecords(array(
    'tableName'   => 'gallery',
    'orderBy'     => 'RAND()',
    'limit'       => '1',
  ));
  $galleryRecord = @$galleryRecords[0]; // get first record

  // load records
  list($footer_logosRecords, $footer_logosMetaData) = getRecords(array(
    'tableName'   => 'footer_logos',
    'limit'       => '5',
    'orderBy'     => 'RAND()',
  ));

  // load records
  list($newsRecords, $newsMetaData) = getRecords(array(
    'tableName'   => 'news',
    'limit'       => '5',
  ));

  // load records
  list($testimonialsRecords, $testimonialsMetaData) = getRecords(array(
    'tableName'   => 'testimonials',
    'limit'       => '1',
    'orderBy'     => 'RAND()',
    'loadUploads' => '0',
  ));
        
  // show error message if no matching record is found
  if (!$google_analyticsRecord) {
    header("HTTP/1.0 404 Not Found");
    print "Record not found!";
    exit;
  }

?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?php echo $captain_metaRecord['page_title'] ?></title>
<meta name="keywords" content="<?php echo $captain_metaRecord['keywords'] ?>">
<meta name="description" content="<?php echo $captain_metaRecord['description_tag'] ?>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="layout.css" rel="stylesheet" type="text/css" />
<script src="maxheight.js" type="text/javascript"></script>
<script src="rollover.js" type="text/javascript"></script>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.css">
<script type="text/javascript" src="shadowbox/shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init();
</script>
<!--[if IE]>

<link href="iestyle.css" rel="stylesheet" type="text/css" />

<![endif]-->
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '<?php echo $google_analyticsRecord['google'] ?>']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</head>

<body id="page2">
<div class="right_bgd"></div>
<div class="main">
    <div id="header">
       <div class="social">
         <div align="center"><a href="http://www.facebook.com/pages/Calypso-Fishing-Adventures/168964359784622" target="_blank"><img src="images/icon-1.gif" alt="" width="20" height="20" border="0" /></a>&nbsp;&nbsp;<a href="index.html" target="#"><img src="images/icon-3.gif" alt="" width="20" height="20" border="0" /></a>&nbsp;&nbsp;<a href="#"><img src="images/youtube.jpg" alt="" width="19" height="20" border="0" /></a></div>
       </div>   <a href="index.php"><img src="images/logo.png" alt="" width="311" height="118" class="logo" /></a><br /> <div class="nav">        <nav>
         <ul id="MenuBar1" class="MenuBarHorizontal">
           <li><a href="index.php" title="Home">Home</a></li>
           <li><a href="#" class="MenuBarItemSubmenu">Locations</a>
             <ul>
               <li><a href="cairns.php" title="Cairns">Cairns</a></li>
               <li><a href="port-stephens.php" title="Port Stephens">Port Stephens</a></li>
             </ul>
           </li>
           <li><a class="MenuBarItemSubmenu" href="#">About Us</a>
             <ul>
               <li><a href="captain.php" title="Captain &amp; Crew">Captain &amp; Crew</a></li>
               <li><a href="news.php" title="News">News</a></li>
</ul>
           </li>
           <li><a href="#" class="MenuBarItemSubmenu">Fishing</a>
             <ul>
               <li><a href="marlin.php" title="Marlin Fishing">Marlin Fishing</a></li>
               <li><a href="big-game.php" title="Big Game Fly Fishing">Big Game Fly Fishing</a></li>
               <li><a href="spear.php" title="Spearfishing">Spearfishing</a></li>
             </ul>
           </li>
           <li><a href="#" class="MenuBarItemSubmenu">The Boat</a>
             <ul>
               <li><a href="calypso.php" title="The Calypso">The Calypso</a></li>
               <li><a href="mothership.php" title="Mothershipping">Mothershipping</a></li>
             </ul>
           </li>
           <li><a href="gallery.php" title="Gallery" class="MenuBarItemSubmenu">Gallery</a>
             <ul>
               <li><a href="photo-gallery.php" title="Photo Gallery">Photo Gallery</a></li>
               <li><a href="video-gallery.php" title="Video Gallery">Video Gallery</a></li>
             </ul>
           </li>
           <li><a href="#" class="MenuBarItemSubmenu">Contact</a>
             <ul>
               <li><a href="contact.php" title="Comments &amp; Questions">Comments &amp; Questions</a></li>
               <li><a href="bookings.php" title="Bookings">Bookings</a></li>
               <li><a href="links.php" title="Related Links">Related Links</a></li>
             </ul>
           </li>
         </ul>
       </nav>
</div>
<br />  
<div class="indent">
  <ul class="ul1">
        <?php echo $home_pageRecord['slogan'] ?></ul>
      </div>
<div class="indentref"><?php foreach ($testimonialsRecords as $record): ?>
        <?php echo $record['content'] ?><br>

      <span class="indentrefname"><?php echo $record['name'] ?>, <?php echo $record['country'] ?> (<?php echo date("M Y", strtotime($record['date'])) ?>)    <?php endforeach ?>

    <?php if (!$testimonialsRecords): ?>
      No records were found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records --></span></div>          
  </div>
    <div id="content">		
        <div class="indent-main">
            <div class="bg-cont">
                <div class="indent-row">
                    <div class="container">
                        <div class="col-1 maxheight">
                        	<div class="indent-col">
                            <div class="tail"><?php foreach ($newsRecords as $record): ?>
                              <h2><?php echo $record['title'] ?> - <?php echo date("D, M jS, Y g:i:s a", strtotime($record['date'])) ?></h2><br />
                                
                                    <p class="p3"><?php echo $record['content'] ?></p>
                                  <p class="p3">      <!-- STEP 2a: Display Uploads for field 'images' (Paste this anywhere inside STEP2 to display uploads) -->
        <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
        <?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="" />
            <?php elseif ($upload['isImage']): ?>
            <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

          <?php else: ?>
            <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

          <?php endif ?>
        <?php endforeach ?>
      <!-- STEP2a: /Display Uploads -->


      <?php endforeach ?>

    <?php if (!$newsRecords): ?>
      No records were found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records --></p>
                                </div>
                            <br />
                        	</div>
                        </div>
                        <div class="col-2 maxheight">
                        	<div class="bg maxheight">
                            	<div class="bg1 maxheight">
                                	<div class="indent-col">
                                        <h2>Old News Items</h2>
                                        <p><br />
                                        </p>
                                        <p>&nbsp;</p>
                                        <p><a href="#" class="link">Read more</a></p>
                                        <p><a href="bookings.php"><img src="images/1page_img1.png" width="397" height="117"></a></p>
                                        <div class="tail1">
<p align="center"><a href="http://www.facebook.com/pages/Calypso-Fishing-Adventures/168964359784622" target="_blank"><img src="temp images/follow-us-on-facebook.png" alt="" width="101" height="60" /></a>&nbsp;&nbsp;<a href="http://twitter.com/#!/calypso_fishing" target="_blank"><img src="temp images/follow-us-on-twitter-bird.jpg" alt="" width="60" height="60" /></a>&nbsp;&nbsp;<a href="http://www.youtube.com/user/calypsotim" target="_blank"><img src="temp images/youtube256x256.png" alt="" width="60" height="60" /></a></p>
<div align="center"><script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 6000,
  width: 400,
  height: 200,
  theme: {
    shell: {
      background: '#E7E9F8',
      color: '#000000',
    },
    tweets: {
      background: '#E7E9F8',
      color: '#000000',
      links: '#006'
    }
  },
  features: {
    scrollbar: true,
    loop: false,
    live: false,
    hashtags: true,
    timestamp: true,
    avatars: false,
    behavior: 'all'
  }
}).render().setUser('Calypso_fishing').start();
</script></div>
                            </div><br />
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="box">
                	<div class="container bg-1">
                        <div class="indent-box">
                            <div class="container"><?php foreach ($footer_logosRecords as $record): ?><!-- STEP 2a: Display Uploads for field 'image' (Paste this anywhere inside STEP2 to display uploads) -->
        <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
        <?php foreach ($record['image'] as $upload): ?>
          <?php if ($upload['hasThumbnail']): ?>
            <a href="<?php echo $record['url'] ?>" target="_blank"><img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" border="0" /></a>
            <?php elseif ($upload['isImage']): ?>
            <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

          <?php else: ?>
            <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

          <?php endif ?>
        <?php endforeach ?>
      <!-- STEP2a: /Display Uploads -->
    <?php endforeach ?>

    <?php if (!$footer_logosRecords): ?>
      No records were found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records --></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>	 
    <div id="footer">
        <?php include("includes/footer.inc.php"); ?>
    </div>
 </div>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>



