osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Cannot center images gallery for Mopics

This is a discussion on Cannot center images gallery for Mopics within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; just tested, like Michael said, only works in FF, without the float: left; it doesn't work in IE or Avant ...



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


Reply

 

LinkBack Thread Tools
  #21  
Old 05-08-2009, 03:57 PM
Member
 
Join Date: Mar 2009
Posts: 81
Thanks: 13
Thanked 3 Times in 3 Posts
Rep Power: 1
ptt81 is on a distinguished road
Default Re: Cannot center images gallery for Mopics

just tested, like Michael said, only works in FF, without the float: left; it doesn't work in IE or Avant

ridex, let me know if you come up with something since we are using the same mod
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #22  
Old 05-08-2009, 04:33 PM
ridexbuilder's Avatar
osCMax Testing Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,031
Thanks: 123
Thanked 100 Times in 93 Posts
Rep Power: 8
ridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of light
Default Re: Cannot center images gallery for Mopics

Quote:
...we are using the same mod
Not quite, I'm using my 'Enhanced' Mopics mod

Would probably need some conditional coding, such as
if IE then..
else...
etc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #23  
Old 05-08-2009, 05:00 PM
Member
 
Join Date: Mar 2009
Posts: 81
Thanks: 13
Thanked 3 Times in 3 Posts
Rep Power: 1
ptt81 is on a distinguished road
Default Re: Cannot center images gallery for Mopics

I meant this part of the mod

"Where no additional product images exist, the standard "Other Images..." box will not appear - as per mod. by osCMax forum member 'mithereal'."

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #24  
Old 05-08-2009, 08:06 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,400
Thanks: 135
Thanked 591 Times in 507 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Cannot center images gallery for Mopics

I did a little tweak and it works in FF and Chrome now. Just changed

HTML Code:
display: table-cell;
to

HTML Code:
display: inline-block;
I was reading about IE and its inability to properly use the display: style. So I found something that changes the .cell style, and supposedly it will work across all browsers, but now I have lost the page, and cannot for the life of me find it again

It was a pretty simple solution, like:
HTML Code:
* html .cell {display: inline;}
But I am going off of memory and have not had a chance to test.
__________________
Michael Sasek
osCMax Developer

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.

osCMax User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #25  
Old 05-09-2009, 01:49 AM
ridexbuilder's Avatar
osCMax Testing Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,031
Thanks: 123
Thanked 100 Times in 93 Posts
Rep Power: 8
ridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of light
Default Re: Cannot center images gallery for Mopics

I actually looked at the display tag but it's beyond my limited knowledge at this point in time
Just when I had got to grips with tables, someone went ahead and came up with divs

Quote:
...cannot for the life of me find it again
I know that feeling well - an age thang?
__________________
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!
Reply With Quote
  #26  
Old 05-09-2009, 01:54 AM
ridexbuilder's Avatar
osCMax Testing Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,031
Thanks: 123
Thanked 100 Times in 93 Posts
Rep Power: 8
ridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of light
Default Re: Cannot center images gallery for Mopics

How to achieve cross-browser support for inline-block :: Aaron Russell ?
CSS display: inline-block; is usable now ??
A wee example would be much appreciated for us slow learners

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



Last edited by ridexbuilder; 05-09-2009 at 01:59 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to ridexbuilder For This Useful Post:
ptt81 (05-09-2009)
  #27  
Old 05-09-2009, 07:23 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,400
Thanks: 135
Thanked 591 Times in 507 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Cannot center images gallery for Mopics

Just change the .screenshots style to :

Code:
.screenshots {
    display: table-cell;
    display: -moz-inline-box;
    text-align: center;
    padding: 5px 0 5px 0;
    margin-left: auto ;
    margin-right: auto ;
}
* html .screenshots { display:inline; } /* for IE 6 */
* + html .screenshots { display:inline; } /* for IE 7 */
 
I haven't had a chance to test it though.
__________________
Michael Sasek
osCMax Developer

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.

osCMax User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 2 Users Say Thank You to michael_s For This Useful Post:
ptt81 (05-09-2009), ridexbuilder (05-10-2009)
  #28  
Old 05-09-2009, 08:14 PM
Member
 
Join Date: Mar 2009
Posts: 81
Thanks: 13
Thanked 3 Times in 3 Posts
Rep Power: 1
ptt81 is on a distinguished road
Default Re: Cannot center images gallery for Mopics

