Location: PHPKode > projects > Caleb's Code > Cafe_Cart/classes/front-back.php
<?php

function showfb($prod,$id) {
   global $pntable;
   $product_fb = array(
      '1'  => '1',
      '2'  => '1',
      '3'  => '1',
      '4'  => '1',
      '5'  => '1',
      '6'  => '1',
      '7'  => '1',
      '8'  => '0',
      '9'  => '0',
      '10' => '1',
      '11' => '1',
      '12' => '1',
      '13' => '0'
      );
   $twosided = true;
   if ($prod == '99') list($product_fb[$prod]) = mysql_fetch_row(mysql_query("SELECT twosided FROM $pntable[cp_seasonal] WHERE prod='$id'"));
   if (!@GetImageSize("http://images.cafepress.com/prodtn_nocache/".$id."_F_TN.jpg")) $twosided = false;
   if (!@GetImageSize("http://images.cafepress.com/prodtn_nocache/".$id."_B_TN.jpg")) $twosided = false;
   if ($product_fb[$prod] && $twosided) {
      $output = "\n<SCRIPT LANGUAGE=\"JavaScript\">\n"
               ."<!--\n"
               ."function swapimg(ToImg, FromImg) {\n"
               ."   document.images[ToImg].src = document.images[FromImg].src;\n"
               ."   }\n"
               ."-->\n"
               ."</SCRIPT>\n"
               ."<table border=\"0\">"
               ."<tr><td colspan=2>click to view front / back:</td></tr>"
               ."<tr><td><a href=\"javascript:swapimg('mainimg', 'img1')\"><img border=\"0\" name=\"img1\" src=\"http://images.cafepress.com/prodtn_nocache/".$id."_F_TN.jpg\" width=48 height=48></a></td>"
               ."<td><a href=\"javascript:swapimg('mainimg', 'img2')\"><img border=\"0\" name=\"img2\" src=\"http://images.cafepress.com/prodtn_nocache/".$id."_B_TN.jpg\" width=48 height=48></a></td></tr></table>";
      }
   else $output = " ";
   return $output;
   }

?>
Return current item: Caleb's Code