Skip to content

Instantly share code, notes, and snippets.

@johanneswuerbach
Forked from anonymous/gist:2400094
Created April 16, 2012 17:28
Show Gist options
  • Save johanneswuerbach/2400106 to your computer and use it in GitHub Desktop.
Save johanneswuerbach/2400106 to your computer and use it in GitHub Desktop.
function getOpenXBannerCode(oXZones,plingaApi) {
var oXLoc=(location.protocol=='https:'?'https':'http') + "://lbopx.plinga.de/www/delivery/spc.php";
var oXZoneIds ='';
$.each(oXZones, function(key, value) {
oXZoneIds += escape(key+'=' + value + "|");
});
oXLoc += "?zones="+oXZoneIds;
oXLoc += (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
oXLoc += '&source='+plingaApi.gameName+'&cb='+m3_r+'&game=' + plingaApi.gameName +'&platform=' + plingaApi.platform +'&lang=' + plingaApi.language);
oXLoc += '&firstbuyer='+(plingaApi.owner.firstBuyer==1?1:0)
if(typeof plingaApi.owner.gender !== 'undefined'){
oXLoc += '&gender='+plingaApi.owner.gender.toLowerCase();
}
var cacheBreacker = Math.floor(Math.random()*99999999999);
oXLoc += '&cb='+cacheBreacker;
$.getScript(oXLoc,function(data){
console.log(data);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment