Hi, there.
I'm trying to use this slideshow code from Dynamic Drive with CMSB, but I can't get the images to load:
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm. Here's the test page:
http://www.cityofowensville.com/home3.php. It works when I do a handcoded version - i.e. without using CMSB - but as soon as I try loading the images with the cms, I get nothing.
My version of the code looks like this:
<script type="text/javascript" src="fadeslideshow.js"></script>
<!-- STEP1: Load Record (Paste this above other step) -->
<?php
require_once "cmsAdmin/lib/viewer_functions.php";
$options = array(); // NOTE: see online documentation for more details on these options
$options['tableName'] = 'homepage_slideshow'; // (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);
?>
<!-- /STEP1: Load Record -->
<!-- STEP2: Display Record (Paste this where you want your record displayed and re-arrange fields) -->
<?php if ($record): ?>
<?php endif ?>
<?php if (empty($record)): ?>
<?php endif ?>
<!-- STEP2: /Display Record -->
<script type="text/javascript">
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
dimensions: [990, 422], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
<?php $firstImage = true ?>
<?php if ($record): ?>
<?php foreach (getUploads($options['tableName'], 'slides', $record['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<?php if (!$firstImage): ?>
,
<?php endif ?>
<?php $firstImage = false ?>
[
<?php echo json_encode($upload['thumbUrlPath']) ?>,
"",
"",
"<a href='" + <?php echo json_encode($upload['info2']) ?> + "' class='aWhite'>"
+ <?php echo json_encode($upload['info1']) ?> + "</a>"
]
<?php endif ?>
<?php endforeach ?>
<?php endif ?>
],
displaymode: {type:'auto', pause:3000, cycles:0, wraparound:false},
persist: true, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler"
})
</script>
I've attached the file for this page.
Any suggestions, please?
Nigel Gordijk
Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net