Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Who would like to see a dynamic MoPics?


dreamscape

Recommended Posts

after working with several people on different problems they were having, Dynamic MoPics v2.0 is here!

 

Why jump to version 2.0? The code has been very much optimized for much much faster parsing time. v2.0 also conatins all previous bug fixes in versions 1.0 - 1.21

 

MAX_DISPLAY_THUMBS is now obsolete. you are only limited by how many extra thumbs u think you can handle making ;)

 

The display code will only be run based on how many extra thumbs it finds rather than MAX_DISPLAY_THUMBS.

 

*Note* if upgrading, just overwrite the popup_image and dynamic_mopics files

 

http://www.oscommerce.com/community/contributions,1114

and make sure you have the same defines for configure.php

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

Hello dreamscape,

I have installed your Mod, it is cool, but i still got 2 problems, please help to shoot it out, thanks:

The first one, I tried many times to put my main thumb pictures in the images/thumbs directory, and when i set the product info, I choose the images/thumbs/image.jpg for the thumb pic, but it don't work, only when i put the image.jpg under the image directory instead inside the thumbs directory, and also, I need to set the configure.php to turn if off.

 define('IN_IMAGE_BIGIMAGES','images_big/'); //directory inside catalog/images where your big images are stored

 define('IN_IMAGE_THUMBS', 'thumbs/'); //directory inside catalog/images where you mopic thumbs are stored..

 define('MAIN_THUMB_IN_SUBDIR', false); //if you store your main thumb in the above directory set this true.  if its in the main image dir, set it false

 define('THUMBS_PER_ROW', '5');

 define('MORE_PICS_EXT', '_screen');

 define('BIG_PIC_EXT', ''); // this is if you name your big thumb like IMAGE_big.jpg, you would put '_big' here.  otherwise leave it blank

 define('THUMB_IMAGE_TYPE', 'jpg'); //the extention for the extra thumbnail images (jpg, gif, bmp, png, etc...)

 define('BIG_IMAGE_TYPE', 'jpg'); //the extention for your big images (jpg, gif,)

2. Another problem is the screenshot squence, the thumb pictures squence seems to be alright, but when i click to get the big image, it will show the next big image instead of the current one, as a result, when i click the final thumb, it shows nothing, what happened to it? please help

by the way, I have pm my testing site for you to have a look, thanks a lot!

Link to comment
Share on other sites

you are correct... if your main thumb is in the main image directory, then you would set 'MAIN_THUMB_IN_SUBDIR' to false...

 

also to get it to the thumb directory in admin, you would get it to thumbs/image.jpg and NOT images/thumbs/image.jpg as OSC adds in the images/ when it calls images.

 

so the pics, that is a small mistake on my part in v2. I placed a line in the wrong spot, causing the large image to be the next in line, rather than its thumb. I am uploading a fix now.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

also to get it to the thumb directory in admin, you would get it to thumbs/image.jpg and NOT images/thumbs/image.jpg as OSC adds in the images/ when it calls images.

so, anyways to let the osc to call the main thumb image in the images/thumbs/ instead under /images/?

since it would be more organized to place all the small main thumbs inside a folder rather than put them in the image folder, there are already too many pictures in the image folder, once if i have many products, there will have many main thumbs inside the image directory, too difficult to manage, by the way, I have gone to your site and see that your main thumb image is also put under the images/thumbs/ directory, how to do so? could you help? many thanks!!! :wink:

Link to comment
Share on other sites

just as I said...

 

in admin, in the image field type in thumbs/image.jpg

dreamscape, I tried to put the main thumbs picture under the image/thumbs/ directory, and set the option in configure.php to true, I found there is a little bit strange behaviour...

in admin, when i type in the path such as thumbs/image.jpg in the product info, click preview, I found the the picture can't be show up, I go inside the /image/thumbs/ to check the file, I saw the the image.jpg file size become zero, I tried many times and the behaviour insist. Finally, I find a way to set it and the pictures show up this time without any problem, that is, I typed in the path thumbs/image.jpg first in the product info, and then finished the insert of the product, after that, then copied the image.jpg main thumb into the /image/thumbs/, only in the way, so I can run it without any problem, anyway, why there is such a strange behaviour?

Link to comment
Share on other sites

the strange behavior is OSC and not to due with anything I've written...

 

if you try to type a path to the image in admin (like thumbs/image.jpg), OSC will overwrite the file with a 0kb file of the same name, and you must re-upload your image... this is a problem with OSC.

 

since I upload all of my images myself anyways, I have just chmodded to images directory so that OSC cannot write to it and therefore cannot overwrite my images with a 0kb file :)

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

