Contributions
Categories and Products Images Folder Tree
This contribution will automatically make folders under the /catalog/images folder that will match the categories tree when you create categories and it will place the products image in the correct folder. This helps keep your
products and categories images separated based on category.
Expand All / Collapse All
Hi: this contribution works breat, thank you!
this addon allow you to make directory when you update category, save you some time going through creating category in case of missing or deleted, or manually ftp, or going through catimagessetup...
in catalog/admin/categories.php
find:
rename($old_dir_name, $dir_to_make);
replace with:
if (is_dir($old_dir_name) == true) {
// rename directory if changing categories name
rename($old_dir_name, $dir_to_make);
} else {
// if directory are missing when update, then recreate directory
mkdir($dir_to_make,0755);
chmod($dir_to_make,0777);
}
zip file incude full block!
-- added filetrap info for more pics contribution compatibility
Rollup of previous mods(filetrap by Kevin Trocciola and Error fix: catimagessetup.php by owhno), improved install docs, oscommerce-2.2rc2a compatibility
-- Added a support forum thread: http://forums.oscommerce.com/index.php?showtopic=313615
Full Package
in toutput.php / poutput.php error.
Fix:
included $ and " in statement
OLD:
$list_output .= 'image['.$a.'] = ' . $old_file . ';' . "n";
NEW:
$list_output .= '$image['.$a.'] = "' . $old_file . '";' . "n";
file include: catimagessetup.php
This trap should solve the problem of incorrect filepaths after modifying a product. For example, if a product has an existing image and is modified, the filepath becomes a never-ending loop.
/images/cat1/cat2/pic.gif turns into /images/cat1/cat2/cat1/cat2/pic.gif and so on.
Decided to upload some brief instructions anyways.
Not much...just compare files with Beyond Compare if you've applied other contributions.
Disregard the file below. This download includes both the categories.php file and some brief instructions.
This download ONLY includes the admin/categories.php file. You need to download the full package below.
All the coding changes are commented quite well so I don't feel there is a need for more instructions.
The basic rule is...everywhere that there is a Category Tree change and a Big Image change following right after it, copy the change from the Category Tree, and change all instances of "product_image" to "product_bimage", without the quotes of course.
I would strongly recommend that you first make SURE that you get each of the Big Image and Category Tree contributions working separately. Then go back and edit the Big Image modifications in admin/categories.php to tie both contributions together.
This isn't an incredibly exciting or breakthrough change, but I hope it helps someone else out there :)
This adds a file for existing sites to run through a conversion / setup to make all the existing categories and products fit into the new images folders. Also added two queries to expand the length of the images fields in the data tables to prevent truncated image names.
this is a bug fix and installation notes updated as well. The full package and updated notes and installation instructions are included in this file.
This contribution will automatically make folders under the /catalog/images folder that will match the categories tree when you create categories and it will place the products image in the correct folder. This helps keep your
products and categories images separated based on category.
Note: Contributions are used at own risk.