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"); } $SQL = "SELECT node, catalog FROM ".$prefix."_amazon_nodes where pnode is not null and locale = '$AMZLocale' order by RAND() LIMIT 1"; $result = $db->sql_query($SQL); list($node, $catalog) = $db->sql_fetchrow($result); $mode = Get_Cat_Mode($catalog); $amazon = amazon_search('BrowseNodeSearch', $node, $mode, 'lite', ''); $content = ""; $content .=""; $content ="
\n"; $AMZ_Count = count($amazon->records); if ($AMZ_Count < 1) { # No Similar Data is Available. Then use the default ASIN. $Asin = $AMZDefault_Asin; $amazon = amazon_search('SimilaritySearch', $Asin, '', 'lite', 1); } foreach($amazon->records as $ind => $arr) { # Extract fields of interest but first clear from previews pass. $Asin = ""; $ProductName = ""; $OurPrice = ""; $ListPrice = ""; $ImageUrl = ""; $Asin = $arr['asin']; $ProductName = $arr['productname']; $OurPrice = $arr['ourprice']; $ListPrice = $arr['listprice']; $Savings = AMZsavings($ListPrice,$OurPrice); $ImageUrl = $arr['imageurlsmall']; if ($Savings[1] > 0 && $AMZImgType != "NO") { if ($Savings[1] > 9) { $ImageUrl = str_replace (".01.", ".01._PE".$Savings[1]."_".$AMZImgType."_SC", $ImageUrl); } else { $ImageUrl = str_replace (".01.", ".01._PE0".$Savings[1]."_".$AMZImgType."_SC", $ImageUrl); } $ImageUrl = str_replace (".jpg", "_.jpg", $ImageUrl); } $LinkURL = "modules.php?name=$AMZModule_Name&asin=$Asin"; $LinkStartStr = ""; $prodName = $arr['productname']; if (strlen($prodName) > 50) { $prodName = rtrim(substr($prodName, 0, 50)).' ...'; } $content .= $LinkStartStr; $content .= "$ProductName"; $content .= ""; $content .= "
\n"; $content .= $LinkStartStr; $content .= "\"$ProductName\"\n"; $content .= "
\n"; if ($arr['ourprice'] != '') { $OurPrice = AMZRemoveCurrency($arr['ourprice']); if (strtolower($OurPrice) == "too low to display") { $OurPrice = "" . _AMZTOOLOW . ""; } } if ($arr['listprice'] != '') { $listprice = AMZRemoveCurrency($arr['listprice']); } $AMZCurrency = AMZGetCurrency(); if ($listprice > $ourprice) { $content .= "" . _AMZBLKLSTPRICE . ": " . $AMZCurrency . "$listprice
"; } $content .= "" . _AMZBLKPRICE . ": " . $AMZCurrency . "$OurPrice

"; } $content .="

"; ?>