:roll: ugh, tell me about this.

 

I get hit by this image problem every so often and it could be annoying if the user is depending on a webbrowser to upload images.

 

I wonder if anybody has reported this as a bug yet?

NewsDesk(934) / FAQDesk(1106) / OrderCheck(1168) :::

Link to comment
Share on other sites

  • 2 weeks later...

when i go to the admin side and i type in thumbs/image.jpg the pop up works just fine but the thumb does not display on the site.....wierd....now when i use the admin to upload the thumb that i want shown ....it will display but the pop will not ...it will not even show that message..?

I am just a newbee....

Link to comment
Share on other sites

when i go to the admin side and i type in thumbs/image.jpg the pop up works just fine but the thumb does not display on the site

 

did u read the above??? are u getting a red X for the thumb? FTP to the site and look in images/thumbs and look at the image.jpg file... is it there?? is it 0KB in size?? if so, that is OSC being its ugly self.

 

I would recommend CHMODing the images direcotry to 644 with this contribution so that OSC cannot overwrite your images with blank 0K files.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

Step 4:

 

open catalog product_info.php

 

Place this where you would like the MoPics to show up:

 

     <tr>

             <td>

<?php include(DIR_WS_MODULES . FILENAME_DYNAMIC_MOPICS); ?>

       </td>

     </tr>

 

 

i am not sure where to put this bit of code ....does it matter

 

chris

I am just a newbee....

Link to comment
Share on other sites

....does it matter

 

chris

 

no... and thats really the point... it designed as a drop in module pretty much...

 

where-ever in your page you want the mopics to appear just put in:

 

<?php include(DIR_WS_MODULES . FILENAME_DYNAMIC_MOPICS); ?>

 

... I put it around the tr and td tags because that is how the OSC main page section is split up, each part is in a tr and td, so i just included them so that its easier to drop it in below like the product description... but basically just put the include where u'd like the extra images to show up.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

<tr>

             <td>

<?php include(DIR_WS_MODULES . FILENAME_DYNAMIC_MOPICS); ?>

       </td>

     </tr>

</noscript>

 

i put it here this is about lines 105 or 106 or so...... does it matter....oh and now i get what you are saying about the chmod.. sometimes i am a little slower than most....but i show up eventually...but anyway does it matter where this code is placed...thanks for the great mod....and your site is awsome..... :lol:

I am just a newbee....

Link to comment
Share on other sites

if you are placing it there:

 

<noscript>  

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>  

<tr>  

<td>  

<?php include(DIR_WS_MODULES . FILENAME_DYNAMIC_MOPICS); ?>  

</td>  

</tr>  

</noscript>

 

take the tr's and td's out since it is gonna be in the same tr and td as the regular image. if u want it there, place it like this:

 

<noscript>  

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>  

</noscript>

<?php include(DIR_WS_MODULES . FILENAME_DYNAMIC_MOPICS); ?>

 

hope that helps

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

you are tops....man i gotta hand it to you...it works like a charm.....you see the code so much clearer than i do....i stare at it for a while before i really see whats going on........it works great...i wonder why osc writes over my jpg.....? oh well thanks again for the great mod

 

chris :D

I am just a newbee....

Link to comment
Share on other sites

it didnt work like this

 

<noscript>  

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>  

</noscript>  

<?php include(DIR_WS_MODULES . FILENAME_DYNAMIC_MOPICS); ?>

 

but it worked like this

 

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

<?php include(DIR_WS_MODULES . FILENAME_DYNAMIC_MOPICS); ?>

</noscript>

 

thought i would just put that out there for anyone interested...i know you dont need this info josh...but just in case some one else might need to configure this great mod.

I am just a newbee....

Link to comment
Share on other sites

  • 8 months later...

HI,

 

I got the contribution working however my color swatches seem to be blown up. Is there a way to make the thumbs smaller.

 

Also how do i get the popup window for them to go, these are color swatches that don't need to be a popup.

 

Thanks

 

Paris

Link to comment
Share on other sites

HI,

 

I got the contribution working however my color swatches seem to be blown up. Is there a way to make the thumbs smaller.

 

Also how do i get the popup window for them to go, these are color swatches that don't need to be a popup.

 

Thanks

 

Paris

check in admin->configuration->images at the Small Image Width and Small Image Height. If you set these to nothing (blank), the images will be the correct size.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

Hi,

 

I just tried that and the whole front page images went rather large. So i can't set the small images to 0.

 

Do you know of any other ways of doing so.

 

Thank you

 

Paris

Edited by Paris_Hayes
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...