mySQLSafe($_GET['catId'])." AND I.cat_id > 0 AND C.hide != '1'" : "AND I.cat_id > 0"; $sql = sprintf("SELECT I.name, I.image, I.productId FROM %1\$sCubeCart_inventory AS I LEFT JOIN %1\$sCubeCart_category AS C ON I.cat_id = C.cat_id WHERE I.disabled != '1' AND C.hide != '1' %2\$s ORDER BY RAND(%3\$d) LIMIT 1", $glob['dbprefix'], $whereClause, $seed); $randProd = $db->select($sql); if ($randProd) { if (($val = prodAltLang($randProd[0]['productId'])) == true) { $randProd[0]['name'] = $val['name']; } $box_content = new XTemplate ("boxes".CC_DS."randomProd.tpl"); $box_content->assign("LANG_RANDOM_PRODUCT",$lang['randomProd']['featured_prod']); $box_content->assign("PRODUCT_ID",$randProd[0]['productId']); $box_content->assign("PRODUCT_NAME",validHTML($randProd[0]['name'])); $thumbRootPath = imgPath($randProd[0]['image'],$thumb=1,$path="root"); $thumbRelPath = imgPath($randProd[0]['image'],$thumb=1,$path="rel"); if (file_exists($thumbRootPath) && !empty($randProd[0]['image'])) { $box_content->assign("IMG_SRC", $thumbRelPath); } else { $box_content->assign("IMG_SRC", "skins/". SKIN_FOLDER . "/styleImages/thumb_nophoto.gif"); } $box_content->parse("random_prod"); $box_content = $box_content->text("random_prod"); } else { $box_content = ''; } ?>