osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Enhanced Dynamic MoPics & Images stored in directories

This is a discussion on Enhanced Dynamic MoPics & Images stored in directories within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; This thread has been started following on from an installation thread. It now seems more appropriate to continue here. Below ...



Find us on Facebook
Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Connect with Facebook Register FAQDonate Members List Calendar Mark Forums Read


View Poll Results: Any use to you?

Yes 5 62.50%
No 2 25.00%
I have no idea! 1 12.50%
Voters: 8. You may not vote on this poll

Closed Thread

 

LinkBack Thread Tools
  #1  
Old 04-29-2009, 02:47 PM
ridexbuilder's Avatar
osCMax Development Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,195
Thanks: 129
Thanked 121 Times in 113 Posts
Rep Power: 9
ridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to all
Lightbulb Enhanced Dynamic MoPics & Images stored in directories

This thread has been started following on from an installation thread. It now seems more appropriate to continue here.

Below is a portion of the installation text file, to explain the purpose of the patch. This patch includes the mod. from mithereal (in the 'sticky' post).

Quote:
Raison D'Etre
Structure the way images are stored on the server.
Reduce bandwidth, particularly on the home page and category views.
(Most importantly?) Speed up the rendering of web pages for end-users and still provide detailed images.

Functionality
Store fullsize images in images/images_big; store thumbnails (reduced-size) in images/thumbs. Do the same for additional images for the same product. eg.
widget.jpg 40Kb --> /images/images_big/
widget.jpg 10Kb --> /images/thumbs/
widget_1.jpg 35Kb --> /images/images_big/
widget_1.jpg 9Kb --> /images/thumbs/
widget_2.jpg 37Kb --> /images/images_big/
widget_2.jpg 9.5Kb --> /images/thumbs/

Where no additional product images exist, the standard "Other Images..." box will not appear - as per mod. by osCMax forum member 'mithereal'.
For product images, it is optional to include additional fullsize images, it's possible just to show a series of thumbnails. In this case, no 'click to enlarge' will appear.

The Admin console will allow an upload/display of both the thumbnail and full-size images. A current limitation is that the same filename should be used for both - not normally an issue but some may prefer the use of a prefix/suffix of 'thumb', for example.

Additionally, Category images are now correctly stored in the images/categories directory. Move/copy any existing category images into this directory. New additions via the Admin. Console will populate into the correct sub-directory.
I'm experiencing issues in uploading an attachment (using Firefox 3.5b4 on WinXP), so for the time being the latest patch is available in the downloads section of my website, shown below.

There are a couple of outstanding details to remedy, which should be easily resolved in the near future.

EJ
[for reference: previous thread Product info image not showing
__________________
UK-based hosting plans with installation, configuration, support and maintenance.
(& some ad-hoc jobs).


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
The Following 3 Users Say Thank You to ridexbuilder For This Useful Post:
JohnW (05-14-2009), judoka (04-29-2009), shirley (08-17-2009)
  #2  
Old 04-29-2009, 03:00 PM
Active Member
 
Join Date: May 2003
Posts: 183
Thanks: 10
Thanked 6 Times in 6 Posts
Rep Power: 7
judoka is on a distinguished road
Default Re: Enhanced Dynamic MoPics & Images stored in directories

Thank you ridexbuilder I just download the new 2.0.2h patch and I will try it as soon as I get a chance either today or tomorrow morning, and I will get right back to you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
The Following User Says Thank You to judoka For This Useful Post:
ridexbuilder (04-29-2009)
  #3  
Old 04-29-2009, 03:18 PM
ridexbuilder's Avatar
osCMax Development Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,195
Thanks: 129
Thanked 121 Times in 113 Posts
Rep Power: 9
ridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to all
Default Re: Enhanced Dynamic MoPics & Images stored in directories

Quote:
First when I get to the product discription page the click to enlarge images doesn't show because it is looking for the images in the main images directory ex: localhost/catalog/images/5478.jpg
Check the contents of templates/yourtemplate/content/product_info.tpl.php - look for this section....

PHP Code:
<?php
        
//// BEGIN:  Added for Dynamic MoPics v3.000
    
if (tep_not_null($product_info['products_image'])) {
?>
          <table border="0" cellspacing="0" cellpadding="2" align="right">
            <tr>
              <td align="center" class="smallText">
<?php
            $image_lg 
mopics_get_imagebase($product_info['products_image'], DIR_WS_IMAGES DYNAMIC_MOPICS_BIGIMAGES_DIR);
            if (
$lg_image_ext mopics_file_exists($image_lgDYNAMIC_MOPICS_BIG_IMAGE_TYPES)) {
                
$image_size = @getimagesize($image_lg '.' $lg_image_ext);
?>

<script language="javascript" type="text/javascript"><!--
document.write('<a href="javascript:popupImage('<?php echo tep_href_link(FILENAME_POPUP_IMAGE'pID=' $product_info['products_id'] . '&type=' $lg_image_ext); ?>','<?php echo ((int)$image_size[1] + 30); ?>','<?php echo ((int)$image_size[0] + 5); ?>');"><?php echo tep_image(DIR_WS_IMAGES DYNAMIC_MOPICS_THUMBS_DIR $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT); ?><br /><span class="smallText"><?php echo TEXT_CLICK_TO_ENLARGE?></span></a>');
//--></script>
<noscript>
<a href="<?php echo tep_href_link($image_lg '.' $lg_image_ext); ?>" target="_blank"><?php echo tep_image(DIR_WS_IMAGES DYNAMIC_MOPICS_THUMBS_DIR $product_info['products_image'], stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT); ?><br /><span class="smallText"><?php echo TEXT_CLICK_TO_ENLARGE?></span></a>
</noscript>
<?php
            
} else {
          echo 
tep_image(DIR_WS_IMAGES DYNAMIC_MOPICS_THUMBS_DIR $product_info['products_image'], stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT);
            }
?>
Or just do a copy & paste job - after backing up your file.
__________________
UK-based hosting plans with installation, configuration, support and maintenance.
(& some ad-hoc jobs).



Last edited by ridexbuilder; 04-29-2009 at 03:34 PM. Reason: Typo! (again) I get worse :-(
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 04-29-2009, 03:32 PM
ridexbuilder's Avatar
osCMax Development Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,195
Thanks: 129
Thanked 121 Times in 113 Posts
Rep Power: 9
ridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to all
Default Re: Enhanced Dynamic MoPics & Images stored in directories

Quote:
I notice is that the review, add to wish list and add to cart buttons images that are being display are not the one from my template but from the fallback template.
I wonder if it is a 'buggy' version of product_info.tpl.php that I have, as the button image path show up as follows.

/catalog/includes/languages/english/images/buttons/button_reviews.gif

There is no BTS type of reference to the images. This is entirely independent of the changes that I've made but looks like the cause of the issue. Can someone confirm the 'standard' lines of code are as follows?:

PHP Code:
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif''10''1'); ?></td>
                <td class="main"><?php echo '<a href="' tep_href_link(FILENAME_PRODUCT_REVIEWStep_get_all_get_params()) . '">' tep_image_button('button_reviews.gif'IMAGE_BUTTON_REVIEWS) . '</a>'?></td>
                <!-- Wish List 3.5 Start -->
                <td align="center"><?php echo tep_image_submit('button_wishlist.gif''Add to Wishlist''name="wishlist" value="wishlist"'); ?></td>
                <!-- Wish List 3.5 End   -->
                <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id'$product_info['products_id']) . tep_image_submit('button_in_cart.gif'IMAGE_BUTTON_IN_CART); ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif''10''1'); ?></td>
              </tr>
            </table></td>
Thanks

EJ
__________________
UK-based hosting plans with installation, configuration, support and maintenance.
(& some ad-hoc jobs).


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 04-30-2009, 11:58 AM
Active Member
 
Join Date: May 2003
Posts: 183
Thanks: 10
Thanked 6 Times in 6 Posts
Rep Power: 7
judoka is on a distinguished road
Default Re: Enhanced Dynamic MoPics & Images stored in directories

Hi ridexbuilder, I just try your new 2.0.2h patch and it went from good (2.0.2g) to bad (2.0.2h) now about 98% of the images have disappear. Now on the first page none of the images are showing because the path now is as follows;

http://localhost/catalog/images/categories/image.jpg

Notice the /categories/ folder, there is no categories folder.

than when I click on one of those missing images it goes to the second page where again none of the images are showing because it also is looking for the images following the same path, (http://localhost/catalog/images/categories/image.jpg).

Now if I click on one of those missing images it goes to the third page and the images are there because now it is looking for the images in the correct path of;

http://localhost/catalog/images/thumbs/image.jpg

Now if I click on one of those product images it goes to the product discription page but the whole right column is missing and I am getting the following error message,

Parse error: syntax error, unexpected '}' in C:wampwwwcatalogincludesmodulesdynamic_mopics.php on line 115

As for the click to enlarge image it is present but it is being pull from the following path;

http://localhost/catalog/images/image.jpg and not from the correct path of http://localhost/catalog/images/thumbs/image.jpg

And when I click on the "click to enlarge" images I am getting the following error message;

Warning: require(includes/languages//popup_image.php) [function.require]: failed to open stream: No such file or directory in C:wampwwwcatalogpopup_image.php on line 24

Fatal error: require() [function.require]: Failed opening required 'includes/languages//popup_image.php' (include_path='.;Chp5pear') in C:wampwwwcatalogpopup_image.php on line 24

Notice the double // before pop_image.php I think this could be why I am getting this error message when I click the "click to enlarge" image.

Also on the buttom of the home page I am getting the following error messages;

Warning: fopen(C:/wamp/www/catalog//cache/_catalog_index.php_<osCsid>__.cache) [function.fopen]: failed to open stream: Invalid argument in C:wampwwwcatalogincludesclassespage_cache.php on line 261

Warning: fwrite(): supplied argument is not a valid stream resource in C:wampwwwcatalogincludesclassespage_cache.php on line 262

Warning: fclose(): supplied argument is not a valid stream resource in C:wampwwwcatalogincludesclassespage_cache.php on line 263

Again if you notice on the first error message there is a double // before the cache/ and there is a _ before the catalog_index.php_<osCsid>__.cache. This could be the reason for these error message. I hope this helps.

I'm going to switch back to the 2.0.2g so the I can try the codes you have on your last two posts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #6  
Old 04-30-2009, 01:08 PM
Active Member
 
Join Date: May 2003
Posts: 183
Thanks: 10
Thanked 6 Times in 6 Posts
Rep Power: 7
judoka is on a distinguished road
Default Re: Enhanced Dynamic MoPics & Images stored in directories

Quote:
Originally Posted by ridexbuilder View Post
Check the contents of templates/yourtemplate/content/product_info.tpl.php - look for this section....

PHP Code:
<?php
        
//// BEGIN:  Added for Dynamic MoPics v3.000
    
if (tep_not_null($product_info['products_image'])) {
?>
          <table border="0" cellspacing="0" cellpadding="2" align="right">
            <tr>
              <td align="center" class="smallText">
<?php
            $image_lg 
mopics_get_imagebase($product_info['products_image'], DIR_WS_IMAGES DYNAMIC_MOPICS_BIGIMAGES_DIR);
            if (
$lg_image_ext mopics_file_exists($image_lgDYNAMIC_MOPICS_BIG_IMAGE_TYPES)) {
                
$image_size = @getimagesize($image_lg '.' $lg_image_ext);
?>

<script language="javascript" type="text/javascript"><!--
document.write('<a href="javascript:popupImage('<?php echo tep_href_link(FILENAME_POPUP_IMAGE'pID=' $product_info['products_id'] . '&type=' $lg_image_ext); ?>','<?php echo ((int)$image_size[1] + 30); ?>','<?php echo ((int)$image_size[0] + 5); ?>');"><?php echo tep_image(DIR_WS_IMAGES DYNAMIC_MOPICS_THUMBS_DIR $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT); ?><br /><span class="smallText"><?php echo TEXT_CLICK_TO_ENLARGE?></span></a>');
//--></script>
<noscript>
<a href="<?php echo tep_href_link($image_lg '.' $lg_image_ext); ?>" target="_blank"><?php echo tep_image(DIR_WS_IMAGES DYNAMIC_MOPICS_THUMBS_DIR $product_info['products_image'], stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT); ?><br /><span class="smallText"><?php echo TEXT_CLICK_TO_ENLARGE?></span></a>
</noscript>
<?php
            
} else {
          echo 
tep_image(DIR_WS_IMAGES DYNAMIC_MOPICS_THUMBS_DIR $product_info['products_image'], stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT);
            }
?>
Or just do a copy & paste job - after backing up your file.
this did not work. I even try putting back on the original templates/yourtemplate/content/product_info.tpl.php and the path is still looking in the main images directory. I'm now going to try your second posted fix above to fix the review, add to wish list and add to cart buttons images.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #7  
Old 04-30-2009, 01:15 PM
ridexbuilder's Avatar
osCMax Development Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,195
Thanks: 129
Thanked 121 Times in 113 Posts
Rep Power: 9
ridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to all
Arrow Re: Enhanced Dynamic MoPics & Images stored in directories

Hi Judoka,
Sorry to hear of your problems. Your installation must be fundamentally different to mine for things to go so horribly wrong!

With my installations, there has always been a(n unused) categories sub-directory, hence the 'inspiration' to use it.

In Admin, Dynamic MoPics - abbreviated settings:
B.I.D. images_big/
T.I.D. thumbs/
M.T.I.T.I.D. false
E.I.P imagebase_{1}
C.I.D. categories/

I'll try to do a complete re-installation in a development environment. It will be osCmax v2.0.2, followed immediately by v2.0.2h. This should provide a baseline to work from. You might like to try the same - though it should be noted that I don't (deliberately) run in a WAMP environment - preferring to run real programs on a real OS

includes/languages//popup_image.php - the language is missing, for some reason.

FYI:
Quote:
As for the click to enlarge image it is present but it is being pull from the following path;

http://localhost/catalog/images/image.jpg and not from the correct path of http://localhost/catalog/images/thumbs/image.jpg
The correct path would be http://localhost/catalog/images_big/image.jpg

I really do advise trying a 'fresh' installation into a different area and/or sign up for free hosting account and put it on a Linux server.

EJ
__________________
UK-based hosting plans with installation, configuration, support and maintenance.
(& some ad-hoc jobs).


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #8  
Old 04-30-2009, 01:17 PM
ridexbuilder's Avatar
osCMax Development Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,195
Thanks: 129
Thanked 121 Times in 113 Posts
Rep Power: 9
ridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to all
Default Re: Enhanced Dynamic MoPics & Images stored in directories

Quote:
I'm now going to try your second posted fix above to fix the review, add to wish list and add to cart buttons images.
You need to slooooow down. This is not a posted fix but a request for information from others.
__________________
UK-based hosting plans with installation, configuration, support and maintenance.
(& some ad-hoc jobs).


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #9  
Old 04-30-2009, 02:13 PM
ridexbuilder's Avatar
osCMax Development Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,195
Thanks: 129
Thanked 121 Times in 113 Posts
Rep Power: 9
ridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to all
Post Re: Enhanced Dynamic MoPics & Images stored in directories

New installation of oscMax v2.0.2 done - I can confirm that it does have an images/categories directory by default (as well as images_big & thumbs).

I've added patch 2.0.2h - yes there's a wee problem with the categories image - they're not being uploaded to the category directory for some reason - I will investigate. It should be straightforward to fix.

Product images seem correct in product info, reviews and wishlist.
Note that I did discover one potential issue: Windows appended "JPG" to the end of an image - case matters! Once renamed to "jpg" everything was fine.


[As previously noted: buttons do NOT reference any BTS templates]

For the time being, progress can be monitored at ejsolutions Development :


EJ
__________________
UK-based hosting plans with installation, configuration, support and maintenance.
(& some ad-hoc jobs).



Last edited by ridexbuilder; 04-30-2009 at 03:00 PM. Reason: URL added
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #10  
Old 04-30-2009, 04:28 PM
ridexbuilder's Avatar
osCMax Development Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,195
Thanks: 129
Thanked 121 Times in 113 Posts
Rep Power: 9
ridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to allridexbuilder is a name known to all
Post Re: Enhanced Dynamic MoPics & Images stored in directories

Patch 'i' posted: additional file products_new.tpl.php that was missed in 'h' (thought it was included in the official v2.0.2)
Category pics now show on website - Admin doesn't show category images but that will need to be resolved another day

EJ


__________________
UK-based hosting plans with installation, configuration, support and maintenance.
(& some ad-hoc jobs).


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Tags
categories, directories, dynamic mopics, images

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Get rid of dynamic mopics mskitti osCMax v2 Features Discussion 2 12-20-2008 05:12 AM
Dynamic MoPics metalman923 osCMax v2 Installation issues 3 11-11-2007 08:48 AM
Dynamic MoPics i2Paq osCMax v2 Installation issues 8 10-16-2007 08:44 AM
Dynamic Mopics - Now you see me - Now you don't cameroti osCMax v2 Features Discussion 10 12-15-2005 12:59 PM
how to use dynamic mopics? i want to put more than 1 pic Anonymous osCMax v1.7 General Mods Discussion 3 07-25-2004 02:14 PM


All times are GMT -8. The time now is 01:06 PM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2009 osCMax
Inactive Reminders By Icora Web Design