Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2007
    Posts
    18
    Plugin Contributions
    0

    Default How to call MED image info on main page? Not an IMG but the path. Help please !

    Let me begin by saying i've never touched php or javascript and am digging myself into this code trying to figure it out.

    Ive decided to put the javascript link in the common header template (i guess i should make it more specialized) but more importantly i'm editing new_products.php to insert the tag that will call the javascript for mouseover.


    problem is.. I dont know how to call path_to_med_graphic.png?

    I'm looking at other parts of the core to get an idea but it looks like they draw variables from whatever other php file is executing the little bits so i'm confused. I dont know how to climb up the code ladder.

    I just need a way to write "images/medium/xxxxxxx_MED.png" per product on the front page.

    Ideally for any small graphic, but hey i'm not gonna bite off more than i can chew. Thanks guys.

    these are nice faces
    Last edited by Yuchant; 24 Sep 2007 at 07:36 AM.

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

    Default Re: How to call MED image info on main page? Not an IMG but the path. Help please !

    I just need a way to write "images/medium/xxxxxxx_MED.png" per product on the front page.
    Besides what you explained as how you want to change the code - What is it that you are trying to do?

    May be easier to make your standard image a bit larger in the admin and use proportional images setting for others that need to be smaller.
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Sep 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: How to call MED image info on main page? Not an IMG but the path. Help please !

    I am trying to use a javascript zoom script on my small images.

    Basically I just need to know what function brings out the path to larger image.

    I'm working on includes/modules/custom/new_products.php

    I'm just editing the tag that every "new product" comes with.

    PHP Code:
      'style="position:relative" onmouseover="showtrail(\' PATH HERE (images/medium/blank_MED.png' '\',\'' $new_products->fields['products_name'] . '\',250,130,350,373,this,0,0,250,130);" onmouseout="hidetrail();"') . '</a><br />'

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: How to call MED image info on main page? Not an IMG but the path. Help please !

    Why don't you use image handler 2 mod? It does exact the same thing (and more)
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    Sep 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: How to call MED image info on main page? Not an IMG but the path. Help please !

    Quote Originally Posted by yellow1912 View Post
    Why don't you use image handler 2 mod? It does exact the same thing (and more)
    Hey thanks for the response. I dont use IH2 because my small images are not shrunken larger images. Plus, when I use IH2 and try to use my own images, it resizes my images to their same dimentions (as specified in the configs) but makes them 20 times larger in file size.

    Basically, I just want that zoom function.

    My only question is how do I get that path in there? $new_products->fields['products_image'] gives me the small image path.


    I just want 'images/medium/products_id_MED.png

  6. #6
    Join Date
    Sep 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: How to call MED image info on main page? Not an IMG but the path. Help please !

    I have no clue what i'm doing here but I put

    PHP Code:
    require(DIR_WS_MODULES zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); 
    at the beginning of "new products" template which I hope wont query it every product.

    Then I could use the naming machine but i dont know how to put values into $products_image_medium.

    Products_image_medium doesnt know what product its trying to "mediumize"

    So when I use $products_image_medium right now i get images/medium/_MED.png.

    Every example of this I see is from using zen_image($products_image_medium, $products_name ) which is not what I want.

  7. #7
    Join Date
    Sep 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: How to call MED image info on main page? Not an IMG but the path. Help please !

    Alright.
    I'm pretty excited as I managed to get SOME results from knowing nothing.

    I put this inside the WHILE
    PHP Code:
    require(DIR_WS_MODULES zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); 
    and put a value into $products_image
    PHP Code:
         $products_image $new_products->fields['products_image']; 
    but when I use that variable in $products_image_medium I get a mismatched image.

    I dont know what to think because in the very next space $new_products->fields['products_name'] is called and its CORRECT but the code right before that gives me a $new_products->fields['products_image'] of the previous product.

    Here is the code line 62 in new_products.php if anybody could point out where to define my $products_image for the medium filename changer

    PHP Code:
        'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' $new_products->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTHIMAGE_PRODUCT_NEW_HEIGHT'style="position:relative" onmouseover="showtrail(\'' .  $products_image_medium '\',\'' $new_products->fields['products_name'] . '\',250,130,350,373,this,0,0,250,130);" onmouseout="hidetrail();"') . '</a><br />') . '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' $new_products->fields['products_id']) . '">' $new_products->fields['products_name'] . '</a><br />' $products_price); 
    Again I have no programming knowledge so any help is greatly appreciated.

  8. #8
    Join Date
    Sep 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: How to call MED image info on main page? Not an IMG but the path. Help please !

    Okay fantastic!!! looks like I solved it by defining products_image before the while statement for the first item, and by moving the second definition before the require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE))

    I definitely didnt expect to be able to do that.

    Which is plenty good for me now. I guess this means I will put this code in New_products, Featured_products, products_all and everything where my small images are used?

    Please let me know if there is a better way to affect all of these templates. Thanks!

    So the end it looks like this:
    PHP Code:
    if ($num_products_count 0) {
      if (
    $num_products_count SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS == ) {
        
    $col_width floor(100/$num_products_count);
      } else {
        
    $col_width floor(100/SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS);
      }
        
    $products_image $new_products->fields['products_image'];
        
      while (!
    $new_products->EOF) {
          
    $products_image $new_products->fields['products_image'];
        require(
    DIR_WS_MODULES zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE));

        
    $products_price zen_get_products_display_price($new_products->fields['products_id']);
        
    $new_products->fields['products_name'] = zen_get_products_name($new_products->fields['products_id']);

        
    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' ' ' 'style="width:' $col_width '%;"',
        
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' $new_products->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTHIMAGE_PRODUCT_NEW_HEIGHT'style="position:relative" onmouseover="showtrail(\'' .  $products_image_medium '\',\'' $new_products->fields['products_name'] . '\',250,130,350,373,this,0,0,250,130);" onmouseout="hidetrail();"') . '</a><br />') . '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' $new_products->fields['products_id']) . '">' $new_products->fields['products_name'] . '</a><br />' $products_price); 
    Now i need to have these preloaded, however the hell you do that.

 

 

Similar Threads

  1. Replies: 4
    Last Post: 1 Oct 2010, 05:09 AM
  2. How NOT to show categories on main page but still keep the subcategories open?
    By Cindy2010 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Jun 2010, 06:24 AM
  3. Replies: 3
    Last Post: 29 Oct 2009, 05:43 PM
  4. Replies: 0
    Last Post: 15 Jan 2009, 03:48 PM

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