Jump to content



- - - - -

Official Topic For 'change Default Image Directories' Contrib


  • Please log in to reply
96 replies to this topic

#41   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 10 August 2007 - 10:47 PM

Also I am having a problem with the products to error that comes up for the products is
Error Error: Destination does not exist.
Error Error: Catalog products images directory does not exist: ..//catalog/images/products/
^
note this destination is there but it is not working

also then a product does work it does not upload in the normal product/... folder it wants to load like this barrels__barrel_accessories/barrels/autococker/Ceramic_1.gif not in the products folder.....

and for the Manufacturers thing there is no errors, it uploads the image but then when it comes back to the normal info to shows you the image, its not there...

so i guess it real doesn't upload it...

I dont know whats up I know I installed it right I followed the steps...

I installed the 1.4v

#42   Dragen

Dragen
  • Members
  • 185 posts
  • Real Name:Lee
  • Gender:Male
  • Location:UK

Posted 11 August 2007 - 12:39 PM

View PostJS_Supplies, on Aug 10 2007, 11:03 PM, said:

ok, I got a problem I can't upload Manufacturers images, why?
I don't know...
What's the problem? Do you recieve any error messages?

#43   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 11 August 2007 - 02:28 PM

OK I will try to give as much details as I can for my to problem:

1. Manufacturers image problem
when I go to edit a manufacturers image and use the browse and get my image I want and click down it reload the hold window and nothing happen, no errors, no image was ever upload becuase it comes up and says this....
[img]http://img116.imageshack.us/img116/2712/mwindowrj2.gif[/img]
and I did make the manufacturers folder for the images


2. Product image problem
Ok, when I upload product, no image is uploaded, two error come up, and the product image file trail is not right is says "S2_1.gif"
Error Error: Destination does not exist.
Error Error: Catalog products images directory does not exist: ..//catalog/images/products/
                                                                                                                       ^
                                                                                                                      note this destination is there

#44   Dragen

Dragen
  • Members
  • 185 posts
  • Real Name:Lee
  • Gender:Male
  • Location:UK

Posted 11 August 2007 - 02:46 PM

View PostJS_Supplies, on Aug 11 2007, 03:28 PM, said:

1. Manufacturers image problem
when I go to edit a manufacturers image and use the browse and get my image I want and click down it reload the hold window and nothing happen, no errors, no image was ever upload

and I did make the manufacturers folder for the images
could you show me the code in catalog/admin/includes/configure.php, on the line containing this:
define('DIR_FS_MANUFACTURERS_IMAGES',
and the code you have in catalog/admin/manufacturers.php at about line 41. It should be this:
		$manufacturers_image = new upload('manufacturers_image');
		$manufacturers_image->set_destination(DIR_FS_CATALOG_IMAGES . DIR_FS_MANUFACTURERS_IMAGES);
		if ($manufacturers_image->parse() && $manufacturers_image->save()) {
		  tep_db_query("update " . TABLE_MANUFACTURERS . " set manufacturers_image = '" . DIR_FS_MANUFACTURERS_IMAGES . $manufacturers_image->filename . "' where manufacturers_id = '" . (int)$manufacturers_id . "'");
		}


View PostJS_Supplies, on Aug 11 2007, 03:28 PM, said:

2. Product image problem
Ok, when I upload product, no image is uploaded, two error come up, and the product image file trail is not right is says "S2_1.gif"
Error Error: Destination does not exist.
Error Error: Catalog products images directory does not exist: ..//catalog/images/products/
I think the second problem has been fixed with a post of mine in this topic. You can find it here: http://forums.oscommerce.com/index.php?s=&...t&p=1118044
No-one's verified if this fix works or not though so let me know!

#45   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 11 August 2007 - 05:00 PM

ok the manufacturers image work now but the product image still dont work

and I tried that one thing that you put to fix it but it did not work for me.

I tried creating a new product and it haves still two errors

Error Error: Destination does not exist.
Error Error: Catalog products images directory does not exist: ..//catalog/images/products/

and I have created the "products" folder so I dont understand that error
[img]http://img74.imageshack.us/img74/6631/pthingfi9.jpg[/img]
thats what it looks like after uploading a image to the product

Edited by JS_Supplies, 11 August 2007 - 05:01 PM.


#46   Dragen

Dragen
  • Members
  • 185 posts
  • Real Name:Lee
  • Gender:Male
  • Location:UK

Posted 11 August 2007 - 05:21 PM

View PostJS_Supplies, on Aug 11 2007, 06:00 PM, said:

ok the manufacturers image work now but the product image still dont work

and I tried that one thing that you put to fix it but it did not work for me.

I tried creating a new product and it haves still two errors

Error Error: Destination does not exist.
Error Error: Catalog products images directory does not exist: ..//catalog/images/products/

and I have created the "products" folder so I dont understand that error

okay.. what've you got in admin/includes/configure.php on the line that starts:
  define('DIR_FS_CATALOG',


#47   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 11 August 2007 - 05:42 PM

  define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);


#48   Dragen

Dragen
  • Members
  • 185 posts
  • Real Name:Lee
  • Gender:Male
  • Location:UK

Posted 11 August 2007 - 05:45 PM

View PostJS_Supplies, on Aug 11 2007, 06:42 PM, said:

  define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);
