Zen Cart Logo
Forums / General Questions / help with zc image function

help with zc image function

Locked

Views: 613

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
5 Dec 2010, 7:17 PM
#1
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

help with zc image function

I need to add ajax zoom effect to my image .. however, i have a bit of problem doing so , due to lack of understanding zc function .

need to add additional element called longdesc to <img> tag.
this element should contain path to large image.

currently trying to add this zoom effect to product all listing .
code that needed to be modified is :

  ```php
$display_products_image = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_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) . '</a>' . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));

so i need to add $parama=longdesc = zen_images() after IMAGE_PRODUCT_ALL_LISTING_HEIGHT . but i have no idea how . tried many ways but ended up with all kinda problems. 

any information would be appreciate. 

thanks.
5 Dec 2010, 8:07 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: help with zc image function

You can add custom additional parameters by adding a 5th parameter to the zen_image() function call.
However, keep in mind that it's unwise to disclose server-side path details to visitors ... so, if your ajax script is relying on you specifying complete paths, then you're engaging in unwise coding practices as far as security is concerned.

Further, while I've not checked the w3c spec about this and I could be wrong in this thought, but isn't "longdesc" intended to be used for something of a useful meaning to the person viewing the page? Putting a "path" in there seems like it's contrary to the intent of that element's use.

6 Dec 2010, 12:02 AM
#3
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: help with zc image function

thanks ..

the idea is to have something like this ..

<img src="smallimage.jpg" longdesc="largeimage.jpg" >

I am not the author of this script but this script called fullsize and can be found pretty easy on the net and all the information regarding this is there ..

so , how can i construct that ??

6 Dec 2010, 12:22 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: help with zc image function

add a 5th parameter: ```
, 'longdesc=" . $path_to_my_image . "'

You'll have to build the right value for the $path_to_my_image variable, by writing custom code to look up the right details.
6 Dec 2010, 12:29 AM
#5
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: help with zc image function

ouch .. :unsure:
Thanks. will try to come up with something