Jump to content
Sign in to follow this  
dreamscape

[Contribution] Dynamic MoPics

Recommended Posts

My trial at this has not worked.

 

Perhaps I just did a whole bunch of stupid things.

 

So, I just took it out and went back to the original.

 

Perhaps I will try it again whenever I am finished other matters.


BG

 

Making the internet community better. Knowledge is power.

Share this post


Link to post
Share on other sites

I can?t try mopics because when i clik to enlarge i get this error:

 

Fatal error: Call to undefined function: remove_current_page() in /home/collectp/public_html/cpcart/popup_image.php on line 15

 

How can i fix this?

Share this post


Link to post
Share on other sites

I'm still quite clueless about the use of mopics...can anybody please explain how to use it?

 

I've installed Dynamic Mopics 2.01 as stated in the install.txt file but how do I edit/add/remove/configure the images? At the admin section? Coz I still see the same interface in the admin section...any advice?

 

FIY, the text "coming soon" can be seen.

Share this post


Link to post
Share on other sites

Does anyone know if MoPics has to be installed before Dynamic MoPics is installed? I'm unsure if an admin interface is needed.

 

Or are the images dynamically added based on configure.php settings and the existence of the images in big_images and thumbs folders?

 

Thanks.

Share this post


Link to post
Share on other sites

Bluestallion -

I figured it out. Like the name says, it's dynamic :) and the images (extras) are figured out depending on the file name.

 

If your settings in configure.php are:

 

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', true); //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', '4');

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, bmp, png, etc...)

 

 

Then, do this:

create 2 folders - images_big and thumbs.

If the main image thumbnail is TEST.jpg, then create the larger version and call it THUMB.jpg - put the larger version in the images_big folder.

 

If you have multiple thumbnails (These are displayed where you see 'Coming Soon' on your product page), name them TEST_screen1.jpg, TEST_screen2.jpg, etc.

Share this post


Link to post
Share on other sites

I'm still not sure if u can have multiple big images for the corresponding thumbnails - if someone can shed some light on this...

Share this post


Link to post
Share on other sites

Hi,

 

I'm using this contrib just for the smaller thumbnails; not the moPics. Neither one is working though. I've read all the posts and the Install.txt and I think I'm doing it right:

 

define('IN_IMAGE_BIGIMAGES','images_big/');

define('IN_IMAGE_THUMBS', 'thumbs/');

define('MAIN_THUMB_IN_SUBDIR', false);

define('THUMBS_PER_ROW', '4');

define('MORE_PICS_EXT', '_screen');

define('BIG_PIC_EXT', '');

define('THUMB_IMAGE_TYPE', 'jpg');

define('BIG_IMAGE_TYPE', 'jpg');

 

with the thumbnails in catalog/images and the big images in catalog/images/imgaes_big

 

When I click to enlarge, all I get is a blank box: for example, see

 

http://www.playgroundforthemind.com/catalo...&products_id=41

 

All the permissions look fine. Any ideas appreciated.

 

Thanks

Share this post


Link to post
Share on other sites

Nevermind . . . I'd forgotten that we were using a mix of jpg and jpeg extensions, and so when moPics defined the extension as jpg, none of the jpegs were working. And then you can't just rename them, you have to tell the database that you've renamed them too.

 

So now it's working like a charm; great contrib - I especially like the fact that it's not necessary to completely replace admin/categories.php unlike some of the other thumbnail contribs.

 

Ben

Share this post


Link to post
Share on other sites

thanks for that info...

 

I am working on a new version that moves the config to admin under configuration -> images & improved logic in the dynamic_mopics.php module...

 

perhaps with jpg format I should check for image.jpeg if image.jpg doesn't exsist.


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

- Edmund Burke

Share this post


Link to post
Share on other sites

Ok, this baffled me at first and its probably the same problem that badjuju is running into so this might help him/her. The issue is the mopic big image names are not intuitive. You gotta read the small print in the instructions, but basically the problem is that the big images for the mopics have to be the SAME NAME as the thumbs. They don't have the BIG_PIC_EXT extension like the main big image. So here is my test example layout to help clarify.

 