Thanks Michael, I've just tested this, show perfectly centered in Firefox and images in rows, but in IE 7 all images still stack up one column although they are now centered. any idea why?

Update:

Finally got it to work, tested in IE7, Avant, FF all images are perfectly centered, tested with 2 or more images and don't forget to remove the div wrapper if you did that. Remember this is apply to those who use this mod http://www.oscmax.com/forums/oscmax-v2-customization-mods/17201-mopics.html and not the stock mopics.

.screenshots {
display: -moz-inline-box;
display: inline-block;
text-align: center;
padding: 5px 0 5px 0;
margin-left: auto ;
margin-right: auto ;
} /* for Firefox 3 */

* html .screenshots {
display: inline;
padding: 5px 0 5px 5px;
} /* for IE 6 & IE 7 */

You don't really need the codes for IE7 as it doesn't change anything with or without, in fact what changed in IE7 is in the IE6 codes, oddly but true but hey it works

in catalog/includes/modules/dynamic_mopics.php

I have to add a <div align="center"></div> as well for the images to center correctly, I can't post instruction since I have modified my files and deleted some of the codes I don't need, so compare your code to mine and make the changes accordingly

Code:
<?php
/*
$Id: dynamic_mopics.php 3 2006-05-27 04:59:07Z user $
  Dynamic MoPics version 3.000, built for osCommerce MS2
  Copyright 2006 osCMax2004-2005 Josh Dechant
  Released under the GNU General Public License
  ---------------------------------------------------
  osCMax Power E-Commerce
  osCommerce Documentation by OSCdox :: osCommerce and osCMax documentation
  Copyright 2006 osCMax
  Released under the GNU General Public License
*/
 // Backwards support for older osCommerce versions
 if (isset($product_info_values) && is_object($product_info_values)) {
  $product_info =& $product_info_values;
 }
 // Set the thumbnail basename; replaces "imagebase" in the user's pattern
 $image_base = mopics_get_imagebase($product_info['products_image'], DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR);
 // Set the large image's basename; replaces "imagebase" in the user's pattern
 $image_base_lg = mopics_get_imagebase($product_info['products_image'], DIR_WS_IMAGES . DYNAMIC_MOPICS_BIGIMAGES_DIR);
 // Get the counting method for the user's pattern (1,2,3; a,b,c; A,B,C; etc)
 $i = mopics_getmethod(DYNAMIC_MOPICS_PATTERN);
 // Set the search for the str_replace pattern search/replace
 $search = array('imagebase', mopics_match_pattern(DYNAMIC_MOPICS_PATTERN));
 // Set the initial replace for the str_replace pattern search/replace
 $replace = array($image_base, $i); 
 // Are there any extra thumbnails for this product?
 if (mopics_file_exists(DIR_FS_CATALOG . str_replace($search, $replace, DYNAMIC_MOPICS_PATTERN))) {
 ?>
 
 <tr>
    <td>
          <div align="center">
 <?
 $row = 0;
  // Loop until all of this product's thumbnails have been found and displayed
  while ($image_ext = mopics_file_exists(DIR_FS_CATALOG .  str_replace($search, $replace, DYNAMIC_MOPICS_PATTERN))) {
   $row++;
   // Set the thumbnail image for this loop
   $image = str_replace($search, $replace, DYNAMIC_MOPICS_PATTERN) . '.' . $image_ext;
   // Parse this thumbnail through tep_image for clients with javascript disabled
   $extraImageImage = tep_image($image, stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
 
   // Set large image replacement for the str_replace pattern search/replace
   $replace_lg = array($image_base_lg, $i);
   // Only link to the popup if a larger image exists
   if ($lg_image_ext = mopics_file_exists(DIR_FS_CATALOG . str_replace($search, $replace_lg, DYNAMIC_MOPICS_PATTERN), DYNAMIC_MOPICS_BIG_IMAGE_TYPES)) {
    // Set the large image for this loop
    $image_lg = str_replace($search, $replace_lg, DYNAMIC_MOPICS_PATTERN) . '.' . $lg_image_ext;
    // Get the large image's size
    $image_size = @getimagesize(DIR_FS_CATALOG . $image_lg);
    // Set large image's URL for clients with javascript disabled
    $extraImageURL = tep_href_link($image_lg);
    // Parse this thumbnail through tep_image for clients with javascript enabled
    $extraImagePopupImage = tep_image($image, addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    // Set the large image's popup width
    $extraImagePopupWidth = ((int)$image_size[0] + 5);
    // Set the large image's popup height
    $extraImagePopupHeight = ((int)$image_size[1] + 30);
    // Set the large image's popup URL text
    $extraImageURLText = TEXT_CLICK_TO_ENLARGE;
    // Set the large image's popup URL
    $extraImagePopupURL = tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&pic=' . $i . '&type=' . $lg_image_ext);
?>
    <div class="screenshots">
<script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link($image_lg) . '" target="_blank" rel="lightbox[group]" title="'.$product_info['products_name'].'" >'
. $extraImagePopupImage; ?><br /><span class="smallText"></span></a>');
//--></script>
          <noscript>
            <a href="<?php echo $extraImageURL; ?>" target="_blank"><?php echo $extraImageImage; ?><br /><span class="smallText"><?php echo $extraImageURLText; ?></span></a>
          </noscript>
    </div>
<?php   
} else {
    // No larger image found; Only display the thumbnail without a "click to enlarge" link
    echo '<div class="screenshots">' . $extraImageImage . '</div>';
   }
   // Increase current count
   $i++;
   // Update the replace for the str_replace pattern search/replace for next image in the sequence
   $replace = array($image_base, $i);
  }
  // All thumbnails have been found and displayed; clear all of the CSS floats
  echo '<div class="clearScreenshots"><hr /></div>';
 } //else {
  // No extra images found for this product
  //echo '<p class="noScreenshots"><span class="smallText">' . TEXT_NO_MOPICS . '</span></p>';
 //}
?>
           </div>
       </td>
    </tr>

Last edited by ptt81; 05-09-2009 at 10:15 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to ptt81 For This Useful Post:
ridexbuilder (05-10-2009)
  #29  
Old 05-10-2009, 06:24 AM
ridexbuilder's Avatar
osCMax Testing Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,031
Thanks: 123
Thanked 100 Times in 93 Posts
Rep Power: 8
ridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of light
Default Re: Cannot center images gallery for Mopics

Good effort guys! Thanks.
Almost there, for me, just issues with the different browsers (standards, what standards ).

Where there are additional pics, with no larger images, then the thumbnails won't line up vertically (no 'Click to enlarge' text), so I need a 'vertical-align: top'. Just playing about with exactly where it's needed. Firefox is working peachy; IE & Opera are going back to column pics - each with a different layout .

[If my understanding is correct the 'Content2' class is now redundant?
I should just concentrate on the 'screenshots' classes]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #30  
Old 05-10-2009, 07:26 AM
ridexbuilder's Avatar
osCMax Testing Team
 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,031
Thanks: 123
Thanked 100 Times in 93 Posts
Rep Power: 8
ridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of lightridexbuilder is a glorious beacon of light
Thumbs up Re: Cannot center images gallery for Mopics

Brilliant stuff!
Now working in Firefox (3.5b4), Opera (10a) and IE (8.0)

For reference:
Code:
.screenshots {
    display: -moz-inline-box;
    vertical-align: top; 
    display: inline-block;
    text-align: center;
    padding: 5px 0 5px 0;
    margin-left: auto ;
    margin-right: auto ;
} /* for Firefox 3 */

* html .screenshots {
    display: inline;
    padding: 5px 0 5px 5px;
} 

.screenshots IMG {
    vertical-align: top;
    display: inline;
    border: 3px double #bbc3d3;
}
Well done, much appreciated.
EJ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to ridexbuilder For This Useful Post:
michael_s (05-10-2009)
Reply

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
Dynamic Mopics additional images to product pages pakrat osCMax v2 Features Discussion 20 08-15-2009 06:13 PM
Enhanced Dynamic MoPics & Images stored in directories ridexbuilder osCMax v2 Customization/Mods 42 05-15-2009 12:02 PM
Oscmax Images Gallery Problem pdr osCMax v2 Customization/Mods 0 12-19-2007 08:33 PM
MoPics Images Per Row im2smrt4u osCMax v2 Features Discussion 5 09-15-2006 10:58 AM
MoPics External Images hrhstephen osCMax v2 Customization/Mods 2 07-30-2005 05:04 AM


All times are GMT -8. The time now is 05:54 AM.


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