Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Dynamic MoPics v2.2


dreamscape

Recommended Posts

New & Improved version = new & improved thread ;)

 

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

- Fixed code bug in pop_image.php where the window was not resizing.

- Added support for older versions of osCommerce who use $product_info_values.

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

 

After testing and helping many people, it appears the one main problem was that some osCommerce versions use $product_info_values while newer versions use $product_info... (a big thanks to the dev team on that one.. real good work there boys). The module has been updated to support both variable arrays. Many of those who where having troubles with only getting "coming soon" but having their images named correctly and in the correct spots should see the problems disappear with this version.

 

Also, in the last v2.1 there was a small problem with the popup_image.php not resizing, which has been fixed now as well.

 

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

 

** Discussion of the Dynamic MoPics should continue in this thread, as this new version solves many of the problems in the old thread **

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 81
  • Created
  • Last Reply

Top Posters In This Topic

Dreamscape,

I am STOKED that you cared enough to put out a new version,

and not so stoked to be the first to ask for help...

I installed the new version, and I'm getting this error code:

Warning: main(DIR_WS_MODULESFILENAME_DYNAMIC_MOPICS) [function.main]: failed to create stream: No such file or directory in /home/shelldav/wwwroot/shelldave.com/ecommerce/catalog/product_info.php on line 170



Warning: main() [function.main]: Failed opening 'DIR_WS_MODULESFILENAME_DYNAMIC_MOPICS' for inclusion (include_path='') in /home/shelldav/wwwroot/shelldave.com/ecommerce/catalog/product_info.php on line 170

 

This is what I have on line 170:

<!-- adding Dynamic MoPics here can be moved around //-->

<tr>

    <td>

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

</td>

     </tr>

<!-- end MoPics //-->

line 170 specifically is the php code

 

big images directory is images_lg/

thumbnails are in thumbs/

main big pic extension is _lg

 

Will this work at the time being with simply a thumb and an enlarged shot?

Another error keeps coming up:

Warning: move_uploaded_file(/home/shelldav/wwwroot/shelldave.com/ecommerce/catalog/images/thumbs/20a.jpg) [function.move-uploaded-file]: failed to create stream: Permission denied in /home/shelldav/wwwroot/shelldave.com/ecommerce/admin/includes/functions/general.php on line 789 



Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpFdabbK' to '/home/shelldav/wwwroot/shelldave.com/ecommerce/catalog/images/thumbs/20a.jpg' in /home/shelldav/wwwroot/shelldave.com/ecommerce/admin/includes/functions/general.php on line 789

And I was getting both of these errors before, maybe they aren't related to the addition of Dynamic Mopics?

Could you please help?

:oops:

Jenn

Link to comment
Share on other sites

Scratch the entire message above, just discovered my product_info.php was WAY faulty. Looking for a backup copy to rewrite now.

Thanks anyway!

:roll:

Link to comment
Share on other sites

Will this work at the time being with simply a thumb and an enlarged shot?

Another error keeps coming up:

Warning: move_uploaded_file(/home/shelldav/wwwroot/shelldave.com/ecommerce/catalog/images/thumbs/20a.jpg) [function.move-uploaded-file]: failed to create stream: Permission denied in /home/shelldav/wwwroot/shelldave.com/ecommerce/admin/includes/functions/general.php on line 789 



Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpFdabbK' to '/home/shelldav/wwwroot/shelldave.com/ecommerce/catalog/images/thumbs/20a.jpg' in /home/shelldav/wwwroot/shelldave.com/ecommerce/admin/includes/functions/general.php on line 789

And I was getting both of these errors before, maybe they aren't related to the addition of Dynamic Mopics?

Could you please help?

:oops:  

Jenn

 

Those errors have nothing to do with the Dynamic MoPics... but rather it seems that the directory images/thumbs does not have write permissions, therefore when you try to upload it in admin, it can't... chmod the thumbs directory to 777.

 

