thejudge99 Posted May 1, 2013 Share Posted May 1, 2013 try this new function in html_output.php // New HTML image wrapper function modified for KISS Image Thumbnailer by FWR Media function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') { // If width and height are not numeric then we can't do anything with it $imageg = @getimagesize($src); // Check the input variables and decide what to do: if($width > $imageg[0] && $height > $imageg[1]){ $image = '<img src="' . tep_output_string($src) . '" alt="' . tep_output_string($alt) . '"'; if (tep_not_null($alt)) { $image .= ' title=" ' . tep_output_string($alt) . ' "'; } $image .= ' '.$imageg[3]; if (tep_not_null($parameters)) $image .= ' ' . $parameters; $image .= ' />'; return $image; }else{ if ( !is_numeric ( $width ) || !is_numeric ( $height ) ) return tep_image_legacy( $src, $alt, $width, $height, $parameters ); require_once DIR_WS_MODULES . 'kiss_image_thumbnailer/classes/Image_Helper.php'; $attributes = array( 'alt' => $alt, 'width' => $width, 'height' => $height ); $image = new Image_Helper( array( 'src' => $src, 'attributes' => $attributes, 'parameters' => $parameters, 'default_missing_image' => DIR_WS_IMAGES . 'no_image_available_150_150.gif', 'isXhtml' => true, 'thumbs_dir_path' => DIR_WS_MODULES . 'kiss_image_thumbnailer/thumbs/', 'thumb_quality' => 75, 'thumb_background_rgb' => array( 'red' => 255, 'green' => 255, 'blue' => 255 ) ) ); if ( false === $image_assembled = $image->assemble() ) { return tep_image_legacy( $src, $alt, $width, $height, $parameters ); } return $image_assembled; } } // end function it checks first the Image dimensions with the original - if both width and height are bigger - it will instead just link the original Image Quote Link to comment Share on other sites More sharing options...
vourlismenos Posted May 8, 2013 Share Posted May 8, 2013 @@14steve14 unfortunately I have to be able to cope with two different dimensions. It's just not possible to rely only on one, and it will also save a lot of time later on, because we won't have to edit the images. @@thejudge99 this could be it. I'll try it and get back to you. Thanks Quote Link to comment Share on other sites More sharing options...
DANMAC Posted May 8, 2013 Share Posted May 8, 2013 Hello If the images are not in the default folder "images" but in "images/products" will I need to change any code in KissIT Thumbnailer? Thank You Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted May 9, 2013 Share Posted May 9, 2013 the Location of all Images along with whatever dimensions are passed to the function - so no that shouldnt matter Quote Link to comment Share on other sites More sharing options...
DANMAC Posted May 10, 2013 Share Posted May 10, 2013 @@thejudge99 Thank You Julian! Quote Link to comment Share on other sites More sharing options...
tgely Posted May 17, 2013 Share Posted May 17, 2013 Hi, maybe this function would be usefull for reset or clean thumbs cache at admin -> Configure -> Images Run in phpMyadmin (mySql): 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 ('Reset thumbs', 'RESET_IMAGE_THUMBS', 'false', 'Reset thumbs cache', 4, 9, '2013-02-20 19:36:26', '2013-01-29 17:11:10', 'tep_cfg_reset_thumbs_cache', 'tep_cfg_select_option(array(''reset'', ''false''),'); add this hard coded function into admin/includes/functions/general.php function tep_cfg_reset_thumbs_cache( $action = 'false' ) { if ($action == 'reset' ) { $mask = "../includes/modules/kiss_image_thumbnailer/thumbs/*.jpg"; array_map( "unlink", glob( $mask ) ); $mask = "../includes/modules/kiss_image_thumbnailer/thumbs/*.gif"; array_map( "unlink", glob( $mask ) ); $mask = "../includes/modules/kiss_image_thumbnailer/thumbs/*.png"; array_map( "unlink", glob( $mask ) ); tep_db_query( "UPDATE " . TABLE_CONFIGURATION . " SET configuration_value='false' WHERE configuration_key='RESET_IMAGE_THUMBS'" ); } } ;) Regards, Gergely Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
vourlismenos Posted May 22, 2013 Share Posted May 22, 2013 It seems that I had missed the extra part in the installation about the product_info file for oscommerce 2.3.x Sorry for wasting your time, and thank you for wasting it :) Quote Link to comment Share on other sites More sharing options...
newburns Posted May 22, 2013 Share Posted May 22, 2013 @@FWR Media Can you confirm @@Gergely suggested cache fix. I woudl like to implement this with the support of the creator of this addon. Would this be included in the next update of this addon? Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted May 22, 2013 Author Share Posted May 22, 2013 Hi, maybe this function would be usefull for reset or clean thumbs cache at admin -> Configure -> Images Yes there really should be a way to clear the thumbs via admin. 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. Link to comment Share on other sites More sharing options...
vampirehunter Posted May 27, 2013 Share Posted May 27, 2013 (edited) once this is installed, does it automatically update any existing images already uploaded for products? ie, the existing default products that are in the fresh install, or would it start working from when you upload your pictures after installation? also, does this alter the existing layout for product info and its images? not sure whether i need another plugin to create a nice layout for the images. im thinking of something like this? big picture and small pictures on right. http://www.shoprevolution.com/fred-perry-silk-tie-belt/ thanks Edited May 27, 2013 by vampirehunter Quote Link to comment Share on other sites More sharing options...
♥altoid Posted May 28, 2013 Share Posted May 28, 2013 once this is installed, does it automatically update any existing images already uploaded for products? ie, the existing default products that are in the fresh install, or would it start working from when you upload your pictures after installation? As they are being viewed. Meaning right after install take a look at the thumbs folder and it's probably empty, then go view one of your products and revisit the thumbs folder, you'll see the thumbs have been generated for that products images. This occurs for existing images and future uploaded images. also, does this alter the existing layout for product info and its images? Same layout, just thumbed. Quote I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can. I remember what it was like when I first started with osC. It can be overwhelming. However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc. There are several good pros here on osCommerce. Look around, you'll figure out who they are. Link to comment Share on other sites More sharing options...
vampirehunter Posted May 28, 2013 Share Posted May 28, 2013 (edited) thanks would any of you guys have any tips on what to do to modify the default image gallery layout to something like this? im trying to find any tutorials /guidelines for css/html that can help achieve this layout. kind of like the smaller thumbnails can be scrolled across or something similar? this site the thumbnails are going left to right, and you can scroll across. http://www.truffleshuffle.co.uk/store/mens-black-superman-vision-tshirt-p-11832.html this site, thumbnail are on the right hand side of the main picture, and go downwards. http://www.shoprevolution.com/chicken-or-egg-shopper/ I guess the scrolling option would be better as some products might need many multiple images. If i can sort out the layout like the ones above, it would be great in conjunction with this plugin. Edited May 28, 2013 by vampirehunter Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted May 30, 2013 Share Posted May 30, 2013 @@FWR Media Hi Robert, thank you very much for this wonderful contribution. I'm testing this now in my new 2.3 store and noticed a small issue. This may be me... and not your contribution.... When the length of my image file names is... for example canon_digital_ixus_800_is_1.png... it not display on the product listing (I have not yet installed in the product info). When I shorten file name to MODEL01.png for example, this image displays fine... Is there a functions in one of your files that can be changed to allow for a longer file name? Also when the image is not displayed because of this issue there is not "no image available" image in its place. Just blank... Thank you very much in advance... Quote Link to comment Share on other sites More sharing options...
vampirehunter Posted May 31, 2013 Share Posted May 31, 2013 (edited) hi, i installed the plugin, works perfect! For the main images (the full size ones in the image folder) i was wondering, is there any way to have the actual Main full size images renamed when uploaded to something more random or specific for each product? for example, if my file name is picture1.jpg whats the best way to change it so that when it uploads, it will be given a more appropriate or maybe random name according to the product id its being uploaded for? Edited May 31, 2013 by vampirehunter Quote Link to comment Share on other sites More sharing options...
tgely Posted June 6, 2013 Share Posted June 6, 2013 Hi Robert, somehow found this: if ( false !== $parameters ) $this->html .= ' ' . tep_output_string( $parameters ); changed to: if ( false !== $parameters ) $this->_html .= ' ' . tep_output_string( $parameters ); Regards Gergely Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
vampirehunter Posted June 6, 2013 Share Posted June 6, 2013 Hi Robert, somehow found this: if ( false !== $parameters ) $this->html .= ' ' . tep_output_string( $parameters ); changed to: if ( false !== $parameters ) $this->_html .= ' ' . tep_output_string( $parameters ); Regards Gergely is this a fix for something? Quote Link to comment Share on other sites More sharing options...
tgely Posted June 6, 2013 Share Posted June 6, 2013 (edited) is this a fix for something? Dear @@vampirehunter, yes it is. This slide out given parameters to "_html" string and not throwing errors. The "html" is not exist in the class. (Image_Helper.php) Edited June 6, 2013 by Gergely given file association Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
vampirehunter Posted June 13, 2013 Share Posted June 13, 2013 Dear @@vampirehunter, yes it is. This slide out given parameters to "_html" string and not throwing errors. The "html" is not exist in the class. (Image_Helper.php) so is _html the correct one or just html? i looked at mine, and its _html. should i change it? Quote Link to comment Share on other sites More sharing options...
vampirehunter Posted June 13, 2013 Share Posted June 13, 2013 (edited) how do i make sure that if item has no image, that i can show the "no image available" thumbnail in the shopping cart? as of now, if items have image, they show, but if no image, then just get the product name. Edited June 13, 2013 by vampirehunter Quote Link to comment Share on other sites More sharing options...
vampirehunter Posted June 13, 2013 Share Posted June 13, 2013 what i meant was in the shopping cart, if my product has no image, no image shows, just product name. i was wondering how i can implement the no image thumbnail into the shopping cart so it will show? Quote Link to comment Share on other sites More sharing options...
vampirehunter Posted June 13, 2013 Share Posted June 13, 2013 (edited) i find this code for functions/html_output.php seems to work but is this the proper way of doing it in conjunction with the kissit thumbnailer? if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) { $src=DIR_WS_IMAGES.'noimage.gif'; } //for what`s the url like :'images/aa/' if(!file_exists($src)||strlen(strstr($src,"."))<=0){ $src=DIR_WS_IMAGES.'noimage.gif'; } Edited June 13, 2013 by vampirehunter Quote Link to comment Share on other sites More sharing options...
vampirehunter Posted June 19, 2013 Share Posted June 19, 2013 Dear @@vampirehunter, yes it is. This slide out given parameters to "_html" string and not throwing errors. The "html" is not exist in the class. (Image_Helper.php) Hi when i checked my file, the change was already done. which version are you using?? is _html the correct one or just html? thanks Quote Link to comment Share on other sites More sharing options...
tgely Posted June 21, 2013 Share Posted June 21, 2013 which version are you using?? I think this was an older... You could see some new features here Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
discxpress Posted July 15, 2013 Share Posted July 15, 2013 (edited) Hello @@FWR Media I just installed this mod and it works great. Except on the index page where broken images are displayed. Please tell me what settings in admin I need to check or any code in the index page. I use OSC 2.3.3 Thanks Edited July 15, 2013 by discxpress Quote Link to comment Share on other sites More sharing options...
vampirehunter Posted July 19, 2013 Share Posted July 19, 2013 (edited) does anyone have any tips on displaying a custom image when a product has no images uploaded? specifically for the product info page. I've managed to get a "no image" displayed on the product listings page and the shopping cart page, but not the product info page. if a product has no images, then on the product info page, nothing is shown. Edited July 19, 2013 by vampirehunter Quote Link to comment Share on other sites More sharing options...
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.