Totally Zenned
- Join Date:
- May 2006
- Posts:
- 712
- Plugin Contributions:
- 0
Jquery Lightbox [Support thread]
Thanks so much for the help...
Views: 82,872
Totally Zenned
Thanks so much for the help...
Totally Zenned
Hi yellow1912,
For updating jqlightbox, which file(s) do we overwrite with a new version?
thanks!
Also, there is a new version of jqlightbox and jqzoom which address the issue of watermark not working for IH2 available for download.
Totally Zenned
gsdcypher:
Hi yellow1912,
For updating jqlightbox, which file(s) do we overwrite with a new version?
thanks!
If you have made no changes then you can overwrite all, otherwise you have to compare the files in the modules/ and the templates/ folder
Totally Zenned
I updated image handler jzoom and jquery lightbox but still no watermark shows up. Uninstalled ih and reinstalled via admin. Cleared image cache. What else can I check?
Totally Zenned
mydanilo:
I updated image handler jzoom and jquery lightbox but still no watermark shows up. Uninstalled ih and reinstalled via admin. Cleared image cache. What else can I check?
You will have to check if the image being used is really ih2 created image. Link should look like this bmz_cache/a/e.....
I cant tell unless I see your site.
Edit: I can confirm that this product is using ih2 image:
http://www.mydanilo.com/fish/fish-table-lamp-tropical-yellow
So if the watermark does not show here, you will have to recheck your ih2 settings. Because the reason is: in previous version, jqzom and lightbox did not use images created by ih2, they use the original images instead, so no wonder the watermark does not show. Now that they already use ih2 images, and if watermark still does not show that has nothing to do with the 2 javascript modules. You should recheck your ih2 setting perhaps?
Totally Zenned
Settings in IH for watermark are activated. What IH file was now modified that takes care of the watermark? I want to check if I use the right file online. Where would the watermark file need to be placed? Still like before like /images/large/watermark_LRG.png ? That's what I have...
Totally Zenned
mydanilo:
Settings in IH for watermark are activated. What IH file was now modified that takes care of the watermark? I want to check if I use the right file online. Where would the watermark file need to be placed? Still like before like /images/large/watermark_LRG.png ? That's what I have...
No IH2 file was modified in this package, if that is the question you want to ask.
Also, your site is loading the correct image that it should, I dont know why watermark is not there though, you may want to try clearing ih2 image cache via ih2 admin?
Also, turn of jqzoom and see if the normal image show with watermarks as well.
You can see on my demo page here:
working:
http://demo.rubikintegration.com/jqzoom/index.php?main_page=product_info&cPath=3_10&products_id=12
not working:
http://demo.rubikintegration.com/jqzoom/index.php?main_page=product_info&cPath=21&products_id=47
I believe there is some kind of rule IH2 requires us to follow, thich Im not exactly sure at the moment lol. Gotta run now but I will check back later.
Totally Zenned
looking at the files from the update and comparing them to my current files, i can only find two files changed.
if(!defined('LARGE_IMAGE_MAX_WIDTH'))
define('LARGE_IMAGE_MAX_WIDTH', MEDIUM_IMAGE_WIDTH);
if(!defined('LARGE_IMAGE_MAX_HEIGHT'))
define('LARGE_IMAGE_MAX_HEIGHT', MEDIUM_IMAGE_HEIGHT);
change:
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . '<a href="'. zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_MAX_WIDTH, LARGE_IMAGE_MAX_HEIGHT) . '" class="'.$css_class.'">' . $thumb_slashes . '</a>\')'. "\n" . '//--></script>';
document.write('<a href="<?php echo zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_MAX_WIDTH, LARGE_IMAGE_MAX_HEIGHT);?>" id="jqzoomMain"<?php if (JQLIGHTBOX_STATUS == 'true') echo ' class="jqlightbox"';?>><?php echo zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT);?></a>');
and change:
echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
but when i make that addition and those changes, it breaks the page...???
Totally Zenned
Exactly how does it break the page?
Totally Zenned
it's weird.... the entire page disappears (images, attributes, etc) and i can't figure out why. everything looks correct. unless i missed a change in one of the other files...
Totally Zenned
gsdcypher:
it's weird.... the entire page disappears (images, attributes, etc) and i can't figure out why. everything looks correct. unless i missed a change in one of the other files...
If entire page disappears, you got some syntax error somewhere
In that case this will help
Totally Zenned
thanks. hmmm tried the utility but it didn't log any errors...
Totally Zenned
gsdcypher:
thanks. hmmm tried the utility but it didn't log any errors...
that is weird, but on some server the error setting is set so that no error is ever displayed, and in such cases i believe I did have to set something else to make the errors appear
http://us2.php.net/error-reporting
Anyhow, it would be very hard to know without seeing the site/page.
Totally Zenned
hi yellow1912,
you can see on my test site the ih2 watermark loads on images (except those images controlled by jquery lightbox)... :huh:
**thanks.
Totally Zenned
gsdcypher:
hi yellow1912,
you can see on my test site the ih2 watermark loads on images (except those images controlled by jquery lightbox)... :huh:
**thanks.
My ZoneAlarm doesnt like tinyurl :d, pm me. Also, fastest way is for you to send me the ftp info of your site so I fix it for you
Totally Zenned
i recoded two files and everything "seems" to work with the lightbox and the ih2 watermarks.
additional_images
<?php
/**
* additional_images module
*
* Prepares list of additional product images to be displayed in template
*
* @package templateSystem
* @copyright Copyright 2003-2007 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: additional_images.php 6132 2007-04-08 06:58:40Z drbyte $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
if (!defined('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE')) define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','Yes');
$images_array = array();
if ($products_image != '') {
// prepare image name
$products_image_extension = substr($products_image, strrpos($products_image, '.'));
$products_image_base = str_replace($products_image_extension, '', $products_image);
// if in a subdirectory
if (strrpos($products_image, '/')) {
$products_image_match = substr($products_image, strrpos($products_image, '/')+1);
//echo 'TEST 1: I match ' . $products_image_match . ' - ' . $file . ' - base ' . $products_image_base . '<br>';
$products_image_match = str_replace($products_image_extension, '', $products_image_match) . '_';
$products_image_base = $products_image_match;
}
$products_image_directory = str_replace($products_image, '', substr($products_image, strrpos($products_image, '/')));
if ($products_image_directory != '') {
$products_image_directory = DIR_WS_IMAGES . str_replace($products_image_directory, '', $products_image) . "/";
} else {
$products_image_directory = DIR_WS_IMAGES;
}
// Check for additional matching images
$file_extension = $products_image_extension;
$products_image_match_array = array();
if ($dir = @dir($products_image_directory)) {
while ($file = $dir->read()) {
if (!is_dir($products_image_directory . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
// if(preg_match("/" . $products_image_match . "/i", $file) == '1') {
if(preg_match("/" . $products_image_base . "/i", $file) == '1') {
if ($file != $products_image) {
if ($products_image_base . str_replace($products_image_base, '', $file) == $file) {
// echo 'I AM A MATCH ' . $file . '<br>';
$images_array[] = $file;
} else {
// echo 'I AM NOT A MATCH ' . $file . '<br>';
}
}
}
}
}
}
if (sizeof($images_array)) {
sort($images_array);
}
$dir->close();
}
}
// Build output based on images found
$num_images = sizeof($images_array);
$list_box_contents = '';
$title = '';
if ($num_images) {
$row = 0;
$col = 0;
if ($num_images < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0 ) {
$col_width = floor(100/$num_images);
} else {
$col_width = floor(100/IMAGES_AUTO_ADDED);
}
for ($i=0, $n=$num_images; $i<$n; $i++) {
$file = $images_array[$i];
$products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
$flag_has_large = true;//file_exists($products_image_large);
$products_image_large = ($flag_has_large ? $products_image_large : $products_image_directory . $file);
$flag_display_large = (IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE == 'Yes' || $flag_has_large);
$base_image = $products_image_directory . $file;
$thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
// remove additional single quotes from image attributes (important!)
$thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes);
$thumb_regular = zen_image($base_image, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$large_link = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);
// Link Preparation:
// bof jqzoom + jqlightbox
if(JQZOOM_STATUS == 'true' || JQLIGHTBOX_STATUS == 'true'){
$css_class = '';
if(JQZOOM_STATUS == 'true')
$css_class = 'jqzoomAdditional';
if(JQLIGHTBOX_STATUS == 'true')
$css_class .= ' jqlightbox';
$css_class = trim($css_class);
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . '<a href="'. zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_MAX_WIDTH, LARGE_IMAGE_MAX_HEIGHT) . '" class="'.$css_class.'">' . $thumb_slashes . '</a>\')'. "\n" . '//--></script>';
}
else
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
// eof jqzoom + jqlightbox
$noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br /><span class="imgLinkAdditional">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' : $thumb_regular ) . '</noscript>';
// $alternate_link = '<a href="' . $products_image_large . '" onclick="javascript:popupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';
$link = $script_link . "\n " . $noscript_link;
// $link = $alternate_link;
// List Box array generation:
$list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => "\n " . $link);
$col ++;
if ($col > (IMAGES_AUTO_ADDED -1)) {
$col = 0;
$row ++;
}
} // end for loop
} // endif
main_product_image
<?php
/**
* main_product_image module
*
* @package templateSystem
* @copyright Copyright 2003-2006 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: main_product_image.php 4663 2006-10-02 04:08:32Z drbyte $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$products_image_extension = substr($products_image, strrpos($products_image, '.'));
$products_image_base = ereg_replace($products_image_extension . '$', '', $products_image);
$products_image_medium = DIR_WS_IMAGES . 'medium/' . $products_image_base . IMAGE_SUFFIX_MEDIUM . $products_image_extension;
$products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension;
/*
echo
'Base ' . $products_image_base . ' - ' . $products_image_extension . '<br>' .
'Medium ' . $products_image_medium . '<br><br>' .
'Large ' . $products_image_large . '<br><br>';
*/
// to be built into a single variable string
:bigups:
New Zenner
gsdcypher:
you can see jquery lightbox in action here:
http://tiny.cc/VMMxNthanks.
what did you use for image rotator? looks very nice.
Totally Zenned
thank you, but since this is OT for this thread i'll be brief - slide show.
New Zenner
Hi All
I spent my Easter sunday to correct a bug in my test site !
It concern either the fisrt or last jqlightbox :
And it works on your sites, not on mine ! In mine, you click and go to the site index... Really good to loose a customer
The great difference : my element.style has not the display:none
<a id="lightbox-nav-btnPrev" href="#" style="background: transparent url(images/lightbox-blank.gif) no-repeat scroll 0% 0%; height: 295px;
and
New Zenner
Love this module. Works Perfectly!
In my current out-of-the-box configuration the lightbox function is only called on the image on the individual product page.
Is there a way to add a lightbox link to the thumbnail images that show in the product listing pages as well? I am running ZC v1.3.8
Tell staff why this post should be reviewed.