Zen Cart Logo
Forums / General Questions / Zen Lightbox added 'garbage' to my EZ Pages

Zen Lightbox added 'garbage' to my EZ Pages

Views: 784

Results 1 to 4 of 4
9 Sep 2012, 7:56 PM
#1
limitless avatar

limitless

Inactive

Join Date:
Jan 2012
Posts:
496
Plugin Contributions:
0

Zen Lightbox added 'garbage' to my EZ Pages

I couldn't find a support thread for Zen Lightbox, so asking here...

I changed out Fual Slimbox for Zen Lightbox and it performs flawlessly on product pages, but when I hit EZ pages, it displays the following at the top:

jQuery(function($) { var lightboxType = "lightbox-g"; fileTypesString = 'jpg,png,gif,'; fileTypes = $.each(fileTypesString.split(",").slice(0,-1), function(index, item) { $("a[href*='"+item+"']").attr('rel', lightboxType); $("a[rel^='lightbox']").slimbox({}, function(el) { return [el.href, el.title /* + '
Download this image'*/]; }, function(el) { return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); }); }); $('#lbPrevLink').addClass('prevNoHover'); $('#lbNextLink').addClass('nextNoHover');}); //-->
HomeLog In

Where is that coming from????

9 Sep 2012, 8:06 PM
#2
limitless avatar

limitless

Inactive

Join Date:
Jan 2012
Posts:
496
Plugin Contributions:
0

Re: Zen Lightbox added 'garbage' to my EZ Pages

Ok, found where its coming from.

If Zen Lightbox 'Enable on EZ Pages' set to true, the garbage shows up.

Whats wrong with the code?

Contents of /includes/modules/pages/page/jscript_zen_lightbox.php

<?php /** * Zen Lightbox * * @author Alex Clarke ([email protected]) * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: jscript_zen_lightbox.php 2008-12-09 aclarke $ */ if (ZEN_LIGHTBOX_STATUS == 'true' && ZEN_LIGHTBOX_EZPAGES == 'true') { require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'zen_lightbox/slimbox.php'); ?>

jQuery(function($) {

<?php if (ZEN_LIGHTBOX_GALLERY_MODE == 'true'){?>
var lightboxType = "lightbox-g";
<?php } else {?>
var lightboxType = "lightbox";
<?php } ?>

fileTypesString = <?php echo ("'" . ZEN_LIGHTBOX_FILE_TYPES . ",". "'");?>;
fileTypes = $.each(fileTypesString.split(",").slice(0,-1), function(index, item) {
$("a[href*='"+item+"']").attr('rel', lightboxType);
$("a[rel^='lightbox']").slimbox({<?php require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'zen_lightbox/options.php'); ?>}, function(el)
{
return [el.href, el.title /* + '<br /><a href="' + el.href + '">Download this image</a>'*/];
}, function(el) {
return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
});
});

<?php if (ZEN_LIGHTBOX_CLOSE_IMAGE == 'true' || ZEN_LIGHTBOX_PREV_NEXT == 'true') { echo ("$('#lbPrevLink').addClass('prevNoHover'); $('#lbNextLink').addClass('nextNoHover');");}?>

});
//--></script><?php } ?>

9 Sep 2012, 8:36 PM
#4
limitless avatar

limitless

Inactive

Join Date:
Jan 2012
Posts:
496
Plugin Contributions:
0

Re: Zen Lightbox added 'garbage' to my EZ Pages

Thanks!

Can a mod Move this to that thread so I don't double post?