Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] More_pics_6 v1.1 For osC 2.2 MS2


surfalot

Recommended Posts

Hello MoPics gurus,

 

I have MoPics working on my MS2 install.

 

I had automatic thumbnail installed but I removed it after it stopped working and I decided to use the MoPics thumbnail method i.e. I also uplaod an image with _s appended to the filename.

 

It worked great until... it stopped working. I am baffled. I didn't do anything to my store other than to add a new product.

 

The _s file is no longer loaded eventhough it is present on the server. But this is for the 1st image only.

 

The other images load the _s file fine and then load the full size image when I click on them...

 

Any clues as to how to fix this?

 

Thanks in advance.

 

Karim.

Link to comment
Share on other sites

  • Replies 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

The _s file is no longer loaded eventhough it is present on the server. But this is for the 1st image only.

 

The other images load the _s file fine and then load the full size image when I click on them...

 

you must be using it with the more pics separated from the default pic. when that option was added, I forgot to update the directions for the thumbnail quick fix. Here are the rest of the changes for that option:

 

also in product_info.php find:

<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
<?php // EOF: More Pics 6 ?>
</noscript>

change to:

<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image( DIR_WS_IMAGES.(file_exists(DIR_WS_IMAGES.str_replace( '.','_s.',$product_info['products_image']))?str_replace( '.','_s.',$product_info['products_image']):$product_info['products_image']), addslashes($product_info['products_name']), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . (file_exists(DIR_WS_IMAGES.str_replace( '.','_s.',$product_info['products_image']))?str_replace( '.','_s.',$product_info['products_image']):$product_info['products_image']), $product_info['products_name'], (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
<?php // EOF: More Pics 6 ?>
</noscript>

Link to comment
Share on other sites

Thanks a lot for the fix surfalot. The small images are now _s files.

 

It now works on the product_info page but it doesn't work on the index page when the products in one category are listed (ex: http://www.domain.com/index.php?cPath=25_56)

 

Another problem is that when I click on the main (parent) small image in the product_info page, I get this:

 

-------------------

Not Found

 

The requested URL /java script:popupWindow('http://www.domain.com/popup_image.php was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Apache/1.3.37 Server at www.domain.com Port 80

------------------

 

If I click on another image (not the parent one), I can access the main image with the arrows in the popup window.

 

Any ideas?

 

Thanks. :thumbsup:

 

 

you must be using it with the more pics separated from the default pic. when that option was added, I forgot to update the directions for the thumbnail quick fix.
Link to comment
Share on other sites

I think it is normal that the images on index.php are the full images but what about the error when I click on the image (to see the full one)?

 

 

-------------------

Not Found

 

The requested URL /java script:popupWindow('http://www.domain.com/popup_image.php was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Apache/1.3.37 Server at www.domain.com Port 80

------------------

Link to comment
Share on other sites

I think it is normal that the images on index.php are the full images but what about the error when I click on the image (to see the full one)?

Can't tell you why. It's working perfectly with my test installation. I've tried IE and Firefox. If you provide a link to the page and the browser you are using, I can look at the output.

Link to comment
Share on other sites

It now works on the product_info page but it doesn't work on the index page when the products in one category are listed (ex: http://www.domain.com/index.php?cPath=25_56)

yes, like I say in the directions, it's not an ideal solution. you need to make a change in each place an image is displayed.

 

In the last instruction of the thumbnail quick fixes, I have replaced the

$new_products['products_image']

with

(file_exists(DIR_WS_IMAGES.str_replace( '.','_s.',$new_products['products_image']))?str_replace( '.','_s.',$new_products['products_image']):$new_products['products_image'])

of the /catalog/includes/modules/new_products.php file.

 

the icons on the product list (index.php) would be in:

 

/catalog/includes/modules/product_listing.php

 

replace each of these

$listing['products_image']

with

 

(file_exists(DIR_WS_IMAGES.str_replace( '.','_s.',$listing['products_image']))?str_replace( '.','_s.',$listing['products_image']):$listing['products_image'])

Link to comment
Share on other sites

Can't tell you why. It's working perfectly with my test installation. I've tried IE and Firefox. If you provide a link to the page and the browser you are using, I can look at the output.

 

 

Thanks for the Help.

 

Here is a link to a page where I have this problem:

 

http://corner73.com/product_info.php?cPath...;products_id=44

 

If you click on the parent image, you get the error message.

 

The other ones are fine...

 

Let me know if you have an idea.

 

Thanks again :thumbsup:

Link to comment
Share on other sites

Thanks for the Help.

Here is a link to a page where I have this problem:

I see the problem now. looks like we fell victim to the dreaded forum spacer. it's suppost to leave "code" items unchanged when posting. in the find and replace items I posted, in both, the forum inserted a space in the words "javascript". Search your page for "java script" and replace it with "javascript" Hopefully it didn't garble anything else up.

Edited by surfalot
Link to comment
Share on other sites

I see the problem now. looks like we fell victim to the dreaded forum spacer. it's suppost to leave "code" items unchanged when posting. in the find and replace items I posted, in both, the forum inserted a space in the words "javascript". Search your page for "java script" and replace it with "javascript" Hopefully it didn't garble anything else up.

 

 

That was simple!

 

Works perfect.

 

Thanks a million :thumbsup:

Link to comment
Share on other sites

If you view this link for example,

 

http://www.prodigycellular.com/new/nokia-6...shed-p-283.html

 

You can see it in action. Its a little glitchy to me, I dont know if that's because I have my next and prev images set, not just on hover.. Anyways, I just manually have it set up for now until I have time to fix it. I place the php code for the different subimages where I want them, might even give you more flexability to space them out as needed. The only bad part is, that it will be in the same place for ever product that is displayed. But, that's pretty much how it was before. Unless you actually echo'd the php thru your description field to place the images where you need them based on perhaps, certain text in your description.

 

All I did was remove the morepics scripts in the product_info.php for where it places the above table.

What happens if you have products without extra images?

 

Would it be possible to code it so that there are no extra images present?

 

I know that more pics 6 1.2b has an option in admin not to display the extra images yet when you click to enlarge the image you get the extra images, Would it be possible to make Lightbox to this also?

Link to comment
Share on other sites

My apologies for the previous long post, I am new to this whole thing. I still haven't figured out why:

 

When I add multiple images to a product the primary image looks ok and has the click to enlarge link below but the pop-up link is not active. The other images seem to work just fine and you can see the primary when you use the arrows to scroll thru the images. If i just have one image as the primary the click to enlarge link works, so it is only when adding images.

 

This seems to be a problem only on Windows IE, I am using XP SP2. Firefox doesn't seem to have this problem. I assume it is a problem using the JavaScript w/ IE.

 

I have also noticed that IE doesn’t display the "Close Window" again another JavaScript issue

 

http://www.fun4baby.com/catalog/diaper-bag...4aba751a60ede9f

 

Any ideas on how I might resolve this?

Link to comment
Share on other sites

My apologies for the previous long post, I am new to this whole thing. I still haven't figured out why:

 

When I add multiple images to a product the primary image looks ok and has the click to enlarge link below but the pop-up link is not active. The other images seem to work just fine and you can see the primary when you use the arrows to scroll thru the images. If i just have one image as the primary the click to enlarge link works, so it is only when adding images.

 

This seems to be a problem only on Windows IE, I am using XP SP2. Firefox doesn't seem to have this problem. I assume it is a problem using the JavaScript w/ IE.

 

I have also noticed that IE doesn’t display the "Close Window" again another JavaScript issue

the close button is not a javascript problem, the image is not there: http://www.fun4baby.com/catalog/images/close.gif

 

I'm not experiencing the problem you describe. Are you using IE7? I'm using IE6 still.

 

the problem may be in your fixPNG() javascript. try removing that from the page and see if it works. none of the lines of your javascript end with a semicolon. All the line of a javascript should end with a semi-colon, just like PHP.

Edited by surfalot
Link to comment
Share on other sites

Thanks sirfalot :D ... that fixed most of my problems. I am still having problems with IE, I even upgraded to IE 7 and still have the same problem... the picture ref works, but the click on enlarge text doesn't on IE only. Wierd I am not going to worry about. I even tried to take out the fixPNG completely and cleared cache. Moving on... Thanks again

Link to comment
Share on other sites

I am still having problems with IE, I even upgraded to IE 7 and still have the same problem...

I see the problem now, it's only the bottom half of the image (and click text). That's why I didn't see it before. IE's rendering engine is stopping the link halfway down the image/text link area.

 

This is related to the IE rendering engine problem. When 2 tables with alignments defined are in the same area, they can actually overlap like having 2 overlapping html DIVs with absolute positioning. the default product image is inside a right aligned table, the more pics are in a center aligned table.

 

Long story short. the problem disappears when you have enough description text to push the More Pics images below the bottom of the default product image. If you are going to have products with very little or no description we can modify the more pics code for your shop and remove the table alignment on the more pics block. that will force the table below the default image and leave a blank space where a longer product description would be.

 

The only other way to avoid this problem is to group the more pics images with the "parent", or default product image. (in the more pics config settings in you admin) You could make a one or 2 column image block along the side of your product description in the settings also.

 

In the course of looking at this I have discovered a logic error in this more pics release that is outputting an empty table on the product with no additional images added. this will not affect the issue you are seeing, but look for an update to fix that in the future.

Link to comment
Share on other sites

This contrib sound interesting - I wonder if you are in control over where the images are uploaded?

 

I mean, I have several categories, and have made image folders for each, so it's like:

 

images/cat1/ lots of images....

images/cat2/ even more pictures...

 

etc.

 

Can you this contrib select which folders to upload to everytime you put in a new product?

 

Helle :-)

Link to comment
Share on other sites

This contrib sound interesting - I wonder if you are in control over where the images are uploaded?

 

I mean, I have several categories, and have made image folders for each, so it's like:

 

images/cat1/ lots of images....

images/cat2/ even more pictures...

 

etc.

 

Can you this contrib select which folders to upload to everytime you put in a new product?

 

Helle :-)

Look in the other contrib intergration folder

Link to comment
Share on other sites

Is there a way to change the file name (prodid_file name or somthing like that) on upload (insert/update) so that the file with the same name as of an excistiong one wont over write the original?

no. As in the original osC code, this contrib assumes you are paying attention to name files uniquely

Link to comment
Share on other sites

Ehhhh what other "contrib intergration folder" - do you mean look for another contrib?

 

Sorry, I just don't understand your answer

 

Helle :-)

the folder Get-Wireless 2 is refering to is in the zip package you downloaded. But that won't help.

 

no there is no a way to specify the folder the image is uploaded to. aside from deleting images not it use anymore, this contrib uploads images the same way the original osC code does.

Link to comment
Share on other sites

the folder Get-Wireless 2 is refering to is in the zip package you downloaded. But that won't help.

 

no there is no a way to specify the folder the image is uploaded to. aside from deleting images not it use anymore, this contrib uploads images the same way the original osC code does.

 

 

Okay - thank you. Then I can't use this contrib....

 

Helle :-)

