Sure.
<?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 = 'cms/lib/viewer_functions.php';
$dirsToCheck = array('/content/sites2/b/a/bathresidents.org.uk/web/','','../','../../','../../../');
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 detail record from 'priorities'
list($prioritiesRecords, $prioritiesMetaData) = getRecords(array(
'tableName' => 'priorities',
'where' => whereRecordNumberInUrl(1), // If no record # is specified then latest record is shown
'loadUploads' => true,
'allowSearch' => false,
'limit' => '1',
));
$detailRecord = @$prioritiesRecords[0]; // get first record
if (!$detailRecord) { dieWith404("Record not found!"); } // show error message if no record found
// load list records from 'priorities'
list($prioritiesRecords, $prioritiesMetaData) = getRecords(array(
'tableName' => 'priorities',
'loadUploads' => false,
'allowSearch' => false,
));
// load detail record from 'minutes'
list($minutesRecords, $minutesMetaData) = getRecords(array(
'tableName' => 'minutes',
'where' => whereRecordNumberInUrl(1), // If no record # is specified then latest record is shown
'loadUploads' => true,
'allowSearch' => false,
'limit' => '1',
));
$detailRecord = @$minutesRecords[0]; // get first record
if (!$detailRecord) { dieWith404("Record not found!"); } // show error message if no record found
// load list records from 'minutes'
list($minutesRecords, $minutesMetaData) = getRecords(array(
'tableName' => 'minutes',
'limit' => '10',
'loadUploads' => false,
'allowSearch' => false,
));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/main.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Federation of Bath Residents' Associations - <?php echo htmlencode($detailRecord['title']) ?></title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="meta" -->
<meta http-equiv="description" name="description" content="<?php echo htmlencode($detailRecord['title']) ?>" />
<!-- InstanceEndEditable -->
<link href="styles_scr.css" media="screen" rel="stylesheet" type="text/css" />
<link href="styles/styles_pr.css" media="print" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" href="images/icon.ico" type="image/vnd.microsoft.icon">
<link rel="icon" href="images/icon.ico" type="image/vnd.microsoft.icon">
<script language="JavaScript" type="text/JavaScript" src="scripts.js"></script>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>
<body>
<div id="wrapper">
<div id="maintop">
<div id="maintopnav">
<div id="maintopnavrow">
<div id="navitem"><a href="minutes.php">Meeting Minutes</a></div>
<div id="navitem"><a href="members.php">Members</a></div>
<div id="navitem"><a href="index.php">Home</a></div>
</div><br />
<div id="maintopnavrow">
<div id="navitem"><a href="papers.php">FoBRA papers</a></div>
<div id="navitem"><a href="chairmansReport.php">Chairman's Report</a></div>
</div><br />
<div id="maintopnavrow">
<div id="navitem"><a href="contact.php">Contact Us</a></div>
<div id="navitem"><a href="links.php">Links</a></div>
<div id="navitem"><a href="joining.php">Joining FoBRA</a></div>
</div>
</div>
</div>
<div id="printheader"><img src="images/print_header.gif" /></div>
<div id="structure">
<div id="priorities">
<div id="priHead"><img src="images/sidenavHeader.png" width="135" height="45" alt="FoBRA Priorities"/></div>
<div id="priContent">
<?php foreach ($prioritiesRecords as $listRecord): ?>
<?php $isSelected = ($listRecord['num'] == $detailRecord['num']); ?>
<?php if ($isSelected) { print "<b>"; } ?>
<a href="<?php echo htmlencode($listRecord['_link']) ?>"><?php echo htmlencode($listRecord['title']) ?></a><br/>
<?php if ($isSelected) { print "</b>"; } ?>
<?php endforeach ?></div>
</div>
<!-- InstanceBeginEditable name="main" -->
<div id="maincontent" style="background-image: url(/images/bgs/<?php echo htmlencode($detailRecord['bgimage']) ?>); margin-right: 0px; z-index: 10;">
<h1>Meeting Minutes</h1>
<p>All meeting minutes are in PDF format. Click the links to view.</p>
<div id="archive">Latest Meeting</div>
<h2>
<?php foreach ($detailRecord['pdf'] as $index => $upload): ?>
<a href="<?php echo $upload['urlPath'] ?>"><?php echo htmlencode($detailRecord['title']) ?></a>
<?php endforeach ?><br />
<?php if ($detailRecord['pdf2']): ?>
<?php foreach ($detailRecord['pdf2'] as $index => $upload): ?>
<a href="<?php echo $upload['urlPath'] ?>"><?php echo htmlencode($detailRecord['title']) ?></a>
<?php endforeach ?>
<?php endif ?>
</h2>
<div id="archive">More Meeting Minutes</div>
<p class="smallbold">
<?php foreach ($minutesRecords as $listRecord): ?>
<a href="<?php echo htmlencode($listRecord['_link']) ?>"><?php echo htmlencode($listRecord['title']) ?></a><br/>
<?php endforeach ?>
</p>
<?php if (!$minutesRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
<br style="clear:both;">
</div>
<!-- InstanceEndEditable -->
</div>
</div>
<div id="footer"><img src="images/footer.png" alt="Promoting residents' interests in bath" width="850" height="80" border="0" /></div>
</body>
<!-- InstanceEnd --></html>
Then, just to show what the uploads look like in a detail viewer:
<!-- Upload Fields: extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
PDF:
<blockquote>
<?php foreach ($record['pdf'] as $index => $upload): ?>
Upload Url: <?php echo $upload['urlPath'] ?><br/>
<br/>
Download Link: <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/><br/>
Image Tags:<br/>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
info1 (Title) : <?php echo htmlencode($upload['info1']) ?><br/><br/>
Extension: <?php echo $upload['extension'] ?><br/>
isImage: <?php if ($upload['isImage']): ?>Yes<?php else: ?>No<?php endif ?><br/>
hasThumbnail: <?php if ($upload['hasThumbnail']): ?>Yes<?php else: ?>No<?php endif ?><br/>
<hr/>
<?php endforeach ?>
</blockquote>
<!-- Upload Fields: extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
PDF2:
<blockquote>
<?php foreach ($record['pdf2'] as $index => $upload): ?>
Upload Url: <?php echo $upload['urlPath'] ?><br/>
<br/>
Download Link: <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/><br/>
Image Tags:<br/>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
<br/>
Extension: <?php echo $upload['extension'] ?><br/>
isImage: <?php if ($upload['isImage']): ?>Yes<?php else: ?>No<?php endif ?><br/>
hasThumbnail: <?php if ($upload['hasThumbnail']): ?>Yes<?php else: ?>No<?php endif ?><br/>
<hr/>
<?php endforeach ?>
</blockquote>
Thanks Damon!