Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Additional Images Module


Parikesit

Recommended Posts

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

 

...

 

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.

 

thanks, i'm gonna try this and then I tell you if it works...

Link to comment
Share on other sites

How do i run the "additional_images.sql" file as mentioned in this contribution?

Your host should have a SQL admin tool available in which you can backup your database and run SQL scripts on the database. Many use a free script package called phpMyAdmin. Ask your host.

 

If you don't get anywhere that way, look at my contributions link. I have a php script that will do it for you. It's an easy install, but I have not included all the resolutions to all the posible touble you may run into when setting this script up.

 

As always BACKUP your database before doing this.

Link to comment
Share on other sites

UPDATED Additional Images Module

 

I am looking for someone to install my Cre Loaded mod into a Oscommerce site (using Additional Images Module) and report back the install changes so I can post the new OSC mod.

 

What this new mod will do:

 

(1) Add the ability to place text under the small thumbnail image on the product info page

 

(2) Add the ability to add text on the large popup image

 

(3) Manage the text from the products page in the admin (categories.php)

 

It was written for Cre Loaded 6.15, which is almost identical to the osc m2 version, but I don't use osc - so I am looking for someone to install the mod and let me know what changes need to be made, then I'll post the new osc mod so others may have use of it.

 

Only PM me if you can help and I'll send you the file.

 

If you are only interested in getting the file (not helping with the details), just wait until we update the script to work fully with osc and I'll post here when it is available.

Edited by pyramids
Link to comment
Share on other sites

  • 2 weeks later...
Any patch to upgrade to latest version of this contribution ?

upload the files in the 1_files_to_upload directory, then compare and update from the files in the 2_files_to_compare directory of the package.

 

The database additions are the same as the previous release, so ignore the 3 SQL files.

Link to comment
Share on other sites

First of all: great contribution, works like a charm. Thank you.

 

