Jump to content

Search the Community

Showing results for tags 'insert categories images'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News and Announcements
    • News and Announcements
  • osCommerce Online Merchant v2.x
    • General Support
    • osCommerce Online Merchant Community Bootstrap Edition
    • Add-Ons
  • Development
  • General
    • General Discussions
    • Live Shop Reviews
    • Security
    • Developer Feedback
  • PayPal's Announcements
  • Sage Pay's Announcements
  • Solomono - new level osCommerce templates's Announcements
  • German Community's OSCOM v2.x
  • German Community's Allgemein

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Real Name


Location


Interests


Website

Found 1 result

  1. hi there, I have CE1.0.5.0, trying to modify admin/categories.php so that can have the categories images (ref to Select Product Image Directory in selected image folder... /* Make New Image subdirectory for categories */ $new_dir_cat = preg_replace('/[^a-zA-Z0-9_.-]/i', '_',$_POST['new_directory']); $dir_cat = (tep_not_null($new_dir_cat) ? $_POST['directory'] . '/' . $new_dir_cat : $_POST['directory']); $dir_cat = ($dir_cat ? $dir_cat .'/' : ''); /* Make New subdirectory */ if ($dir_cat && !is_dir($root_images_dir . $dir_cat)) { if (mkdir($root_images_dir . $dir_cat)) $messageStack->add_session(sprintf(SUCCESS_CREATED_DIRECTORY, $new_dir_cat, $images_dir.$_POST['directory']), 'success'); } $categories_image = new upload('categories_image'); $categories_image->set_destination($root_images_dir . $dir_cat); if ($categories_image->parse() && $categories_image->save()) { tep_db_query("update categories set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'"); } $OSCOM_Hooks->call('categories', 'insertcategoryupdatecategoryAction'); tep_redirect(tep_href_link('categories.php', 'cPath=' . $cPath . '&cID=' . $categories_id)); break; with the code, i can create a new sub-image folder name, and the new categories image will save into server image/new_image_folder, however, the /catalog/images/ IMAGE DOES NOT EXIST when hit Edit, the images not show up, because path is still catalog/images/, if update cat-test-04.jpg it only allow to save under catalog/images/ not the new image sub-solder, it end up saved in both catalog/images/ and catalog/images/test-cat4/ has cat-test-04.jpg but only catalog/images/cat-test-04.jpg will show up in the front end how can I modify code so that #1 images in new folder will show up in the front page #2 images not only limited the location of original website setting path: catalog/images/ I also want to be able to delete just categories images, not the whole categories details (ref to Delete Category Image (ONLY for osC 2.2) I followed the installation instruction as below (I only modified a bit of the codes) but it doesn't work, did I make some mistakes? Step #1 function tep_remove_category_image($category_id) { $category_image_query = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$category_id . "'"); $category_image = tep_db_fetch_array($category_image_query); $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where categories_image = '" . tep_db_input($category_image['categories_image']) . "'"); $duplicate_image = tep_db_fetch_array($duplicate_image_query); if ($duplicate_image['total'] < 2) { if (file_exists(DIR_FS_CATALOG_IMAGES . $category_image['categories_image'])) { unlink(DIR_FS_CATALOG_IMAGES . $category_image['categories_image']); } } tep_db_query("update " . TABLE_CATEGORIES . " set categories_image ='' where categories_id = '" . (int)$category_id . "'"); } Step #2 case 'delete_category_image_confirm': if (isset($_POST['categories_id'])) { $categories_id = tep_db_prepare_input($_POST['categories_id']); tep_remove_category_image($categories_id); } tep_redirect(tep_href_link('categories.php', 'cPath=' . $cPath)); break; Step #3 $contents[] = ['align' => 'center', 'text' => tep_draw_bootstrap_button(IMAGE_EDIT, 'fas fa-cogs', tep_href_link('categories.php', 'cPath=' . $category_path_string . '&cID=' . $cInfo->categories_id . '&action=edit_category'), null, null, 'btn-warning mr-2') . tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash', tep_href_link('categories.php', 'cPath=' . $category_path_string . '&cID=' . $cInfo->categories_id . '&action=delete_category'), null, null, 'btn-danger xxx text-white mr-2') . tep_draw_bootstrap_button(IMAGE_MOVE, 'fas fa-arrows-alt', tep_href_link('categories.php', 'cPath=' . $category_path_string . '&cID=' . $cInfo->categories_id . '&action=move_category'), null, null, 'btn-light') . // add delete image button tep_draw_bootstrap_button(IMAGE_DELETE_IMAGE, 'fas fa-trash', tep_href_link('categories.php', 'cPath=' . $category_path_string . '&cID=' . $cInfo->categories_id . '&action=delete_category_image'), null, null, 'btn-danger xxx text-white mr-2') ]; any help is appreciated, thanks! Lyn
×