Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 8 votes

Simple Multi Image Add-on (Un-Limited) with FancyBox Popups


957 replies to this topic

#201 Sharon_U

  • Community Member
  • 79 posts
  • Real Name:Sharon

Posted 13 October 2009, 16:14

View PostSharon_U, on 13 October 2009, 02:22, said:

Thank you for the reply. I checked, and the comma is there where it is supposed to be. I have another thought: I also have a Custom Meta Tags contribution (by Randelia) installed, and it seems that some of the code from your contribution is overlapping with that one in the categories.php file. Perhaps that is where the issue lies (?) I will PM a URL so you can take a look.

Thanks again.

There are two of us here working on this, and we've each gone through and re-entered the code very carefully in case we made an error the first time (for both product_info and categories) with no luck. Here is the code for the product_info.php if you care to have a look:

<?php
/*
  $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

  // Simple multi image addon  
$image_group = TINY_IMAGE_GROUP_SIZE; //Number of images to show per row/column
$vertical_format = (ADDITIONAL_IMAGE_FORMAT == 'vertical');  
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_array, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
    $product_info = tep_db_fetch_array($product_info_query);
    $products_image_array = unserialize($product_info['products_image_array']);
    if (!is_array($products_image_array)) $products_image_array = array();
// EOF Simple multi image addon

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<?php // Randelia Custom_META_Tags_Per_Item. Includes TITLE!
echo ShowMETA('product_info', $products_id, $languages_id); ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
<!-- Simple multi image addon -->
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.fancybox.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.easing.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.easydrag.handler.beta2.js"></script>
<link rel="stylesheet" href="<?php echo DIR_WS_IMAGES ?>js/fancybox.css" type="text/css" media="screen">
<script type="text/javascript">
    $(document).ready(function() {
      $("div#fancy a").fancybox({
    'zoomSpeedIn':  800, 
    'zoomSpeedOut':  700, 
    'overlayShow':  <?php echo (DIM_BACKGROUND == 'true' ? 'true' : 'false'); ?>,
    'overlayOpacity': <?php echo (BKG_LUMA/10); ?>,
    'zoomOpacity':   true,
    <?php if (SWING_POPUP == 'true') echo "'easingIn' : 'easeOutBack',"; ?>
    'hideOnContentClick': false
        
  });
  <?php if (DRAG_POPUP == 'true') echo '$("#fancy_outer").easydrag();'; ?>
});

</script>
<style type="text/css">
<!--
<?php if (SHOW_NAV == 'true') echo 'span#fancy_left_ico {left: 20px;}  span#fancy_right_ico {right: 20px;}';
         switch (POS_NAV) {
                 case 'top':
                  echo 'span.fancy_ico { top: 38px; }';
                  break;
                case 'bottom':
                  echo 'span.fancy_ico { bottom: 20px; }';
                  break;
                default:
                  echo 'span.fancy_ico { top: 50%; }';
                  break;
                  }    
                  ?>
// -->
</style>

<!--[if IE 6]> 
<style type="text/css"> 
div#fancy_bg {display: none;} 
div#fancy_content, 
div#fancy_inner, 
div#fancy_outer {background-color: transparent; background-image: url 
(); border: 1;} 
</style> 
<![endif]--> 
<!-- EOF Simple multi image addon -->
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
  <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="1" bordercolor =#f7bdde width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
    </table></td>
<!-- body_text //-->
    <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
  // Simple multi image addon  
  if (!tep_db_num_rows($product_info_query)) {
// EOF Simple multi image addon
?>
      <tr>
        <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <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 align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  } else {
    // Simple multi image addon  section moved

    tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

    if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
      $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
    } else {
      $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
    }

    if (tep_not_null($product_info['products_model'])) {
      $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
    } else {
      $products_name = $product_info['products_name'];
    }
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td class="main">
<?php
    if (tep_not_null($product_info['products_image'])) {
?>
          <!-- Simple multi image addon -->
         <div id="fancy">
          <table border="0" cellspacing="0" cellpadding="2" align="right">
            <tr>
              <td align="center" class="smallText">

<?php $source = ''; $thumb = (class_exists('oscthumb') && CFG_MASTER_SWITCH == 'On'); if ($thumb) { preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $product_info['products_image'],'','','','','',5), ENT_NOQUOTES), $image);  $source=str_replace('&amp;','&',$image[1]); }
  echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . tep_href_link(($source ? $source : DIR_WS_IMAGES . $product_info['products_image']), $product_info['products_name']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"', false, 5) . '<br />' . '</a>'; 
               if(!$vertical_format) { echo ''; $row = 1; reset($products_image_array); while (list($key, $value) = each($products_image_array)) { 
               if ($thumb) {           
               $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image);  $source=str_replace('&amp;','&',$image[1]); 
               } 
               echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . tep_href_link($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; 
              
                ++$row; if ($row > $image_group) { echo '<br />'; $row = 1; } } } 
                echo '</td>';
               if($vertical_format) { echo '<td>'; $row = 1; reset($products_image_array); while (list($key, $value) = each($products_image_array)) { 
               if ($thumb) {           
               $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image);  $source=str_replace('&amp;','&',$image[1]); 
               } 
               echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . tep_href_link($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . '</a>'; 
              
                  ++$row; if ($row > $image_group) { echo '</td><td>'; $row = 1; } } echo '</td>'; } ?>

                            
            </tr>
          </table>
          </div>
          <!-- EOF Simple multi image addon -->

<?php
    }
?>
          <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
    $products_attributes = tep_db_fetch_array($products_attributes_query);
    if ($products_attributes['total'] > 0) {
?>
          <table border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
            </tr>
<?php
      $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
      while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
        $products_options_array = array();
        $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
        while ($products_options = tep_db_fetch_array($products_options_query)) {
          $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
          if ($products_options['options_values_price'] != '0') {
            $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
          }
        }

        if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
          $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
        } else {
          $selected_attribute = false;
        }
?>
            <tr>
              <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
              <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
            </tr>
<?php
      }
?>
          </table>
<?php
    }
?>
        </td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
    $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
    $reviews = tep_db_fetch_array($reviews_query);
    if ($reviews['count'] > 0) {
?>
      <tr>
        <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
    }

    if (tep_not_null($product_info['products_url'])) {
?>
      <tr>
        <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
    }

    if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
      <tr>
        <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
      </tr>
<?php
    } else {
?>
      <tr>
        <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
      </tr>
<?php
    }
?>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <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_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>//-->
                <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>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td>
<?php
    if ((USE_CACHE == 'true') && empty($SID)) {
      echo tep_cache_also_purchased(3600);
    } else {
      include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
    }
  }
?>
        </td>
      </tr>
    </table></form></td>
<!-- body_text_eof //-->
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="1" bordercolor =#f7bdde width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
    </table></td>
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


#202 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 13 October 2009, 17:01

View PostSharon_U, on 13 October 2009, 16:14, said:



I don`t see any issue there, perhaps its a dbase one, ie categories.php put wrong data in field, have u checked by browsing with phpmyadmin
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#203 Sharon_U

  • Community Member
  • 79 posts
  • Real Name:Sharon

Posted 13 October 2009, 18:21

View Postspooks, on 13 October 2009, 17:01, said:

I don`t see any issue there, perhaps its a dbase one, ie categories.php put wrong data in field, have u checked by browsing with phpmyadmin

We just tried browsing with phpmyadmin, looking at categories.php, but we don't really know what we're looking at. We are not well versed in manipulating php or mysql so unfortunately we're going to do an uninstall for now. Maybe someone else who is also using the Custom Metatags contribution from Randelia will have the same issue and be able to figure it out, so we'll keep an eye on this support thread.

Thanks again for your time.

#204 Marcog85

  • Community Member
  • 8 posts
  • Real Name:Marco

Posted 13 October 2009, 18:39

Are there people who has the same problem as I. Image in Fancybox aren't resized correctly in IE, FF is okay.
http://shop.myastrolife.nl/product_info.php?products_id=240. As you can see image in IE8 isn't resized, in FF it is.
Is this a stylesheet issue ? Hope someone can help me. Thanks again.

#205 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 13 October 2009, 18:57

View PostMarcog85, on 13 October 2009, 18:39, said:

Are there people who has the same problem as I. Image in Fancybox aren't resized correctly in IE, FF is okay.
http://shop.myastrol...roducts_id=240. As you can see image in IE8 isn't resized, in FF it is.
Is this a stylesheet issue ? Hope someone can help me. Thanks again.


You have failed to complete the install correctly, please complete the install in full b4 you report any issues, otherwise u are likely to be reporting matters that have already been addressed. [img]http://forums.oscommerce.com/public/style_emoticons/default/wink.gif[/img]
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#206 axioma

  • Community Member
  • 154 posts
  • Real Name:yesid borislov

Posted 13 October 2009, 19:41

this fancy addon works simply perfect... if you have osthumbs addon remember to disable on osthumb --Encrypt Image Filenames--
bye

#207 Marcog85

  • Community Member
  • 8 posts
  • Real Name:Marco

Posted 14 October 2009, 09:01

View Postspooks, on 13 October 2009, 18:57, said:

You have failed to complete the install correctly, please complete the install in full b4 you report any issues, otherwise u are likely to be reporting matters that have already been addressed. [img]http://forums.oscommerce.com/public/style_emoticons/default/wink.gif[/img]


You're right, was missing <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
sorry about that, all works well.

#208 theurbanrooster

  • Community Member
  • 45 posts
  • Real Name:Pete Crebbin

Posted 14 October 2009, 12:30

View Postsuresh.mars, on 13 October 2009, 11:58, said:

Thanks mate. Will try ur instructions. Hope everything goes fine.

OK - are we talking about making the "Text Box" below bigger, as mine doesn't contain all the words... what file are we looking at?

#209 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 14 October 2009, 15:07

View Posttheurbanrooster, on 14 October 2009, 12:30, said:

OK - are we talking about making the "Text Box" below bigger


The previous post was regarding page layout, not really related to this contrib.

I assume you refering to the popup image title, yes if the title is too long there can be an issue, I have come up with a solution, though not ideal.

in product_info.php, b4 the </head> add:

 

<?php if (strlen($product_info['products_name']) > 40) {
 $product_info['products_name'] = wordwrap($product_info['products_name'], 40, '<br>');
 ?>
<style type="text/css">
div#fancy_title {
 text-align:center;
}
div#fancy_title table td {
  padding-top: 10px;
 vertical-align: top;
}
 td#fancy_title_left, td#fancy_title_right, td#fancy_title_main {height: 52px; background: #000 url();} 
      
</style>
<!--[if IE]>
<style type="text/css">
td#fancy_title_left {
 background: transparent url(<?php echo DIR_WS_IMAGES ?>js/fancy_title_left.png) repeat-x;
}

td#fancy_title_main {
 background: transparent url(<?php echo DIR_WS_IMAGES ?>js/fancy_title_main.png) repeat-x;
}

td#fancy_title_right {
 background: transparent url(<?php echo DIR_WS_IMAGES ?>js/fancy_title_right.png) repeat-x;
}
</style>
<![endif]-->
<?php } ?>


The '40's above set the title lenght at which height is increased & line is broken, adjust to fit your content.
The height: 52px sets the new height, adjust to fit your font size.
Firefox wont stretch the borders, so they are removed in this mode, IE is fine with that though so they stay for IE.


Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#210 mrjoslin

  • Community Member
  • 11 posts
  • Real Name:Mike

Posted 14 October 2009, 23:26

Hey, so i installed this contribution, but the JS is not working. I have been sorting through the code and I cannot seem to find the solution. You mentioned earlier in the thread that because it is jquery based it will not work if there are other jquery scripts. On the homepage of my site i use an image-swapper that is jquery based. I ensured that script was removed from the template i am using for STS, but still no fancy popups. I have added the js folder and contents to my catalog/images/ dir and verified the upload was successful. I cannot figure out what else could be going wrong. Feel free to look at the test i have here test product

Thanks in advance.

Mike

#211 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 14 October 2009, 23:35

mrjoslin& said:



you have failed to install correctly, please follow all the install instructions, not just some of them, otherwise it will never work!!

If you need tips on installing this thread may help.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#212 mrjoslin

  • Community Member
  • 11 posts
  • Real Name:Mike

Posted 15 October 2009, 02:45

View Postspooks, on 14 October 2009, 23:35, said:

you have failed to install correctly, please follow all the install instructions, not just some of them, otherwise it will never work!!

If you need tips on installing this thread may help.


Hey, I at least narrowed it down. If i turn off my STS (simple template system) everything works fine. The contribution looks great, now i'm even more excited to get it working. Has anyone had any luck getting this to work with STS? I noticed that if i copy the header info from product_info.php to my index.php.html template at least the images pop up. unfortunately i can't seem to figure out how to get the ones with php to function properly... any help would be appreciated.

#213 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 15 October 2009, 09:19

had any luck getting this to work with STS?

View Postmrjoslin, on 15 October 2009, 02:45, said:


I see, pity you did'nt mention STS b4, I don't use STS, but ivanio http://forums.oscomm.../263361-ivanio/ has stated he has it working fine with that, you could ask him for instructions, or post in the STS support thread, I believe it should be staight forward.

If it helps, I noticed with STS on your page was missing all the header additions. [img]http://forums.oscommerce.com/public/style_emoticons/default/ohmy.gif[/img]

If you find a solution, it would be helpful to others if you would post it here. [img]http://forums.oscommerce.com/public/style_emoticons/default/biggrin.gif[/img]

Edited by spooks, 15 October 2009, 09:21.

Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#214 Epsilon Solutions

  • Community Member
  • 11 posts
  • Real Name:Ivan

Posted 16 October 2009, 04:22

Its a great contributions however I have two problems

1. everything works well until I installed osCthumb. the thumbnails images works fine, however when the popup comes up it
says "forbidden parameter : osCsid" can anyone point me in the right directions as to how to fix this problem
2. the loading time is very slow, once I take out the javascript for this contribution it loads normal again, is that normal or just me.

any help would be much appreicated thanks

#215 martina

  • Community Member
  • 13 posts
  • Real Name:Martina di Vertacollini

Posted 16 October 2009, 09:47

I like this contribution that I installed yesterday and got working like a charm, without any problems. Many thanks to the developer!

I have a question for an enhancement: would it be possible to change the popup script so that the popup disappears automatically when you klick on another area in the webshop?
That would be better because now you have to click the cross in the upper right corner of the popup to have it disappear. If you don't, you are left with many openstanding browser-screens.

THX

#216 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 16 October 2009, 10:15

View PostEpsilon Solutions, on 16 October 2009, 04:22, said:

1. everything works well until I installed osCthumb. the thumbnails images works fine, however when the popup comes up it
says "forbidden parameter : osCsid" can anyone point me in the right directions as to how to fix this problem
2. the loading time is very slow, once I take out the javascript for this contribution it loads normal again, is that normal or just me.


1. Yes, could be a problem on some stores (mainly MS2) in some circumstances, its because I automatically used tep_href_link but this is one of the few cases when its not needed!! [img]http://forums.oscommerce.com/public/style_emoticons/default/blush.gif[/img]

in product_info.php, find:

echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . tep_href_link(($source ? $source : DIR_WS_IMAGES . $product_info['products_image']), $product_info['products_name']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"', false, 5) . '
</a>'; 

replace with:

echo '<a  rel="image_group" title="'.$product_info['products_name'].'" href="' . ($source ? $source : DIR_WS_IMAGES . $product_info['products_image']) . '" alt="' . $product_info['products_name'] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"', false, 5) . '
</a>'; 

2. Likely you have large images & its the load time for images, if you just disable scripts then reload, as your pic is now in the browser cache so load will be much quicker. For a valid comparison, disable scripts , clear browser cache, then reload.

Edited by spooks, 16 October 2009, 10:28.

Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#217 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 17 October 2009, 10:14

make the popup disappear when you klick on other content

View Postmartina, on 16 October 2009, 09:47, said:



This option is already included, to enable simply add:

 

'hideOnContentClick' : true,


to the options list, ie after

'zoomSpeedOut': 700,

in your head seaction


Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#218 martina

  • Community Member
  • 13 posts
  • Real Name:Martina di Vertacollini

Posted 17 October 2009, 10:57

View Postspooks, on 17 October 2009, 10:14, said:

make the popup disappear when you klick on other content


This option is already included, to enable simply add:

 

'hideOnContentClick' : true,


to the options list, ie after

'zoomSpeedOut': 700,

in your head seaction


#219 martina

  • Community Member
  • 13 posts
  • Real Name:Martina di Vertacollini

Posted 17 October 2009, 11:04

THX for your speedy reply; I should have known but did not entirely know where to put the line.

Because I have several images per product which reflect actually the attributes of a product I name the images, eg duchess-blue.jpg, so for the benefit of customers I changed the line in product_info.php a little bit to show the name of the image as well as the name of the product.

"echo '<a rel="image_group" title="'.$product_info['products_name'].'" href="' . ($source ? $source : DIR_WS_IMAGES . $product_info['products_image']) . '" alt="' . $product_info['products_name'] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"', false, 5) . '<br />' . '</a>'; "
becomes:
echo '<a rel="image_group" title="'.$product_info['products_name'].'-' .$product_info['products_image'].'" href="' . ($source ? $source : DIR_WS_IMAGES . $product_info['products_image']) . '" alt="' . $product_info['products_name'] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"', false, 5) . '<br />' . '</a>';

and a little bit further on (twice):
echo '<a rel="image_group" title="'.$product_info['products_name'].'" href="' . tep_href_link($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>';
becomes:
echo '<a rel="image_group" title="'.$product_info['products_name'].'-' .$value.'" href="' . tep_href_link($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>';

Maybe other persons might like this too.
Thx again.

#220 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 17 October 2009, 13:57

View PostSharon_U, on 13 October 2009, 02:22, said:

I will PM a URL so you can take a look.


I`ve just spotted your PM (I don't check messages too often!) I see no code on your site, Have u reverted?
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.