I have, however, a small problem (at least I hope it's small):

 

In the product page, I want to display the first picture full size and the other pictures should be thumbnails and do the normal popup-routine. (I could also live with all pictures full size below the text, but I guess, this is the wrong module for it, then.)

 

I know I have to tweak product_info.php, but after wrecking it twice (I know why I like to backup things),

I thought it might be better to ask.

 

Cheers,

 

bob-cat

Link to comment
Share on other sites

I'm sorry bob-cat, brain-fart on my part. I was thinking of another contrib.

 

The additional images under the product description and the default (main) image should conform to the "Display Image Width" and "Display Image Height" settings under Admin -> Configuration -> Images if you have all the directions completed correctly.

 

Those settings should have been added when you ran the additional_images.sql SQL file on your database.

 

In your product info file you need to change a few places to remove or change the default image restrictions.

 

there are 2 ocurrences of each of these two code snippets:

 

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

 

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

 

change them all to 2 single quotes (a empty string) to make your default image unrestricted.

Link to comment
Share on other sites

Thanks for the hint, it would have helped, but the small image and the large image are two seperate images, so it still displays the small one, on that page, because it just isn't bigger ...

 

(Did that to ease load on the list view, so this is on purpose.) So now I guess I must tweak the query to get at the larger image.

Link to comment
Share on other sites

Thanks for the hint, it would have helped, but the small image and the large image are two seperate images, so it still displays the small one, on that page, because it just isn't bigger ...

 

(Did that to ease load on the list view, so this is on purpose.) So now I guess I must tweak the query to get at the larger image.

in that case you want to change this in 2 places (same location as before):

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

to

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

it will first determine if the pop image is defined, display it, or display the small if it doesn't.

in place of the other changes make them the width and height you desire in single quotes instead of the empty single quotes. Or change back to the original code to be displayed the same size as the additional images.

Edited by surfalot
Link to comment
Share on other sites

  • 2 weeks later...

Hi! I'm using this contrib without any problems on one shop; but for anbother... everuthing is ok , I can add the images, they appear in Admin, but on product_info they dont.

I've triple checked the files with the changes and everything is ok...

 

The thing is that this second shop is an exact copy of the previous one, so it should work, I guess. The only difference is that Image Magic is installed on both, but only in the first one is ON , on the second (this one, with th e Additional Images problems is not working - images aren't displayed if I turn it ON.

 

So, I'm in some mes... :D Please, help me! I've read all the posts but didn't find a solution. Thank you!

Link to comment
Share on other sites

Hi! I'm using this contrib without any problems on one shop; but for anbother... everuthing is ok , I can add the images, they appear in Admin, but on product_info they dont.

I've triple checked the files with the changes and everything is ok...

 

The thing is that this second shop is an exact copy of the previous one, so it should work, I guess. The only difference is that Image Magic is installed on both, but only in the first one is ON , on the second (this one, with th e Additional Images problems is not working - images aren't displayed if I turn it ON.

 

So, I'm in some mes... :D Please, help me! I've read all the posts but didn't find a solution. Thank you!

Link to comment
Share on other sites

Hi! I'm using this contrib without any problems on one shop; but for anbother... everuthing is ok , I can add the images, they appear in Admin, but on product_info they dont.

I've triple checked the files with the changes and everything is ok...

 

The thing is that this second shop is an exact copy of the previous one, so it should work, I guess. The only difference is that Image Magic is installed on both, but only in the first one is ON , on the second (this one, with th e Additional Images problems is not working - images aren't displayed if I turn it ON.

 

So, I'm in some mes... :D Please, help me! I've read all the posts but didn't find a solution. Thank you!

 

 

Sorry sorry sorry for the multiple posts, I kept getting The page cannot....

Edited by roxanacaz
Link to comment
Share on other sites

Well, if I turn Image M on... most of the images don't show up at all and still the additional images aren't there (in the Catalog side because in the Admin sside they appear as they should).

Edited by roxanacaz
Link to comment
Share on other sites

first make sure you have the 3 changes to /catalog/product_info.php inserted correctly:

line: 73 of the contrib package file.

lines: 110-117

lines: 168-174

 

if that does not resolve the issue may I suggest, if you are not going to use the image magic, put your tep_image() function back to it's original form. Back up your html_output.php file first just in case you wish to go back. It is in:

 

/catalog/includes/functions/html_output.php

 

and this is what it should look like:

 

////
// The HTML image wrapper function
 function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
  return false;
}

// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';

if (tep_not_null($alt)) {
  $image .= ' title=" ' . tep_output_string($alt) . ' "';
}

if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
  if ($image_size = @getimagesize($src)) {
	if (empty($width) && tep_not_null($height)) {
	  $ratio = $height / $image_size[1];
	  $width = intval($image_size[0] * $ratio);
	} elseif (tep_not_null($width) && empty($height)) {
	  $ratio = $width / $image_size[0];
	  $height = intval($image_size[1] * $ratio);
	} elseif (empty($width) && empty($height)) {
	  $width = $image_size[0];
	  $height = $image_size[1];
	}
  } elseif (IMAGE_REQUIRED == 'false') {
	return false;
  }
}

if (tep_not_null($width) && tep_not_null($height)) {
  $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
}

if (tep_not_null($parameters)) $image .= ' ' . $parameters;

$image .= '>';

return $image;
 }

Link to comment
Share on other sites

Thjank you very much, I'll keep in mind this advice, but for now I installed ultrapics and everything seems to be working, though I'm having a hard time modifying categories.php for both ultrapics and html area, but I'll keep trying.

Thanks again!

Link to comment
Share on other sites

Hi i am thinking to add Mod to this Contribution (Subdirectories box wheen uploading image), i have much pictures in my store and store seems to slow down wheen adding aditional images, they all save in images folder so i wanted to add checkbox wich will ask where do you want to upload an aditional image. Can somone help me with this?

 

Thank you

Regards

Kamil

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...