Page 243 of 373 FirstFirst ... 143193233241242243244245253293343 ... LastLast
Results 2,421 to 2,430 of 3726
  1. #2421

    Default Re: Zen Lightbox...

    Quote Originally Posted by niestudio View Post
    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 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.
    Go that extra mile, you never know what's at the end of the road

    Empowerment Sanctuary

  2. #2422
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Zen Lightbox...

    Quote Originally Posted by niestudio View Post
    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
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  3. #2423
    Join Date
    Nov 2009
    Posts
    285
    Plugin Contributions
    5

    Default Re: Zen Lightbox...

    Quote Originally Posted by DivaVocals View Post
    and see what SHE finds

    apologies, female programmers rock!

  4. #2424
    Join Date
    Oct 2007
    Location
    Emporia, Kansas
    Posts
    1,762
    Plugin Contributions
    0

    Default Re: Zen Lightbox...

    Quote Originally Posted by niestudio View Post
    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:

    Code:
    <?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
    
    ?>
    Last edited by DarkAngel; 28 Feb 2011 at 10:16 PM.

  5. #2425

    Default Re: Zen Lightbox...

    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.
    Go that extra mile, you never know what's at the end of the road

    Empowerment Sanctuary

  6. #2426
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Zen Lightbox...

    You were the OTHER example I was looking for.. 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..

    Quote Originally Posted by DarkAngel View Post
    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:

    Code:
    <?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
    
    ?>
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  7. #2427
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Zen Lightbox...

    Quote Originally Posted by niestudio View Post

    apologies, female programmers rock!
    No worries!!!

    I wouldn't call me a programmer exactly.. I'm more of a hunt, peck, and "let's try this" kinda girl..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  8. #2428
    Join Date
    Oct 2007
    Location
    Emporia, Kansas
    Posts
    1,762
    Plugin Contributions
    0

    Default Re: Zen Lightbox...

    Quote Originally Posted by DivaVocals View Post
    No worries!!!

    I wouldn't call me a programmer exactly.. I'm more of a hunt, peck, and "let's try this" kinda girl..
    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.

  9. #2429

    Default Re: Zen Lightbox...

    Quote Originally Posted by DarkAngel View Post
    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.
    Yep! Not silly at all...it's one of the first things I look for because I know all too well how easy it is to do <grin>
    Go that extra mile, you never know what's at the end of the road

    Empowerment Sanctuary

  10. #2430
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Zen Lightbox...

    Quote Originally Posted by DarkAngel View Post
    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.
    Well I meant that I don't write PHP code.. I actually do have a web design certificate (I am proficient with HTML/CSS), and because I do work as Senior Business Systems Analyst, my role in development projects is typically not that of a programmer/developer or DBA.. However, I have worked in the world of web based software development for long enough that I have figured a LOT out on my own.. However I am still a LONG way from calling myself a programmer..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

 

 

Similar Threads

  1. Free Shipping Rules addon [Support Thread]
    By numinix in forum Addon Shipping Modules
    Replies: 36
    Last Post: 2 Dec 2016, 01:56 PM
  2. v151 Reviews Reply addon [Support Thread]
    By mikestaps in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 17 Oct 2014, 01:29 AM
  3. Jquery Lightbox [Support thread]
    By yellow1912 in forum All Other Contributions/Addons
    Replies: 257
    Last Post: 2 Aug 2012, 10:57 PM
  4. File Upload Required addon [Support Thread]
    By 1100101 in forum All Other Contributions/Addons
    Replies: 21
    Last Post: 10 Dec 2011, 03:00 AM
  5. [Support Thread] IE only JavaScripts and Stylesheets Addon
    By Meshach in forum All Other Contributions/Addons
    Replies: 16
    Last Post: 31 May 2011, 08:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR