sql_query("SELECT AMZVer, AMZModule_Name, AMZ_id, cache_maxtime, AMZMore, AMZSingle, AMZQuickAdd, AMZShowReview, AMZShowSimilar, AMZLocale, AMZReviewMod, ImageType, default_asin, AMZ_Popular, AMZBuyBox, AMZShowXML FROM ".$prefix."_amazon_cfg"); list($AMZVer, $AMZModule_Name, $amazon_id, $amazon_xml_cache_maxtime, $AMZMore, $AMZSingle, $AMZQuickAdd, $AMZShowReview, $AMZShowSimilar, $AMZLocale, $AMZReviewMod, $AMZImgType, $AMZDefault_Asin, $AMZ_Popular, $AMZBuyBox, $AMZShowXML) = $db->sql_fetchrow($result); require_once("includes/NukeAmazon/functions.php"); if (isset($newlang)) { include("modules/$AMZModule_Name/language/lang-$newlang.php"); $language = $newlang; } elseif (isset($lang)) { include("modules/$AMZModule_Name/language/lang-$lang.php"); $language = $lang; } else { include("modules/$AMZModule_Name/language/lang-$language.php"); } $Asin = GetAsin(''); $isql = "update ".$prefix."_amazon_items set imp = imp + 1 where asin = '$Asin'"; $iresult = $db->sql_query($isql); $xi = 1; while ($xi < $TItems) { $NAsin = GetAsin(''); $isql = "update ".$prefix."_amazon_items set imp = imp + 1 where asin = '$NAsin'"; $iresult = $db->sql_query($isql); $Asin .= "," . $NAsin; $xi++; } $amazon = amazon_search('AsinSearch', $Asin, '', 'lite', ''); if(isset($amazon->errorMsg)) { # Error with Requested Data, use the default ASIN. $Asin = $AMZDefault_Asin; $amazon = amazon_search('AsinSearch', $Asin, '', 'lite', ''); $isql = "update ".$prefix."_amazon_items set imp = imp + 1 where asin = '$Asin'"; $iresult = $db->sql_query($isql); } $content = "\n"; $AMZColWidth = 100 / $TCol; $AMZ_Col = 0; foreach ($amazon->records as $ind => $arr) { if ($AMZ_Col == 0) { # Start Row $content .= "\n"; } # Start Column $AMZ_Col++; $content .= ""; if ($AMZ_Col == $TCol) { $content .= "\n"; $AMZ_Col = 0; } } $content .= "
\n"; # Extract fields of interest but first clear from previews pass. $Asin = ""; $ProductCatalog = ""; $ProductName = ""; $ProductDescription = ""; $Author = ""; $UPC = ""; $OurPrice = ""; $ListPrice = ""; $UsedPrice = ""; $CollectiblePrice = ""; $ThirdPartyNewPrice = ""; $Savings = ""; $UsedPrice = ""; $ImageUrl = ""; $SalesRank = ""; $Rating = ""; $ReleaseDate = ""; $Manufacturer = ""; $Mpaa = ""; $Actor = ""; $Director = ""; $TotalResults = ""; $Feature = ""; $Availability = ""; $Media = ""; $Isbn = ""; $NumberOfOfferings = ""; $Artist = ""; $Asin = $arr['asin']; $ProductCatalog = $arr['catalog']; if( is_array($arr['artist'])) { $ArtistCount = count($arr['artist']); $Artist = ""; $i = 0; while ($ArtistCount > $i) { if ($i > 0) { $Artist .= ", "; } $Artist .= "".$arr['artist'][$i].""; $i++; } } $ProductName = $arr['productname']; $OurPrice = $arr['ourprice']; if ($OurPrice == "") { $OurPrice = $arr['listprice']; } $ListPrice = $arr['listprice']; $Savings = AMZsavings($ListPrice,$OurPrice); if (strtolower($OurPrice) == "too low to display") { $OurPrice = ""._AMZTOOLOW.""; } $ImageUrl = AMZIS($Asin, 'T'); $LinkURL = "modules.php?name=$AMZModule_Name&asin=$Asin"; $LinkStartStr = ""; $content .= $LinkStartStr; $content .= "\"$ProductName\"\n"; $content .= "
"; if ($Artist) { $content .= "" . $Artist . "
\n"; } $content .= $LinkStartStr; $content .= "$ProductName
\n"; if ($OurPrice) { $content .= ""._AMZBLKPRICE.": $OurPrice
\n"; } $content .= "
"; # Log # 2.7 Center Block Created. ?>