Incorrect records displaying on detail page
3 posts by 2 authors in: Forums > CMS Builder
Last Post: November 15, 2016 (RSS)
I know it must be something simple but I can't figure it out! I've created a list of events and the link to the detail page shows the correct URL, however when you click on it they all show the first record in the database regardless of what you click on.
The live page is here:
http://www.thenelunefoundation.org/events.php
List page (events.php)
<?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('/home/thth3571/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 from 'event'
list($eventRecords, $eventMetaData) = getRecords(array(
'tableName' => 'event',
'loadUploads' => true,
'allowSearch' => false,
));
// load records from 'annual_events'
list($annual_eventsRecords, $annual_eventsMetaData) = getRecords(array(
'tableName' => 'annual_events',
'loadUploads' => true,
'allowSearch' => false,
));
?>
<!doctype html>
<html lang="en">
<head> <meta charset="utf-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>The NELUNE Foundation - Helping patients fight cancer with dignity</title>
<meta name="description" content="Providing psychological and practical support, assistance and care for public hospital and underprivileged cancer patients in the community - 'Helping patients fight cancer with dignity'.
">
<meta name="keywords" content=“The NELUNE Foundation, Cancer Charity“>
<link rel="stylesheet" type="text/css" href="assets/css/custom-animations.css" />
<link rel="stylesheet" type="text/css" href="assets/css/lib/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
<script src="assets/js/readmore.min.js"></script>
</head>
<body id="blog-page" class="products-page">
<!-- Preloader -->
<div class="preloader-mask">
<div class="preloader"><div class="spin base_clr_brd"><div class="clip left"><div class="circle"></div></div><div class="gap"><div class="circle"></div></div><div class="clip right"><div class="circle"></div></div></div></div>
</div>
<!-- Header -->
<header>
<nav class="navigation navigation-header relative-header background-header">
<div class="container">
<div class="navigation-brand">
<div class="brand-logo">
<a href="index.php#hero" class="logo"></a><a href="index.php#hero" class="logo logo-alt"></a>
</div>
</div>
<button class="navigation-toggle">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button> <div class="navigation-navbar collapsed">
<ul class="navigation-bar navigation-bar-left"> <li><a href="index.php#about">About</a></li>
<li><a href="index.php#projects">Projects</a></li>
<li><a href="index.php#sponsors">Sponsors</a></li>
<li><a href="news.php">News</a></li>
<li><a href="events.php">Events</a></li>
<li><a href="gallery.php">Gallery</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
<ul class="navigation-bar navigation-bar-right">
<li><a href="howtohelp.php">How to help</a></li>
<li class="featured"><a class="btn btn-sm btn-outline" href="donate.php">Donate</a></li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<h3 class="highlight">UPCOMING EVENTS</h2>
<p class="post-text">
Book early and avoid disappointment!<br>
</p>
<div class="product-list row material-view">
<div class="clearfix">
<?php foreach ($eventRecords as $record): ?>
<div class="product col-md-6">
<div class="product-inner">
<div class="product-image-wrapper">
<?php foreach ($record['images'] as $index => $upload): ?>
<span class="product-image" style="background-image: url('<?php echo $upload['urlPath'] ?>');"></span>
<?php endforeach ?>
<span class="product-price-container">
<span class="product-price-wrapper">
<span class="product-price"><?php echo htmlencode($record['price']) ?></span>
</span>
</span>
<div class="product-controls">
<div class="product-controls-wrapper">
<a href="<?php echo $record['_link'] ?>" class="btn btn-sm btn-outline-color product-link">READ MORE</a>
<?php foreach ($record['booking_form'] as $index => $upload): ?>
<a href="<?php echo $upload['urlPath'] ?>" class="btn btn-sm btn-outline-color product-buy"><span class="icon icon-shopping-18"></span>Book now</a>
<?php endforeach ?>
</div>
</div>
</div>
<div class="product-content">
<h3 class="product-title"><a href="<?php echo $record['_link'] ?>"><?php echo htmlencode($record['title']) ?></a></h3>
<div class="product-description">
<p><?php echo date("D, M jS, Y", strtotime($record['date'])) ?></p>
</div>
</div>
</div>
</div>
<?php endforeach ?>
</div>
</div>
</div>
<div class="container">
<h3 class="highlight">OUR EVENTS</h2>
<p class="post-text"><br>
The foundation runs a variety of annual events<br>
</p>
<div class="product-list row list-view">
<?php foreach ($annual_eventsRecords as $record): ?>
<div class="product col-md-12">
<div class="product-inner">
<div class="product-image-wrapper">
<?php foreach ($record['images'] as $index => $upload): ?>
<span class="product-image" style="background-image: url('<?php echo $upload['urlPath'] ?>');"></span>
<?php endforeach ?>
</div>
<div class="product-content">
<h3 class="product-title"><?php echo htmlencode($record['title']) ?></h3>
<div class="product-description">
<article><?php echo htmlencode($record['details']) ?></article>
</div>
</div>
</div>
</div>
<?php endforeach ?>
</div>
</div>
</div>
</div>
<footer id="footer" class="footer light-text">
<div class="container">
<div class="footer-content row">
<div class="col-sm-3 col-xs-12">
<ul class="list-unstyled">
<p>The NELUNE Foundation<br>
PO Box 1033,<br>
Spit Junction 2088 NSW</p>
<p><strong>Media Enquiries:</strong><br>
Marketing Manager<br>
NELUNE Foundation<br>
<a href="mailto:info@thenelunefoundation.org">info@thenelunefoundation.org</a><br>
02 8082 8199<br></p>
<div class="social-wrap">
<ul class="list-inline socials">
<li><a href="https://www.facebook.com/nelunefoundation/"><span class="icon icon-socialmedia-08"></span></a></li>
<li><a href="http://twitter.com/NeluneR"><span class="icon icon-socialmedia-07"></span></a></li>
<li><a href="http://www.youtube.com/channel/UCVutWJqVU8Jw0-U7MZOiAQg?feature=watch"><span class="icon icon-socialmedia-29"></span></a></li>
</ul>
</div>
</div>
<!--
<div class="col-sm-4 col-xs-12 border">
<a href="#about">About</a><br>
<a href="howtohelp.php">How to help</a><br>
<a href="donate.php">Donate</a><br>
<a href="#projects">Projects</a><br>
<a href="#sponsors">Sponsors</a><br>
<a href="news.php">News</a><br>
<a href="events.php">Events</a><br>
<a href="gallery.php">Gallery</a><br>
<a href="contact.php">Contact</a><br>
</div>
<div class="col-sm-3 col-xs-12">
</div>
-->
</div>
</div>
<div class="copyright">© <script type="text/javascript">
document.write(new Date().getFullYear());
</script> The NELUNE Foundation. All rights reserved</div>
</footer>
<div class="back-to-top"><i class="fa fa-angle-up fa-3x"></i></div>
<!--[if lt IE 9]>
<script type="text/javascript" src="assets/js/jquery-1.11.3.min.js?ver=1"></script>
<![endif]-->
<!--[if (gte IE 9) | (!IE)]><!-->
<script type="text/javascript" src="assets/js/jquery-2.1.4.min.js?ver=1"></script>
<!--<![endif]-->
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/js/jquery.flexslider-min.js"></script>
<script type="text/javascript" src="assets/js/jquery.appear.js"></script>
<script type="text/javascript" src="assets/js/jquery.plugin.js"></script>
<script type="text/javascript" src="assets/js/jquery.countdown.js"></script>
<script type="text/javascript" src="assets/js/jquery.waypoints.min.js"></script>
<script type="text/javascript" src="assets/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="assets/js/toastr.min.js"></script>
<script type="text/javascript" src="assets/js/startuply.js"></script>
<script src="assets/js/readmore.js"></script>
<script>
$('#info').readmore({
moreLink: '<a href="#">Usage, examples, and options</a>',
collapsedHeight: 384,
afterToggle: function(trigger, element, expanded) {
if(! expanded) { // The "Close" link was clicked
$('html, body').animate({scrollTop: element.offset().top}, {duration: 100});
}
}
});
$('article').readmore({speed: 500});
</script>
</body>
</html>
<?php /* This is a PHP data file */ if (!@$LOADSTRUCT) { die("This is not a program file."); }
return array (
'_detailPage' => '',
'_disableAdd' => '0',
'_disableErase' => '0',
'_disableModify' => '0',
'_disablePreview' => '0',
'_disableView' => '1',
'_filenameFields' => NULL,
'_hideRecordsFromDisabledAccounts' => '0',
'_indent' => '0',
'_listPage' => NULL,
'_maxRecords' => '',
'_maxRecordsPerUser' => '',
'_perPageDefault' => '25',
'_previewPage' => '',
'_requiredPlugins' => '',
'_tableName' => 'events',
'listPageFields' => NULL,
'listPageOrder' => '',
'listPageSearchFields' => '_all_',
'menuHidden' => '0',
'menuName' => 'OLD - Events',
'menuOrder' => '0000000015',
'menuType' => 'single',
'num' => array(
'order' => '1',
'type' => 'none',
'label' => 'Record Number',
'isSystemField' => '1',
),
'createdDate' => array(
'order' => '2',
'type' => 'none',
'label' => 'Created',
'isSystemField' => '1',
),
'createdByUserNum' => array(
'order' => '3',
'type' => 'none',
'label' => 'Created By',
'isSystemField' => '1',
),
'updatedDate' => array(
'order' => '4',
'type' => 'none',
'label' => 'Last Updated',
'isSystemField' => '1',
),
'updatedByUserNum' => array(
'order' => '5',
'type' => 'none',
'label' => 'Last Updated By',
'isSystemField' => '1',
),
'intro' => array(
'order' => '1392634052',
'label' => 'Intro',
'type' => 'wysiwyg',
'fieldPrefix' => '',
'description' => '<br><br>',
'defaultContent' => '',
'allowUploads' => '1',
'isRequired' => '0',
'isUnique' => '0',
'minLength' => '',
'maxLength' => '',
'fieldHeight' => '50',
'allowedExtensions' => 'gif,jpg,png,wmv,mov,swf,pdf',
'checkMaxUploadSize' => '1',
'maxUploadSizeKB' => '5120',
'checkMaxUploads' => '1',
'maxUploads' => '25',
'resizeOversizedImages' => '1',
'maxImageHeight' => '800',
'maxImageWidth' => '600',
'createThumbnails' => '1',
'maxThumbnailHeight' => '150',
'maxThumbnailWidth' => '150',
'createThumbnails2' => '0',
'maxThumbnailHeight2' => '150',
'maxThumbnailWidth2' => '150',
'createThumbnails3' => '0',
'maxThumbnailHeight3' => '150',
'maxThumbnailWidth3' => '150',
'createThumbnails4' => '0',
'maxThumbnailHeight4' => '150',
'maxThumbnailWidth4' => '150',
'useCustomUploadDir' => '0',
'customUploadDir' => '',
'customUploadUrl' => '',
),
'the_lilac_ball' => array(
'order' => '1392634089',
'label' => 'The Lilac Ball',
'type' => 'wysiwyg',
'fieldPrefix' => '',
'description' => '<br><br>',
'defaultContent' => '',
'allowUploads' => '1',
'isRequired' => '0',
'isUnique' => '0',
'minLength' => '',
'maxLength' => '',
'fieldHeight' => '200',
'allowedExtensions' => 'gif,jpg,png,wmv,mov,swf,pdf',
'checkMaxUploadSize' => '1',
'maxUploadSizeKB' => '5120',
'checkMaxUploads' => '1',
'maxUploads' => '25',
'resizeOversizedImages' => '1',
'maxImageHeight' => '800',
'maxImageWidth' => '600',
'createThumbnails' => '1',
'maxThumbnailHeight' => '150',
'maxThumbnailWidth' => '150',
'createThumbnails2' => '0',
'maxThumbnailHeight2' => '150',
'maxThumbnailWidth2' => '150',
'createThumbnails3' => '0',
'maxThumbnailHeight3' => '150',
'maxThumbnailWidth3' => '150',
'createThumbnails4' => '0',
'maxThumbnailHeight4' => '150',
'maxThumbnailWidth4' => '150',
'useCustomUploadDir' => '0',
'customUploadDir' => '',
'customUploadUrl' => '',
),
'the_lilac_trivia' => array(
'order' => '1392634207',
'label' => 'The Lilac Trivia',
'type' => 'wysiwyg',
'fieldPrefix' => '',
'description' => '<br><br>',
'defaultContent' => '',
'allowUploads' => '1',
'isRequired' => '0',
'isUnique' => '0',
'minLength' => '',
'maxLength' => '',
'fieldHeight' => '200',
'allowedExtensions' => 'gif,jpg,png,wmv,mov,swf,pdf',
'checkMaxUploadSize' => '1',
'maxUploadSizeKB' => '5120',
'checkMaxUploads' => '1',
'maxUploads' => '25',
'resizeOversizedImages' => '1',
'maxImageHeight' => '800',
'maxImageWidth' => '600',
'createThumbnails' => '1',
'maxThumbnailHeight' => '150',
'maxThumbnailWidth' => '150',
'createThumbnails2' => '0',
'maxThumbnailHeight2' => '150',
'maxThumbnailWidth2' => '150',
'createThumbnails3' => '0',
'maxThumbnailHeight3' => '150',
'maxThumbnailWidth3' => '150',
'createThumbnails4' => '0',
'maxThumbnailHeight4' => '150',
'maxThumbnailWidth4' => '150',
'useCustomUploadDir' => '0',
'customUploadDir' => '',
'customUploadUrl' => '',
),
'the_lilac_swim' => array(
'order' => '1392634281',
'label' => 'The Lilac Swim',
'type' => 'wysiwyg',
'fieldPrefix' => '',
'description' => '<br><br>',
'defaultContent' => '',
'allowUploads' => '1',
'isRequired' => '0',
'isUnique' => '0',
'minLength' => '',
'maxLength' => '',
'fieldHeight' => '200',
'allowedExtensions' => 'gif,jpg,png,wmv,mov,swf,pdf',
'checkMaxUploadSize' => '1',
'maxUploadSizeKB' => '5120',
'checkMaxUploads' => '1',
'maxUploads' => '25',
'resizeOversizedImages' => '1',
'maxImageHeight' => '800',
'maxImageWidth' => '600',
'createThumbnails' => '1',
'maxThumbnailHeight' => '150',
'maxThumbnailWidth' => '150',
'createThumbnails2' => '0',
'maxThumbnailHeight2' => '150',
'maxThumbnailWidth2' => '150',
'createThumbnails3' => '0',
'maxThumbnailHeight3' => '150',
'maxThumbnailWidth3' => '150',
'createThumbnails4' => '0',
'maxThumbnailHeight4' => '150',
'maxThumbnailWidth4' => '150',
'useCustomUploadDir' => '0',
'customUploadDir' => '',
'customUploadUrl' => '',
),
'royal_sovereign_stakes_race_day' => array(
'order' => '1392634455',
'label' => 'Royal Sovereign Stakes Race Day',
'type' => 'wysiwyg',
'fieldPrefix' => '',
'description' => '',
'defaultContent' => '',
'allowUploads' => '1',
'isRequired' => '0',
'isUnique' => '0',
'minLength' => '',
'maxLength' => '',
'fieldHeight' => '200',
'allowedExtensions' => 'gif,jpg,png,wmv,mov,swf,pdf',
'checkMaxUploadSize' => '1',
'maxUploadSizeKB' => '5120',
'checkMaxUploads' => '1',
'maxUploads' => '25',
'resizeOversizedImages' => '1',
'maxImageHeight' => '800',
'maxImageWidth' => '600',
'createThumbnails' => '1',
'maxThumbnailHeight' => '150',
'maxThumbnailWidth' => '150',
'createThumbnails2' => '0',
'maxThumbnailHeight2' => '150',
'maxThumbnailWidth2' => '150',
'createThumbnails3' => '0',
'maxThumbnailHeight3' => '150',
'maxThumbnailWidth3' => '150',
'createThumbnails4' => '0',
'maxThumbnailHeight4' => '150',
'maxThumbnailWidth4' => '150',
'useCustomUploadDir' => '0',
'customUploadDir' => '',
'customUploadUrl' => '',
),
'golf_day' => array(
'order' => '1432032605',
'label' => 'Jann Kohlman Golf Day',
'type' => 'wysiwyg',
'fieldPrefix' => '',
'description' => '<br><br>',
'defaultContent' => '',
'allowUploads' => '1',
'isRequired' => '0',
'isUnique' => '0',
'minLength' => '',
'maxLength' => '',
'fieldHeight' => '200',
'allowedExtensions' => 'gif,jpg,png,wmv,mov,swf,pdf',
'checkMaxUploadSize' => '1',
'maxUploadSizeKB' => '5120',
'checkMaxUploads' => '1',
'maxUploads' => '25',
'resizeOversizedImages' => '1',
'maxImageHeight' => '800',
'maxImageWidth' => '600',
'createThumbnails' => '1',
'maxThumbnailHeight' => '150',
'maxThumbnailWidth' => '150',
'createThumbnails2' => '0',
'maxThumbnailHeight2' => '150',
'maxThumbnailWidth2' => '150',
'createThumbnails3' => '0',
'maxThumbnailHeight3' => '150',
'maxThumbnailWidth3' => '150',
'createThumbnails4' => '0',
'maxThumbnailHeight4' => '150',
'maxThumbnailWidth4' => '150',
'useCustomUploadDir' => '0',
'customUploadDir' => '',
'customUploadUrl' => '',
),
);
?>
Detail page (event.php)
<?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('/home/thth3571/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 record from 'event'
list($eventRecords, $eventMetaData) = getRecords(array(
'tableName' => 'event',
'where' => '', // load first record
'loadUploads' => true,
'allowSearch' => false,
));
$eventRecord = @$eventRecords[0]; // get first record
if (!$eventRecord) { dieWith404("Record not found!"); } // show error message if no record found
?>
<!doctype html>
<html lang="en">
<head> <meta charset="utf-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>The NELUNE Foundation - Helping patients fight cancer with dignity</title>
<meta name="description" content="Providing psychological and practical support, assistance and care for public hospital and underprivileged cancer patients in the community - 'Helping patients fight cancer with dignity'.
">
<meta name="keywords" content=“The NELUNE Foundation, Cancer Charity“>
<link rel="stylesheet" type="text/css" href="assets/css/custom-animations.css" />
<link rel="stylesheet" type="text/css" href="assets/css/lib/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="assets/css/style.css" />
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body id="blog-page" class="blog-page">
<!-- Preloader -->
<div class="preloader-mask">
<div class="preloader"><div class="spin base_clr_brd"><div class="clip left"><div class="circle"></div></div><div class="gap"><div class="circle"></div></div><div class="clip right"><div class="circle"></div></div></div></div>
</div>
<!-- Header -->
<header>
<nav class="navigation navigation-header relative-header background-header">
<div class="container">
<div class="navigation-brand">
<div class="brand-logo">
<a href="index.php#hero" class="logo"></a><a href="index.php#hero" class="logo logo-alt"></a>
</div>
</div>
<button class="navigation-toggle">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button> <div class="navigation-navbar collapsed">
<ul class="navigation-bar navigation-bar-left"> <li><a href="index.php#about">About</a></li>
<li><a href="index.php#projects">Projects</a></li>
<li><a href="index.php#sponsors">Sponsors</a></li>
<li><a href="news.php">News</a></li>
<li><a href="events.php">Events</a></li>
<li><a href="gallery.php">Gallery</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
<ul class="navigation-bar navigation-bar-right">
<li><a href="howtohelp.php">How to help</a></li>
<li class="featured"><a class="btn btn-sm btn-outline" href="donate.php">Donate</a></li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container blog">
<div class="col-md-12 col-lg-9 post-list">
<article class="post">
<span class="post-date base-clr-bg">
<span class="post-day"><?php echo date("d", strtotime($eventRecord['date'])) ?></span>
<span class="post-month"><?php echo date("M", strtotime($eventRecord['date'])) ?></span>
<span class="post-year"><?php echo date("Y", strtotime($eventRecord['date'])) ?></span>
</span>
<div class="post-content">
<h3 class="post-title highlight"><?php echo htmlencode($eventRecord['title']) ?></h3>
<?php foreach ($eventRecord['images'] as $index => $upload): ?>
<img src="<?php echo $upload['urlPath'] ?>" class="post-image img-responsive" alt="">
<?php endforeach ?>
<div class="post-text">
<p><?php echo htmlencode($eventRecord['details']) ?></p>
<?php foreach ($eventRecord['booking_form'] as $index => $upload): ?>
<a class="btn base_clr_txt base_clr_bg base_clr_brd" href="<?php echo $eventRecord['_link'] ?>">Book now</a>
<?php endforeach ?>
</div>
</div>
</article>
</div>
<div class="col-md-12 col-lg-12 post-list align-center">
<a class="btn btn-outline-color base_clr_txt base_clr_bg base_clr_brd" href="events.php">Back to events</a>
</div>
</div>
<footer id="footer" class="footer light-text">
<div class="container">
<div class="footer-content row">
<div class="col-sm-3 col-xs-12">
<ul class="list-unstyled">
<p>The NELUNE Foundation<br>
PO Box 1033,<br>
Spit Junction 2088 NSW</p>
<p><strong>Media Enquiries:</strong><br>
Marketing Manager<br>
NELUNE Foundation<br>
<a href="mailto:info@thenelunefoundation.org">info@thenelunefoundation.org</a><br>
02 8082 8199<br></p>
<div class="social-wrap">
<ul class="list-inline socials">
<li><a href="https://www.facebook.com/nelunefoundation/"><span class="icon icon-socialmedia-08"></span></a></li>
<li><a href="http://twitter.com/NeluneR"><span class="icon icon-socialmedia-07"></span></a></li>
<li><a href="http://www.youtube.com/channel/UCVutWJqVU8Jw0-U7MZOiAQg?feature=watch"><span class="icon icon-socialmedia-29"></span></a></li>
</ul>
</div>
</div>
<!--
<div class="col-sm-4 col-xs-12 border">
<a href="#about">About</a><br>
<a href="howtohelp.php">How to help</a><br>
<a href="donate.php">Donate</a><br>
<a href="#projects">Projects</a><br>
<a href="#sponsors">Sponsors</a><br>
<a href="news.php">News</a><br>
<a href="events.php">Events</a><br>
<a href="gallery.php">Gallery</a><br>
<a href="contact.php">Contact</a><br>
</div>
<div class="col-sm-3 col-xs-12">
</div>
-->
</div>
</div>
<div class="copyright">© <script type="text/javascript">
document.write(new Date().getFullYear());
</script> The NELUNE Foundation. All rights reserved</div>
</footer>
<div class="back-to-top"><i class="fa fa-angle-up fa-3x"></i></div>
<!--[if lt IE 9]>
<script type="text/javascript" src="assets/js/jquery-1.11.3.min.js?ver=1"></script>
<![endif]-->
<!--[if (gte IE 9) | (!IE)]><!-->
<script type="text/javascript" src="assets/js/jquery-2.1.4.min.js?ver=1"></script>
<!--<![endif]-->
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/js/jquery.flexslider-min.js"></script>
<script type="text/javascript" src="assets/js/jquery.appear.js"></script>
<script type="text/javascript" src="assets/js/jquery.plugin.js"></script>
<script type="text/javascript" src="assets/js/jquery.countdown.js"></script>
<script type="text/javascript" src="assets/js/jquery.waypoints.min.js"></script>
<script type="text/javascript" src="assets/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="assets/js/toastr.min.js"></script>
<script type="text/javascript" src="assets/js/startuply.js"></script>
</body>
</html>
<?php /* This is a PHP data file */ if (!@$LOADSTRUCT) { die("This is not a program file."); }
return array (
'_detailPage' => '/event.php',
'_disableAdd' => '0',
'_disableErase' => '0',
'_disableModify' => '0',
'_disablePreview' => '0',
'_disableView' => '1',
'_filenameFields' => 'title',
'_hideRecordsFromDisabledAccounts' => '0',
'_indent' => '0',
'_listPage' => '',
'_maxRecords' => '',
'_maxRecordsPerUser' => '',
'_perPageDefault' => '25',
'_previewPage' => '',
'_requiredPlugins' => '',
'_tableName' => 'event',
'listPageFields' => 'dragSortOrder, title, upcoming',
'listPageOrder' => 'dragSortOrder DESC',
'listPageSearchFields' => '_all_',
'menuHidden' => '0',
'menuName' => 'Events',
'menuOrder' => '0000000006',
'menuType' => 'multi',
'num' => array(
'order' => 1,
'type' => 'none',
'label' => 'Record Number',
'isSystemField' => '1',
),
'createdDate' => array(
'order' => 2,
'type' => 'none',
'label' => 'Created',
'isSystemField' => '1',
),
'createdByUserNum' => array(
'order' => 3,
'type' => 'none',
'label' => 'Created By',
'isSystemField' => '1',
),
'updatedDate' => array(
'order' => 4,
'type' => 'none',
'label' => 'Last Updated',
'isSystemField' => '1',
),
'updatedByUserNum' => array(
'order' => 5,
'type' => 'none',
'label' => 'Last Updated By',
'isSystemField' => '1',
),
'dragSortOrder' => array(
'order' => 6,
'label' => 'Order',
'type' => 'none',
),
'title' => array(
'order' => 7,
'label' => '',
'type' => 'textfield',
'defaultValue' => '',
'fieldPrefix' => '<br><font size="16">You can leave any fields that are not required blank.</font> <br><br><b>Event title</b><br>',
'description' => '',
'fieldWidth' => '',
'isPasswordField' => '0',
'isRequired' => '1',
'isUnique' => '0',
'minLength' => '',
'maxLength' => '',
'charsetRule' => '',
'charset' => '',
),
'__separator002__' => array(
'order' => 8,
'label' => '',
'type' => 'separator',
'separatorType' => 'blank line',
'separatorHeader' => '',
'separatorHTML' => '<tr>
<td colspan=\'2\'>
</td>
</tr>',
),
'date' => array(
'order' => '9',
'label' => '',
'type' => 'date',
'fieldPrefix' => '<b>Date</b> <b>Time</b><br>',
'description' => '',
'isRequired' => '0',
'isUnique' => '0',
'defaultDate' => 'none',
'defaultDateString' => '2015-01-01 20:00:00',
'showTime' => '0',
'showSeconds' => '0',
'use24HourFormat' => '0',
'yearRangeStart' => '',
'yearRangeEnd' => '',
),
'price' => array(
'order' => 10,
'label' => 'Price',
'type' => 'textfield',
'defaultValue' => '',
'fieldPrefix' => '',
'description' => '',
'fieldWidth' => '',
'isPasswordField' => '0',
'isRequired' => '0',
'isUnique' => '0',
'minLength' => '',
'maxLength' => '',
'charsetRule' => '',
'charset' => '',
),
'__separator003__' => array(
'order' => 11,
'label' => '',
'type' => 'separator',
'separatorType' => 'blank line',
'separatorHeader' => '',
'separatorHTML' => '<tr>
<td colspan=\'2\'>
</td>
</tr>',
),
'upcoming' => array(
'order' => 12,
'label' => '',
'type' => 'checkbox',
'fieldPrefix' => '<b>Show in upcoming events?</b> ',
'checkedByDefault' => '0',
'description' => 'Yes',
'checkedValue' => 'Yes',
'uncheckedValue' => 'No',
),
'__separator001__' => array(
'order' => 13,
'label' => '',
'type' => 'separator',
'separatorType' => 'blank line',
'separatorHeader' => '',
'separatorHTML' => '<tr>
<td colspan=\'2\'>
</td>
</tr>',
),
'details' => array(
'order' => 14,
'label' => '',
'type' => 'textbox',
'defaultContent' => '',
'fieldPrefix' => '<b>Event details</b><br>',
'description' => '',
'isRequired' => '0',
'isUnique' => '0',
'minLength' => '',
'maxLength' => '',
'fieldHeight' => '200',
'autoFormat' => '1',
),
'__separator004__' => array(
'order' => 15,
'label' => '',
'type' => 'separator',
'separatorType' => 'blank line',
'separatorHeader' => '',
'separatorHTML' => '<tr>
<td colspan=\'2\'>
</td>
</tr>',
),
'booking_form' => array(
'order' => 16,
'label' => '',
'type' => 'upload',
'fieldPrefix' => '<p><b>Booking form</b><br> If you have a PDF booking form add it here</p>',
'description' => '',
'isRequired' => '0',
'allowedExtensions' => 'gif,jpg,png,pdf,jpeg',
'checkMaxUploadSize' => '0',
'maxUploadSizeKB' => '5120',
'checkMaxUploads' => '1',
'maxUploads' => '1',
'resizeOversizedImages' => '0',
'maxImageHeight' => '800',
'maxImageWidth' => '600',
'createThumbnails' => '0',
'maxThumbnailHeight' => '150',
'maxThumbnailWidth' => '150',
'createThumbnails2' => '0',
'maxThumbnailHeight2' => '150',
'maxThumbnailWidth2' => '150',
'createThumbnails3' => '0',
'maxThumbnailHeight3' => '150',
'maxThumbnailWidth3' => '150',
'createThumbnails4' => '0',
'maxThumbnailHeight4' => '150',
'maxThumbnailWidth4' => '150',
'useCustomUploadDir' => '0',
'customUploadDir' => '',
'customUploadUrl' => '',
'infoField1' => '',
'infoField2' => '',
'infoField3' => '',
'infoField4' => '',
'infoField5' => '',
),
'__separator005__' => array(
'order' => 17,
'label' => '',
'type' => 'separator',
'separatorType' => 'blank line',
'separatorHeader' => '',
'separatorHTML' => '<tr>
<td colspan=\'2\'>
</td>
</tr>',
),
'facebook' => array(
'order' => 18,
'label' => '',
'type' => 'textfield',
'defaultValue' => '',
'fieldPrefix' => '<p><b>Facebook event</b><br>If you have a link to your Facebook event paste it here</p>',
'description' => '',
'fieldWidth' => '',
'isPasswordField' => '0',
'isRequired' => '0',
'isUnique' => '0',
'minLength' => '',
'maxLength' => '',
'charsetRule' => '',
'charset' => '',
),
'__separator006__' => array(
'order' => 19,
'label' => '',
'type' => 'separator',
'separatorType' => 'blank line',
'separatorHeader' => '',
'separatorHTML' => '<tr>
<td colspan=\'2\'>
</td>
</tr>',
),
'images' => array(
'order' => 20,
'label' => '',
'type' => 'upload',
'fieldPrefix' => '<b>Event images</b><br>',
'description' => '',
'isRequired' => '0',
'allowedExtensions' => 'gif,jpg,png,wmv,mov,swf,pdf',
'checkMaxUploadSize' => '1',
'maxUploadSizeKB' => '5120',
'checkMaxUploads' => '1',
'maxUploads' => '25',
'resizeOversizedImages' => '1',
'maxImageHeight' => '800',
'maxImageWidth' => '600',
'createThumbnails' => '1',
'maxThumbnailHeight' => '150',
'maxThumbnailWidth' => '150',
'createThumbnails2' => '0',
'maxThumbnailHeight2' => '150',
'maxThumbnailWidth2' => '150',
'createThumbnails3' => '0',
'maxThumbnailHeight3' => '150',
'maxThumbnailWidth3' => '150',
'createThumbnails4' => '0',
'maxThumbnailHeight4' => '150',
'maxThumbnailWidth4' => '150',
'useCustomUploadDir' => '0',
'customUploadDir' => '',
'customUploadUrl' => '',
'infoField1' => '',
'infoField2' => '',
'infoField3' => '',
'infoField4' => '',
'infoField5' => '',
),
);
?>
Hi superhappybunnycat,
This seems to be happening because the detail page has been setup to load the first record from the events section, but it needs to get the record based on the value in the URL. You need to update detail.php as follows:
// load record from 'event'
list($eventRecords, $eventMetaData) = getRecords(array(
'tableName' => 'event',
'where => whereRecordNumberInUrl(0),
'limit' => '1',
'loadUploads' => true,
'allowSearch' => false,
));
$eventRecord = @$eventRecords[0]; // get first record
if (!$eventRecord) { dieWith404("Record not found!"); } // show error message if no record found
So I've updated the where statement so that it uses the whereRecordNumberInUrl function, which gets the num value from the URL and creates a where statement for it. I've also added a limit so that only 1 record is returned at a time.
Cheers,
Greg
PHP Programmer - interactivetools.com