Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Custom image mouse over

    Hello everyone,

    I need help calling on a products image to use in a javascript command line. This is what I have so far. Let me know what I need to do

    Code:
    <?php
      if (zen_not_null($products_image)) {
      ?>
    <?php
    /**
     * display the main product image
     */
       require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
    <?php
      }
    ?>
    I will have to insert into this code snippet:

    Code:
    showtrail(imagename,title,oriwidth,oriheight,zoomimgwidth,zoomimgheight, image, startx, starty, startw, starth)
    And this is what I have so far total:

    Code:
    showtrail(<?php
      if (zen_not_null($products_image)) {
      ?>
    <?php
    /**
     * display the main product image
     */
       require($template->get_template_dir('rollover/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
    <?php
      }
    ?>,
    <?php echo $products_name; ?>,100,80,200,200,this,0,0,100,80)
    I am not a php programmer.... so on a scale of 1 to 10 ... how bad did I butcher this.
    I am about to try this but i am making this post now because I am pretty confident that this will not work.

    -Avel-

    ps.. the bolded rollover word is the directory where i have the new size image stored.

    this is basically how it will work. when someone rools over an image the script will kick in and pull the image url and then call for the larger image from the rollover directory with the same image name and will also call for the product title name.
    User of zencart

  2. #2
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Re: Custom image mouse over

    I tried to find were to add the code but have been unsuccessful so far. I want directly in the php that call the and write out the html for the product listing when in the view all or featured products sections of zencart.

    Can anyone shed a little light where to look.
    User of zencart

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Custom image mouse over

    Can anyone shed a little light where to look.
    You can look at how other mods address this and while not specifically what you are doing you will probably find some leads that will help guide you.
    I believe that most use a bit of js to implement but look at the PopUp on Attribute Images, Swap Images via MouseOver or Click and Zen Lightbox modules in the downloads/other section
    Zen-Venom Get Bitten

  4. #4
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Re: Custom image mouse over

    ok i think i know where i need to put the code needed to make the image mouseover work:

    Code:
    showtrail(<?php
      if (zen_not_null($products_image)) {
      ?>
    <?php
    /**
     * display the main product image
     */
       require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
    <?php
      }
    ?>,
    <?php echo $products_name; ?>,100,80,200,200,this,0,0,100,80)
    I think that is right... the code above is supposed to call the following string to pass to the js file:

    Code:
    showtrail(imagename,title,oriwidth,oriheight,zoomimgwidth,zoomimgheight, image, startx, starty, startw, starth)
    I think that I have to put the top code section:

    Code:
    showtrail(<?php
      if (zen_not_null($products_image)) {
      ?>
    <?php
    /**
     * display the main product image
     */
       require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
    <?php
      }
    ?>,
    <?php echo $products_name; ?>,100,80,200,200,this,0,0,100,80)
    into here:

    Code:
    if (PRODUCT_ALL_LIST_IMAGE != '0') {
            if ($products_all->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
              $display_products_image = str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));
            } else {
              $display_products_image = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' . $products_all->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $products_all->fields['products_image'], $products_all->fields['products_name'], IMAGE_PRODUCT_ALL_LISTING_WIDTH, IMAGE_PRODUCT_ALL_LISTING_HEIGHT, INSERT HERE) . '</a>' . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));
            }
          } else {
            $display_products_image = '';
          }
    I tested it but got the following error:

    Code:
    Parse error:  syntax error, unexpected '<', expecting ')' in /home/.nightshadow/avel/batteriesinaflash.com/includes/templates/template_biaf/templates/tpl_modules_products_all_listing.php33
    any confirmation or guidance will be greatful for...

    Thank you kobra for the guidance.. actually gave me a direction on where to look which was pretty close to what i was looking at but just didnt know it.
    User of zencart

  5. #5
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Custom image mouse over

    any confirmation or guidance will be greatful for...
    How about some file names where thay came from (cart file or mod file)and approx line or code that precedes your entries
    Zen-Venom Get Bitten

  6. #6
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Re: Custom image mouse over

    Sorry about not including important information like that..

    I was working with the file:

    approx line: 32

    /includes/templates/my_template/templates/tpl_modules_products_all_listings.php

    I will have to do the code insert into other files to get the result I want(image rollovers) in that section but for now I have been doing the testing with All Products section of zencart
    User of zencart

  7. #7
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Re: Custom image mouse over

    Code:
    showtrail(<?php
      if (zen_not_null($products_image)) {
      ?>
    <?php
    /**
     * display the main product image
     */
       require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
    <?php
      }
    ?>,
    <?php echo $products_name; ?>,100,80,200,200,this,0,0,100,80)
    In the above section of code I needed to produce this javascript command with the called for parameters to auto loaded into every picture in the View All Product in Zencart
    Code:
    showtrail(imagename,title,oriwidth,oriheight,zoomimgwidth,zoomimgheight, image, startx, starty, startw, starth)
    The imagename php code I got from the file:

    includes/templates/my_template/templates/tpl_product_info_display.php

    which has the follow code that calls the image for a product when called on to be displayed:
    imagename =
    Code:
    <!--bof Main Product Image -->
    <?php
      if (zen_not_null($products_image)) {
      ?>
    <?php
    /**
     * display the main product image
     */
       require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
    <?php
      }
    ?>
    <!--eof Main Product Image-->
    I also used the same file to call the title for a product using the code:
    title =
    Code:
    <!--bof Product Name-->
    <?php echo $products_name; ?>
    <!--eof Product Name-->
    I inserted those snippets into the js command from the first code box above and I keep getting this error:

    Code:
    Parse error:  syntax error, unexpected '<', expecting ')' in /home/.nightshadow/avel/batteriesinaflash.com/includes/templates/template_biaf/templates/tpl_modules_products_all_listing.php  on line 32
    when I insert the the following file:

    approx line: 32
    /includes/templates/my_template/templates/tpl_modules_products_all_listings.php

    at the following section of code:
    Code:
    if (PRODUCT_ALL_LIST_IMAGE != '0') {
            if ($products_all->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
              $display_products_image = str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));
            } else {
              $display_products_image = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' . $products_all->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $products_all->fields['products_image'], $products_all->fields['products_name'], IMAGE_PRODUCT_ALL_LISTING_WIDTH, IMAGE_PRODUCT_ALL_LISTING_HEIGHT, INSERT HERE) . '</a>' . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));
            }
          } else {
            $display_products_image = '';
          }
    So I hope that better explains what Im trying to do so that some one can clearly understand me and help me

    Thank you in advance
    User of zencart

 

 

Similar Threads

  1. Image size on mouse over
    By Big Ben in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 7 Nov 2011, 07:25 AM
  2. Mouse over Image Handler not working
    By shaneburton in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 22 Nov 2010, 05:50 PM
  3. Mouse over event on image on listing page
    By tallberg in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Aug 2010, 02:19 AM
  4. Image on mouse over?
    By GoranCro in forum General Questions
    Replies: 9
    Last Post: 21 Oct 2009, 07:27 PM
  5. Mouse over larger image
    By Bruce1952 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 11 Sep 2008, 01:47 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