osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Options as Images for MS2

This is a discussion on Options as Images for MS2 within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; This allows you to delete the option category image. And when you delete an image from a category clears it ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 08-16-2007, 03:13 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,284
Thanks: 66
Thanked 306 Times in 292 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post Options as Images for MS2

This allows you to delete the option category image. And when you delete an image from a category clears it from your catalog/images/options directory

in catalog/admin/options_images.php
***FIND:
case 'delete':
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_thumbnail = '' where products_options_values_id = '" . tep_db_input($vID) . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES , tep_get_all_get_params(array('action'))));
break;

ADD AFTER:
case 'delete_option_image':
****actually delete the image here from server
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_thumbnail = '' where products_options_id = '" . (int)$oID . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES , tep_get_all_get_params(array('action'))));
break;

***FIND:
echo ' '.tep_draw_form('option_image', FILENAME_OPTIONS_IMAGES,tep_get_all_get_params(arr ay('action')).'action=save_option_image', 'post', 'enctype="multipart/form-data"');
echo TITLE_OPTION_IMAGE.' '.tep_draw_file_field('option_image').' '.tep_image_submit('button_upload.gif',IMAGE_UPLOA D, 'align="absbottom"');

REPLACE WITH:
echo ' '.tep_draw_form('option_image', FILENAME_OPTIONS_IMAGES,tep_get_all_get_params(arr ay('action')).'action=save_option_image', 'post', 'enctype="multipart/form-data"');
echo TITLE_OPTION_IMAGE.' '.tep_draw_file_field('option_image').' '.tep_image_submit('button_upload.gif',IMAGE_UPLOA D, 'align="absbottom"').' <a href="' . tep_href_link(FILENAME_OPTIONS_IMAGES, 'action=delete_option_image&oID=' . $options_id ).'">' . tep_image_button('button_delete.gif', IMAGE_DELETE,'ALIGN=absbottom');


***FIND:
case 'delete':
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_thumbnail = '' where products_options_values_id = '" . tep_db_input($vID) . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES , tep_get_all_get_params(array('action'))));
break;

case 'delete_option_image':
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_thumbnail = '' where products_options_id = '" . (int)$oID . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES , tep_get_all_get_params(array('action'))));
break;

***REPLACE WITH:
case 'delete':
$options_query = tep_db_query("select products_options_values_thumbnail from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . tep_db_input($vID) . "'");
$options_id = tep_db_fetch_array($options_query);
@unlink(DIR_FS_CATALOG_IMAGES.'options/'.$options_id['products_options_values_thumbnail']);
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_thumbnail = '' where products_options_values_id = '" . tep_db_input($vID) . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES , tep_get_all_get_params(array('action'))));
break;

case 'delete_option_image':
$options_query = tep_db_query("select products_options_thumbnail from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$oID . "'");
$options_id = tep_db_fetch_array($options_query);
@unlink(DIR_FS_CATALOG_IMAGES.'options/'.$options_id['products_options_thumbnail']);
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_thumbnail = '' where products_options_id = '" . (int)$oID . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES , tep_get_all_get_params(array('action'))));
break;



not a complete package

More...
__________________
Michael Sasek
osCMax Developer


osCMax Templates - Hundreds of premium quality templates. New designs every month!

xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience


osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Options as Images for MS2 michael_s New osCommerce Contributions 0 07-15-2007 04:18 PM
using images with options type feature Christy osCMax v1.7 Discussion 0 01-28-2004 11:16 AM
Options as Images nevets osCMax v1.7 Discussion 1 12-16-2003 02:20 PM
Is there add-on for Available Options? laonux osCommerce 2.2 Modification Help 2 07-07-2003 06:57 PM
Images uploaded in /catalog/images Anonymous osCommerce 2.2 Installation Help 1 12-05-2002 09:15 AM


All times are GMT -8. The time now is 08:30 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax