Jump to content
surfalot

[Contribution] More_pics_6 v1.1 For osC 2.2 MS2

Recommended Posts

The image appears on the product_info.php page...

 

I can have 1 image, 2 images, 3 images etc...it normally shows just the 1 - what I mean by normally is because sometimes it does not show any image at all.

 

If you want I download the package again - has it all been updated and ready ?

 

 

Where on the page is the image you are seeing? Is it full size? Aret here any thumbnails showing? Do you have more than 2 images loaded for that product?

 

Regards

Jim

Share this post


Link to post
Share on other sites

I haven't uploaded a new version yet -- I'm waiting to see if you found another bug. Just make the two changes I posted above.

 

Is your store online where I can look at it? If not, please answer my questions.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Would rather get the newest version!

 

I was wondering.. if the images are somewhere else (other then the original product edit pages) can I setup a link on the product edit page that goes to the new image editor BUT with a product_id that will limit the images listing to just that product? That will help us manage the images better then thumbing through hundreds of images for all the products, I'm sure anyone with more then a few dozen options in "Product Attributes/options" is familiar with the problem.

 

Anyone have a site running with the new version we can see live?

 

Thanks!

 

Regards,

-Moses

 

You can do that with version 1.4.3. It's still limited to 6 images, but they're all on the Categories/Products page.

 

Regards

Jim

Share this post


Link to post
Share on other sites

The images can't be on the usual Product page because the database is set up as a "one-to-many" relationship. That is, one product can be linked to by many images. The number of images is indeterminate, so the number of image entries on the page can't be determined ahead of time. I suppose some sort of fancy Javascript could be coded up to handle this, if somebody wanted it bad enough.

 

You can restrict the image page to a specific product by selecting the product in the dropdown, or by searching for the product name (or part of the name.) It should be possible to link that from the Product page as well. The image page dropdown uses a GET form indexed by the products_id, so this should only require a simple link. I'll take a look at doing that.

 

The only site that I know of using this right now is my test site, and that's password protected. Send me an email or PM and I'll give you a password for it.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hey Jim,

 

I had restored our orginal store after it did not work..

 

I thought I did answer all your questions - what would you like to know?

 

Once you have all your questions answered then I will take all your responses and redo the entire cart again to see what happens.

 

Thanks

 

David

 

http://www.fesup-usa.com/shopping/

Share this post


Link to post
Share on other sites

1. Where on the page is the image you are seeing?

2. Is it full size?

3. Are there any thumbnails showing?

4. How many images do you have loaded for that product?

 

Yes, it would be much easier if I could see the page. If that's not possible, we'll have to work with question-and-answer.

 

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Jim,

 

I have added everything back and followed your instructions step by step...

 

Still the same problem...I will PM you my site stuff so you can take a look and see where the issue is...

 

http://www.fesup-usa.com/shopping

 

Thanks

 

David

 

 

 

1. Where on the page is the image you are seeing?

2. Is it full size?

3. Are there any thumbnails showing?

4. How many images do you have loaded for that product?

 

Yes, it would be much easier if I could see the page. If that's not possible, we'll have to work with question-and-answer.

 

Regards

Jim

Share this post


Link to post
Share on other sites

I've just posted Version 2.0.1. This is a minor bugfix and upgrade to the previous package. The two bugs noted above have been fixed and the correct catalog/includes/languages/english.php is provided.

 

Also, I've added a link from the Products listing under Admin > Categories/Products to the Images Admin for each product. This should make it easier to update a product.

 

Thanks to everyone who found bugs and offered suggestions.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
I've just posted Version 2.0.1. This is a minor bugfix and upgrade to the previous package. The two bugs noted above have been fixed and the correct catalog/includes/languages/english.php is provided.

 

Also, I've added a link from the Products listing under Admin > Categories/Products to the Images Admin for each product. This should make it easier to update a product.

 

Thanks to everyone who found bugs and offered suggestions.

 

Regards

Jim

I think you posted your v2.0.1 More Pics contribution in the wrong place.

Share this post


Link to post
Share on other sites

I certainly did. I've asked the moderator to remove it. Thanks for letting me know.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I've added another update with a couple more bugfixes and some improved instructions. In the right place this time, I think.

 

If you are using the CSS image substitution code in this selection, you should make all of the images that you want to put in the css box the same size. Images that are too different may appear distorted. The browser seems to display all images with the same dimensions as the first one. This only applies to images for a given product; the images for a different product may be a different size.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I have just installed More Pics 2.0.1 and experiencing an issue with it especially at the product_info.php page, becuase I am not using the default osC template. Can you please suggest an easy way around it.

 

Also I have NOT noticed any changes in v2.0.1 and v2.0.2 files that you uploaded. Am I correct or just delusional? Cheers.

 

I've added another update with a couple more bugfixes and some improved instructions. In the right place this time, I think.

 

