Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Additional Images Module


Parikesit

Recommended Posts

I have a new store and i need to create both medium sized images and thumbnails.

can anybody recommend me a contrib to look for?

 

would this be the right contrib?

 

right now there are hundreds of products already created on the site so i need a contrib that makes the other two images for existing products, not just when I create the SKU.

 

any ideas would be helpfull...

Link to comment
Share on other sites

  • 3 weeks later...

could any one please post the sample photo of this contribution outcome, os commerce is great but some contribution don't include the sample image (so which is not for other to justify does it fit his need)

Link to comment
Share on other sites

  • 2 months later...

I have this working on my test server XAMPP but after I uploaded it I get:

 

*the click to enlarge part but no image in my product pages.

 

**I can only add 1 image any others give me this error: 1062 - Duplicate entry '0' for key 1

 

insert into additional_images (products_id, images_description, popup_images) values ('30', '', 'Blk-Char-tip.jpg')

 

*** When I try to delete an image, It will delete but I get this error then need to hit the back button to go back to admin console:

Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /MY PATHl/catalog/admin/includes/functions/database.php on line 134

 

Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /MY PATH/catalog/admin/includes/functions/database.php on line 134

 

Warning: Cannot modify header information - headers already sent by (output started at /MY PATH/catalog/admin/includes/functions/database.php:134) in /MY PATH/catalog/admin/includes/functions/general.php on line 22

 

 

Any help will be appreciated, this is my only speedbump before going live.

 

Dave V

Link to comment
Share on other sites

  • 1 month later...

Since my hosting upgraded to PHP 5 I get this error. I can't add images any longer.

I would be thankful for some help how t o modify the code to work with PHP 5.

 

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/httpd/ws2890/blush.se/shop2/admin/categories.php on line 444

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/httpd/ws2890/blush.se/shop2/admin/includes/functions/database.php on line 55

Warning: Variable passed to each() is not an array or object in /home/httpd/ws2890/blush.se/shop2/admin/includes/functions/database.php on line 58

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/httpd/ws2890/blush.se/shop2/admin/includes/functions/database.php on line 62

Warning: Variable passed to each() is not an array or object in /home/httpd/ws2890/blush.se/shop2/admin/includes/functions/database.php on line 63
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') values)' at line 1

insert into additional_images) values)

[TEP STOP]

Link to comment
Share on other sites

Thanks Nicolas!

 

The error when adding an image is gone.

I get another one when deleting an image, even if the image avtually is deleted;

 

Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/httpd/ws2890/blush.se/shop2/admin/includes/functions/database.php on line 134

Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/httpd/ws2890/blush.se/shop2/admin/includes/functions/database.php on line 134

Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/ws2890/blush.se/shop2/admin/includes/functions/database.php:134) in /home/httpd/ws2890/blush.se/shop2/admin/includes/functions/general.php on line 197

 

Line 134 in database.php is the second below;

 

  if (function_exists('mysql_real_escape_string')) {
return mysql_real_escape_string($string, $$link);
 } elseif (function_exists('mysql_escape_string')) {
return mysql_escape_string($string);
 }

Edited by Fredrik.r
Link to comment
Share on other sites

Found it.

 

Changed

 

$additional_images_id[] = tep_db_prepare_input($HTTP_POST_VARS['additional_images_id']);

 

to

 

$additional_images_id = tep_db_prepare_input($HTTP_POST_VARS['additional_images_id']);

 

in admin/categories.php

Link to comment
Share on other sites

  • 1 month later...

I just installed the new version 1.1.5, and I get this error in the popup window when i click on "click to enlarge" on product_info page:

 

osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Code Modification: March 2004 Andrey A. Skleznev "IT-Commerce" ltd. Mailto: [email protected] Released under the GNU General Public License */ require('includes/application_top.php'); $navigation->remove_current_page(); // BOF: Additional Images: Added: , p.products_image_pop $products_query = tep_db_query("select pd.products_name, p.products_image, p.products_image_pop from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'"); // EOF: Additional Images $products = tep_db_fetch_array($products_query); ?>

