Zen Cart Logo
Forums / All Other Contributions/Addons / Zen Lightbox addon [Support Thread]

Zen Lightbox addon [Support Thread]

Views: 953,204

Results 2,401 to 2,420 of 3,722
28 Feb 2011, 4:52 PM
#2401
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Zen Lightbox addon [Support Thread]

niestudio:

Is it the site that is in your signature?
If so, it seems to be working properly on your "Staying in the now" page.
Can you post a link to page where you are seeing the wrong behavior?

Yep, that's the site. When I mouse over the images on this page, this page, and this page, the file path and image name are displayed in the status bar. (It actually does this for all main product images on all product pages).

I posted this same question to the IH2 support thread first because I saw another poster had the same issue and had posted there. This is the feedback I was given: > you are not using just image handler on that page you are using a lightbox mod, which overwrites image handler file for that page,

I think the very latest version of lightbox (see the support thread as i don't know if its in the downloads yet) should work out of the box with image handler
The file that sets that particular page comes with lightbox

A look at the code on the product pages reveals this around line 235:

<!--bof Main Product Image -->
 
<div id="productMainImage" class="centeredContent back">
<script language="javascript" type="text/javascript"><!--
document.write('<a href="images/PGc1.jpg" rel="lightbox-g" title="Staying in the Now"><img src="bmz_cache/c/ca8da9d479083782b2e2dad6008ef12b.image.200x200.jpg" alt="Staying in the Now" title=" Staying in the Now " width="200" height="200" /><br /><span class="imgLink">larger image</span></a>');
//--></script>
<noscript>
<a href="http://empowermentsanctuary.com/marketplace/index.php?main_page=popup_image&pID=37" target="_blank"><img src="bmz_cache/c/ca8da9d479083782b2e2dad6008ef12b.image.200x200.jpg" alt="Staying in the Now" title=" Staying in the Now " width="200" height="200" /><br /><span class="imgLink">larger image</span></a></noscript>
</div>
<!--eof Main Product Image-->

Update, a new comment on the IH2 Support Thread from DivaVocals may be the answer. Your thoughts?

Nigel is correct and in the next release (should be submitted this week - still testing the modifications) I'll make sure I add this to the readme.. The latest versions of the Zen Lightbox supports IH2 OUT THE BOX without any file merging required.. I'm at work and I can't remember which file it is off the top of my head, but there is ONE file that ZLB and IH2 have in common.. You do NOT need to merge the ZLB file with the IH2 file.. Simply REPLACE the IH2 file with the one from ZLB fileset and you should be good to go

28 Feb 2011, 5:01 PM
#2402
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

One more thing...

When I installed IH2 and Zen Lightbox 161, the only common file I found was includes/modules/custom_template/additional_images.php. At that time, I overrode the IH2 file with the ZLB file.

If I download ZLB 162 and do the same thing, will this resolve the issue, or is there another file I need to do this with?

28 Feb 2011, 5:17 PM
#2403
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

Maybe it's just best if I simply upgrade ZLB to v1.62?

28 Feb 2011, 5:19 PM
#2404
niestudio avatar

niestudio

Zen Follower

Join Date:
Nov 2009
Posts:
285
Plugin Contributions:
2

Re: Zen Lightbox addon [Support Thread]

ScriptJunkie:

Maybe it's just best if I simply upgrade ZLB to v1.62?

I dont think thats going to help you, the only changes to 1.6.2 were close on image click and always show previous and next buttons.

I'm looking at the code now, but I'm not all that familiar with IH2.
stand by…

daniel

28 Feb 2011, 5:41 PM
#2405
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

niestudio:

I dont think thats going to help you, the only changes to 1.6.2 were close on image click and always show previous and next buttons.

I'm looking at the code now, but I'm not all that familiar with IH2.
stand by…

danielOkay lemme chime in here because I am not that familiar with ZLB either:smile:.. What I do know is that it is SUPPOSED to include code which works WITH IH2 out the box (it appears that this was part of one of the improvements Alex Clarke's versions brought to the table).. What I posted on the IH2 thread was based on feedback I've received from users of BOTH mods -- users of both modules have reported that the one common file between IH2 and ZLB -- includes/modules/YOUR_TEMPLATE/additional_images.php -- should NOT be merged. They have all indicated that the ZLB version of this file shoud OVERWRITE the IH2 version of this file.

In comparison, Fual Slimbox requires the merging of the code in the common files for IH2 to work with it.. However, the issue ScriptJunkie is reporting seems to be a NON-ISSUE (see this website -- http : // www . hairisle . com/Less-Than-Perfect/Processed-Wefts/Indian-Remy-Machine-Weft-Relaxed-Texture-4-Oz. -- for an example of Fual Slimbox and IH2 working together) Whether you rightclick to view the image source or mouseover the images, the images are all being called from the IH2 bmz_cache folders for the small, medium, and large product images.

Hope all of this is useful information when researching this..:smile:

28 Feb 2011, 6:12 PM
#2406
niestudio avatar

niestudio

Zen Follower

Join Date:
Nov 2009
Posts:
285
Plugin Contributions:
2

Re: Zen Lightbox addon [Support Thread]

DivaVocals:

Okay lemme chime in here because I am not that familiar with ZLB either:smile:.. What I do know is that it is SUPPOSED to include code which works WITH IH2 out the box (it appears that this was part of one of the improvements Alex Clarke's versions brought to the table).. What I posted on the IH2 thread was based on feedback I've received from users of BOTH mods -- users of both modules have reported that the one common file between IH2 and ZLB -- includes/modules/YOUR_TEMPLATE/additional_images.php -- should NOT be merged. They have all indicated that the ZLB version of this file shoud OVERWRITE the IH2 version of this file.

In comparison, Fual Slimbox requires the merging of the code in the common files for IH2 to work with it.. However, the issue ScriptJunkie is reporting seems to be a NON-ISSUE (see this website -- http : // www . hairisle . com/Less-Than-Perfect/Processed-Wefts/Indian-Remy-Machine-Weft-Relaxed-Texture-4-Oz. -- for an example of Fual Slimbox and IH2 working together) Whether you rightclick to view the image source or mouseover the images, the images are all being called from the IH2 bmz_cache folders for the small, medium, and large product images.

Hope all of this is useful information when researching this..:smile:

Thanks DivaVocals,
I was hoping you would chime in.
I know others have said they got IH2 and ZLB working together ok, but I dont really have a need for IH2 and I dont really have time to learn it just to be able to troubleshoot the 2 working together.

ScriptJunkie, I would just suggest making sure all IH2 is installed and then ZLB installed after so that the additional_images file gets overwritten.

daniel

28 Feb 2011, 6:30 PM
#2407
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

niestudio:

ScriptJunkie, I would just suggest making sure all IH2 is installed and then ZLB installed after so that the additional_images file gets overwritten.
daniel

Already done. When I initially installed, I started by completely removing/uninstalling an older version of ZLB. I then installed IH2. After that, I installed v1.61 of ZLB and overrode the additional images file.

Then about a half hour ago, wondering if I only thought that I overrode the additional images file, I downloaded the additional images file from my server, and compared it to both the IH2 file and the ZLB file to make sure I had the ZLB file on the server and that I didn't "transpose" them during install.

All is as it should be.

I took a look at the link Diva provided (where the site is using Fual Slimbox and IH2). I see on that site that on mouseover, the bmz cache file is displayed in the status bar as the image link. Also, when the image is right clicked and copy link is selected, the URL given points to the bmz cache.

This is not the case for me. I'm wondering if it's possible to find out what's different between ZLB and FSB as it relates to this particular functionality, and then use that difference to change how ZLB behaves?

Or is it just me that ZLB is behaving this way for? Because if it's just me, I'll uninstall and reinstall both of them and see if that resolves the "issue".

28 Feb 2011, 6:46 PM
#2408
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

Gonna test tonight myself.. I was in the middle of compiling the latest IH2 updates (minor updates mostly) Ckosloff and I tested in previous IH2 releases IH2's functionality with both ZLB and FSB. I need to test the same two lightboxes with this upcoming IH2 update before I submit the new IH2 to the downloads (previously ckosloff tested ZLB, I tested FSB).. I will be reporting back my findings from this testing as well..

At first blush, it looks like ZLB only APPEARS to work with IH2.. In reality it looks like what happens is that IH2 works everywhere on your site but the product details page where the ZLB code seems to be using default Zen Cart image locations..

ScriptJunkie:

Already done. When I initially installed, I started by completely removing/uninstalling an older version of ZLB. I then installed IH2. After that, I installed v1.61 of ZLB and overrode the additional images file.

Then about a half hour ago, wondering if I only thought that I overrode the additional images file, I downloaded the additional images file from my server, and compared it to both the IH2 file and the ZLB file to make sure I had the ZLB file on the server and that I didn't "transpose" them during install.

All is as it should be.

I took a look at the link Diva provided (where the site is using Fual Slimbox and IH2). I see on that site that on mouseover, the bmz cache file is displayed in the status bar as the image link. Also, when the image is right clicked and copy link is selected, the URL given points to the bmz cache.

This is not the case for me. I'm wondering if it's possible to find out what's different between ZLB and FSB as it relates to this particular functionality, and then use that difference to change how ZLB behaves?

Or is it just me that ZLB is behaving this way for? Because if it's just me, I'll uninstall and reinstall both of them and see if that resolves the "issue".

28 Feb 2011, 6:59 PM
#2409
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

DivaVocals:

At first blush, it looks like ZLB only APPEARS to work with IH2.. In reality it looks like what happens is that IH2 works everywhere on your site but the product details page where the ZLB code seems to be using default Zen Cart image locations..

I wish we had more sites to look at, so we could see if this is unique to my site. Occasionally, my site will do some weird things. LOL must be reflective of my personality <grin>

28 Feb 2011, 7:32 PM
#2410
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

Ok...so I've ruled out that this is unique to my site. A portion of the code I posted in post 2409 can be found in this file:

includes/templates/my_custom_template/templates/tpl_modules_main_product_image.php

The code is below:

<script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="' . zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="' . $rel . '" title="' . addslashes($products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>
<?php } else { ?>
<?php // eof Zen Lightbox 2008-12-15 aclarke ?>
<script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>

It appears to be calling both the large and medium product images from the default zen cart locations instead of from the bmz cache folder (which is where images reside when IH2 is installed).

Neistudio, I know you mentioned being unfamiliar with IH2, but is this something you would know how to change? In other words, if you know how to write code, is it easy to change where the images are called from, or is IH2-specific knowledge required? (the bmz_cache folder resides at the store root).

I would do this myself and submit the changes here for the community, but I don't know how to write the code.

28 Feb 2011, 7:50 PM
#2411
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

ScriptJunkie:

I wish we had more sites to look at, so we could see if this is unique to my site. Occasionally, my site will do some weird things. LOL must be reflective of my personality <grin>:laugh::laugh: I'll let ya know what my testing reveals..

28 Feb 2011, 8:06 PM
#2412
niestudio avatar

niestudio

Zen Follower

Join Date:
Nov 2009
Posts:
285
Plugin Contributions:
2

Re: Zen Lightbox addon [Support Thread]

ScriptJunkie:

Neistudio, I know you mentioned being unfamiliar with IH2, but is this something you would know how to change? In other words, if you know how to write code, is it easy to change where the images are called from, or is IH2-specific knowledge required? (the bmz_cache folder resides at the store root).

Lets give divavocals a chance and see what he finds, and then maybe we can collaborate and get an update to ZLB if/where needed.

28 Feb 2011, 8:13 PM
#2413
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

niestudio:

Lets give divavocals a chance and see what he finds, and then maybe we can collaborate and get an update to ZLB if/where needed.

Cool :smile: In the meantime, I've isolated the code that manages this behavior in FSB (both FSB and ZLB share the main product image template file).

I'm going to take a crack at re-working it for ZLB. I'll post here what I figure out.

28 Feb 2011, 8:21 PM
#2414
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

niestudio:

Lets give divavocals a chance and see what he finds, and then maybe we can collaborate and get an update to ZLB if/where needed.and see what SHE finds:blush::laugh:

28 Feb 2011, 8:23 PM
#2415
niestudio avatar

niestudio

Zen Follower

Join Date:
Nov 2009
Posts:
285
Plugin Contributions:
2

Re: Zen Lightbox addon [Support Thread]

DivaVocals:

and see what SHE finds:blush::laugh:

:oops:
apologies, female programmers rock!

28 Feb 2011, 9:12 PM
#2416
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

niestudio:

Lets give divavocals a chance and see what he finds, and then maybe we can collaborate and get an update to ZLB if/where needed.

I have the IH2 rev 8d and ZLB1.61 ( did not know there was a 1.62

and let me tell you that I did use the file that they both share as is from I think IH2 and it would not work with LB but then I tried the one from LB totally removing the other one first and still no joy so I finally had to merge them together myself and that is how I got them both to live happily together

well then it won't let me upload it so here is the codeand we can wait to see what Diva comes up with in th try she does:

<?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();

// do not check for additional images when turned off
if ($products_image != '' && $flag_show_product_info_additional_images != 0) {
  // 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_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;
    
    //  Begin Image Handler changes 1 of 2
//  $flag_has_large = file_exists($products_image_large);
    $flag_has_large = true;//file_exists($products_image_large);
//  End Image Handler changes 1 of 2

    // bof Zen Lightbox 2008-12-11 aclarke
    if (function_exists('handle_image')) {
      $flag_has_large = true;
    } else {
    // eof Zen Lightbox 2008-12-11 aclarke
    $flag_has_large = file_exists($products_image_large);
    // bof Zen Lightbox 2008-12-11 aclarke
    }
    // eof Zen Lightbox 2008-12-11 aclarke
    $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);
    
    //  Begin Image Handler changes 2 of 2 remove additional single quotes from image attributes (important!)
    $thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes);
//  End Image Handler changes 2 of 2
    
    
    
    // bof Zen Lightbox 2008-12-11 aclarke
    if (function_exists('handle_image')) {
    // remove additional single quotes from image attributes (important!)
    $thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes);
    }
    // eof Zen Lightbox 2008-12-11 aclarke
    $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 Zen Lightbox 2008-12-11 aclarke
    if (ZEN_LIGHTBOX_STATUS == 'true') {
      if (ZEN_LIGHTBOX_GALLERY_MODE == 'true') {
        $rel = 'lightbox-g';
      } else {
        $rel = 'lightbox';
      }
    $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="' . zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="' . $rel . '" title="' . addslashes($products_name) . '">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
    } else {
    // eof Zen Lightbox 2008-12-11 aclarke
    $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>';
    // bof Zen Lightbox 2008-12-11 aclarke
    }
    // eof Zen Lightbox 2008-12-11 aclarke

    $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

?>
28 Feb 2011, 9:23 PM
#2417
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

That's interesting. The additional images file that came with my version of ZLB 161 already had those IH2 changes in them, so there was no need to merge files...simply replacing the IH2 version with the ZLB version of the file worked for me.

The issue now in my case is how ZLB interacts with the main image file. It works fine for a ZC install without IH2, but doesn't work with IH2.

I'll be taking a look at the code for that hopefully this afternoon.

28 Feb 2011, 9:47 PM
#2418
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

You were the OTHER example I was looking for.. :laugh: I knew you ran both and I checked your site.. It looks like your images are correctly being called from the bmz_cache folder.. I may need to bug you for some other things.. If you don't mind sharing, can you PM me an e-mail address.. or better yet.. I'll PM you mine..

DarkAngel:

I have the IH2 rev 8d and ZLB1.61 ( did not know there was a 1.62

and let me tell you that I did use the file that they both share as is from I think IH2 and it would not work with LB but then I tried the one from LB totally removing the other one first and still no joy so I finally had to merge them together myself and that is how I got them both to live happily together

well then it won't let me upload it so here is the codeand we can wait to see what Diva comes up with in th try she does:

<?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(); // do not check for additional images when turned off if ($products_image != '' && $flag_show_product_info_additional_images != 0) { // 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_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; // Begin Image Handler changes 1 of 2 // $flag_has_large = file_exists($products_image_large); $flag_has_large = true;//file_exists($products_image_large); // End Image Handler changes 1 of 2 // bof Zen Lightbox 2008-12-11 aclarke if (function_exists('handle_image')) { $flag_has_large = true; } else { // eof Zen Lightbox 2008-12-11 aclarke $flag_has_large = file_exists($products_image_large); // bof Zen Lightbox 2008-12-11 aclarke } // eof Zen Lightbox 2008-12-11 aclarke $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); // Begin Image Handler changes 2 of 2 remove additional single quotes from image attributes (important!) $thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes); // End Image Handler changes 2 of 2 // bof Zen Lightbox 2008-12-11 aclarke if (function_exists('handle_image')) { // remove additional single quotes from image attributes (important!) $thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes); } // eof Zen Lightbox 2008-12-11 aclarke $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 Zen Lightbox 2008-12-11 aclarke if (ZEN_LIGHTBOX_STATUS == 'true') { if (ZEN_LIGHTBOX_GALLERY_MODE == 'true') { $rel = 'lightbox-g'; } else { $rel = 'lightbox'; } $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="' . zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="' . $rel . '" title="' . addslashes($products_name) . '">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>'; } else { // eof Zen Lightbox 2008-12-11 aclarke $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>'; // bof Zen Lightbox 2008-12-11 aclarke } // eof Zen Lightbox 2008-12-11 aclarke $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 ?>
28 Feb 2011, 9:51 PM
#2419
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Zen Lightbox addon [Support Thread]

niestudio:

:oops:
apologies, female programmers rock!
No worries!!!:laugh:

I wouldn't call me a programmer exactly.. I'm more of a hunt, peck, and "let's try this" kinda girl:laugh:..

28 Feb 2011, 9:59 PM
#2420
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Zen Lightbox addon [Support Thread]

DivaVocals:

No worries!!!:laugh:

I wouldn't call me a programmer exactly.. I'm more of a hunt, peck, and "let's try this" kinda girl:laugh:..

that's me too it is a "let's try this and hope I don't kill it type of thing" but I am learning...lol

now this may seem silly but, did you make very sure that all the files are in their right spots..sometimes a left out one (i do that too often) or one that got corrupted on the way up will do things to the mods.