<?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";
      $options = array();                // NOTE: see online documentation for more details on these options
      $options['tableName'] = 'blog'; // (REQUIRED) MySQL tablename to list record from. Example: "article";
      $options['recordNum'] = '';        // (optional) Record number to display.  Example: "1"; Defaults to number on end of url, then 1
      $options['where']     = '';        // (ADVANCED) MySQL WHERE conditions to use INSTEAD of recordNum to look up record. Example: "fieldname = 'value'"
      $record = getRecord($options);
    ?>
<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="/xx/BLOG/basic.css" />
</head>
<body>
<div id="first_container">
<div id="second_container">
<div id="third_container">

    <?php
      require_once "/xxx/viewer_functions.php";
      $options = array();                  // NOTE: see online documentation for more details on these options
      $options['tableName']  = 'blog';  // (REQUIRED) MySQL tablename to list record from. Example: 'article';
      $options['titleField'] = 'title';    // (optional) MySQL fieldname used in viewer url for search engines. Example: 'title' would display: viewer.php/article_title_here-123
      $options['viewerUrl']  = '/xxx/blogPage.php'; // (optional) URL of viewer page. Example: '/articles/view.php';
      $options['perPage']    = '9999';         // (optional) The number of records to display per page. Example: '5'; Defaults to 10.
      $options['orderBy']    = 'order DESC, date DESC, title';         // (optional) Fieldnames to sort by. Example: 'field1, field2 DESC, field3';
      $options['pageNum']    = '1';         // (optional) Page number of results to display. Example: '1'; Defaults to number on end of url, then 1
      $options['where']      = '';         // (ADVANCED) Additional MySQL WHERE conditions. Example: 'fieldname = "value"'
      $options['useSeoUrls'] = '1';         // (ADVANCED) Set this to '1' for search engine friendly urls: view.php/123 instead of view.php?123 (not supported on all web servers, and viewerUrl must be absolute path such as '/path/viewer.php')
      list($listRows, $listDetails) = getListRows($options);
    ?>

              <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 class="title"></div>
<div class="border">
<div class="content">
<h1>Vanero</h1>
<div class="text">
   
    <?php
      require_once "/xxx/viewer_functions.php";
      $options = array();                // NOTE: see online documentation for more details on these options
      $options['tableName'] = 'blog'; // (REQUIRED) MySQL tablename to list record from. Example: "article";
      $options['recordNum'] = '';        // (optional) Record number to display.  Example: "1"; Defaults to number on end of url, then 1
      $options['where']     = '';        // (ADVANCED) MySQL WHERE conditions to use INSTEAD of recordNum to look up record. Example: "fieldname = 'value'"
      $record = getRecord($options);
    ?>

    <?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($options['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($options['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>
</div>
</div>
</div>
</body>
</html>