Jump to content

Dragen

Members
  • Content count

    183
  • Joined

  • Last visited

1 Follower

About Dragen

  • Birthday 05/22/1988

Profile Information

  1. I think they're always uploaded with 777, but even if they're not meant to be 777 on the images wont matter at all. It's more important on the .php files. They should never have 777!
  2. hmm.. It might also have been because you hadn't removed a couple of other bits of code that my suggestion made, but if it's working anyway that's good! :thumbsup:
  3. // copy image only if modified $cid = explode('_', $cPath); foreach($cid as $key => $value){ $cdat = tep_db_query("SELECT categories_name FROM categories_description WHERE categories_id = '" . $value . "' && language_id = '1'"); $cat = tep_db_fetch_array($cdat); $categoryfile .= $cat[categories_name] . "/"; $_SESSION['categoryfile'] = $categoryfile; } $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $categoryfile); if ($products_image->parse() && $products_image->save()) { $products_image_name = DIR_FS_PRODUCTS_IMAGES . $categoryfile . $products_image->filename; } else { $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : ''); } break; } } hi mindtwist. If you're not wanting seperate category/sub-category files justs change the code you had above to this: // copy image only if modified $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES); if ($products_image->parse() && $products_image->save()) { $products_image_name = DIR_FS_PRODUCTS_IMAGES . $products_image->filename; } else { $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : ''); } break; } } That should do the trick. roxanacaz I'm not sure what you're error is... Try changing this part: $cid = explode('_', $cPath); foreach($cid as $key => $value){ $cdat = tep_db_query("SELECT categories_name FROM categories_description WHERE categories_id = '" . $value . "' && language_id = '1'"); $cat = tep_db_fetch_array($cdat); $categoryfile .= $cat[categories_name] . "/"; $_SESSION['categoryfile'] = $categoryfile; } to this: $cid = explode('_', $cPath); foreach($cid as $key => $value){ $cdat = tep_db_query("SELECT categories_name FROM categories_description WHERE categories_id = '" . $value . "' && language_id = '1'"); $cat = tep_db_fetch_array($cdat); $categoryfile .= $cat[categories_name] . "/"; } $_SESSION['categoryfile'] = $categoryfile; It might solve the problem...
  4. What code do you have on admin/categories.php around line 315 through to about line 370?
  5. just out of curiosity, what happens if you change this: define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT . '../'); to this: define('DIR_FS_DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']);
  6. hmm.. that looks fine too. I don't think I can figure out this one. Do you want me to show you how to set it up just for manufacterers and categories?
  7. Thanks. From looking at your code I really can't see what's causing the problem. For some reason it seems to be looking in ..//catalog/images/products/ to save the image, but the directory is invalid. You can have ..// I'd have expected the directory to be something like this: /home/fhlinux181/s/catalog/images/products/ I tried changing the directory it was looking in for you, but it didn't seem to work. I'm sorry, but I can't seem to figure this one out. I'm gonna try one last thing in admin/includes/configure.php what've you got for: define('DIR_FS_CATALOG_IMAGES',
  8. Yeah, that looks right to me. When you upload a new product and it gives you the error, instead of going back and trying again, refresh the page (press f5). Then what is the exact error message you recieve? If you let me know the exact directory it can't find, after the page refresh.
  9. hm... I'm not sure what the problem is. If you have the code in admin/categories.php how it is in my original fix that I linked you to.. (before I changed it in my last post) and the same with admin/includes/languages/categories.php.. change this prt back: define('ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_DOES_NOT_EXIST', basically undoing what my last post told you to do. Then when you go to upload a product and press submit. When it shows the error message, refresh the page (f5). Sometimes the error message lags, so it may say something different (although I doubt it..) then copy out the exact error message.. for me.
  10. I checked through all your code and it looks fine. I'm pulling at straws here but try changing the code to this: <?php // copy image only if modified unset($_SESSION['categoryfile']); $cid = explode('_', $cPath); $categoryfile = ''; foreach($cid as $key => $value){ if($value != '0'){ $cdat = tep_db_query("SELECT `categories_name` FROM `categories_description` WHERE `categories_id` = '" . $value . "' && `language_id` = '1'"); $cat = tep_db_fetch_array($cdat); $categoryfile .= $cat['categories_name'] . "/"; } } $_SESSION['categoryfile'] = $categoryfile; $products_image = new upload('products_image'); $products_image->set_destination('..' . DIR_WS_CATALOG . 'images/' . . DIR_FS_PRODUCTS_IMAGES . $categoryfile); if ($products_image->parse() && $products_image->save()) { $products_image_name = DIR_FS_PRODUCTS_IMAGES . $categoryfile . $products_image->filename; } else { $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : ''); } break; } } // check if the catalog image directory exists if (is_dir('..' . DIR_WS_CATALOG . 'images/' . . DIR_FS_PRODUCTS_IMAGES . $categoryfile)) { if (!is_writeable('..' . DIR_WS_CATALOG . 'images/' . . DIR_FS_PRODUCTS_IMAGES . $categoryfile)) $messageStack->add(ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error'); } else { $messageStack->add(ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error'); unset($_SESSION['categoryfile']); } ?> also to get the correct error message if it doesn't work open admin/includes/languages/categories.php: find the line starting: define('ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_DOES_NOT_EXIST', replace with: define('ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog products images directory does not exist: ' . '..' . DIR_WS_CATALOG . 'images/' . . DIR_FS_PRODUCTS_IMAGES . $_SESSION['categoryfile']);
  11. okay.. are you sure you copied the code properly in my fix? // copy image only if modified unset($_SESSION['categoryfile']); $cid = explode('_', $cPath); $categoryfile = ''; foreach($cid as $key => $value){ if($value != '0'){ $cdat = tep_db_query("SELECT `categories_name` FROM `categories_description` WHERE `categories_id` = '" . $value . "' && `language_id` = '1'"); $cat = tep_db_fetch_array($cdat); $categoryfile .= $cat['categories_name'] . "/"; } } $_SESSION['categoryfile'] = $categoryfile; $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $categoryfile); if ($products_image->parse() && $products_image->save()) { $products_image_name = DIR_FS_PRODUCTS_IMAGES . $categoryfile . $products_image->filename; } else { $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : ''); } break; } } // check if the catalog image directory exists if (is_dir(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $categoryfile)) { if (!is_writeable(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $categoryfile)) $messageStack->add(ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error'); } else { $messageStack->add(ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error'); unset($_SESSION['categoryfile']); } ?> and are you using the drop-down menu to select the categories (shown below)? If you are then that will cause an error. you need to select categories by clicking on it in the main list instead
  12. I think I've got it.. try chaging this: define('DIR_WS_CATALOG', '/catalog/'); to this: define('DIR_WS_CATALOG', 'catalog/');
  13. what on define('DIR_FS_DOCUMENT_ROOT' and define('DIR_WS_CATALOG' I'm only asking because I don't understand why the error message says the directory as: ..//catalog/images/products/ it shouldn't be using ../ and their should be something between the two slashes '/'.
  14. try changing it to this: define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT);
×