
Originally Posted by
simon1066
Hi, would you mind sharing how you did this. I'm about to start a new site with this template and this would be useful.
There are several files involved in the change to make this work. The first is in the supersized.3.2.7.min.js script which is more than I can show here. Best to PM me with an email address and I can send you the updated script.
The second file that needs changed is the /includes/templates/your_template_name/common/tpl_main_page.php
find where the supersized script is being loaded (about line 100) and change the code that follows to match the following:
Code:
<script type="text/javascript" src="includes/templates/dover_fine/jscript/jquery.easing.min.js"></script>
<script type="text/javascript" src="includes/templates/dover_fine/jscript/supersized.3.2.7.min.js"></script>
<script type="text/javascript" src="includes/templates/dover_fine/jscript/supersized.shutter.min.js"></script>
<script type="text/javascript">
jQuery(function($){
$.supersized({
// Functionality
slide_interval : 7000, // Length between transitions
transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
transition_speed : 1000, // Speed of transition
vertical_center: 0,
new_window: 0,
autoplay:1,
// Components
slide_links: 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank')
slides : [// Slideshow Images
<?php
$banner = $db->Execute("SELECT banners_id, banners_title, banners_image, banners_html_text, banners_open_new_windows, banners_url FROM " . TABLE_BANNERS . " WHERE status = 1 AND banners_group = 'homepageslide' order by rand()");
if ($banner->RecordCount() > 0) {
while (!$banner->EOF) {
$newwindow = ($banner->fields['banners_open_new_windows']) ? "', nwin : '1" : '';
$bannerurl = ($banner->fields['banners_url']) ? "', url : '" . zen_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner->fields['banners_id']) : '';
echo "{image : '" . HTTP_SERVER . DIR_WS_CATALOG . 'images/' . $banner->fields['banners_image'] . $bannerurl . $newwindow . "'},";
zen_update_banner_display_count($banner->fields['banners_id']);
$banner->MoveNext();
}
It's important to add the parameter 'new_window: 0,' to the script options. This is what tells the script to not open a new window. You will notice in the code above in the loop that sets up the slides a new parameter that is being passed to the script called 'nwin'. This is being set by looking at the setting of the banner for open in a new window. This parameter then overrides the script setting to either open in a new window, or open in the same window based on the setting in the banner.
Hope that makes sense. If not, let me know.
Bookmarks