[insert_php]
/*
*
* Lennox.com Product API v1.0 Example
* PRODUCT DETAILS
*
* XML Source: https://lennox.com/api/v1/category/
*
* PHP 5 w/ XML transport
* Author: Ben Wilson (bwilson@powercreative.com)
* 2008/10/09
*
* Version 1.0 – Initial write
* Version 1.1 – Ratings and Reviews addition – 02/13/2013
*
* Note: the “allow_url_fopen” directive in your php.ini file must be
* set to “On” for this demo to work.
*/
/* Replace “YOUR-API-KEY” with your Lennox Webservices/API Key */
$APIKEY = ‘HYvgukj’;
//fetch MODEL from querystring ‘
if (!empty($_GET[‘product’])) { $product_id = $_GET[“product”]; }
else { echo “This script requires a valid model ID.”; exit(); }
?>
function basePopup(uri,width,height,winName,winArgs) { /* close existing popUp window */ if (typeof(popUp) == "object") { if (typeof(popUp.window) == "object") popUp.close(); } popUp = window.open(uri, winName, 'width=' + width + ',height=' + height + winArgs); /* attempt to focus the new window */ if (typeof(popUp) == "object") { try { popUp.focus(); } catch(err) { return false; } } return false; }
// A general-purpose popup window function function popupWindow(uri, width, height) { var windowName = 'popup'; if(arguments.length > 3) { windowName = arguments[3]; } return basePopup(uri,width,height,windowName,',scrollbars=no,resizable=yes,menubar=no,toolbar=no,location=no,directories=no,status=no,menubars=no'); }
// A general-purpose popup window function with full chrome function popupScrollOnly(uri,width,height,windowName) { return basePopup(uri,width,height,windowName,',scrollbars=yes,resizable=yes,menubar=no,toolbar=no,location=no'); }
function EnlargePhoto(filename) {
return popupScrollOnly('image-popup.php?filename=' + filename,610,570,'photo');
}
Product) {
$product = $xml->Product; ?>
Images->LargeImage ?>” onclick=”return EnlargePhoto(this.href);”>View Larger
Animations) { Reviews->Review as $review) { ‘:”;
ReviewText ?> IsRecommended) == ‘TRUE’) { ?>
foreach ($product->Animations->Animation as $anim) { ?>
See what other customers are saying about the ModelName; ?>:
$userRating = $review->Rating . ‘/’ . $review->RatingRange;
print ($j > 0) ? ‘
print date(‘F j, Y’,strtotime($review->SubmissionTime)) . ‘
‘; ?>
UserNickname . ” – ” . $review->UserLocation; ?>
Title ?>
Yes, I recommend this product.
Publications) { ?>
Publications
Publications->Publication as $pub) { ?>
[/insert_php]
