Affilistore Mod - LightBox V2 Integration

This integrates the LightBox v2 script into affilistore.

When a product (from list) image or similar product image is clicked it will show the large product image.
This requires some product template change for which there is no fixed method.

Effectively though I would recommend moving the PRODLINK link from wrapping aroung the image and to its own link wrapping some text, like More or Details. Example can be seen on the iwatches.co.uk site.

Download LightBox V2 - Here

Upload the js, cs & images folders to your site root. Effectively creating 3 new folders. No overwriting of existing files.

1. index.tpl
In your skin index.tpl file add the following above the tag

HTML:
  1. <script type="text/javascript" src="{INSTALLDIR}js/prototype.js"></script>
  2. <script type="text/javascript" src="{INSTALLDIR}js/scriptaculous.js?load=effects,builder"></script>
  3. <script type="text/javascript" src="{INSTALLDIR}js/lightbox.js"></script>

Add the following below the main

CODE:
  1. <link rel="stylesheet...line

HTML:
  1. <link rel="stylesheet" href="{INSTALLDIR}css/lightbox.css" type="text/css" media="screen" />

2. includes/products.inc.php
Add the following after the //thumb image if/else section around line 60

PHP:
  1. //LightBox Image
  2. $lightImage = $similar['prodImageURL'];
  3. $lightCaption = $similar['prodName'];
  4. $box_content->assign("LBOXLINK", $lightImage);
  5. $box_content->assign("LBOXTITLE", $lightCaption);

Add the following after the //thumb image if/else section around line 490

PHP:
  1. //LightBox Image
  2. $lightImage = $row_product['prodImageURL'];
  3. $lightCaption = $row_product['prodName'];
  4. $box_content->assign("LBOXLINK", $lightImage);
  5. $box_content->assign("LBOXTITLE", $lightCaption);

3. styleTemplates/products.tpl
This depends on how you want to style your products section, but requires a new image wrap link e.g

HTML:
  1. <p class="styleProdImage">
  2.     <a href="{LBOXLINK}" rel="lightbox" title="{LBOXTITLE}">
  3.         <img src="{IMAGELINK}"  alt="{NAME}" onerror="imgerr(this);" />
  4.     </a>
  5. </p>

( the p tag could be replaced with an inline tag such as span)

Move the original image wrap to e.g

HTML:
  1. <div class="styleProdLink">
  2.     <a href="{PRODLINK}"><span class="styleProdMore">More </span></a>
  3. </div>

Again div can be replaced with span for inline styling

3. StyleSheet

Add any extra styling to the css file e.g

CSS:
  1. .styleProdImage {
  2.     text-align:center;
  3.     display:block;
  4.     }
  5. .styleProdLink {
  6.     position: absolute;
  7.     bottom:0;
  8.     right:0;
  9.     line-height: 200%;
  10. }

You will need to use your own css styles!
S

One Comment Posted

6:45 pm on August 29th, 2008

[...] - bookmarked by 4 members originally found by hominymanchild on 2008-08-18 Affilistore Mod - LightBox V2 Integration http://www.anyname.co.uk/2008/07/affilistore-mod-lightbox-v2-integration/ - bookmarked by 2 [...]

 
Name
E-mail
Website
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.