Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parikesit

Pioneers
  • Posts

    263
  • Joined

  • Last visited

Everything posted by Parikesit

  1. Sorry, that's a bug... Just create a php file in admin folder, with the code below. Run that file once and delete it afterward. <?php //bug no modRewrite require('includes/application_top.php'); if (!defined('OSC_PRODUCT_IMAGE_MODREWRITE')) { tep_db_query("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_title,configuration_key,configuration_value,configuration_description,configuration_group_id,sort_order,date_added, set_function) VALUES ('OPI: mod_rewrite enabled', 'OSC_PRODUCT_IMAGE_MODREWRITE', 'true', 'OsC Product Image Module: If mod_rewrite enable, set to true. Otherwise, set to false. <br />', '4', '264', NOW(), '" . tep_db_input("tep_cfg_select_option(array('true', 'false'), ") . "')"); } require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  2. There is an addon "Stock View with Quantity per Attribute" out there, but I did not know how the frontpage look like. But I guess it's easy to create some javascript function using jQuery to get similar output. As for the site mentioned, I did not use that addon but created myself, including the backend and frontend. I also use prototypejs instead of jQuery for frontpage catalog. @zaenal
  3. Some others suggestion... Your product list (index.php) seem still use default image (a big one) that slowdown your site. Try to use opi thumbnail to display your product image everywhere. Files that display product image product_info.php (done) popup_image.php product_reviews.php product_reviews_info.php product_reviews_write.php products_new.php reviews.php shopping_cart.php specials.php includes/modules/also_purchased_products.php includes/modules/new_products.php includes/modules/product_listing.php (!important) includes/modules/boxes/bm_reviews.php includes/modules/boxes/bp_specials.php includes/modules/boxes/bm_whats_new.php Just use the same method as product_info.php. Below an example to edit includes/modules/product_listing.php file... Find... case 'PRODUCT_LIST_IMAGE': if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $prod_list_contents .= ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id'] . '&products_name=' . $listing['products_name']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>'; } else { $prod_list_contents .= ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id'] . '&products_name=' . $listing['products_name']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>'; } break; Replace with: --here we use "thumbs/def/small/" but you can use other "def", or just edit opi_thumbnail.php to fit your need. case 'PRODUCT_LIST_IMAGE': if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $prod_list_contents .= ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '"><img src="' . tep_href_link(DIR_WS_IMAGES . 'thumbs/def/small/' . $listing['products_image']) . '" alt="' . $listing['products_name'] . '" /></a></td>'; } else { $prod_list_contents .= ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '"><img src="' . tep_href_link(DIR_WS_IMAGES . 'thumbs/def/small/' . $listing['products_image']) . '" alt="' . $listing['products_name'] . '" /></a></td>'; } break; @zaenal
  4. There is no error on your opi_thumbnail.php and .htaccess. I try to access your rain_light.gif and 0-3-months-yellow-lily.jpg using opi thumbnailer, and it's works: square rain_light.gif - http://www.rain-e-da.../rain_light.gif small rain_light.gif - http://www.rain-e-da.../rain_light.gif square 0-3-months-yellow-lily.jpg - http://www.rain-e-da...yellow-lily.jpg small 0-3-months-yellow-lily.jpg - http://www.rain-e-da...yellow-lily.jpg I guess the problem come from your tep_image function. Did you add an addon that modify tep_image function? Well, if you add file_exists check to tep_image, the result will always null because the thumbnail is generated on-the-fly by opi_thumbnail.php. Just try to write IMG tag without tep_image on your product_info.php: <?php if (tep_not_null($product_info['products_image'])) { //$pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order"); $products_images = explode(',', $product_info['products_images']); if (sizeof($products_images) > 1) { ?> <div id="piGal" style="float: right;"> <ul> <?php $pi_counter = 0; foreach ($products_images as $pi) { $pi_counter++; $pi_entry = ' <li><a href="'; $pi_entry .= tep_href_link(DIR_WS_IMAGES . 'thumbs/def/large/' . $pi); $pi_entry .= '" target="_blank" rel="fancybox"><img src="' . tep_href_link(DIR_WS_IMAGES . 'thumbs/def/display/' . $pi) . '" /></a>'; $pi_entry .= '</li>'; echo $pi_entry; } ?> </ul> </div> <script type="text/javascript"> $('#piGal ul').bxGallery({ maxwidth: 300, maxheight: 200, thumbwidth: <?php echo (($pi_counter > 1) ? '75' : '0'); ?>, thumbcontainer: 300, load_image: 'ext/jquery/bxGallery/spinner.gif' }); </script> <?php } else { ?> <div id="piGal" style="float: right;"> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . 'thumbs/def/large/' . $product_info['products_image']) . '" target="_blank" rel="fancybox"><img src="' . tep_href_link(DIR_WS_IMAGES . 'thumbs/def/display/' . $product_info['products_image']) . '" alt="' . addslashes($product_info['products_name']) . '" hspace="5" vspace="5" /></a>'; ?> </div> <?php } ?> <script type="text/javascript"> $("#piGal a[rel^='fancybox']").fancybox({ cyclic: true }); </script> <?php } ?> @zaenal
  5. Never seen it... I'm not linux expert, but this could be happen on some server that appoint specific privilege (user and user group) to PHP. Another workaround, try to CHMOD the folder manually. Open opi_thumbnail.php, and find @mkdir(OPI_FS_IMAGES_OPI_THUMB . $subdir, OPI_FS_CHMOD), and make some change like below: //check directory $dirs = explode(DIRECTORY_SEPARATOR, $imMode['thumb']); $subdir = ''; for ($i=0; $i < sizeof($dirs)-1; $i++) { $subdir .= $dirs[$i] . DIRECTORY_SEPARATOR; if (!is_dir(OPI_FS_IMAGES_OPI_THUMB . $subdir)) { @mkdir(OPI_FS_IMAGES_OPI_THUMB . $subdir); } @chmod(OPI_FS_IMAGES_OPI_THUMB . $subdir, OPI_FS_CHMOD); } @zaenal
  6. On linux you should use octal value with leading zero. On opi_thumbnail.php find OPI_FS_CHMOD, and set 0755 define('OPI_FS_CHMOD', 0755); If you can't find OPI_FS_CHMOD on that file, I'm afraid you use older version. Download the new one here: http://addons.oscommerce.com/info/8139
  7. Hi Graham, I have no idea why it's did not show up on your product info page, because the thumbnail images work properly. I try to access your store but seem it's on "maintenance" mode... Try to "view source" and find the IMG tag that load thumbnail image. How it look like? Does the SRC attribute pointing to the right URL? <img src=".../images/thumbs/def/display/products/0-3-months-yellow-lily-1.jpg" /> @zaenal
  8. Hi Gemma, Open file in admin: /includes/classes/productImageHandler.php, and replace below line if (mkdir($dest . $new_folder)) { with this one if (mkdir($dest . $new_folder, 0755)) { Hope that help. Note: It's seem OPI need one more configuration for handling this. So it's can be configured from admin page. Thanks, @zaenal
  9. Hi Johnatan, Maybe you can replace your code like below: //// // The HTML image wrapper function if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) { $src=DIR_WS_IMAGES.'thumbs/def/display/nopic.jpg'; //no image url when you upload the product. } //over Cheers, @zaenal
  10. Do you use IIS or Apache? It's seem OPI can not find your image folder. Please make some test below: Assuming that your domain is domain.com, installed oscommerce in root directory, and you have an image in root_directory/images/products/virtual_image.png, can you view this image using URL http: // domain.com/images/thumbs/def/adminthumb/virtual_image.png ? If you can not see the image using this URL, your problem should be in your htaccess, etc. (If you pass point above) What the value of configuration below when editing product. View source and find similar line below var oscProductImageHelper = { ... imageURL: ???, ... } If you use Apache with modrewrite, its should be: imageURL: {path:'http://domain.com/images/', relative:'products/', medium:'http://domain.com/images/thumbs/def/adminpreview/', small:'http://domain.com/images/thumbs/def/adminthumb/', transparent:'images/pixel_trans.gif'}, Otherwise, if you use IIS its should be: imageURL: {path:'http://domain.com/images/', relative:'products/', medium:'http://domain.com/opi_thumbnail.php?def=adminpreview', small:'http://domain.com/opi_thumbnail.php?def=adminthumb', transparent:'images/pixel_trans.gif'}, Cheers, @zaenal
  11. Hi Bryan, I can't view the image. Something wrong, but not from OPI. Do you install other addon? Just a quick fix from your admin folder, go to includes/application_top.php, find line/text like "error_reporting()", then change it like below: //Set the level of error reporting error_reporting(0); Best, @zaenal Note: for your security concern... When trying to ask in the forum, hide/mask your real path/root and don't announce it to the world, moreover you also provide your domain and your gmail .
  12. Hi Gemma, To set your watermark, open opi_thumbnail.php file. Edit some configuration below: define('OPI_FS_IMAGES_WATERMARK', OPI_FS_IMAGES_OPI_PATH . str_replace('/', DIRECTORY_SEPARATOR, '_hidden_/watermarked.png') ); // watermark file define('OPI_IMAGES_WM_WMIN', 600); define('OPI_IMAGES_WM_HMIN', 600); define('OPI_IMAGES_WM_POSITION', 'CC'); define('OPI_IMAGES_WM_OPACITY', 20); If you "remove" the images before deleting a product, the thumbnail will be cleaned up. But if you delete product directly without removing it's images (or you use EP to update product and/or products_images) then the _thumbnail_ will not be cleaned up. The easiest way to deal with... after updating products, for example using EP, go to Configurations > Images > OPI: Cleanup Thumbnail, then set it value to true (then go back to edit/access/view product or categories to make it 'executed'.) Now you will have an empty _thumbnail_ folder. @zaenal
  13. I downloaded the last version of EP (v2-77a) and try to figure out how to make OPI works with it. It's seem it just as easy as add new variable to product's $custom_fields array. Open easypopulate.php, find line below (arround line 300) $custom_fields[TABLE_PRODUCTS] = array(); Insert products_images to the array: 'products_images'=>'OPI' $custom_fields[TABLE_PRODUCTS] = array('products_images' => 'OPI'); I've never use EP, but I'm sure above patch will works. @zaenal
  14. OPI: TIGHTEN-UP SECURITY File change: opi_thumbnail.php I just uploaded the new opi_thumbnail.php. There is no new feature in this one, only some enhancement in security issue by sanitizing all user input (global variable _GET). Big thanks to Te Taipo for his advice. DOWNLOAD: http://addons.oscommerce.com/info/8139 (click on "History" tab to see old release) NEW INSTALLATION -------------------------- Download full package from previous release (OPI 2.0) Replace opi_thumbnail.php with the new one. UPGRADE INSTALLATION --------------------------------- Backup your old opi_thumbnail.php. If you previously made some configuration change to the old one, do similar changes to this new opi_thumbnail.php. Upload the new opi_thumbnail.php. @zaenal
  15. Hi Raphael, I'm affraid I miss something here because I did not get enough information to answer. Such symptoms occurs due to any of below: using IIS or Apache without modRewrite enabled --> set Configuration > Images > OPI: mod_rewrite enabled to false .htaccess does not configured properly --> see opi-advanced.htaccess in the download archieve. folder catalog:images/_thumbnail_ not writeable --> chmod it to 755 (or 775, 777 in several hosting server) The image should be in folder catalog:/images/products/... There will be no images/thumbs/ folder in your server. It's virtually exists by configuring .htaccess with modRewrite enabled. The idea here is to have as many images for our products, without having to upload small/medium/big ones. Then OPI thumbnailer will serve us to produce any image in any size. That's why OPI can not support video, flash, or other file format. Only gif, jpg and png are supported. Best, @zaenal
  16. MySQLi Extension for OsC 2.X - http://bit.ly/nnripo | Just after reading PHP core developers are planning to kill the PHP original MySQL extension

  17. PHP core developers are planning to kill the PHP original MySQL extension - http://bit.ly/nnripo

  18. Native MySQL extension is slightly faster than the improved MySQLi extension, but the latest more stable and have more features. This addon simply replicate the default database function, so you don't have to worry that you need to edit many files. The installation process as easy as uploading a file (database_mysqli.php) and edit one line in application.top.php. As a bonus, this addon add new tep_db_multi_query function (see: mysqli.multi-query.php), so now you can make multi query in one call. Sample of using "tep_db_multi_query" can be found in the archive. Download it here: http://addons.oscommerce.com/info/8168 Best, @zaenal
  19. Ahh, sorry... wrong copy paste Replace all lines related to TABLE_PRODUCTS_IMAGES with: <?php if (tep_not_null($product_info['products_image'])) { $products_images = explode(',', $product_info['products_images']); if (sizeof($products_images) > 1) { ?> <div id="piGal" style="float: right;"> <ul> <?php $pi_counter = 0; foreach ($products_images as $pi) { $pi_counter++; $pi_entry = ' <li><a href="'; $pi_entry .= tep_href_link(DIR_WS_IMAGES . 'thumbs/def/large/' . $pi); $pi_entry .= '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'thumbs/def/display/' . $pi) . '</a>'; $pi_entry .= '</li>'; echo $pi_entry; } ?> </ul> </div> <script type="text/javascript"> $('#piGal ul').bxGallery({ maxwidth: 300, maxheight: 200, thumbwidth: <?php echo (($pi_counter > 1) ? '75' : '0'); ?>, thumbcontainer: 300, load_image: 'ext/jquery/bxGallery/spinner.gif' }); </script> <?php } else { ?> <div id="piGal" style="float: right;"> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . 'thumbs/def/large/' . $product_info['products_image']) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'thumbs/def/display/' . $product_info['products_image'], addslashes($product_info['products_name']), null, null, 'hspace="5" vspace="5"') . '</a>'; ?> </div> <?php } ?> <script type="text/javascript"> $("#piGal a[rel^='fancybox']").fancybox({ cyclic: true }); </script> <?php } ?>
  20. Another catalog files you should consider to edit: popup_image.php product_reviews.php product_reviews_info.php product_reviews_write.php products_new.php reviews.php shopping_cart.php specials.php includes/modules/also_purchased_products.php includes/modules/new_products.php includes/modules/product_listing.php includes/modules/boxes/bm_reviews.php includes/modules/boxes/bm_specials.php includes/modules/boxes/bm_whats_new.php Find "products_image" in that files, similar to... - tep_image(DIR_WS_IMAGES . $product_info['products_image'], ...) - tep_image(DIR_WS_IMAGES . $review['products_image'], ...) - tep_image(DIR_WS_IMAGES . $products_new['products_image'], ...) - tep_image(DIR_WS_IMAGES . $products['products_image'], ...) - tep_image(DIR_WS_IMAGES . $reviews['products_image'], ...) - tep_image(DIR_WS_IMAGES . $specials['products_image'], ...) - tep_image(DIR_WS_IMAGES . $products[$i]['image'], ...) -> in shopping_cart.php - tep_image(DIR_WS_IMAGES . $orders['products_image'], ...) - tep_image(DIR_WS_IMAGES . $new_products['products_image'], ...) - tep_image(DIR_WS_IMAGES . $listing['products_image'], ...) - tep_image(DIR_WS_IMAGES . $random_product['products_image'], ...) Edit it by adding 'thumbs/def/small/' after DIR_WS_IMAGE, and make null for width and height, so it will look like tep_image(DIR_WS_IMAGES . 'thumbs/def/small/' . $product_info['products_image'], addslashes($product_info['products_name']), null, null, 'hspace="5" vspace="5"') You can change 'thumbs/def/small/' to other OPI config, for example for popup_image.php you can use 'thumbs/def/large/'. The english version is here http://www.rhinebutik.com/en/product_info.php?products_id=2 . @zaenal
  21. Replace/edit (arround line 35) product query by adding p.products_images after p.products_image $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); with $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_images, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); Since we don't need another query to table TABLE_PRODUCTS_IMAGE, remove line related to it, and replace with following code <?php if (tep_not_null($product_info['products_image'])) { $pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order"); $products_images = explode(',', $product_info['products_images']); //if (tep_db_num_rows($pi_query) > 0) {// if (sizeof($products_images) > 1) { ?> <div id="piGal" style="float: right;"> <ul> <?php $pi_counter = 0; foreach ($products_images as $pi) { $pi_counter++; $pi_entry = ' <li><a href="'; $pi_entry .= tep_href_link(DIR_WS_IMAGES . 'thumbs/def/large/' . $pi); $pi_entry .= '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'thumbs/def/display/' . $pi) . '</a>'; $pi_entry .= '</li>'; echo $pi_entry; } ?> </ul> </div> <script type="text/javascript"> $('#piGal ul').bxGallery({ maxwidth: 300, maxheight: 200, thumbwidth: <?php echo (($pi_counter > 1) ? '75' : '0'); ?>, thumbcontainer: 300, load_image: 'ext/jquery/bxGallery/spinner.gif' }); </script> <?php } else { ?> <div id="piGal" style="float: right;"> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . 'thumbs/def/large/' . $product_info['products_image']) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'thumbs/def/display/' . $product_info['products_image'], addslashes($product_info['products_name']), null, null, 'hspace="5" vspace="5"') . '</a>'; ?> </div> <?php } ?> <script type="text/javascript"> $("#piGal a[rel^='fancybox']").fancybox({ cyclic: true }); </script> <?php } ?> If you want to see it in action, here my modified products_info.php page http://www.rhinebutik.com/id/product_info.php?products_id=2 . Fell free to try because I disable create account and checkout. @zaenal
  22. I'm currently working on new shopping site with OsCommerce that will be launched in the next month. This site will be mobile ready. In my case, I only need to modify osCommerce catalog (frontpage) to HTML5+CSS3. That's what all I need for mobile website. No extra addon or contribution needed. But porting OsC to HTML5+CSS3 is somewhat difficult... I have to say, OsCommerce far from buggy, but... rigid, yes :: D Well, what can you expect from something that is made from 00's era? @zaenal
  23. My b'day on OsC forum (19 Sep 2002 - 19 Sept 2011)

×
×
  • Create New...