0

I would like to know how to pin the thumbnails generated by oscthumb.php using the Oscthumb addon in an Oscommerce store.

I use below code to display the thumbnail on my productinfo.php page -

   <?php echo '<a id="thumb'.$listing['products_id'].'" class="highslide" onclick="return hs.expand(this);" oncontextmenu="return false;" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . ' ">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

I use below code for adding shareaholic pinterest and other buttons to the catalog-

<div class='shareaholic-canvas' data-app='share_buttons' data-app-id='########'></div>
<script type="text/javascript">
//<![CDATA[
  (function() {
    var shr = document.createElement('script');
    shr.setAttribute('data-cfasync', 'false');
    shr.src = '//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js';
    shr.type = 'text/javascript'; shr.async = 'true';
    shr.onload = shr.onreadystatechange = function() {
      var rs = this.readyState;
      if (rs && rs != 'complete' && rs != 'loaded') return;
      var site_id = '09989e2564a76db8b57ba83caf1ba977';
      try { Shareaholic.init(site_id); } catch (e) {}
    };
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(shr, s);
  })();
//]]>
</script>

When I use the pin button the Pinterest Pop up appears. After selecting the thumbnail to pin, On Add Pin I get below error -The actual url of website in below error is replaced with 'xxxxxxxx'

Parameter 'image_url' (value http://www.xxxxxxxxx.com/xxxxxxxx/oscthumb.php?src=kLvOxc_GvqGr5cnh1H-sxdrVrN6WtuHbw7PNkbXWvtvM1NSbqsDU2NrWuNfX55a4sZk.&w=140&h=121&fltr[]=wmt|%A9%20Vita%20Sion|12|B|626262|HARLOWSI.TTF|70|10|0&fltr[]=fram|2|1|CCCCCC|FFFFFF|000000&f=jpg&q=95&hash=11e6fa75c9ca8bdb6490201dd9ced2be) is not a valid URL format.

Please could you help me solve the above issue.

Yuki
  • 29
  • 6

1 Answers1

0

Not familiar with shareaholic, but looks like you can specify image filename : http://support.shareaholic.com/hc/en-us/articles/200471586-Customizing-Shares-title-link-image-using-data-attributes in which case you could do something like data-image='http://www.sitename.com/<?php echo $product_info['products_image']; ?>

user29671
  • 782
  • 6
  • 13
  • But how to add this code for pinterest only... because the thumbnail image script cannot be changed :( – Yuki May 19 '14 at 12:51
  • Wouldnt adding the data-image link to the main pic file help all the share functions ? So they pick up on the big main image instead of the thumbnail ? – user29671 May 19 '14 at 13:01
  • It had no effect I used below code
    '>
    – Yuki May 19 '14 at 13:08
  • I dont use shareaholic so cant help further, many they have a forum you can browse ? The code you just posted seems the same as in their faqs. – user29671 May 19 '14 at 13:26