Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24
  1. #21
    Join Date
    Feb 2011
    Posts
    63
    Plugin Contributions
    0

    Default Re: Additional image doesn't work

    Hi

    I am having the same trouble I have found that if i switch back to the classic template then the additional images can be viewed but on the new template they dont I can see by the posts that the additional_images.php file could be different and to copy the original one and place over the new one I am a little wary of doing this as the the site i am doing has been done by someone else and passed to me to finish so there are some items on this I am unsure of is there any other way of getting the images to display ?

    the site is www.happiechappie.com (adult site)

    thanks in advance for any help
    Macbain

  2. #22
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Additional image doesn't work

    Quote Originally Posted by macbain View Post
    is there any other way of getting the images to display ?
    You've confirmed that there is not a problem with the core Zen Cart code, the problem is with the template that somebody else has done for you.

    Though I can understand why you'd be nervous about messing with code that somebody else did, the only logical place to fix it is where it's broken.

    Trying to find a way to fix it that avoids that area is rather like asking how to fix a car that's broken down without opening the hood. I'm afraid it can't be done. You, or somebody with access to your site's file, is going to have to roll up their sleeves and get their hands dirty.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #23
    Join Date
    Feb 2011
    Posts
    63
    Plugin Contributions
    0

    Default Re: Additional image doesn't work

    Yeah I kinda knew I would have too just not sure what to change

    this is a copy of the new template addtional_images.php
    #
    <?php
    #
    /**
    #
    * (C) CopyRight 2008 MagicToolBox - www.magictoolbox.com - [email protected]
    #
    */
    #

    #
    /*
    #
    image/
    #
    .....
    #
    subdir/
    #
    ......
    #
    imageName.extension - base
    #
    imageName**.extension - additional
    #
    large/imageName**_LRG.extension - large images
    #
    medium/imageName**_MED.extension - medium images
    #

    #
    MagicToolbox use only large images. All thumbnails will be dinamicaly created
    #
    */
    #
    if (!defined('IS_ADMIN_FLAG')) die('Illegal Access');
    #

    #
    // if Magic Slideshow enabled
    #
    if (ZEN_MAGICSLIDESHOW_STATUS == 'true') {
    #

    #
    //load module
    #
    require_once(DIR_FS_CATALOG . DIR_WS_MODULES . 'magictoolbox/magictoolbox_addons.php');
    #
    $mod = & magictoolboxLoadModule('MagicSlideshow');
    #

    #
    $images = array();
    #

    #
    if(!isset($GLOBALS['magictoolbox']['images'])) {
    #
    // we can load additional images only if base image present
    #
    if (!empty($products_image)) {
    #
    $info = pathinfo($products_image);
    #
    if(intval(phpversion()) < 5 || !isset($info["filename"])) {
    #
    $info["filename"] = basename($info["basename"], ".".$info["extension"]);
    #
    }
    #
    if($info["dirname"] == '.') $info["dirname"] = '';
    #
    if(!empty($info["dirname"])) $info["dirname"] .= '/';
    #
    $images = glob(DIR_FS_CATALOG . DIR_WS_IMAGES . $info["dirname"] . $info["filename"] . '*.' . $info["extension"]);
    #
    // found only original image
    #
    //if (count($images) == 1) $images = array();
    #
    // sort images
    #
    if (count($images) > 0) {
    #
    sort($images);
    #
    $_images = array();
    #
    foreach($images as $img) {
    #
    if($img == DIR_FS_CATALOG . DIR_WS_IMAGES . $info["dirname"] . $info["filename"] . '.' . $info["extension"]) {
    #
    $main = true;
    #
    } else {
    #
    $main = false;
    #
    }
    #
    $img = str_replace(DIR_FS_CATALOG . DIR_WS_IMAGES, '', $img);
    #

    #
    $info = pathinfo($img);
    #
    if(intval(phpversion()) < 5 || !isset($info["filename"])) {
    #
    $info["filename"] = basename($info["basename"], ".".$info["extension"]);
    #
    }
    #
    if($info["dirname"] == '.') $info["dirname"] = '';
    #
    if(!empty($info["dirname"])) $info["dirname"] .= '/';
    #
    $lrg = 'large/' . $info['dirname'] . $info['filename'] . IMAGE_SUFFIX_LARGE .'.'. $info['extension'];
    #
    if(!file_exists(DIR_FS_CATALOG . DIR_WS_IMAGES . $lrg)) $lrg = $img;
    #
    $_images[] = array(
    #
    'main' => $main,
    #
    'img' => DIR_WS_CATALOG . magictoolboxGetThumb($lrg, 'original', $mod->params),
    #
    'medium' => DIR_WS_CATALOG . magictoolboxGetThumb($lrg, 'thumb', $mod->params),
    #
    'thumb' => DIR_WS_CATALOG . magictoolboxGetThumb($lrg, 'selector', $mod->params)
    #
    );
    #
    }
    #
    $GLOBALS['magictoolbox']['images'] = $images = $_images;
    #
    }
    #
    }
    #
    } else {
    #
    $images = $GLOBALS['magictoolbox']['images'];
    #
    }
    #

    #
    if($mod->type == 'standard') {
    #
    $list_box_contents = array();
    #
    $title = '';
    #
    $c = count($images);
    #

    #
    if ($c > 1) {
    #
    $row = $col = 0;
    #
    if ($c < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0 ) {
    #
    $col_width = floor(100/$c);
    #
    } else {
    #
    $col_width = floor(100/IMAGES_AUTO_ADDED);
    #
    }
    #

    #
    foreach($images as $image) {
    #

    #
    $img = $image['img'];
    #
    $medium = $image['medium'];
    #
    $thumb = $image['thumb'];
    #
    $id = 'MainImage';
    #

    #
    $link = $mod->subTemplate(compact("img","thumb","medium","id"));
    #

    #
    // 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 ++;
    #
    }
    #
    }
    #
    }
    #
    $num_images = $c;
    #
    }
    #
    } else {
    #
    //if disabled Magic Slideshow then default template will be loaded
    #
    require_once(dirname(dirname(__FILE__)) . "/" . basename(__FILE__));
    #
    }
    #
    ?>
    which as you can see includes a magic show !!!

    This is a copy of the original additional_images.php file
    #
    <?php
    #
    /**
    #
    * additional_images module
    #
    *
    #
    * Prepares list of additional product images to be displayed in template
    #
    *
    #
    * @package templateSystem
    #
    * @copyright Copyright 2003-2010 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 16913 2010-07-16 03:38:06Z ajeh $
    #
    */
    #
    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_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 = 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);
    #
    $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:
    #
    $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascriptopupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
    #

    #
    $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="javascriptopupWindow(\''. $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

    Dont know a hugh amount about php files and how to amend them any help would be hugely appreciated

    thanks again for you swift reply
    Macbain

  4. #24
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Additional image doesn't work

    Based on the 'additional_images.php' file you provided, it would seem there has been a module installed called 'magictoolbox' or magicslideshow'. You should be able to access its controls using:

    Admin > Configuration
    or
    Admin > Tools

    Look at the bottom of either list to find the module. You want to confirm it is set for OFF.

    If it is set for OFF and problem solved then you know the problem is with that module. No matter what though, It is a module that was purchased and you will need to contact the module creator directly for Support.

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Image Handler Doesn't Work With Opera Browser ?
    By Mal2869 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 16 Mar 2009, 12:11 AM
  2. Image Handler 2 doesn't work for my zencart 1.38a
    By bluesky2008 in forum All Other Contributions/Addons
    Replies: 16
    Last Post: 19 Aug 2008, 10:22 AM
  3. Securing Image folder doesn't work right...
    By Karina_L in forum General Questions
    Replies: 2
    Last Post: 9 Oct 2006, 10:16 PM
  4. custom image popup script only work for main image, not for additional images
    By gems14k in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 4 Oct 2006, 05:19 AM

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