KJ666 Posted March 30, 2010 Posted March 30, 2010 I would like to know how to resize the image on the product info page ?? BUT not via the admin as that changes the pics on the home page and the cats. I found the code any ideas ?? echo '<a rel="image_group" title="'.$title.'" href="' . ($m_source ? $m_source : DIR_WS_IMAGES . $product_info['products_image']) . '" alt="' . $product_info['products_name'] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"', false, 5) . '<br /></a>'; Take it where small image width and height is but not sure how to right it as pixels ??? I did think of editting the name to like PRODUCT_IMAGE_HEIGHT and running it in mysql to get it on the admin page with the rest but not sure how to do it. EDIT: would this work ?? INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Product Image Height', 'PRODUCT_IMAGE_HEIGHT', '30', 'Image height for product thumbnails', 4, 30, NULL, now(), '', ''); And INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('Product Image Width', 'PRODUCT_IMAGE_WIDTH', '30', 'Image width for product thumbnail', 4, 31, NULL, now(), '', '');
germ Posted March 30, 2010 Posted March 30, 2010 One way: if ( $image_size = @getimagesize( DIR_WS_IMAGES . $product_info['products_image'] ) ) { $scale = 1.0; // alter scale factor to suit your needs $width = (int)($image_size[0] * $scale); $height = (int)($image_size[1] * $scale); } else { $width = SMALL_IMAGE_WIDTH; $height = SMALL_IMAGE_HEIGHT; } echo '<a rel="image_group" title="'.$title.'" href="' . ($m_source ? $m_source : DIR_WS_IMAGES . $product_info['products_image']) . '" alt="' . $product_info['products_name'] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], $width, $height, 'hspace="5" vspace="5"', false, 5) . '<br /></a>'; If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
jhworld Posted March 30, 2010 Posted March 30, 2010 I asked this question 2wice earlier and no one said a word... WoW
germ Posted March 30, 2010 Posted March 30, 2010 I asked this question 2wice earlier and no one said a word... WoW He posted code for me to work with. As far as I can tell, you haven't. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
jhworld Posted March 30, 2010 Posted March 30, 2010 If I don't know where to start, how can I possibly post a code... I don't even know which file to open to find the image file attributes... That's my biggest question, where, aside from that, how. Some of us are not professionals.
germ Posted March 30, 2010 Posted March 30, 2010 If I don't know where to start, how can I possibly post a code... I don't even know which file to open to find the image file attributes... That's my biggest question, where, aside from that, how. Some of us are not professionals. And some of us don't have crystal balls to see what isn't in plain sight. You have posted no links to your site (and I gather that won't happen until hell freezes over). I don;t know if you have standard osC code or a monster template some script kiddie dropout coded. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Recommended Posts
Archived
This topic is now archived and is closed to further replies.