If you are using the CSS image substitution code in this selection, you should make all of the images that you want to put in the css box the same size. Images that are too different may appear distorted. The browser seems to display all images with the same dimensions as the first one. This only applies to images for a given product; the images for a different product may be a different size.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Sorry if this has been brought up before!!

 

I get the following error message, when i click on the ZOOM button to see more images.

 

1054 - Unknown column 'category_page' in 'where clause'

select products_name from products_description where products_id = '48' and category_page = '0' and product_page = '0' and language_id = '1'

 

I tried solving the above issue by adding the missing entity in the database and images poped up fine, but i am not if that is the right solution. and whether the issue below is related to this missing entity:

 

in the popup window, i get the images with left and right arrows but with no sense of image numbers. By that i mean, when the last image in the popup approaches, the 'right' arrow doesnt disappear.

 

Not to mention that i dont get all images displayed on the product_info page if i enable 'top', 'bottom' or ' middle', etc option. Only one image would appear with the zoom button at the bottom.

 

Any idea why is this all happening??

 

I've added another update with a couple more bugfixes and some improved instructions. In the right place this time, I think.

 

If you are using the CSS image substitution code in this selection, you should make all of the images that you want to put in the css box the same size. Images that are too different may appear distorted. The browser seems to display all images with the same dimensions as the first one. This only applies to images for a given product; the images for a different product may be a different size.

 

Regards

Jim

Share this post


Link to post
Share on other sites

That's one of the differences between 2.0.1 and 2.0.2. Check the SQL file in the distribution.

 

You need to have at least two additional images to have them show at the bottom of the page, or wherever you have the extra images set to show up. These extra images should not be flagged Category, Product, or Popup in order to be included.

 

The problem with the images not showing anywhere except at the bottom is likely something to do with your template. I can't help you with a template that I've never seen.

 

I'm working on another update. Well, I'll be working on it again as soon as I finish dealing with a hard drive crash on my development workstation.

 

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Rite! yes, i noticed that in the upgrade.sql file.... but after applying the SQL update, i am still getting the same error. i think its because the popup_image.php file is executing the query on 'PRODUCT_DESCRIPTION' table and your SQL update is for 'PRODUCT_IMAGES' table.

 

I did get the additional images thingi working. thanks for that. now i need to just change the HTML to suite my template and hopefully it will be working fine.

 

Hopefully the update you are working on will solve these issues and sorry about the crashing HD.

 

Hoping to hear some good news from you soon.

 

That's one of the differences between 2.0.1 and 2.0.2. Check the SQL file in the distribution.

 

You need to have at least two additional images to have them show at the bottom of the page, or wherever you have the extra images set to show up. These extra images should not be flagged Category, Product, or Popup in order to be included.

 

The problem with the images not showing anywhere except at the bottom is likely something to do with your template. I can't help you with a template that I've never seen.

 

I'm working on another update. Well, I'll be working on it again as soon as I finish dealing with a hard drive crash on my development workstation.

 

 

Regards

Jim

Share this post


Link to post
Share on other sites

