<?php
//=================================================================\\
// url_functions.php v1.2 \\
//----------------------------------------------------------------------------------------------------------------------\\
// This file is part of Accessories Me PHP Affiliate Script. \\
//----------------------------------------------------------------------------------------------------------------------\\
// File purpose: Format AWSECommerceService URL for parser \\
//-----------------------------------------------------------------------------------------------------------------------\\
// COPYRIGHT: (C) 2004, 2005 Len Johnson \\
// Website: http://www.accessories.me.uk \\
// Email: hide@address.com \\
// Mail: GB WEBS, 4 Leominster Walk, West Midlands, B45 9SW, UK \\
// SUPPORT: http://www.accessories.me.uk/forum-2.htm \\
//------------------------------------------------------------------------------------------------------------------------\\
// DONATIONS: If you have found this script useful you can make a donation to support \\
// it's continued development at http://www.accessories.me.uk/about12.htm \\
//------------------------------------------------------------------------------------------------------------------------\\
// COPYING/LICENSE: Accessories Me PHP Affiliate Script is free software; \\
// you can redistribute it and/or modify it under the terms of the GNU General Public License \\
// as published by the Free Software Foundation; either version 2 \\
// of the License, or (at your option) any later version. See LICENSE.TXT \\
//------------------------------------------------------------------------------------------------------------------------\\
// Accessories Me PHP Affiliate Script is distributed in the hope that it will be useful, \\
// but WITHOUT ANY WARRANTY; \\
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \\
// See the GNU General Public License for more details. \\
//-------------------------------------------------------------------------------------------------------------------------\\
// You should have received a copy of the GNU General Public License along with this program; \\
// if not, write to: \\
// Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \\
// http://www.opensource.org/licenses/gpl-license.html \\
//-------------------------------------------------------------------------------------------------------------------------\\
// CHANGELOG \\
// 05-02-05 Search function added \\
//=================================================================\\
function browse($BrowseNode, $SearchIndex)
{
global $sort;
global $page;
$ecsUrl = ECS4_AMAZON_URL;
$ecsUrl .= '&SubscriptionId=1MD4MCSQSNXVA6EV3WG2';
$ecsUrl .= '&AssociateTag='. ASSOCIATEID;
$ecsUrl .= '&Operation=ItemSearch';
$ecsUrl .= '&SearchIndex='. $SearchIndex;
$ecsUrl .= '&BrowseNode='. $BrowseNode;
$ecsUrl .= '&ResponseGroup=Large';
$ecsUrl .= '&XMLEscaping=Double';
if ($page)
{
$ecsUrl .= '&ItemPage='. $page;
}
if ($sort)
{
$ecsUrl .= '&Sort='. $sort;
}
return $ecsUrl;
}
function product($ASIN)
{
$ecsUrl = ECS4_AMAZON_URL;
$ecsUrl .= '&SubscriptionId=1MD4MCSQSNXVA6EV3WG2';
$ecsUrl .= '&AssociateTag='. ASSOCIATEID;
$ecsUrl .= '&Operation=ItemLookup';
$ecsUrl .= '&ItemId=' . $ASIN;
$ecsUrl .= '&BrowseNode='. $BrowseNode;
$ecsUrl .= '&ResponseGroup=Large';
$ecsUrl .= '&XMLEscaping=Double';
return $ecsUrl;
}
function search($Keywords,$SearchIndex,$BrowseNode)
{
global $sort;
global $page;
$ecsUrl = ECS4_AMAZON_URL;
$ecsUrl .= '&SubscriptionId=1MD4MCSQSNXVA6EV3WG2';
$ecsUrl .= '&AssociateTag='. ASSOCIATEID;
$ecsUrl .= '&Operation=ItemSearch';
$ecsUrl .= '&Keywords=' . $Keywords;
$ecsUrl .= '&SearchIndex='. $SearchIndex;
$ecsUrl .= '&BrowseNode='. $BrowseNode;
$ecsUrl .= '&ResponseGroup=Large';
if ($page)
{
$ecsUrl .= '&ItemPage='. $page;
}
if ($sort)
{
$ecsUrl .= '&Sort='. $sort;
}
return $ecsUrl;
}
?>