Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] UltraPics v1.0 - Addition Image Pac


Guest

Recommended Posts

Hello,

If the above image is correct, is there a way to set broken images with maybe a noimage.gif?

 

Thanks JR

 

 

Hi

If you search through the forum there is a fix for this problem but I cannot remember what page.

 

I made the amendment for the fix and now it doesn't give any broken image error messages when I don't upload an image.

 

Regards

Peter

Link to comment
Share on other sites

  • Replies 375
  • Created
  • Last Reply

Top Posters In This Topic

First of all I want to say that this is a very nice addons, however...... there is something in this addon that's very disturbing to me, although it already was like this in the 'vanilla' version of oscommerce. When you upload images it puts them in a general folder this is fine however the images names aren't renamed with a prefix of the product id whatsoever to make them unique to a certain product. For example when I upload an image with the same filename but in different products, it starts to get very messy. The imagenames aren't bound to the product, even though they can be tracked in the products table.

 

I already tried to do some quick fix for this (making the image column names unique), however i'm afraid the users that will deal with my shop will not understand mysql errors and will have a very hard time to track filenames themselves. When I have more time I will code a seperate dialog/form apart from the product submission to upload images. This way the product_id is always available and uploads of images don't get lost when some required fields of the product submission failed. This way you can use the product_id to prefix the images or make a new folder with the product_id and put the images in there.

 

I would also suggest to make a seperate table for the product images and remove the added columns to the products table. Then you'll just join the product tables and the product_image table by it's product_id. It keeps the products table more clean and you can upload as much images as you like to any product. This way you can also give the individual image the same id as they have in the imagetable. Combining with the above product_id named folders; every image will be unique and then it will be possible to upload images with the same names to different products without any worries. This also gives the possibility to upload the same image to both the small, medium, large field and automatically resize them to the apropiate image sizes set in the Images settings. It will make the whole user experience alot easier, especially for those with little know-how about web applications and boosting the site speed as well with apropiate sized images.

Edited by asmoday
Link to comment
Share on other sites

Hi

If you search through the forum there is a fix for this problem but I cannot remember what page.

 

I made the amendment for the fix and now it doesn't give any broken image error messages when I don't upload an image.

 

Regards

Peter

 

Just turn off "Force Images" in the admin and osC will not display the broken image.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

  • 2 weeks later...

Corrected several bugs in additional_images.php in both versions of ultrapics with and without lightbox.

They are posted here: http://addons.oscommerce.com/info/1642

(lightbox version is pending file size approval)

both archives are full package releases.

also compiled a new and complete installation guide for lightbox version.

 

now about the bugs:

 

according to the specifications when small image x is available and large image x is available

ultraimages should generate a thumbnail of small image x that pops up large image x upon clicking. but this didn't work properly as the "if condition" was worded wrong.

 

here's how it was:

 

<?php
} elseif
   (($product_info['products_image_sm_1'] != '') && ($product_info['products_image_sm_1'] != '')) {
?>
 <td align="center" class="smallText">
  <script language="javascript"><!--
	 document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . 'ℑ=1') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
	 <noscript>
	   <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_1']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
	  </noscript>
  </td>

 

look at elseif condition!!

then look at <noscript>generated link points to the wrong image</noscript>

and this same wrong code is applied to all six image sets.

 

 

now same thing with the lightbox version:

 

look at elseif condition here:

 

