Code needs cleaning up as im figuring things out and playing around but at moment it works for what i want , the URL is allowed to be hidden and all sites doing same are doing it, some with no URL showing and some with there own URL then link,
Hope this helps.
Code:
<?
$affiliateid = '******'; //Letters and numbers
$trackingid = '******'; //numbers only
function UrlSigner($urlDomain, $urlPath, $partner, $key){
settype($urlDomain, 'String');
settype($urlPath, 'String');
settype($partner, 'String');
settype($key, 'String');
$URL_sig = "hash";
$URL_ts = "timestamp";
$URL_partner = "aid";
$URLreturn = "";
$URLtmp = "";
$s = "";
$time = time();
$urlPath = str_replace(" ", "+", $urlPath);
$URLtmp = $urlPath . "&" . $URL_partner . "=" . $partner . "&" . $URL_ts . "=" . $time;
$s = $urlPath . "&" . $URL_partner . "=" . $partner . "&" . $URL_ts . "=" . $time . $key;
$tokken = "";
$tokken = base64_encode(pack('H*', md5($s)));
$tokken = str_replace(array("+", "/", "="), array(".", "_", "-"), $tokken);
$URLreturn = $urlDomain . $URLtmp . "&" . $URL_sig . "=" . $tokken;
return $URLreturn;
}
$request = simplexml_load_file(UrlSigner('http://uk.shoppingapis.kelkoo.com', '/V2/productSearch?query=tv&show_products=1&show_subcategories=0&show_refinements=0&logicalType=and&start=1&results=&merchantId=', $trackingid, $affiliateid));
?>
<!--
body,td,th {
font-size: 10px;
}
-->
<table width="620"; cellpadding="0">
<?
foreach ($request->Products->Product as $details) {
$GridImage = $details->Offer->GridImage->Url;
$Price = $details->Offer->Price;
$Url = $details->Offer->Url;
$ProductName = $details->Offer->ProductName;
$Summary = $details->Offer->Summary;
$DeliveryCost = $details->Offer->DeliveryCost;
echo '<tr><td width="130" valign="top" style="border:0;"><a href="http://clk.tradedoubler.com/click?p=3431&a=*********&url='.$Url.'" target="_blank"><span style="center; color:#ffffff; font-weight:;"><img src="'.$GridImage.'" style="text-align: center; float:left; border:0; margin-left:10px; margin-right:10px; margin-bottom:20px; margin-top:20px" alt="'.$ProductName.'"title="'.$ProductName.'" height="130" width="150"/> </td><td><a href="http://clk.tradedoubler.com/click?p=3431&a=1640667&url='.$Url.'" target="_blank"><style="text-align: center; float:left; border:0; margin-left:10px; margin-bottom:50px"> <h3>'.$ProductName.'</h3><p>'.$Summary.'</p></a></td><td><a href="http://clk.tradedoubler.com/click?p=3431&a=1640667&url='.$Url.'" target="_blank"> <center><style="text-align: center; float:left; border:0; margin-left:10px; margin-bottom:50px"><h3>£'.$Price.' </h3>(P&P: £'.$DeliveryCost.')<p>More Info</p></a>
<!-- AddThis Button BEGIN --> <a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&username=xa-4b57caaa4af87277"><img alt="Bookmark and Share" height="14" src="http://s7.addthis.com/static/btn/sm-share-en.gif" style="border: 0pt none;" width="60" /></a>
<script src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4b57caaa4af87277" type="text/javascript"></script>
<!-- AddThis Button END -->
</center></td></tr>';}
//echo '<pre>';
//print_r($request);
//echo '</pre>';
?></td>
</tr>
</tbody>
</table>
__________________
FOR SALE > Please login or register to view this content. Registration is FREE < JOB LOT INC 20/MONTH MULTI SITE HOSTING PM IF INTERESTED
Please login or register to view this content. Registration is FREE
|