File structure:

images/thumbs

images/big_images

 

Configure.php setup:

define('IN_IMAGE_BIGIMAGES','big_images/');

define('IN_IMAGE_THUMBS', 'thumbs/');

define('MAIN_THUMB_IN_SUBDIR', true);

define('THUMBS_PER_ROW', '4');

define('MORE_PICS_EXT', '');

define('BIG_PIC_EXT', '_big');

define('THUMB_IMAGE_TYPE', 'gif');

define('BIG_IMAGE_TYPE', 'gif');

 

Test example:

images/thumbs/the_matrix.gif

images/thumbs/the_matrix1.gif

images/thumbs/the_matrix2.gif

images/thumbs/the_matrix3.gif

images/thumbs/the_matrix4.gif

images/thumbs/the_matrix5.gif



images/big_images/the_matrix_big.gif

images/big_images/the_matrix1.gif

images/big_images/the_matrix2.gif

images/big_images/the_matrix3.gif

images/big_images/the_matrix4.gif

images/big_images/the_matrix5.gif

 

The main thing here is to notice that NOT all of the big images have the "_big" extension included.

 

Hope that helps ya badjuju.

 

Matt

Share this post


Link to post
Share on other sites

the only reason I put the BIG_PIC_EXT in is cause some people had alot of products with images already in or made just in the main images directory.

 

The BIG_PIC_EXT is meant to be used if you decide for whatever reson to make your file structure like this:

 

images/the_matrix.gif 

images/thumbs/the_matrix1.gif 

images/thumbs/the_matrix2.gif 

images/thumbs/the_matrix3.gif 

images/thumbs/the_matrix4.gif 

images/thumbs/the_matrix5.gif 



images/the_matrix_big.gif 

images/big_images/the_matrix1.gif 

images/big_images/the_matrix2.gif 

images/big_images/the_matrix3.gif 

images/big_images/the_matrix4.gif 

images/big_images/the_matrix5.gif

 

Otherwise, you do best to save yourself the headache & not use the BIG_PIC_EXT (make it blank) if you are following the structure as it was intended:

images/thumbs/the_matrix.gif 

images/thumbs/the_matrix1.gif 

images/thumbs/the_matrix2.gif 

images/thumbs/the_matrix3.gif 

images/thumbs/the_matrix4.gif 

images/thumbs/the_matrix5.gif 



images/big_images/the_matrix.gif 

images/big_images/the_matrix1.gif 

images/big_images/the_matrix2.gif 

images/big_images/the_matrix3.gif 

images/big_images/the_matrix4.gif 

images/big_images/the_matrix5.gif


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

- Edmund Burke

Share this post


Link to post
Share on other sites

I've been puzzling over this one for days! I actually was just about to dissect some of the dynamic mopics code as I thought there might be a bug somewhere.

 

Thanks for posting these clarifications! These forums are great.

 

-al

Share this post


Link to post
Share on other sites

umm... please post your configuration and naming scheme... then I can help you :wink:


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

- Edmund Burke

Share this post


Link to post
Share on other sites

Sorry... I got a bit caught up in my debugging and forgot to post it. :oops:

 

However, I've managed to sort it out, mostly. I just changed the main_thumb_in_subdir to false and renamed the big image to _b.gif and it's now working.

 

What's not working is the main thumb - it's showing a second copy of the thumb, not the big image.

 

My current defines:

 

define('IN_IMAGE_BIGIMAGES','images_big/');

define('IN_IMAGE_THUMBS', 'thumbs/');

define('MAIN_THUMB_IN_SUBDIR', false);

define('THUMBS_PER_ROW', '3');

define('MORE_PICS_EXT', '_');

define('BIG_PIC_EXT', '_b');

define('THUMB_IMAGE_TYPE', 'gif');

define('BIG_IMAGE_TYPE', 'gif');

 

My current file structure:

 