try changing it to this:
  define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT);


#49   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 11 August 2007 - 06:21 PM

still the same
I dont know it this helps but this is how my oscommerce  was installed:
[img]http://img181.imageshack.us/img181/4862/untitledlu6.jpg[/img]

#50   Dragen

Dragen
  • Members
  • 185 posts
  • Real Name:Lee
  • Gender:Male
  • Location:UK

Posted 11 August 2007 - 06:59 PM

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 '/'.

#51   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 11 August 2007 - 07:13 PM

View PostDragen, on Aug 11 2007, 02:59 PM, said:

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 '/'.
  define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs)
  define('DIR_WS_CATALOG', '/catalog/');


#52   Dragen

Dragen
  • Members
  • 185 posts
  • Real Name:Lee
  • Gender:Male
  • Location:UK

Posted 11 August 2007 - 07:16 PM

I think I've got it..
try chaging this:
  define('DIR_WS_CATALOG', '/catalog/');
to this:
  define('DIR_WS_CATALOG', 'catalog/');


#53   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 11 August 2007 - 07:40 PM

when i do that it makes the little English flag goes a way and it still don't work... same errors

Error: Destination does not exist.
Error Error: Catalog products images directory does not exist: ../images/products/

#54   Dragen

Dragen
  • Members
  • 185 posts
  • Real Name:Lee
  • Gender:Male
  • Location:UK

Posted 11 August 2007 - 09:21 PM

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)?
[img]http://i48.photobucket.com/albums/f238/DragenMyspace/drop-downcategories.gif[/img]
If you are then that will cause an error.
you need to select categories by clicking on it in the main list instead

#55   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 11 August 2007 - 10:44 PM

ya, still don't work and I don't use the drop down menu, personal I think its a pain using it and never use it
[img]http://img381.imageshack.us/img381/6981/untitledia7.jpg[/img]

#56   Dragen

Dragen
  • Members
  • 185 posts
  • Real Name:Lee
  • Gender:Male
  • Location:UK

Posted 11 August 2007 - 11:35 PM

View PostJS_Supplies, on Aug 11 2007, 11:44 PM, said:

ya, still don't work and I don't use the drop down menu, personal I think its a pain using it and never use it
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']);

Edited by Dragen, 11 August 2007 - 11:38 PM.


#57   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 12 August 2007 - 12:21 AM

when i replace the code the whole oscommerce goes blank.... man I feel bad I am making work so hard on this.... I wish I could understand this code then I could help

Edited by JS_Supplies, 12 August 2007 - 12:22 AM.


#58   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 13 August 2007 - 02:14 AM

ok, is there a way to just make the manufacturers  and categories just change directories and the products not since the products don't like to corporate, unless you want to still figure out how to make then work its up do you..

#59   Dragen

Dragen
  • Members
  • 185 posts
  • Real Name:Lee
  • Gender:Male
  • Location:UK

Posted 13 August 2007 - 09:55 AM

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.

#60   JS_Supplies

JS_Supplies
  • Members
  • 43 posts
  • Real Name:Jordan Dravis
  • Gender:Male
  • Location:Florida

Posted 13 August 2007 - 01:46 PM

admin/categories.php (line 315)
// 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']);
  }
admin/includes/languages/categories.php (line 96)
define('ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog products images directory does not exist: ' . DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $_SESSION['categoryfile']);
Is this right?