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; (Still get a generic error trying to do an attachment)....



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
  #11  
Old 05-08-2009, 07:55 AM
ridexbuilder's Avatar
osCMax Development Team

 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,220
Thanks: 130
Thanked 124 Times in 116 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: Cannot center images gallery for Mopics



(Still get a generic error trying to do an attachment).
__________________
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
  #12  
Old 05-08-2009, 08:26 AM
michael_s's Avatar
osCMax Developer


 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,755
Thanks: 139
Thanked 609 Times in 521 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

Trivial to center the mopics box on the product page.

I just wrapped the existing block in a div with its own centering ID. Took 2 seconds.

New code:
HTML Code:
 <div id="content2">
                <div class="screenshotsHeader">
                    <div class="screenshotsHeaderText"><?php echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
                </div>
                <div class="screenshotsBlock">
                    <?php include(DIR_WS_MODULES . 'dynamic_mopics.php'); ?>
                       </div>
            </div> 
New CSS in dynamic_mopics.css:
HTML Code:
#content2 {
  width: 450px ;
  margin-left: auto ;
  margin-right: auto ;
}
See screen shot.
Attached Images
File Type: jpg center-mopix2.jpg (20.1 KB, 2 views)
__________________
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 User Says Thank You to michael_s For This Useful Post:
ridexbuilder (05-08-2009)
  #13  
Old 05-08-2009, 09:20 AM
ridexbuilder's Avatar
osCMax Development Team

 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,220
Thanks: 130
Thanked 124 Times in 116 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: Cannot center images gallery for Mopics

That seems to address the 2nd point but leaves the images within the box to 'fend from themselves' - unless I'm missing something (likely )
__________________
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
  #14  
Old 05-08-2009, 12:47 PM
Member
 
Join Date: Mar 2009
Posts: 84
Thanks: 16
Thanked 3 Times in 3 Posts
Rep Power: 1
ptt81 is on a distinguished road
Default Re: Cannot center images gallery for Mopics

To Michael, I've tried this, the problem is the images themselve are stuck with the float: left; no matter how you center the block, images stay on left side thus not really center, having more or less images would screw up the orientation. Im using this mod so I don't have the codes you posted but I did the same where the same codes got moved to the dynamic_mopics.php

This is the mod im using mopics

i attached a picture of my problem, you can see the box itself is center but the images inside are not

this is my codes in dynamic_mopics.php, unless I did something completely wrong that I didn't know.