/images/A107.gif

/image/thumbs/A107_1.gif

/image/thumbs/A107_2.gif

/image/thumbs/A107_3.gif

/image/thumbs/A107_4.gif

/image/thumbs/A107_5.gif

 

/images/images_big/A107_b.gif

/image/images_big/A107_1.gif

/image/images_big/A107_2.gif

/image/images_big/A107_3.gif

/image/images_big/A107_4.gif

/image/images_big/A107_5.gif

 

each image is labelled with "th", "th-b", "1", "b 1" etc so you can tell which image is being shown.

 

I suspect I've not integrated dynamic mopics instead of mopics (part of the SEC) which is causing the main thumb problem. Any suggestions would be gratefully accepted!

 

http://www.frozenlightning.com/catalog/pro...&products_id=39

 

-al

Share this post


Link to post
Share on other sites

I cannot find /images/images_big/A107_b.gif on your server...

 

what is there is:

 

/images/images_big/A107.gif

 

so you do not need the define('BIG_PIC_EXT', '_b');

 

change it to:

define('BIG_PIC_EXT', '');

 

and it should work...

 

it shows the thumbnail if it can't find the big image (otherwise a red X would appear)... it can't /images/images_big/A107_b.gif and I couldn't find it either... I did find /images/images_big/A107.gif. So just make the 'BIG_PIC_EXT' blank.


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

- Edmund Burke

Share this post


Link to post
Share on other sites

Thanks, you've hit the nail on the head. I must have missed it in all my testing and changes...

 

This is a great little contribution!

 

-al

Share this post


Link to post
Share on other sites

Hey I got one for you. It seems like all the others I read on here, and I've double checked everything, but it still isnt working. All I get is "coming soon"

 

Here is what I have:

 

Product:

http://www.gofastperformance.com/catalog/p...&products_id=36

 

File Structure:

 

images

images/thumbs

images/images_big

 

 

Code:

 

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', true); //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', '3');

define('MORE_PICS_EXT', '_pic');

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, bmp, png, etc...)

 

 

Files:

 

stalker.jpg

stalker_pic2.jpg

stalker_pic3.jpg

 

I put all 3 files in all 3 directories to see if it would work, but still it does not work.

 

 

If anyone can help I would GREATLY appreciate it.

 

James

Share this post


Link to post
Share on other sites

Had a quick look and here's what's coming up:

 

Your thumbnail (on the main screen) has a path of:

 

http://www.gofastperformance.com/catalog/i...ges/stalker.jpg

 

Dynamic Mopics is looking for a file as below:

 

http://www.gofastperformance.com/catalog/i...ges/thumbs/.jpg

 

With your defines, you should have your pics as follows:

 

/thumbs/stalker.jpg (your main thum)

/thumbs/stalker_pic1.jpg (your second thumb)

...

/thumbs/stalker_pic3.jpg (etc)

 

/images_big/stalker_big.jpg (big version)

/images_big/stalker_pic1.jpg (big version)

...

/images_big/stalker_pic3.jpg ...

 

 

As a nice little aside, you don't really need to have the big images if you turn on Calculate Image Size in the Admin->My Store section. Then you just put the big pic in your thumbs directory and OSC will automatically scale the sucker. When you click on the thumb, it shows the unscaled version.

 

for instance for this link:

 

http://www.frozenlightning.com/catalog/pro...&products_id=34

 

my paths look like:

 

thumbs/g103.gif

thumbs/g103_1.gif

thumbs/g103_2.gif

thumbs/g103_3.gif

 

My defines:

define('IN_IMAGE_BIGIMAGES','images_big/');

define('IN_IMAGE_THUMBS', 'thumbs/');

define('MAIN_THUMB_IN_SUBDIR', true);

define('THUMBS_PER_ROW', '3');

define('MORE_PICS_EXT', '_'); // add "_1" etc to each pic

define('BIG_PIC_EXT', ''); // no big extension

define('THUMB_IMAGE_TYPE', 'gif');

