Thank you again Dave,
It now works perfectly, thanks to your guidance.
Here’s the final code, in context with the rotator code I'm using for anyone else needing the same.
<?php // load uploads from accounts
$uploadRecords = mysql_select('uploads', " tableName = 'accounts' AND fieldName = 'large_banners' ");
?>
<script>
window.addEvent('domready', function() {
// modified from http://joesong.com/2009/11/external-links-in-new-window-passive-and-with-mootools/
// to avoid using the 'target' attribute, which is not part of xhtml 1.0 strict
var currentDomain = window.location.host;
$(document.body).addEvent('click', function(evt) {
var target = $(evt.target);
if (target.get('tag') !== 'a') {
target = target.getParent();
}
if (target && target.get('tag') === 'a' && target.get('href').test('http') && !target.get('href').test(currentDomain)) {
window.open(target.get('href'), '_blank');
return false;
}
});
});
window.addEvent('domready', function(){
var data = { <?php $blank = "'" ?><?php $output = '';
?>
<?php shuffle ($uploadRecords) ?>
<?php foreach ($uploadRecords as $upload): ?>
<?php $output .= "'". "/cmsAdmin/uploads/".$upload['urlPath']. "'". ": { caption: " ."'4'". ",". "href:" . "'" . $upload['info3'] . "'" . " }" . ","; ?>
<?php endforeach ?>
<?php $output = rtrim($output,","); // remove trailing comma
print $output;
?>
};
new Slideshow('top', data, { captions: false, controller: false, thumbnails: false, overlap: false, delay: <?php echo $common_informationRecord['top_rotator_duration']?>, duration: <?php echo $common_informationRecord['cross_fade_duration']?>, height: 100, hu: '', width: 668 });
});
</script>
<script>
window.addEvent('domready', function(){
var data2 = { <?php $blank = "'" ?><?php $output = '';
?>
<?php shuffle ($uploadRecords) ?>
<?php foreach ($uploadRecords as $upload): ?>
<?php $output .= "'". "/cmsAdmin/uploads/".$upload['urlPath']. "'". ": { caption: " ."'4'". ",". "href:" . "'" . $upload['info3'] . "'" . " }" . ","; ?>
<?php endforeach ?>
<?php $output = rtrim($output,","); // remove trailing comma
print $output;
?>
};
new Slideshow('bottom', data2, { captions: false, controller: false, thumbnails: false, overlap: false, delay: <?php echo $common_informationRecord['bottom_rotator_duration']?>, duration: <?php echo $common_informationRecord['cross_fade_duration']?>, height: 100, hu: '', width: 668 });
});
</script>
Top rotator
<div align="center" id="top" class="slideshow"></div>
Bottom Rotator
<div align="center" id="bottom" class="slideshow"></div>
Best,
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php