PHP 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
  http://oscdox.com
  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$replaceDYNAMIC_MOPICS_PATTERN))) {
 
?>
 
      <tr>
       <td>
            <div id="screenshots">
    <?
 $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$replaceDYNAMIC_MOPICS_PATTERN))) {
   
$row++;
   
// Set the thumbnail image for this loop
   
$image str_replace($search$replaceDYNAMIC_MOPICS_PATTERN) . '.' $image_ext;
   
// Parse this thumbnail through tep_image for clients with javascript disabled
   
$extraImageImage tep_image($imagestripslashes($product_info['products_name']), SMALL_IMAGE_WIDTHSMALL_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_lgDYNAMIC_MOPICS_PATTERN), DYNAMIC_MOPICS_BIG_IMAGE_TYPES)) {
    
// Set the large image for this loop
    
$image_lg str_replace($search$replace_lgDYNAMIC_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($imageaddslashes($product_info['products_name']), SMALL_IMAGE_WIDTHSMALL_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>
Attached Images
File Type: jpg Untitled-2.jpg (38.5 KB, 3 views)

Last edited by ptt81; 05-08-2009 at 01:07 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15  
Old 05-08-2009, 12:51 PM
ridexbuilder's Avatar
osCMax Development Team

 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,220
Thanks: 130
Thanked 124 Times in 116 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: Cannot center images gallery for Mopics

ptt81 (likewise with the mod, plus my additions) but easy to adapt with a little bit of messing around (put the last </div> as the final line).
Yes, as stated, Michael has kindly fixed the second part to my query but our original issue remains open.

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



Last edited by ridexbuilder; 05-08-2009 at 12:54 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16  
Old 05-08-2009, 01:10 PM
Member
 
Join Date: Mar 2009
Posts: 84
Thanks: 16
Thanked 3 Times in 3 Posts
Rep Power: 1
ptt81 is on a distinguished road
Default Re: Cannot center images gallery for Mopics

ridex, what do you mean putting the last </div> as the final line? may be we're not on the same page...lol. see my post above
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17  
Old 05-08-2009, 01:15 PM
ridexbuilder's Avatar
osCMax Development Team

 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,220
Thanks: 130
Thanked 124 Times in 116 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: Cannot center images gallery for Mopics

You sneakily added to your post ... it appears that your code differs slightly from mine but the fundamental issue remains the same - centering within the box.
__________________
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
  #18  
Old 05-08-2009, 01:23 PM
Member
 
Join Date: Mar 2009
Posts: 84
Thanks: 16
Thanked 3 Times in 3 Posts
Rep Power: 1
ptt81 is on a distinguished road
Default Re: Cannot center images gallery for Mopics

well at least we're on the same page on that issue

hope Michael or someone have a work around for this
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19  
Old 05-08-2009, 01:26 PM
ridexbuilder's Avatar
osCMax Development Team

 
Join Date: Jul 2008
Location: Haggisland
Posts: 1,220
Thanks: 130
Thanked 124 Times in 116 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: Cannot center images gallery for Mopics

He's a nice man, a very nice man and I'm jealous 'cos he still lives in Heat City, AZ - whereas I'm freezing my buns off (nearly)

[Hoping flattery will get us everything]
__________________
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
  #20  
Old 05-08-2009, 01:29 PM
michael_s's Avatar
osCMax Developer


 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,755
Thanks: 139
Thanked 609 Times in 521 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

That could be a bit tricky, but should not be too hard.

I think the issue is cross browser compatibility. You need to find css that will work in all browsers. I coded something in a couple minutes, but it only displayed properly in FF. Wouldn't work in IE or Chrome (both displayed differently from each other and firefox).

If you want my FF solution to put you on the right track, the code below generates the display shown in the attached screenshot for FF. This doesn't work in IE or Chrome, so it is not a solution, but a starting point. If I have more time I may get back to do something here. I think it might be better to start over from scratch instead of trying to fix the current html/css.



code block in product_info.tpl.php
HTML Code:
 <div id="content2">
                <div class="screenshotsHeader">
                    <div class="screenshotsHeaderText"><?php echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
                </div>
                <div class="screenshotsBlock">
                    <div id="content3">
                    <?php include(DIR_WS_MODULES . 'dynamic_mopics.php'); ?>
                    </div>
                   </div>
            </div> 
CSS needed:
HTML Code:
.screenshots {
    display: table-cell;
    text-align: center;
    padding: 5px 0 5px 0;
    margin-left: auto ;
    margin-right: auto ;
}

#content2 {
  width: 450px ;
  margin-left: auto ;
  margin-right: auto ;
}

#content3 {
  display: inline;
  margin-left: auto ;
  margin-right: auto ;
}
Attached Images
File Type: gif center-mopix3.gif (19.1 KB, 5 views)
__________________
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-08-2009), ridexbuilder (05-08-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 05:13 PM
Enhanced Dynamic MoPics & Images stored in directories ridexbuilder osCMax v2 Customization/Mods 42 05-15-2009 11:02 AM
Oscmax Images Gallery Problem pdr osCMax v2 Customization/Mods 0 12-19-2007 07:33 PM
MoPics Images Per Row im2smrt4u osCMax v2 Features Discussion 5 09-15-2006 09:58 AM
MoPics External Images hrhstephen osCMax v2 Customization/Mods 2 07-30-2005 04:04 AM


All times are GMT -8. The time now is 07:19 PM.


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