You're right; the popup code is incorrect. The queries should be (Lines 34-49 of popup_image.php)

 

	$products_query = tep_db_query ("select products_name 
										from " . TABLE_PRODUCTS_DESCRIPTION . " 
								 where products_id = '" . $PID . "' 
								   and language_id = '" . (int) $languages_id . "'
							  ");
$products = tep_db_fetch_array ($products_query);

$image_no = 0;
$images_array = array();
$products_images_query = tep_db_query ("select images_id,
											   image_filename
										from " . TABLE_PRODUCTS_IMAGES . "
										where products_id =  '" . $PID . "'
										  " . $and_sql . "
										order by images_order ASC
									 ");

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Thanks Jim! The update worked!!!

 

You're right; the popup code is incorrect. The queries should be (Lines 34-49 of popup_image.php)

 

	$products_query = tep_db_query ("select products_name 
										from " . TABLE_PRODUCTS_DESCRIPTION . " 
								 where products_id = '" . $PID . "' 
								   and language_id = '" . (int) $languages_id . "'
							  ");
$products = tep_db_fetch_array ($products_query);

$image_no = 0;
$images_array = array();
$products_images_query = tep_db_query ("select images_id,
											   image_filename
										from " . TABLE_PRODUCTS_IMAGES . "
										where products_id =  '" . $PID . "'
										  " . $and_sql . "
										order by images_order ASC
									 ");

 

Regards

Jim

Share this post


Link to post
Share on other sites

The new version is up here. I fixed everything that was mentioned here, and added some files that I missed previously. Please post here if you are having any problems with this one.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim,

 

This is what I get, after modifying my admin/categories.php file and SQL:

 

1054 - Unknown column 'p.image_filename' in 'field list'

select p.products_id, pd.products_name, p.products_quantity, p.image_filename, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p left join products_images pi on p.products_id = pi.products_id, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '1' and pi.product_page = '1' order by pd.products_name

 

Any Clues???

 

The new version is up here. I fixed everything that was mentioned here, and added some files that I missed previously. Please post here if you are having any problems with this one.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Explain me one more thing please.

 

If I add 2 additional images to a product, I can only select any 2 appear in the popup window and the remaining one to appear as the main image with product description.

 

Now this feature is turning into a bug, because if I only have one product image and I click on ZOOM button, the popup window shows the LEFT and RIGHT arrows but no image. Do you think there is a work around it? or will i need to upload the same image as popup image?

Share this post


Link to post
Share on other sites

The first one is a typo. Change p.image_filename to pi.image_filename. Thanks; I'll fix that one.

 

I'm apparently having a problem expaining the image flags. Let's try again.

* If you have only one image, set all three flags (Categories, Products, and Popup) on that image. This emulates the action of the original osCommerce with a single image.

* If you have a small image that you want to use for Categories and a larger one for the other two, set the Categories flag on the small one and the other two flags on the larger image.

* If you have two or more that you want to show in the popup, set the popup flag on one of them and set Group Popup image with sub-images to true in the More Pics configuration.

There are an endless number of possibilities, so I can't cover them all. If you need more examples, post exactly what you want to do and I'll help.

 

Let's get this one working right before we try to integrate Easy Populate. It shouldn't be that hard, but one thing at a time....

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
The first one is a typo. Change p.image_filename to pi.image_filename. Thanks; I'll fix that one.

 

I'm apparently having a problem expaining the image flags. Let's try again.

* If you have only one image, set all three flags (Categories, Products, and Popup) on that image. This emulates the action of the original osCommerce with a single image.

* If you have a small image that you want to use for Categories and a larger one for the other two, set the Categories flag on the small one and the other two flags on the larger image.

* If you have two or more that you want to show in the popup, set the popup flag on one of them and set Group Popup image with sub-images to true in the More Pics configuration.

There are an endless number of possibilities, so I can't cover them all. If you need more examples, post exactly what you want to do and I'll help.

 

Let's get this one working right before we try to integrate Easy Populate. It shouldn't be that hard, but one thing at a time....

 

Regards

Jim

 

 

By the way, I havent yet updated to version 2.0.3. I am still on 2.0.2.

 

I tried your settings and now the MAIN PRODUCT IMAGE on the product_info page appears along with the rest of the images in the popup window. Which is perfectly fine.

 

Here is a working link with multiple images: http://www.vkjewellers.co.uk/product_info.php?products_id=3

 

The problem now remains that:

If I only have one MAIN PRODUCT IMAGE, the popup window displays that image with LEFT AND RIGHT arrows at the bottom and they are actually clickable. I dont want those arrows to appear if there is only one image. I think there is something wrong with the popup_image.php image number checking code.

 

Here is the link to a product with a single image: http://www.vkjewellers.co.uk/product_info....p;products_id=1

 

And here is my popup_image.php code:

 

<?php
/*
 $Id: popup_image.php,v 1.18 2003/06/05 23:26:23 hpdl Exp $
 $Mod: 20081216 More Pics 2.0 kymation $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 $navigation->remove_current_page();

 // BOF - Extra Pictures Enhancement //
 // BOF removed for EP enhancement //
 //$products_query = tep_db_query("select pd.products_name, p.products_image 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 . "'");
 //$products = tep_db_fetch_array($products_query);
 // EOF removed for EP enhancement //

 $PID = (int) $_GET['pID'];
 $display = (int) $_GET['display'];

 if ($PID != 0) { // Do nothhing if there is no PID
// Add restrictions to the query based on admin settings
$and_sql = '';
if (MORE_PICS_GROUP_WITH_CATEGORY == 'false') {
  $and_sql .= " and category_page = '0' ";
}
if (MORE_PICS_GROUP_WITH_PRODUCTS == 'false') {
  $and_sql .= " and product_page = '0' ";
}

$products_query = tep_db_query ("select products_name
										from " . TABLE_PRODUCTS_DESCRIPTION . "
								 where products_id = '" . $PID . "'
								   and language_id = '" . (int) $languages_id . "'
							  ");
$products = tep_db_fetch_array ($products_query);

$image_no = 0;
$images_array = array();
$products_images_query = tep_db_query ("select images_id,
											   image_filename
										from " . TABLE_PRODUCTS_IMAGES . "
										where products_id =  '" . $PID . "'
										  " . $and_sql . "
										order by images_order ASC
									 ");

// Commented out due to the above query update	
//	$products_query = tep_db_query ("select products_name 
//											from " . TABLE_PRODUCTS_DESCRIPTION . " 
//									where products_id = '" . $PID . "' 
//									  " . $and_sql . "
//									  and language_id = '" . (int) $languages_id . "'
//								  ");
//	$products = tep_db_fetch_array ($products_query);
//
//	$image_no = 0;
//	$images_array = array();
//	$products_images_query = tep_db_query ("select images_id,
//												   image_filename
//											from " . TABLE_PRODUCTS_IMAGES . "
//											where products_id =  '" . $PID . "'
//											order by images_order ASC
//										 ");

$num_products_images = tep_db_num_rows ($products_images_query);
$last_image = $num_products_images - 1;
$max_images = (int) MORE_PICS_NUMBER_OF_ROWS * MORE_PICS_NUMBER_OF_COLS;
if ($max_images  < $last_image) {
  $last_image = $max_images;
}
while ($products_images = tep_db_fetch_array ($products_images_query) ) {
  $images_array[$image_no] = $products_images['image_filename'];
  $image_no++;
}

// Get next & previous IDs and the current image name
switch ($display) {
  case 0:
	$previous_image_id = -1;
	if (MORE_PICS_WRAP_POPUP_IMAGES == 'true') {
	  $previous_image_id = $last_image;
	}
	$current_image = $images_array[0];
	$next_image_id = $display + 1;
	break;

  case $last_image:
	$previous_image_id = $last_image - 1;
	$current_image = $images_array[$last_image];
	$next_image_id = -1;
	if (MORE_PICS_WRAP_POPUP_IMAGES == 'true') {
	  $next_image_id = 0;
	}
	break;

  default:
	$previous_image_id = $display - 1;
	$current_image = $images_array[$display];
	$next_image_id = $display + 1;
}

 // EOF - Extra Pictures Enhancement //
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo $products['products_name']; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<script language="javascript"><!--
var i=0;
function resize() {
<!--  // BOF - Extra Pictures Enhancement // -->
/*  if (navigator.appName == 'Netscape') i=40; 
 if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+160-i);*/
 if (document.layers) i=40;
 if (document.images[0]) window.resizeTo(document.images[0].width +50, document.images[0].height+150);
<!--  // EOF - Extra Pictures Enhancement // -->
 self.focus();
}
//--></script>
<!--  // BOF - Extra Pictures Enhancement // -->
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5)">
<!--  // EOF - Extra Pictures Enhancement // -->
</head>
<body onLoad="resize();">
<!--  // BOF - Extra Pictures Enhancement // -->
<?php //echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<?php
/* 
//
// for use if you want to define a maximum width and height for the large popup images.
//   This is a waste of your bandwidth -- just size the images correctly before you upload
//  
$max_width=0;
$max_height=0;
$img = DIR_WS_IMAGES . $current_image;
list($width, $height, $type, $attr) = getimagesize($img);
if ($max_width!=0 && $max_width<$width && $max_height!=0 && $max_height<$height) {
 if (($max_width-$width)>($max_height-$height)) {
$width = $max_width;
$height = 0;
 } else {
$width = 0;
$height = $max_height;
 }
} elseif ($max_width!=0 && $max_width<$width) {
 $width = $max_width;
 $height = 0;
} elseif ($max_height!=0 && $max_height<$height) {
 $width = 0;
 $height = $max_height;
}
echo '<tr><td align="center"><img src="' . $img . '"' . (($width!=0)?' width="'.$width.'"':'') . (($height!=0)?' height="'.$height.'"':'') . '></td>';
*/
//
// to use the above code, you must remove the next line.
 echo '<tr><td align="center"><img src="' . DIR_WS_IMAGES . $current_image . '"></td>';
?>
	</tr>
	<tr>
	  <td height="0" align="center"></td>
	</tr>
	<tr>
	  <td height="20" align="center">
<?php
 if ($previous_image_id != -1 || $next_image_id != -1) {
echo '<hr color="#666" size="1">';
 }

 if ($previous_image_id != -1){
echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $PID . '&display=' . $previous_image_id) . '">' . tep_image (DIR_WS_IMAGES . 'left.gif', 'previous', '', '', 'border="0"') . '</a>';
 }

 if ($next_image_id != -1){
echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, 'pID=' . $PID . '&display=' . $next_image_id) . '">' . tep_image (DIR_WS_IMAGES . 'right.gif', 'next', '', '', 'border="0"') . '</a>';
 } 
?>
  </td>
</tr>
 </table>
<!--  // EOF - Extra Pictures Enhancement // -->
</body>
</html>
<?php
require('includes/application_bottom.php');
// BOF - Extra Pictures Enhancement //  
} // if ($PID
// EOF - Extra Pictures Enhancement //
?>

 

 

Please have a look and get me out of my misery. Thanks.

Share this post


Link to post
Share on other sites

That's very odd. The buttons show in IE but not in Firefox. Something strange is going on here. I'll take another look at the code.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×