define('BIG_IMAGE_TYPE', 'gif');

 

 

A more "normal" way of doing it is in this example. the images are labelled so you can see what's happening:

 

http://www.frozenlightning.com/catalog/pro...?products_id=35

 

paths:

/thumbs/A107.gif

/thumbs/A107_1.gif

...

/thumbs/A107_5.gif

 

/images_big/A107.gif

/images_big/A107_1.gif

...

/images_big/A107_5.gif

 

 

Good luck!

 

-al

Share this post


Link to post
Share on other sites

OK thanks for your help, but I am still having problems. I changed my definitions so it reads:

 

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

 

 

Still it is not finding the images :?

 

Anything else you see that could be wrong?

 

Thanks

 

James

Share this post


Link to post
Share on other sites

Right, at least it's finding the main thumb this time, but this isn't good news! If you look at the properties of your images, you'll see they're being loaded from the /images directory, not the /thumbs directory as you set it to be. This means that Dyn Mopics isn't installed correctly.

 

It also appears that the big pic is just a non-scaled version of your thumb (ie: your thumb is a scaled-down version of the pop-up). The path of the popup image is the same as that of your thumb:

 

http://www.gofastperformance.com/catalog/i...ges/stalker.jpg

 

 

The documentation about where Dynamic mopics wants the images is a bit confusing... but the condensed version is:

 

Create lo-res thumbs in /thumbs as follows:

/thumbs/stalker.jpg (main thumb)

/thumbs/stalker_pic1.jpg

/thumbs/stalker_pic2.jpg

 

Create hi-res big pics in /images_big as follows:

/images_big/stalker.jpg (matching big version of main thumb)

/images_big/stalker_pic1.jpg (big version of thumb 1)

/images_big/stalker_pic2.jpg

 

 

I had a look at your site and was able to see in your /images directory (something you'll want to fix before you go live -- put blank index.htm docs in each subdir or people will get a directory listing).

 

It looks like you've got the images in the right places, so something must be wrong with your installation code. I'd have a look in your catalog/product_info.php file and make sure you've got the following code stuck in there

 

      <tr>

    	 <td>

 <?php echo '<!-- BEGIN Dynamic Mopics Includes -->'; ?>

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

 <?php echo '<!-- END Dynamic Mopics Includes -->'; ?>

</td>

     </tr>

 

I stuck it just before the following code:

 

<?php

   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

   $reviews = tep_db_fetch_array($reviews_query);

   if ($reviews['count'] > 0) {

?>

 

I'm using CVS 5-18-03 with the Shoppe Enhancement Controller so my code might be a bit different than what you're using, but the DynMopics lines should be the same.

 

As a debug, I'd do what I did and edit your pics so you know which one is showing (because it might just be a scaled version of the thumbs rather than the correct one showing). That means get rid of all the pics that you have in the /images directory and only put small versions of the pics in your /thumbs directory. At least this way you'll be able to tell where the pics are being loaded from.

 

Good luck! It took me a good week to figure out what was going on with this since the SEC has the old Mopics installed and I had to undo that stuff first... :tellme:

 

-al

Share this post


Link to post
Share on other sites

I went back and checked everything, and still it is not working.

 

I did already have the code in the product info page. (coming soon shows on the product info page, so you know the code is there).

 

The only image it is loading is the one I upload through the admin section.

 

All I really want is the same pic for both the thumbnail, and big image. I will let OSC scale it for me.

 

I really dont know where to go next.

 

James

Share this post


Link to post
Share on other sites
OK thanks for your help, but I am still having problems. I changed my definitions so it reads:

 

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

 

No... no no no no no no no...

 

you main thumb is /images/stalker.jpg ... that is NOT in the thumb directory.

 

set 'MAIN_THUMB_IN_SUBDIR' to false...

 

this is not hard to configure people...


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

- Edmund Burke

Share this post


Link to post
Share on other sites

I have tried it both ways, I also have the same pics in all 2 directories. Still no luck... :(

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
Sign in to follow this  

×