Parikesit 6 Posted February 27, 2003 Additional Images Module (Version 1.0) http://www.oscommerce.com/community/contributions,1032 Features: - A real image module - 'Unlimited' additional images for each product - Popup image for each additionals - Add/Delete additional images from Admin panel - 3 sizes image Send your comment to this forum Enjoy, Parikesit :D recent contributions: mySQLi extension for osc 2.X, OPI: advanced image handling (ajax, thumbnail, watermark, etc), and other contributions all here Share this post Link to post Share on other sites
Parikesit 6 Posted February 28, 2003 Hi Belivers, Glad to see you... My online store still under development... :oops: Soon, maybe 8) Parikesit recent contributions: mySQLi extension for osc 2.X, OPI: advanced image handling (ajax, thumbnail, watermark, etc), and other contributions all here Share this post Link to post Share on other sites
Parikesit 6 Posted February 28, 2003 Here some preview from my local PC. Admin Preview: [1] [2] [3] recent contributions: mySQLi extension for osc 2.X, OPI: advanced image handling (ajax, thumbnail, watermark, etc), and other contributions all here Share this post Link to post Share on other sites
lorene 0 Posted February 28, 2003 I just tried this out and I ran into a couple of problems. - the table is called additional_images, but is defined as products_images - the boxes.php modifications file is empty. I'm guessing there should be a class in there called imagesbox? i think that's all Share this post Link to post Share on other sites
Parikesit 6 Posted February 28, 2003 Thanks a lot to Lorene. I have upload the patch for this bug, see: http://www.oscommerce.com/community/contributions,1032 Anyway here the missing files/configuration: #Admin - admin/includes/application_top.php define('TABLE_ADDITIONAL_IMAGES', 'additional_images'); #Catalog - catalog/includes/application_top.php //filename define('FILENAME_ADDITIONAL_IMAGES', 'additional_images.php'); define('FILENAME_POPUP_ADD_IMAGE', 'popup_add_image.php'); //table define('TABLE_ADDITIONAL_IMAGES', 'additional_images'); - catalog/includes/classes/boxes.php (add to boxes.php) class imagesBox extends tableBox { function imagesBox($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->imagesBoxContents($contents)); $this->table_cellpadding = '1'; $this->tableBox($info_box_contents, true); } function imagesBoxContents($contents) { $this->table_cellpadding = '4'; $this->table_parameters = 'class="imagesBoxContents"'; return $this->tableBox($contents); } } recent contributions: mySQLi extension for osc 2.X, OPI: advanced image handling (ajax, thumbnail, watermark, etc), and other contributions all here Share this post Link to post Share on other sites
mazza 0 Posted February 28, 2003 I just downloaded the contribution for closer examination of code. Looks nice. I noticed that there are no language fields even though desciption is given. Are you planning to add them ? I personally do not want anything more to the product_info.php, but would still like to give addional images for vieving. The gallery mod was a bit hard to use with different directories and naming rules for images. Could this mod be modified so that instead of showing preview images in product_info.php, it would show link to Product_gallery.php (if there are any additional images for the product ). Product_gallery.php would be sligthly modified product_info.php with additional images included. Do you think this can be done ? "Use no way as way, have no limitation as limitation." - Bruce Lee Share this post Link to post Share on other sites
Parikesit 6 Posted February 28, 2003 I noticed that there are no language fields even though desciption is given. Are you planning to add them ? "Image Description" value just show as ToolTip (on mouse over images) in Catalog, and as ImageName in Admin. Maybe we do not really need to add languages functionality to them. ... Could this mod be modified so that instead of showing preview images in product_info.php, it would show link to Product_gallery.php (if there are any additional images for the product ). Product_gallery.php would be sligthly modified product_info.php with additional images included. Do you think this can be done ? Yes! that would be great. I'll try do it. Thank's recent contributions: mySQLi extension for osc 2.X, OPI: advanced image handling (ajax, thumbnail, watermark, etc), and other contributions all here Share this post Link to post Share on other sites
Salvo 0 Posted February 28, 2003 Could this mod be modified so that instead of showing preview images in product_info.php' date=' it would show link to Product_gallery.php (if there are any additional images for the product ). Product_gallery.php would be sligthly modified product_info.php with additional images included. Do you think this can be done ?[/quote'] Yes! that would be great. I'll try do it. Thank's Something very very cood would be: Once more than 1 image is uploaded for that product, the pop up window would open with 1 or as many as uploaded image ( as thumbnail ) with one larger image. clicking on the thumb, with bigger image would change with the one clicked.... Salvo Share this post Link to post Share on other sites
teksigns 0 Posted February 28, 2003 everything is working . i think EXCEPT when the additional image pops up theres nothing there ! its just a little white blank box............ Share this post Link to post Share on other sites
teksigns 0 Posted February 28, 2003 fixed that problem edited popup_add_image.php changed: $navigation->remove_current_page(); to : //$navigation->remove_current_page(); now they work Share this post Link to post Share on other sites
MasterBeta 0 Posted February 28, 2003 Upon creating Tbl additional_images I get this error Key column 'product_add_images_id' doesn't exist in table i am using a shell to manually enter the add_images.sql file. I am uncertain of what syntax to use (if any) to 'execute' the add_images.sql file as a source file. :oops: If your syntax is correct in the file and there is a way to execute a *.sql from a shell, w/o phpmyadmin (<-- I dont have) I'd really like to know! Otherwise could you explain the structure of the table, or even better tell me what to change. this is the syntax i used from your dl'd file drop table if exists additional_images; create table additional_images ( additional_images_id int(11) not null auto_increment, products_id int(11) not null , images_description varchar(255) , medium_images varchar(64) , popup_images varchar(64) , PRIMARY KEY (product_add_images_id, products_id) ); maybe I just need to change the product_add_images_id name Besides not writing to mySql table the script is running fine so far. Thanks Ash Share this post Link to post Share on other sites
MasterBeta 0 Posted February 28, 2003 From what i can tell is that it's not quite working perfectly yet, but the basic idea is to be able to have multiple images for one product in the form of popup windows. I dont know yet because I'm not sure how to design the new table. Once I get it up i can message you a link. I'm sceptical of posting it here because my site isnt running yet and I need to conserve precious bandwidth. Hopefully someone else has it running though! I'm curious myself :D Share this post Link to post Share on other sites
teksigns 0 Posted February 28, 2003 when im in the admin area and i add a image everything is ok . but if i try to delete the image i get a Error : Call To Undefined Function: si() in categories.php on line xxx when i check that line it reads for ($i=0; $i<si($additional_images_id); $i++) { what have i missed ? there must be a function i dont have ...... Share this post Link to post Share on other sites
okonstan 0 Posted February 28, 2003 rewrite case 'del_images' to these one: case 'del_images': $additional_images_id = tep_db_prepare_input($HTTP_GET_VARS['pID']); if ( ($HTTP_POST_VARS['products_id']) && (is_array($HTTP_POST_VARS['additional_images_id'])) ) { $product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); $additional_images_id = $HTTP_POST_VARS['additional_images_id']; for ($i=0; $i<sizeof($additional_images_id); $i++) { tep_db_query("delete from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'"); } } //tep_db_query("delete from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . $HTTP_POST_VARS['additional_images_id'] . "'"); tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id)); break; Share this post Link to post Share on other sites
Parikesit 6 Posted March 1, 2003 I add new file of this patch to the package: http://www.oscommerce.com/community/contributions,1032 Upon creating Tbl additional_images I get this error drop table if exists additional_images; create table additional_images ( additional_images_id int(11) not null auto_increment, products_id int(11) not null , images_description varchar(255) , medium_images varchar(64) , popup_images varchar(64) , PRIMARY KEY (product_add_images_id, products_id) ); IT HAS TO BE: drop table if exists additional_images; create table additional_images ( additional_images_id int(11) not null auto_increment, products_id int(11) not null , images_description varchar(255) , medium_images varchar(64) , popup_images varchar(64) , PRIMARY KEY (additional_images_id, products_id) ); Just change the "product_add_images_id" with "additional_images_id" Thanks recent contributions: mySQLi extension for osc 2.X, OPI: advanced image handling (ajax, thumbnail, watermark, etc), and other contributions all here Share this post Link to post Share on other sites
teksigns 0 Posted March 1, 2003 thank you the new case rewrite fixed the problem . all works well now as you can see here http://www.teksigns.com/shop/product_info....products_id=544 Share this post Link to post Share on other sites
MasterBeta 0 Posted March 1, 2003 I'm having the same problem as Teksigns was having. I changed the code in popup_add_image.php as you suggested Teksigns, but it did not fix the error. The image is uploaded, and it appears at the bottom of the page resized, but when clicked to enlarge, i get the 404 error. Any suggestions??? Otherwise the scipt is running fine, I think. Thanks, Ash Share this post Link to post Share on other sites
erisen 0 Posted March 1, 2003 I'm having the same problem as Teksigns was having. I changed the code in popup_add_image.php as you suggested Teksigns, but it did not fix the error. The image is uploaded, and it appears at the bottom of the page resized, but when clicked to enlarge, i get the 404 error. Any suggestions??? Otherwise the scipt is running fine, I think. Thanks, Ash I have installed the contribution properly. It is working great. Thanks a lot for such a needed peace of code. Ash, I think you may get something if you try to look in to your catalog/includes/application_top.php file and find the follwing line: #catalog/includes/application_top.php define('FILENAME_POPUP_ADD_IMAGE', 'popup_add_image.php'); needs to be define('FILENAME_POPUP_IMAGE_ADD', 'popup_add_image.php'); please note, one says IMAGE_ADD, the other ADD_IMAGE. good luck! thanks again for the contribution. GALATASARAY RULES! ultrAslan - ultrAslan - ultrAslan Share this post Link to post Share on other sites
Guest Posted March 1, 2003 We got it working by not taking any notice of your updates, but changing the define table name additional_images to product_images Also your SQL statement does not work!!!!!! Otherwise, excellent script, just needs sorting out....... Share this post Link to post Share on other sites
MasterBeta 0 Posted March 3, 2003 Excellent catch erisen!!!!! :D Now at least im getting a real error instead of a 404 so the page has been called up properly. The error in the popup window is as follows: require('includes/application_top.php'); $navigation->remove_current_page(); $products_query = tep_db_query("SELECT images_description, popup_images FROM " . TABLE_ADDITIONAL_IMAGES . " WHERE additional_images_id = '" . $HTTP_GET_VARS['imagesID'] . "'"); $products_values = tep_db_fetch_array($products_query); ?> Fatal error: Call to undefined function: tep_image() in /catalog/popup_add_image.php on line 37 Line 37 looks like this: echo tep_image(DIR_WS_IMAGES . $products_values['popup_images'], $products_values['images_description'], POPUP_IMAGE_WIDTH, POPUP_IMAGE_HEIGHT); ?> Any ideas? Thanks, Ash Share this post Link to post Share on other sites
Birger 0 Posted March 3, 2003 I have the same problem :( Share this post Link to post Share on other sites
Parikesit 6 Posted March 3, 2003 There are some different configuration in OLD 2.2 CVS and the later CVS like MS1. Example: In the header of the popup_images.php CVS#20020620 we find: require('includes/application_top.php'); But in the MS1 there is a line "$navigation->remove_current_page();" require('includes/application_top.php'); $navigation->remove_current_page(); For save configuration, take a look to popup_images.php from your CVS version. Than replace the some changing lines and save as "popup_add_image.php" Regards Parikesit recent contributions: mySQLi extension for osc 2.X, OPI: advanced image handling (ajax, thumbnail, watermark, etc), and other contributions all here Share this post Link to post Share on other sites
Parikesit 6 Posted March 3, 2003 Find the similliar lines in "popup_images.php" and replace. Than save as "popup_add_image.php": $products_query = tep_db_query("SELECT images_description, popup_images FROM " . TABLE_ADDITIONAL_IMAGES . " WHERE additional_images_id = '" . $HTTP_GET_VARS['imagesID'] . "'"); $products_values = tep_db_fetch_array($products_query); and echo tep_image(DIR_WS_IMAGES . $products_values['popup_images'], $products_values['images_description'], POPUP_IMAGE_WIDTH, POPUP_IMAGE_HEIGHT); Enjoy :) recent contributions: mySQLi extension for osc 2.X, OPI: advanced image handling (ajax, thumbnail, watermark, etc), and other contributions all here Share this post Link to post Share on other sites
nomove 0 Posted March 4, 2003 Hello, i had the same prob, but i found the answer very easily. The only thing you have to do is to write a forgotten "<?" above the "require...." After that it works fine! Greets nomove Share this post Link to post Share on other sites
Birger 0 Posted March 4, 2003 Hello, a forgotten "<?" above the "require...." nomove Thanks! You are the bigest!!!! :P (forgoted "<?php", but only in /catalog/admin/popup_ad_image.php and /catalog/popup_ad_image.php If you changes also in /catalog/admin/popup_image.php and /catalog/popup_image.php this produces an error in 'primary' popup imageproduct). Share this post Link to post Share on other sites