<?php
} elseif
   (($product_info['products_image_sm_1'] != '') && ($product_info['products_image_sm_1'] != '')) {
?>
 <td align="center" class="smallText">

 

here in the first line you can see how the link is pointing at the wrong image (small image) while it should point to large image:

 

		 <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_1']) . '" target="_blank" rel="lightbox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>

  </td>

 

of course this was fixed in the new version that is going to be on the add-on page once it's size is approved.

Thanx to everyone who has contributed. This is a great add-on and I highly suggest to apply this to a clean oscommerce install to prevent problems. there's only a handful of add-ons that should be applied to a clean os install, This surely is one of them.

Santa's little freelancer

Link to comment
Share on other sites

Corrected several bugs in additional_images.php in both versions of ultrapics with and without lightbox.

They are posted here: http://addons.oscommerce.com/info/1642

(lightbox version is pending file size approval)

both archives are full package releases.

also compiled a new and complete installation guide for lightbox version.

 

Greatly Appreciated! Thanks Nimz! :thumbsup:

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

now keep this legend in mind when attaching images to your product:

 

Products Image: Main Image used in catalog & description page as a small thumbnail. This is the image you click on in the description page.

 

Bigger Image: is the image that you will see when you click on Main image.

 

Pop-up Image: do not use this image as you don't see this image apearing anywhere as it is meant to act as a pop up image with the regular UltraPics without the lightbox.

 

a tip: I set a thumbnail of my product image to Main image. although it will automatically show the image as a thumbnail regardless of size. I set a bigger size of the thumbnail to my bigger image to see it pop up in the lightbox when one clicks on the main page.

 

I brought the quote above by Nimz from a post outside of this thread thinking it may be useful to other UltraPic users.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

i have a problem with lightbox not showing the additional images that have been added via admin - When i click to enlarge an additional image it just loads in the normal windows pop up (opens a new page with the image displayed inside) - i want lightbox to open my additional image with also the option to go through the other images like on the demo site for lightbox. Can anyone help please?

Edited by weddingdayessentials
Link to comment
Share on other sites

i have a problem with lightbox not showing the additional images that have been added via admin - When i click to enlarge an additional image it just loads in the normal windows pop up (opens a new page with the image displayed inside) - i want lightbox to open my additional image with also the option to go through the other images like on the demo site for lightbox. Can anyone help please?

 

ok so i added [product] to the rel="lightbox" line that was originally in my product_info.php so it reads rel="lightbox[product]" simple.

Link to comment
Share on other sites

show product name in lightbox and possibly other text?? I've been searching this thread for an answer but had no luck. Can anyone tell me which file to modify and what code to enter to get lightbox to display the product name and any text i wish to add???

 

Thanks

Link to comment
Share on other sites

I've fixed the code to ensure the pop up image also opens in a lightbox. fix is posted on the contribution page.

 

as for displaying the products name with the image on the lightbox first make sure you have applied the latest fix I posted on the contribution page of this add-on then do the following:

 

 

open products_info.php:

 

FIND:

 

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_med']) . '" rel="lightbox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>

 

REPLACE:

 

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_med']) . '" rel="lightbox" title="'. $product_info['products_name'] . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>

 

This would add the name of the product to the bottom of the image in the lightbox.

if you compare the two pieces of code you can see that the only difference is the addition of:

 

title= " your line of text"

 

which is now set to the product's name. you can enter anything in between the " " and it will appear on the bottom of the image lightbox as long as you use the correct syntax.

Santa's little freelancer

Link to comment
Share on other sites

Hello - Am I missing something> I am trying to install & all seems very straightforward except for one thing...

The admin/ files don't have manual edit instructions. I cannot overwrite mine as I already have modified files (MSRP contrib makes many changes to admin/categories.php).

 

I have downloaded the previous version (without lightbox) and it has instructions - but is the install the same on the admin side with light box?

 

Can anyone help please?

Link to comment
Share on other sites

  • 2 weeks later...

I am having a problem understanding these manual install instructions for version 2.04. Everything is fine until I get to the admin/catalog.php instructions, on the part where it reads:

 

***BOF NOTE***

THE THRID LINE MAY HAVE TO BE MANUALLY EDITED

*PASTE THIS

, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6

*AFTER THIS

products_image

*PASTE THIS

. "', '" . tep_db_input($product['products_image_med']) . "', '" . tep_db_input($product['products_image_lrg']) . "', '" . tep_db_input($product['products_image_sm_1']) . "', '" . tep_db_input($product['products_image_xl_1']) . "', '" . tep_db_input($product['products_image_sm_2']) . "', '" . tep_db_input($product['products_image_xl_2']) . "', '" . tep_db_input($product['products_image_sm_3']) . "', '" . tep_db_input($product['products_image_xl_3']) . "', '" . tep_db_input($product['products_image_sm_4']) . "', '" . tep_db_input($product['products_image_xl_4']) . "', '" . tep_db_input($product['products_image_sm_5']) . "', '" . tep_db_input($product['products_image_xl_5']) . "', '" . tep_db_input($product['products_image_sm_6']) . "', '" . tep_db_input($product['products_image_xl_6'])

*AFTER THIS

tep_db_input($product['products_image'])

***EOF NOTE***

 

I am puzzled by this part, because not only does it not say what portion may need to be edited, but it doesn't tell me where to put this at. Where does this portion of the code go??

Link to comment
Share on other sites

Hello - Am I missing something> I am trying to install & all seems very straightforward except for one thing...

The admin/ files don't have manual edit instructions. I cannot overwrite mine as I already have modified files (MSRP contrib makes many changes to admin/categories.php).

 

I have downloaded the previous version (without lightbox) and it has instructions - but is the install the same on the admin side with light box?

 

Can anyone help please?

 

...anybody?

Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

 

I am very new to this and will need and appriciate your help. I have correctly made the changes but my problem is getting the commands on the SQL to work. I have been told that I have to put them one by one as if they are all put in at once it will not work. (Just to clarify this, it's my first time using the SQL).

 

I started to put them one by one and the 'INSERT TO'

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Enable Additional Images?', 'ULTIMATE_ADDITIONAL_IMAGES', 'enable', 'Display Additional Images below Product Description?', 4, 10, now(), now(), NULL, 'tep_cfg_select_option(array(\'enable\', \'disable\'),');

 

Seems to work fine when added one by one.

 

BUT as soon as I start to put these 'ALTER TABLE' in the same SQL window

ALTER TABLE `products` ADD `products_image_med` VARCHAR(64) AFTER `products_image`;

 

I start getting errors. What am I doing wrong? Am I not supposed to put them all in the same box?

 

Maybe I am not getting it in the right place as all this has been done guess work. This site is an addon domain at my other site so, What I do is, I go to:-

Cpanel--php/my/admin--(choose my database on the left hand side)--(a big table of files comes up & I dont click on any of them but go staright to the top SQL button and a big box comes up--I writte the first command '''INSERT INTO configuration.... and it works fine'''--I then press the Edit button so that I can add the rest one by one and another box opens and allows me to add them one by one, they all work--as soon as the is done and I start the 'ALTER TABLE' I get:

 

Error

SQL query:

# Affected rows: 1

ALTER TABLE `products` ADD `products_image_lrg` VARCHAR( 64 ) AFTER `products_image_med` ;

MySQL said:

#1060 - Duplicate column name 'products_image_lrg'

 

I AM NOT SURE WHY I KEEP GETTING THIS BUT I DO NOT DUPLICATE THEM, IT WILL NOT EVEN ALLOW ME TO GET THE SECOND ONE IN.

 

Your help will be much appriciated, I am also very sorry about this massive essay.

 

Thank you in advance

reloadzzz

Link to comment
Share on other sites

Hi all,

 

I am very new to this and will need and appriciate your help. I have correctly made the changes but my problem is getting the commands on the SQL to work. I have been told that I have to put them one by one as if they are all put in at once it will not work. (Just to clarify this, it's my first time using the SQL).

 

I started to put them one by one and the 'INSERT TO'

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Enable Additional Images?', 'ULTIMATE_ADDITIONAL_IMAGES', 'enable', 'Display Additional Images below Product Description?', 4, 10, now(), now(), NULL, 'tep_cfg_select_option(array(\'enable\', \'disable\'),');

 

Seems to work fine when added one by one.

 

BUT as soon as I start to put these 'ALTER TABLE' in the same SQL window

ALTER TABLE `products` ADD `products_image_med` VARCHAR(64) AFTER `products_image`;

 

I start getting errors. What am I doing wrong? Am I not supposed to put them all in the same box?

 

Maybe I am not getting it in the right place as all this has been done guess work. This site is an addon domain at my other site so, What I do is, I go to:-

Cpanel--php/my/admin--(choose my database on the left hand side)--(a big table of files comes up & I dont click on any of them but go staright to the top SQL button and a big box comes up--I writte the first command '''INSERT INTO configuration.... and it works fine'''--I then press the Edit button so that I can add the rest one by one and another box opens and allows me to add them one by one, they all work--as soon as the is done and I start the 'ALTER TABLE' I get:

 

Error

SQL query:

# Affected rows: 1

ALTER TABLE `products` ADD `products_image_lrg` VARCHAR( 64 ) AFTER `products_image_med` ;

MySQL said:

#1060 - Duplicate column name 'products_image_lrg'

 

I AM NOT SURE WHY I KEEP GETTING THIS BUT I DO NOT DUPLICATE THEM, IT WILL NOT EVEN ALLOW ME TO GET THE SECOND ONE IN.

 

Your help will be much appriciated, I am also very sorry about this massive essay.

 

Thank you in advance

reloadzzz

 

"Duplicate column name 'products_image_lrg'" means u already have this column in the products table.

go to phpmyadmin and double check the table see if you see that column.

Santa's little freelancer

Link to comment
Share on other sites

Hello..

I love this contrib!!!

i just need a bit of helt with a simple thing..

It all seems to work fine, excpt that my extra images don't show up for the customer..

Any hints on where i have to look and what i have to change?

 

Thanks in advance..

Steph

Link to comment
Share on other sites

In addition to the above..

Maybe someone could have a look at my page?

i have made a link to the product i use as a test.. i have uploaded 6 images to this product, both in SM and XL.. but nothing happens..

The Lightbox of the original image works fine, but i can't see the rest..

here is the link:

test product on my website..

 

Furthermore.. i have way too many of the same i my image part of the admin.. is this normal?

imagestoo.jpg

Link to comment
Share on other sites

Hi Just a Quicky, lightbox works a treat just 2 problems

 

1. If page load is not complete and image is clicked opens in new tab

2. more important one, there is no next and previous buttons on the pop up any ideas

 

Thank for a great contrib

Edited by twokxltd
Link to comment
Share on other sites

@ firben

 

Hm it could be something simple, and in simple things I am good :)

 

Do you have in filename product_info.php

 

after:

<!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //-->
<?php
if ($product_info['products_image_med']!='') {
	  $new_image = $product_info['products_image_med'];
	  $image_width = MEDIUM_IMAGE_WIDTH;
	  $image_height = MEDIUM_IMAGE_HEIGHT;
	 } else {
	  $new_image = $product_info['products_image'];
	  $image_width = SMALL_IMAGE_WIDTH;
	  $image_height = SMALL_IMAGE_HEIGHT;}?>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_med']) . '" rel="lightbox[grouped]">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
<!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! //-->
		  </td>
		</tr>

 

this:

	 <?php
// BOF MaxiDVD: Modified For Ultimate Images Pack!
if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') { include(DIR_WS_MODULES . 'additional_images.php'); }
// BOF MaxiDVD: Modified For Ultimate Images Pack!
; ?>

 

 

At your second question I would say you have uploaded the sql-file two times to many. You can remove two out of three lines via i.e. phpMyAdmin

 

Hope this was helpfull.

Seize the Night!

 

Handy Contrib:

RSS News v0.8 Scrolls news from an xml file in a infobox.

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