matta Posted October 4, 2008 Share Posted October 4, 2008 (edited) Ignore the first post, this one solution takes care of both problems... I've got this same problem on RC2a, even after implementing xispita10's mod: 1) Add a new product and choose an image. 2) When I click "Preview", the image appears fine. 3) When I click "Insert", then check the Admin page or the Product page, the image is gone. 4) Image is in the proper subfolder. Why aren't the admin and product pages finding the image? Seems the location is not being written to the database. Why? Thanks for your help OK, here's what I've determined: There are 2 issues going on with xispita10's mod: 1) The folders create names from the Category name, but replace spaces with underscores (I assume this was done to accomodate web servers that don't like spaces in filenames). So, a category name of "Bells and Whistles" becomes a folder name of "bells_and_whistles". Using $categories_name_array[$language_id] to grab the category name still includes spaces and won't resolve to the proper folder. 2) The $language_id is wrong: Previously in the admin/categories.php, the code loops through $language_id['id'] and sets the values for each language (English, German, Spanish are the 3 defaults). When it ends, it leaves $language_id as the last value (3 in this example, or Spanish). If you're lazy like me and haven't filled in any of the fields other than English, the value will be blank. So, when it tries to find $categories_name_array[$language_id] (which would be the blank Spanish value), it returns nothing, resulting in a missing directory. Solution: Replace xispita10's code: tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $categories_name_array[$language_id] . "/" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'"); With: tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_output_generated_category_path_fs($categories_id) . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'"); Any additional thoughts to make this better? Edited October 4, 2008 by matta Quote Link to comment Share on other sites More sharing options...
John_from_Oz Posted October 17, 2008 Share Posted October 17, 2008 Having problems when I go back and edit a product: Is this just me, or are others having problems? Works correctly the first time- ie when put in as a new product eg: image uploaded from my computer goes to correct location: test_category/testcat_one/skin_1.jpg If I go back and edit that product, say the description, and leave image input box blank then preview is fine, but 'update' adds the folder names to its beginning (again) test_category/testcat_one/test_category/testcat_one/skin_1.jpg If I upload the image again from my computer it goes back to correct location If I write 'none' as the image filename everything updates OK There is a test for a null field in the update function, but somehow when the field is passed to the update function, it has something in it.. the test is here: case 'updateproduct' if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) Quote Link to comment Share on other sites More sharing options...
lildog Posted October 28, 2008 Author Share Posted October 28, 2008 are you using xispas fix? lildog Quote Link to comment Share on other sites More sharing options...
John_from_Oz Posted October 28, 2008 Share Posted October 28, 2008 are you using xispas fix? lildog No, what is it? Where do I find it? - Just did a search for it, and came up with this post only... Quote Link to comment Share on other sites More sharing options...
John_from_Oz Posted October 31, 2008 Share Posted October 31, 2008 are you using xispas fix? lildog Are you refering to the post at top of page 2 by xispita10 ? Sep 17 2008, 09:21 PM I used the latest contribution, so it wasn't needed- the relevant section in my admin/categories.php reads: if ($categories_image = new upload('categories_image', $dir_to_make)) { $db_image_file_name = tep_output_generated_category_path_fs($categories_id) . $categories_image->filename; tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($db_image_file_name) . "' where categories_id = '" . (int)$categories_id . "'"); } This appears to be the area of the program where the extra path is being added at the front Seems to me we need to skip this altogether if nothing to upload? Quote Link to comment Share on other sites More sharing options...
John_from_Oz Posted October 31, 2008 Share Posted October 31, 2008 are you using xispas fix? lildog I've discovered the problem! I misunderstood the instructions in README.txt that say "(Earlier versions than oscommerce-2.2rc2a)" I thought that meant I didn't need to make those changes on my version.. When I put them in it all worked fine. Maybe the moderator can remove the earlier (useless) post? Quote Link to comment Share on other sites More sharing options...
lildog Posted October 31, 2008 Author Share Posted October 31, 2008 Yeah....that is pretty easy to miss and I don't like it but I didn't know how to package it for two versions of osc. Maybe next time I will just make two install docs to make it easier. lildog I've discovered the problem!I misunderstood the instructions in README.txt that say "(Earlier versions than oscommerce-2.2rc2a)" I thought that meant I didn't need to make those changes on my version.. When I put them in it all worked fine. Maybe the moderator can remove the earlier (useless) post? Quote Link to comment Share on other sites More sharing options...
Guest Posted December 4, 2008 Share Posted December 4, 2008 Has anyone got this too work with RCA2, if so can they post there admin/categories.php file and catimagessetup.php files please. Getting no pictures added, warning file location does not exist Quote Link to comment Share on other sites More sharing options...
devilgrins Posted January 4, 2009 Share Posted January 4, 2009 Has anyone got this too work with RCA2, if so can they post there admin/categories.php file and catimagessetup.php files please. Getting no pictures added, warning file location does not exist Probably the same problem that i am getting... lots of warning.. and then the final single warning. Please explain where this could be going wrong? Warning: mkdir() [function.mkdir]: File exists in /home/kod49616/public_html/admin/catimagessetup.php on line 152 Warning: Cannot modify header information - headers already sent by (output started at /home/kod49616/public_html/admin/catimagessetup.php:152) in /home/kod49616/public_html/admin/includes/functions/general.php on line 110 Quote Link to comment Share on other sites More sharing options...
victorianwinter Posted January 7, 2009 Share Posted January 7, 2009 It says safe mode is on..and its under admin. Does that mean I have to take the ht.password off for a moment? or put it outside of the admin folder? *newbie* Quote Link to comment Share on other sites More sharing options...
victorianwinter Posted January 7, 2009 Share Posted January 7, 2009 (edited) It says safe mode is on..and its under admin. Does that mean I have to take the ht.password off for a moment? or put it outside of the admin folder? *newbie* I re-did it correctly, making sure I did everything the readme file says, but it still says: Safe mode appears to be enabled. This script will not work. You cannot continue. *is lost* Edited January 7, 2009 by victorianwinter Quote Link to comment Share on other sites More sharing options...
thecramp Posted February 25, 2009 Share Posted February 25, 2009 hi, i french sorry for my english , i have installed it on my RC2a and make the correction and now it works. There is still the probleme with catimagessetup.php , somebody found a sulution ?? I 'd like to know do we have a solution to delete the folder when we delete a categorie ? Thanks best regards. Quote Link to comment Share on other sites More sharing options...
mghay Posted March 4, 2009 Share Posted March 4, 2009 I've got this same problem on RC2a, even after implementing xispita10's mod: 1) Add a new product and choose an image. 2) When I click "Preview", the image appears fine. 3) When I click "Insert", then check the Admin page or the Product page, the image is gone. 4) Image is in the proper subfolder. Why aren't the admin and product pages finding the image? Seems the location is not being written to the database. Why? Thanks for your help In 2.2rc2a - Categories image problem resolved by using fix as above - Products image problem resolved by using "$sql_data-array['products_image']....... . " patch in original READ_ME file marked as only for earlier versions than 2.2rc2a. All now works as advertised. Thanks to all for original and fixes. :lol: Mike Quote Link to comment Share on other sites More sharing options...
KJ666 Posted March 17, 2009 Share Posted March 17, 2009 Having problems when I go back and edit a product:Is this just me, or are others having problems? Works correctly the first time- ie when put in as a new product eg: image uploaded from my computer goes to correct location: test_category/testcat_one/skin_1.jpg If I go back and edit that product, say the description, and leave image input box blank then preview is fine, but 'update' adds the folder names to its beginning (again) test_category/testcat_one/test_category/testcat_one/skin_1.jpg If I upload the image again from my computer it goes back to correct location If I write 'none' as the image filename everything updates OK There is a test for a null field in the update function, but somehow when the field is passed to the update function, it has something in it.. the test is here: case 'updateproduct' if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) I am also getting this problem along with the other one of not showing the images but was showing in the admin area when previewed but not again ?? Used the fix still not a thing. Quote Link to comment Share on other sites More sharing options...
hakanibo Posted April 23, 2009 Share Posted April 23, 2009 hi! i have a probleme. first sorry for my english. i have ultrapic (http://addons.oscommerce.com/info/1642) I added categories and product images but only Main Image in folder. other images in catalog/images folder. How can I do together http://addons.oscommerce.com/info/2409 (categories and product images in folder) and UltraPics 2.08 (http://addons.oscommerce.com/info/1642) . Quote Link to comment Share on other sites More sharing options...
ismanmanu Posted April 26, 2009 Share Posted April 26, 2009 HI I´m Spanish, sorry for my english Move and Copy products don´t work. Yes move products but not products images paths. How can I do Thanks, thanks, thanks. Quote Link to comment Share on other sites More sharing options...
cocorico Posted June 2, 2009 Share Posted June 2, 2009 Hi, I've installed this ad-on. I want to uninstalled it now .. how do I do it? I forgot to backup my database before I installed this ad-on ... Quote Link to comment Share on other sites More sharing options...
Guest Posted June 4, 2009 Share Posted June 4, 2009 I`ve managed to follow the steps, but i don`t get the images to apear. It seems that the images should in "http://xxx.xxx/images/xxx.jpg not in the new created folder. Any ideea how to resolv this ? I olso have the more pics 1.4.3 installed and i`ve made the modifications. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2009 Share Posted June 5, 2009 OK. I`ve managed to make the photos to apear, but, the first photo is from the product folder, the other ones ar from the images folder-and not from the new product folder (as the first one). :blink: Quote Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2009 Share Posted June 6, 2009 This is a great addon, but, i don`t get it to work with more pics 1.4.3 (the classical version because it has the best design for my online travel shop). If anyone got this to addons working together well - please share a thought. I`m out of ideas. PS: i don`t understand php - but a recognize it :huh::D Quote Link to comment Share on other sites More sharing options...
Patty Posted July 13, 2009 Share Posted July 13, 2009 This could be a nice add on, but there's a couple of things that need to be fixed. I can't get it to work, it does create the directory and uploads the file, but it doesn't write the image name to the DB, hence the image shows as broken on the catalog (same problem that was mentioned earlier in this topic). If I move a category, when I edit or add a new product, there's an error saying the destination folder doesn't exist. If I recreate the category, folder is created, now problem. Can anybody help fixing these problems? I'm using RC2a by the way. Tks in advance for any help. Quote Patty Link to comment Share on other sites More sharing options...
Haitashi Posted November 18, 2009 Share Posted November 18, 2009 Installed v1.3. Everything was created successfully except that now the product images aren't showing up. I see that the links to the image aren't including the new image category folders. To those who have experienced this what did you do to fix it? THANKS! Quote If you have a serious problem but it can be solved, why worry about it? If you have a serious problem but it can't be solved, then why worry about it? Link to comment Share on other sites More sharing options...
maxemus Posted January 29, 2010 Share Posted January 29, 2010 Hello What happens if the category tree is changed. IE the name or where the category is moved. Are the images moved to the new structure? Quote Link to comment Share on other sites More sharing options...
spooks Posted January 29, 2010 Share Posted January 29, 2010 Hello What happens if the category tree is changed. IE the name or where the category is moved. Are the images moved to the new structure? I don`t believe this contrib is supported any more, perhaps your best solution is to try another. Select Product Image Directory & Instant Update For Products allows you to choose the directory for any product image &/or create new directories, the full path is stored in the dbase, so moving a product will not cause any issue. Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
tarbantinbookstore Posted April 10, 2010 Share Posted April 10, 2010 Hi, You write: ***FIND: case 'new_product_preview': // copy image only if modified $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES); if ($products_image->parse() && $products_image->save()) { ***CHANGE TO: case 'new_product_preview': // copy image only if modified $products_image = new upload('products_image'); // EOF Categories and Products Images Folder Tree $prod_path = $HTTP_GET_VARS['cPath']; $lchar = strrpos($prod_path, '_'); if ($lchar + 1 == 1) { $lachar = 0; } else { $lachar = $lchar + 1; } $prod_path_id = substr($prod_path, $lachar); $prod_folder = tep_output_generated_category_path_fs($prod_path_id); $products_image->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder); // EOF Categories and Products Images Folder Tree if ($products_image->parse() && $products_image->save()) { BUT in my categories.php written: case 'new_product_preview': // copy image only if modified if (($HTTP_POST_VARS['unlink_image'] == 'yes') or ($HTTP_POST_VARS['delete_image'] == 'yes')) { $products_image = ''; $products_image_name = ''; } else { $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES); if ($products_image->parse() && $products_image->save()) { Some text missing in your instruction. What I must to do?? I use Oscommerce V2.2 RC2. Thanks (sorry for my english) 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.