Guest Posted December 6, 2007 Posted December 6, 2007 In order to avoid complicated installations to improve the quality of the thumbnails, I'd like to do the following: Via Admin I will provide the shop with a proper thumbnail (produced in Photoshop). In my case it is stored in the directory 'images'. After that I FTP new BIG images - which are shown in the popup window - which are gonig to be stored in a separate directory 'images_big'. At the bottom of popup_image.php there are the following lines of code: ================================================================== // // <body onload="resize();"> <?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?> </body> </html> ================================================================== I presume that '$products['products_image']' holds the path to the thumbnail image (i.e.: 'images/book03.jpg'). I need to change that path into 'images_big/book03.jpg'. So a little bit of string manipulation here :-" How do i do that in PHP? Anyone? Thanks, Frans Quote
satish Posted December 6, 2007 Posted December 6, 2007 In order to avoid complicated installations to improve the quality of the thumbnails, I'd like to do the following: Via Admin I will provide the shop with a proper thumbnail (produced in Photoshop). In my case it is stored in the directory 'images'. After that I FTP new BIG images - which are shown in the popup window - which are gonig to be stored in a separate directory 'images_big'. At the bottom of popup_image.php there are the following lines of code: ================================================================== // // <body onload="resize();"> <?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?> </body> </html> ================================================================== I presume that '$products['products_image']' holds the path to the thumbnail image (i.e.: 'images/book03.jpg'). I need to change that path into 'images_big/book03.jpg'. So a little bit of string manipulation here :-" How do i do that in PHP? Anyone? Thanks, Frans <?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?> in this DIR_WS_IMAGES is responsible for directory/folder naming hard code this value to what YOu want. Satish Quote Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
♥FWR Media Posted December 6, 2007 Posted December 6, 2007 <?php echo tep_image('images_big/' . $products['products_image'], $products['products_name']); ?> Assuming the image has exactly the same name Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted December 6, 2007 Posted December 6, 2007 <?php echo tep_image('images_big/' . $products['products_image'], $products['products_name']); ?> Assuming the image has exactly the same name Your assumption is correct! Otherwise it wouldn't work I'm afraid. Does '$products['products_image'] hold just the image's name ("book03.jpg") or the complete (relative) path? ("images/book03.jpg"). If this is the case I will have to do some string manipulation to replace the dir 'images' with 'images_big'. (I've not a clue how that works in PHP.) Any idea? Frans Quote
♥FWR Media Posted December 6, 2007 Posted December 6, 2007 (edited) Well what's your directory structure then? is images_big folder INSIDE the images folder or is it catalog/images_big? Or to ask a different way WHERE is your images_big folder located? Edited December 6, 2007 by Babygurgles Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted December 6, 2007 Posted December 6, 2007 Well what's your directory structure then? is images_big folder INSIDE the images folder or is it catalog/images_big? Or to ask a different way WHERE is your images_big folder located? I changed my directory structure accordingly. Now the small images are in 'images', the big ones in 'images_big'. Just by replacing the small code in the popup_image.php - as you suggested - did the trick. Thanks very much !! (I've learned some PHP on the fly as well :thumbsup: ) Quote
♥FWR Media Posted December 6, 2007 Posted December 6, 2007 Thanks very much !!(I've learned some PHP on the fly as well :thumbsup: ) My pleasure Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.