huggettm Posted November 6, 2017 Share Posted November 6, 2017 Not sure if CC4 is discussed on here? But ill try I think I modified our thumbnails to point to actual images rather than be created based off the main image. Having recently added some new products, for the first time in years the thumbnails do not work (they are named correctly and in the correct file) Can anyone tell me what file controls where the thumbnail path is stored? Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted November 6, 2017 Share Posted November 6, 2017 I don't know but as a guess classes/gd/gd.inc.php. Quote Link to comment Share on other sites More sharing options...
huggettm Posted November 6, 2017 Author Share Posted November 6, 2017 thanks that seems to control the size of the file when it is created by cubecart, I dont understand why the thumbnails are not associated with the product though, they are in the correct folder and called thumb_ the main product images work. im wondering if it might be a mysql / mysqli error? Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 6, 2017 Share Posted November 6, 2017 Unless the code has been modified, or a plugin (such as they were for CC4) has modified things, CC3/4 assumes there is a file with the same filename as the master image, but prepended with thumb_ in the /thumbs/ sub-folder. Quote Link to comment Share on other sites More sharing options...
huggettm Posted November 7, 2017 Author Share Posted November 7, 2017 thanks Brian, its very odd, in this case it is not recognising the thumbs. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 7, 2017 Share Posted November 7, 2017 Can we have a web address to review the situation? Quote Link to comment Share on other sites More sharing options...
huggettm Posted November 8, 2017 Author Share Posted November 8, 2017 http://www.online-fancy-dress.co.uk/store/adult-fancy-dress/pirate/deluxe-pirate-beard-one-size/prod_11745.html you can see the image but the thumbnail does not work http://www.online-fancy-dress.co.uk/store/index.php?searchStr=1501&_a=viewCat&Submit=Go although the image exists: http://www.online-fancy-dress.co.uk/store/images/uploads/thumbs/thumb_1501.jpg Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 8, 2017 Share Posted November 8, 2017 In the file /includes/functions.inc.php, near line 888 (CC448), there is the function imgPath() where the $thumb argument may be true. If so, then the following code is run: if ($thumb) { //$img = "thumbs/thumb_".str_replace('thumb_', '', basename($img)); $img = "thumbs/thumb_".preg_replace('/^thumb_/', '//', basename($img), 1); } Would you say this started happening after an upgrade from a much earlier version? I disagree with the replacement string, although I am sure a lot more people would have complained if this was a real problem. Because CC3/4 is a lot more forgiving about outputting rogue content ahead of schedule, let's try this: In /includes/content/viewCat.inc.php, near line 366, find: if (file_exists($thumbRoot)) { $view_cat->assign('SRC_PROD_THUMB', $thumbRootRel); } else { $view_cat->assign('SRC_PROD_THUMB', $GLOBALS['rootRel'].'skins/'. SKIN_FOLDER . '/styleImages/thumb_nophoto.gif'); } Change to: if (file_exists($thumbRoot)) { $view_cat->assign('SRC_PROD_THUMB', $thumbRootRel); } else { echo "\n<!--\nThumbnail root path: ".$thumbRoot."\n-->\n"; $view_cat->assign('SRC_PROD_THUMB', $GLOBALS['rootRel'].'skins/'. SKIN_FOLDER . '/styleImages/thumb_nophoto.gif'); } The echo will send the image path for the thumbnail to the browser. Where it will end up in the HTML of the page, I don't know. Have your browser show you the HTML source and you should easily find it. Quote Link to comment Share on other sites More sharing options...
huggettm Posted November 8, 2017 Author Share Posted November 8, 2017 Hi Brian, No updates to CC have been made on this for a while. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 9, 2017 Share Posted November 9, 2017 Did you make the edit to the code? I don't see the extra output - not that I know this will work. Quote Link to comment Share on other sites More sharing options...
huggettm Posted November 9, 2017 Author Share Posted November 9, 2017 it messed up all the thumbnails for the popular products and stretched them so i changed it back - this is a working store Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 9, 2017 Share Posted November 9, 2017 The extra code is an HTML comment. It shouldn't have affected anything. Do this in the middle of the night. It should take all of three minutes. Quote Link to comment Share on other sites More sharing options...
huggettm Posted November 11, 2017 Author Share Posted November 11, 2017 Upgraded to CC6 instead. Thank you for trying. 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.