And yes, the dynamic mopics will work with just a main thumb and large image... if you do not want other images, but rather just the main thumb and large image for it, then do not include the dynamic_mopics.php in the product_info.php page and it will not look for other images, but the popup_image will show the larger image of the main thumb.

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

- Edmund Burke

Link to comment
Share on other sites

I got rid of those other error codes,

skipped including dynamic_mopics.php in product_info.php,

but I'm getting no image on click...

 

http://shelldave.com/ecommerce/catalog/default.php

 

In admin/configuration, when I enter the image under each product, I am putting thumbs/38b.jpg....is that correct?

 

Got any clues? I am sure it is another stupid mistake on my part, but I would be delighted with any assistance. :roll:

Jenn

Link to comment
Share on other sites

I know it sounds ridiculously foolish, but I had downloaded v2.1 again. In my defense maybe I jumped the gun and got to it before it was setup. (There was only one download site at the time and now there's 2.)

 

Anyway, uploaded newer files, still having trouble. For the record, so far all mistakes have been my own, but I truly appreciate you looking out for us amateurs

 

Anyway, I renamed all image files to get rid of _lg extension. Yet clicking on image in order to see larger view has _lg as part of the url? I am not sure where I should correct this?

 

I did delete configure of old versions, as well as uploading new popup_image.php... (this is when I went to try and fix things myself)

 

dang it, I think I just made things worse. I will gladly send a donation for your help with this.

Now I uploaded the new dynamic_mopics.sql 'ass'uming it would just write over anything similar, but I have two of each command in admin/configure Dynamic Mopics area now.

 

:?:

Link to comment
Share on other sites

Just an update, we have sorted nrapt's problems.

 

For future reference, here was the problem, she has OSC in search engine safe URL mode. the module uses the variables $_GET instead of $HTTP_GET_VARS, which apparently do not work in search engine safe URL mode. So for anyone else in search engine safe URL mode, to fix the problem just replace the $_GET in popup_image.php with $HTTP_GET_VARS

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

- Edmund Burke

Link to comment
Share on other sites

Dreamscape,

 

After messing with the configuration, I figure out that i needed to have certain images in certain places in order for the images to work. What I did was put the small images or thumbs in my main image directory so they could be seen. If I put true to the thumbnail directory and make a folder called thumbs, the images wont show up and I get this message when I "click here to enlarge" public_html/images/images_big/_big.gif

 

It can't find the pictures or set them correctly, so they wont show. Would you be kind enough to explain what I have that problem?

 

At the moment this is how I have everything set up:

 

Big Images Directory images_big/

Thumbnail Images Directory thumbs/

Main Thumbnail In Thumb Directory false

Number of Pics per Row 2

Mo Pics Extension _pic

Main Big Pic Extension _big

Mo Pics Thumbnail Image Type gif

Mo Pics Big Image Type gif

 

Folders created:

 

images/lv-210.gif

images/lv-210m.gif

 

images/image_big/lv-210_big.gif

images/image_big/lv-210m_big.gif

 

What I want to know is if that is the right process.. What does the thumbs/ folder make happen? I can't seem to understand that... Could I put more images inside? How would I go about putting them up...

 

Thanks for the help!

Link to comment
Share on other sites

Hi

 

Firstly great mod - time effective and functional.

 

I have a small problem with certain computers though. Whilst I can get the popup image from big_images directory to open in my Mac and in other computers (PC's and Macs in different browsers) and the whole thing works fine, on some peoples computers the popup image is blank. When you look at the source, it seems to be OK - so it seems to me that the image is downloading from the right directory but just not showing in the popup window ... no other mods are affecting the popup_image.php file

 

I have searched the forums without success - is it this image resize problem discussed above? - any other ideas?

 

Thanks in advance

Stuart :?

Link to comment
Share on other sites

I have a small problem with certain computers though. Whilst I can get the popup image from big_images directory to open in my Mac and in other computers (PC's and Macs in different browsers) and the whole thing works fine, on some peoples computers the popup image is blank. When you look at the source, it seems to be OK - so it seems to me that the image is downloading from the right directory but just not showing in the popup window ... no other mods are affecting the popup_image.php file

 

After messing around with the code and changing the popup_image.php to the new version, the problem now seems to have confined itself to PC's only, Macs show the image without any problems at all. I have installed 'featured products' mod and column listing mods as well ... dow you think these would affect dynamic mopics? Otherwise could it be something to do with PCs' implementation of java?

 

Thanks

Stuart

Link to comment
Share on other sites

hmm..

 

I wrote the entire module (popup & all) on a PC and have only tested the popup on a PC. It works fine for me (winXP Pro SP1). Have a URL I can check yours?

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

- Edmund Burke

Link to comment
Share on other sites

Dreamscape,

 

After messing with the configuration, I figure out that i needed to have certain images in certain places in order for the images to work. What I did was put the small images or thumbs in my main image directory so they could be seen. If I put true to the thumbnail directory and make a folder called thumbs, the images wont show up and I get this message when I "click here to enlarge" public_html/images/images_big/_big.gif

 

It can't find the pictures or set them correctly, so they wont show. Would you be kind enough to explain what I have that problem?

 

At the moment this is how I have everything set up:

 

Big Images Directory images_big/

Thumbnail Images Directory thumbs/

Main Thumbnail In Thumb Directory false

Number of Pics per Row 2

Mo Pics Extension _pic

Main Big Pic Extension _big

Mo Pics Thumbnail Image Type gif

Mo Pics Big Image Type gif

 

Folders created:

 

images/lv-210.gif

images/lv-210m.gif

 

images/image_big/lv-210_big.gif

images/image_big/lv-210m_big.gif

 

What I want to know is if that is the right process.. What does the thumbs/ folder make happen? I can't seem to understand that... Could I put more images inside? How would I go about putting them up...

 

Thanks for the help!

 

The thumbs folder is if you want more than one pic for each product... you'd use it and name the extra pics like:

 

lv-210_pic1.gif, lv-210_pic2.gif, etc...

 

you do not need the:

Main Big Pic Extension _big

 

I put that in primarily for people who were putting both their main thumb & main big image into the same directory.

 

images/lv-210.gif

images/lv-210m.gif

 

images/image_big/lv-210_big.gif

images/image_big/lv-210m_big.gif

that should be working. is the products image defined as "lv-210.gif" in admin?

 

Also, do you have search engine safe URLs enabled (there is a bug with search engine safe URLs that prohibit the popup from working)??

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

- Edmund Burke

Link to comment
Share on other sites

Sure Dreamscape

 

The link is http://www.dikaye.com/catalog/product_info...products_id=142 I've left the echo on so you can see the exact location of the picture being called.

 

I'm not sure its anything to do with DMP, I think the image information is not being passed to the popup image so there is no size info for the picture. But its bizarre that Macs handle it fine and PCs don't ... suggests that its a java problem to me - could it be in html output.php?

 

I'm getting a bit weirded out by this problem

 

Thanks

Stuart

Link to comment
Share on other sites

stuart, for some reason your oscommerce install doesn't seem to be handling the lowsrc="images/pixel_trans.gif"... which is weird because that is a browser thing and works on an install of DMP v2.2 I just helped someone with...

 

anways try removing the lowsrc="images/pixel_trans.gif" from the image echo in popup_image.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

thanks dreamscape

 

I've tried that, and now I have this in the echo ---

 

echo tep_image($image, $products_values['products_name'], '', '', '');

 

but unfortunately still no joy ... it appears that the image sizes are 0 and 0 , do you think that tep_image has anything to do with it? I'm still not sure I understand why it would work on Macs but not on PC's ... weird!

 

Cheers

Stuart

Link to comment
Share on other sites

yeah must be the tep_image function... mine returns the image dimensions... yours is returning zero. what osc snapshot are you on?

 

try using this:

echo tep_image($image, $products_values['products_name']);

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 Dreamscape

 

Its resolved ... I had a look at the function tep_image and found that it required the images required to be set to "true" in the admin ... you guessed it ... they were set to "false". Now it seems to work on my neighbours PC.

 

Still a bit confused as to why a Mac would load the image and a PC wouldn't ... but I'm not going to lose any more sleep over that

 

Anyway, thanks for all your help and for the brilliant mod ...

 

Cheers

Stuart

Link to comment
Share on other sites

Hi,

I'm new to this forum and to osc...

 

I've installed this contribution without any problem (after replace thos $_get with the proper $) but now there're 2 things I don't understand....

 

1. The big image of the default thumb open in a pop-up and shows the pic and the url!?!

 

2. The additional pics won't show... I've named them with a _pic1, _pic2, ... extension and put those thumbnails in a thumb subfolder in the folder of the big ones.

 

What went wrong???

 

http://www.fetishteam.com/catalog/product_.../23/language/en

Link to comment
Share on other sites

Hi,

I'm new to this forum and to osc...

 

I've installed this contribution without any problem (after replace thos $_get with the proper $) but now there're 2 things I don't understand....

 

1. The big image of the default thumb open in a pop-up and shows the pic and the url!?!

 

2. The additional pics won't show... I've named them with a _pic1, _pic2, ... extension and put those thumbnails in a thumb subfolder in the folder of the big ones.

 

What went wrong???

 

http://www.fetishteam.com/catalog/product_.../23/language/en

 

well for starters you are trying to put additional images on on of the default products... those images aren't regular images in that they are in their own subdir: images/gt_interactive/wheel_of_time.gif

 

the actualy image name is gt_interactive/wheel_of_time.gif, so if you wanted extra images for that, you would have to place the thumbs like:

images/thumbs/gt_interactive/wheel_of_time_pic1.gif

images/thumbs/gt_interactive/wheel_of_time_pic2.gif

 

and the big images like:

images/images_big/gt_interactive/wheel_of_time_pic1.gif

images/images_big/gt_interactive/wheel_of_time_pic2.gif

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 dreamscape,

thx for the quick response... :)

 

I've got this to work!!!

 

->http://www.fetishteam.com/catalog/product_.../products_id/29

 

But why the pop-up shows the pic & the PATH?

 

Thx in advance... :D

 

In popup_image.php find:

 

 

/* 

  if the big image isn't shown unkomment the next line, and check the path:

  maybe you have to remove '/'. or adjust the path, depends on your configuration

*/

echo DIR_FS_CATALOG . $image_path . $image_base . $image_addon . $image_ext . '<br>';

 if (is_file(DIR_FS_CATALOG . $image_path . $image_base . $image_addon . $image_ext)) {



change:



echo DIR_FS_CATALOG . $image_path . $image_base . $image_addon . $image_ext . '<br>';

 if (is_file(DIR_FS_CATALOG . $image_path . $image_base . $image_addon . $image_ext)) {



to: 



//echo DIR_FS_CATALOG . $image_path . $image_base . $image_addon . $image_ext . '<br>';

 if (is_file(DIR_FS_CATALOG . $image_path . $image_base . $image_addon . $image_ext)) {

 

And that will remove the path. Just click on the pick and it will close the window.

 

Hope this helps.

Link to comment
Share on other sites

yes just comment it out... reason it is uncommented by default is that people have problems and don't bother to check the path. With this mod, it is easiest to tell what is going wrong by look at the path if u know what you're looking for... so I had the path echo enabled by default... just comment it out to get rid of it once you have the module working well (as I see you do).

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

- Edmund Burke

Link to comment
Share on other sites

That did it!! :D :D :D

 

Thx a lot for your help and for this great contribution!

 

May I ask another dumb question, which has nothing to do with this contribution? :blush:

 

Per default the image (if the product is made via admin) always is put to www.mysite.com/catalog/images/pic.jpg

 

How can I create a product with an image in (for example) www.mysite.com/catalog/images/gt_interaktive/pic.jpg?

 

This is a thing I still don't understand... :oops: :oops: :oops:

 

Would be great if you could answer this to a newbie...

 

Thx for all,

Alex

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