<?php echo "<?xml version='1.0'?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

    <?php
	require_once "/xxx/viewer_functions.php";  
	// load menu items 
	$listOptions = array();  
	$listOptions['tableName']  = 'blog'; 
	$listOptions['titleField'] = 'title'; 
	$listOptions['viewerUrl']  = '/xxx/blogPage.php'; 
	$listOptions['perPage']    = '9999'; 
	$listOptions['orderBy']    = 'order ASC, date DESC, title'; 
	$listOptions['pageNum']    = '1'; 
	$listOptions['where']      = ''; 
	$listOptions['useSeoUrls'] = '1'; 
	list($listRows, $listDetails) = getListRows($listOptions); 

	// get record num for page content 
	$numFromUrl = getNumberFromEndOfUrl(); 
	if (!$numFromUrl) {   
	  $lastIndex  = count($listRows) - 1;   
	  $numFromUrl = $listRows[$lastIndex]['num']; // use default 
	} 

	// load page content $options = array(); 
	$pageOptions = array(); 
	$pageOptions['tableName'] = 'blog'; 
	$pageOptions['recordNum'] = $numFromUrl;
	$pageOptions['where']     = ''; 
	$record = getRecord($pageOptions);	  
    ?>


<title>Demo :: <?php echo $record['title'] ?></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/xxx/basic.css" />
</head>
<body>
<div id="first_container">
<div id="second_container">
<div id="third_container">






<div class="title"></div>
<div class="border">
<div class="content">
<h1>Vanero</h1>
<div class="text">
   

    <?php if ($record): ?>
      Record Number: <?php echo $record['num'] ?><br/>
      Title: <?php echo $record['title'] ?><br/>
      Date: <?php echo date("D, M jS, Y G:H:s a", strtotime($record['date'])) ?><br/>

      Content: <?php echo $record['content'] ?><br/>
      External Link: <?php echo $record['external_link'] ?><br/>
    <?php endif ?>

    <?php if (empty($record)): ?>
      No record found!<br/><br/>
    <?php endif ?>


    <?php foreach (getUploads($pageOptions['tableName'], 'story_image', $record['num']) as $upload): ?>
      <?php if ($upload['hasThumbnail']): ?>
        <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" />

      <?php elseif ($upload['isImage']): ?>
        <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" />

      <?php else: ?>
        <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a>

      <?php endif ?>
    <?php endforeach ?>


    <?php foreach (getUploads($pageOptions['tableName'], 'image_gallery', $record['num']) as $upload): ?>
      <?php if ($upload['hasThumbnail']): ?>
        <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" />

      <?php elseif ($upload['isImage']): ?>
        <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" />

      <?php else: ?>
        <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a>

      <?php endif ?>
    <?php endforeach ?>

</div>
</div>
</div>
<ul id="submenu">
<li><span id="submenuselected">English</span></li>
<li><a href="#">Dutch</a></li>
</ul>
<div class="designinfo"> valid XHTML | valid CSS | Design by Vanero</div>


        <ul id="menu">
		<?php $numFromUrl = getNumberFromEndOfUrl(); foreach ($listRows as $record): if ($record): ?>
		<?php if ($record['num'] == $numFromUrl): ?>
			<li><span id="menuselected"><?php echo $record['title'] ?></span></li>
		<?php elseif ($numFromUrl == ""): ?> 
			<li><span id="menuselected"><a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a></span></li>
		<?php else: ?>
			<li><a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a></li>
		<?php endif ?>
		<?php endif ?>
		<?php endforeach ?>
        </ul>


</div>
</div>
</div>
</body>
</html>