Link to comment
Share on other sites

Please, pRiebe, wilfy, maybe surfalot,

 

Did you find the line to replace for the $mopics_output to succeed opening the link in a lightbox?

 

I'm trying to replace

$mopics_output .= '			  <td align="center" class="smallText"><script language="javascript"><!--
			document.write(\'<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'].'&invis='.(MOPICS_GROUP_WITH_PARENT=='true'?$mo_item:($mo_item+1))).'\\\')">' . tep_image(DIR_WS_IMAGES . $mopics_images[$mo_item], addslashes($product_info['products_name']), (MOPICS_RESTRICT_PARENT=='false'&&$mo_item==0&&MOPICS_GROUP_WITH_PARENT=='true'?'':$mopics_image_width), (MOPICS_RESTRICT_PARENT=='false'&&$mo_item==0&&MOPICS_GROUP_WITH_PARENT=='true'?'':$mopics_image_height), 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>\');
			//--></script><noscript>
			  <a href="' . tep_href_link(DIR_WS_IMAGES . $mopics_images[$mo_item]) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $mopics_images[$mo_item], $product_info['products_name'], $mopics_image_width, $mopics_image_height, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>
			  </noscript></td>'."\n";

 

I'd like to have the same pictures displayed but with the linkrel lightbox.

 

To explain, I'm in the middle of the morepics / ajax popup image conflict!

 

The first contrib display 6 products below the description and the second display them in one column to the right. If I delete the lines about the column, I don't have the lightbox previous and next buttons. So I let the

lines but replaced pictures'adress by a "blank.gif" one pixel. (except for the first one, the principal picture, in order to open the lightbox and have the previous and next buttons)

Now stand the 6 products displayed by the morepics contrib, but they open in a new pop up window, what I

don't like.

 

It seems to work at these two oscommerce adresses found in this thread:

http://www.prodigycellular.com/new/nokia-6...shed-p-283.html

http://www.jaldijaldi.co.uk/product_info.p...products_id=122

 

so maybe you can help me.

 

And I'm very sorry that I didn't know how to explain my problem shortlier, and for my english!

Thanks.

Link to comment
Share on other sites

I have read until I am cross-eyed, I have hunted and pecked with HTML kit and winmerge, I have the tools, but not the knowledge.

I have sts 4 (with header tags) and on the fly thumbnails. I am trying to get more pics installed. I get "Parse error: parse error, unexpected T_ELSE in .../admin/categories.php on line 844" and of course I cannot get into admin catalog. My admin config works fine, and the more pics option is there and seems to be functional.

Here is some of the code before and after line 844:

 

 

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>

</tr>

</table></form>

 

<!-- HTC BOC //-->

<?php

} elseif ($action == 'new_product_preview') {

if (tep_not_null($HTTP_POST_VARS)) {

$pInfo = new objectInfo($HTTP_POST_VARS);

$products_name = $HTTP_POST_VARS['products_name'];

$products_description = $HTTP_POST_VARS['products_description'];

$products_head_title_tag = $HTTP_POST_VARS['products_head_title_tag'];

$products_head_desc_tag = $HTTP_POST_VARS['products_head_desc_tag'];

$products_head_keywords_tag = $HTTP_POST_VARS['products_head_keywords_tag'];

$products_url = $HTTP_POST_VARS['products_url'];

} else {

// BOF: More Pics 6 Added: , p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6

$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");

// EOF: More Pics 6

$product = tep_db_fetch_array($product_query);

 

I am pretty sure that it is simply an extra bracket or...from when I merged the two files, but I simply cannot find it.

Can someone help a newbie through this pretty please?

learn...love...laugh...live

Link to comment
Share on other sites

Now I feel dumb. All I had to do was break down and ask for help, and then go read another thread and I find a link to 'Edit Plus'. It tracked down my missing bracket with about a 30 second learning curve!

So, now I can get into my administration catalog, looks great. *Until* I try to add a product. What a mess!! I don't know how to take a screenshot, but I have three seperate instances of 'product image1/remove image/product image2/remove' etc. And no picture files are being uploaded when I hit preview!

I am way out of my league here. If some PHP guru could find it in their heart...

learn...love...laugh...live

Link to comment
Share on other sites

hey Nae,

 

I didn't actually script it to work with the contribution. I have each one of those pictures set manually. I dont use the columns and rows that is in the admin file. I stopped working on this because I had issues with the live site. I am sure I will back on this again here shortly and I will reply with fixed $mopics_output.

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