Fatal error: Call to undefined function tep_image() in /customers/kjolebutikken.com/kjolebutikken.com/httpd.www/oscdemo1/popup_image.php on line 45

 

Anyone know what can be wrong?

 

Thanks:-)

Best regards

Kjolebutikken

Link to comment
Share on other sites

I just installed the new version 1.1.5, and I get this error in the popup window when i click on "click to enlarge" on product_info page:

 

osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Code Modification: March 2004 Andrey A. Skleznev "IT-Commerce" ltd. Mailto: [email protected] Released under the GNU General Public License */ require('includes/application_top.php'); $navigation->remove_current_page(); // BOF: Additional Images: Added: , p.products_image_pop $products_query = tep_db_query("select pd.products_name, p.products_image, p.products_image_pop from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'"); // EOF: Additional Images $products = tep_db_fetch_array($products_query); ?>

Fatal error: Call to undefined function tep_image() in /customers/kjolebutikken.com/kjolebutikken.com/httpd.www/oscdemo1/popup_image.php on line 45

 

Anyone know what can be wrong?

 

Thanks:-)

 

 

 

Never mind, I found ut. Had done something wrong during installation.

Thanks:-)

Best regards

Kjolebutikken

Link to comment
Share on other sites

Hello:

 

First off all Thank you for posting version 1.1.5.. I have a new store & am a newbie to oscommerce and was having problems with the previous version off the contibution. With the new package it was easy to integrate the contribution, so thank you.

 

I just have one question, the pop-up images are all being displayed in different sizes? Is the a reason why and how to make them all consistently show the same sizes.

 

Ie. Image 1, 2, 3 default product sizes are the same.

But pop-up of Image 1 is different then Image 2 which is different than Image 3.

 

Also is there a way to change the layout off how the images are displayed.. (ie. in a column on right hand side or left hand side).. This is not a necessaisity just nice option to have.

 

Overall excellent contribution, and thank you.

Link to comment
Share on other sites

did you run the file: extra_width_images.sql from the package on your database tool? If you do not insert those configurations in your database, then that would happen. Afterwards you will find 4 more settings in your admin -> configuration -> images.

Edited by surfalot
Link to comment
Share on other sites

Also is there a way to change the layout off how the images are displayed.. (ie. in a column on right hand side or left hand side).. This is not a necessaisity just nice option to have.

look for a future version. I wanted to do more with it, but ran out of time. I wrote a nice routine for More Pics 6, it just needs to be adopted here.

Link to comment
Share on other sites

did you run the file: extra_width_images.sql from the package on your database tool? If you do not insert those configurations in your database, then that would happen. Afterwards you will find 4 more settings in your admin -> configuration -> images.

 

Thankyou. I had executed the sql, but had not put in the size for pop-up images.. Thanks for the quick answer.

Link to comment
Share on other sites

In hindsight, I think this would be a better way of doing it.

 

find in product_info.php:

(!empty($product_info['products_image'])?DISPLAY_IMAGE_WIDTH:SMALL_IMAGE_WIDTH)

replace with

SMALL_IMAGE_WIDTH

find in product_info.php:

(!empty($product_info['products_image'])?DISPLAY_IMAGE_HEIGHT:SMALL_IMAGE_HEIGHT)

replace with:

SMALL_IMAGE_HEIGHT

that will set the default image to the size of the "Small Image Width" and "Small Image Height" as defined in the configuration -> images area. This is different forom the settings for the additional images you already saw.

 

if you want to hardcode a specific size here because you want this different from the Small Image Width" and "Small Image Height" settings, just change it to a specific number instead of the constants.

Link to comment
Share on other sites

is this way of displaying extra images without the image popup.. can it be done.. can anyway please help me..

Yes there is, it would be a javascript. I have not done that myself. Search around the contribs, I know someone has uploaded code for that. checkout post #393 of the more pics 6 contrib. there is an example of a different type of popup you might like.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...