Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Location
    The great midwest... Well, okay, it's not so great, but I'm stuck here!
    Posts
    217
    Plugin Contributions
    0

    help question Problem integrating additional image titles addon and commercial addon

    I am trying to get text centered below my additional product images giving information as to what color of clothing I'm using. I am using Image Handler 2 to insert images and Magic Zoom to swap my images. I found a module called additional image titles, however, it is written to go in additional_images.php of the original file using image handler. Magic Zoom uses different code for additional_images.php and when I put in the new code from the module it will not work.

    I think it has to do with different variable names. I have worked on this for days and can't get it to work. The code I am trying to add is:


    // additional image titles
    $add_img_constant = 'ADDIMG_' . strtoupper(str_replace(array('/','\\','.','-'),'_',substr_replace($base_image,'',0,7)));// if any other characters beside /\.- could be used in filepath, add them to array
    if (defined($add_img_constant)) {//add text above or below images
    $link = (ADDIMG_TEXT_TOP)? '<h4 class="addImgTitle">' . constant($add_img_constant) . '</h4>' . $link: $link . '<h4 class="addImgTitle">' . constant($add_img_constant) . '</h4>';
    }
    // /additional image titles



    You Set this up in the library

    In /includes/languages/english/extra_definitions/additional_image_titles_defines.php, define constants as shown.

    define ('ADDIMG_TEXT_TOP',true);//change to false to put text below images
    define ('ADDIMG_RINGS_RING23_01_JPG','Additional View #1'); //example title for /images/rings/ring23_01.jpg
    define ('ADDIMG_HOE_SIDE_JPG','Side View'); //example title for /images/hoe_side.jpg




    My Magiczoom code before I try and modify is:

    <?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 Zoom enabled
    if (ZEN_MAGICZOOM_STATUS == 'true') {

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

    $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 Zoom then default template will be loaded
    require_once(dirname(dirname(__FILE__)) . "/" . basename(__FILE__));
    }
    ?>

    Can anyone please help, not sure what to do.
    I DID IT, I actually built a working cart, with the help of so many of you, Stevesh, Schoolboy, RescoCCC, to name a few. I just take one bite out of the elephant at a time and try to keep my sense of humor...

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,612
    Plugin Contributions
    123

    Default Re: Problem integrating additional image titles addon and commercial addon

    You should really be talking with the Magic Zoom people.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Jun 2010
    Location
    The great midwest... Well, okay, it's not so great, but I'm stuck here!
    Posts
    217
    Plugin Contributions
    0

    Default Re: Problem integrating additional image titles addon and commercial addon

    Registration on the Magic Zoom Plus forum has been disabled, so I'm unable to ask for help on that board.
    I DID IT, I actually built a working cart, with the help of so many of you, Stevesh, Schoolboy, RescoCCC, to name a few. I just take one bite out of the elephant at a time and try to keep my sense of humor...

  4. #4
    Join Date
    Jan 2009
    Posts
    33
    Plugin Contributions
    0

    Default Re: Problem integrating additional image titles addon and commercial addon

    Use the contact form. http://www.magictoolbox.com/contact/ They are very helpful.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 12 Jan 2016, 02:56 AM
  2. Integrating Nochex addon ( noob attempting)
    By rosieb in forum Addon Payment Modules
    Replies: 3
    Last Post: 2 Sep 2011, 09:49 PM
  3. Additional Customers Fields Addon SQL problem
    By Dasha in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 12 Sep 2008, 05:41 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