|
Intro: this isn't a rehashed method. this is some real deal stuff
Basically the method was to create an incentive gateway type affiliate program that's only for adult traffic - I would rebroker offers from cpa networks and blank the refferer onto my review type landing page.
Here is the entire setup:
In one directory create the the following .htaccess file- <FilesMatch "\.(js)$">
- AddHandler application/x-httpd-php .js
- </FilesMatch>
复制代码 This will make it possible to run php scripts inside your javascript file. No publisher is going to trust you if tell them include php scripts from your server.
Next is the actual gateway code. Save this file as the gateway.js file - it's going to be the file that they will include. I didn't do too much work on it so the unlock method is a timer.- var loaded = true;
- var hasloaded = false;
- var delay_time = 0;
- var unscroll_time = 200;
- var a = 0;
- hide_ie_embeds = 0;
- function setCookie(c_name,value,expiredays)
- {
- var exdate=new Date();
- exdate.setDate(exdate.getDate()+expiredays);
- document.cookie=c_name+ "=" +escape(value)+
- ((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
- }
- function getCookie(c_name)
- {
- if (document.cookie.length>0)
- {
- c_start=document.cookie.indexOf(c_name + "=");
- if (c_start!=-1)
- {
- c_start=c_start + c_name.length+1;
- c_end=document.cookie.indexOf(";",c_start);
- if (c_end==-1) c_end=document.cookie.length;
- return unescape(document.cookie.substring(c_start,c_end));
- }
- }
- return "";
- }
- function getScrollPos(){
- var topScroll;
- if (self.pageYOffset) {
- topScroll = self.pageYOffset;
- }else if (document.documentElement and& document.documentElement.scrollTop){
- topScroll = document.documentElement.scrollTop;
- }else if (document.body) {
- topScroll = document.body.scrollTop;
- }
- return topScroll;
- }
- function getPageSize(){
- var xScroll, yScroll;
- if (window.innerHeight and& window.scrollMaxY) {
- xScroll = window.innerWidth + window.scrollMaxX;
- yScroll = window.innerHeight + window.scrollMaxY;
- } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
- xScroll = document.body.scrollWidth;
- yScroll = document.body.scrollHeight;
- } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
- xScroll = document.body.offsetWidth;
- yScroll = document.body.offsetHeight;
- }
- var windowWidth, windowHeight;
- if (self.innerHeight) { // all except Explorer
- if(document.documentElement.clientWidth){
- windowWidth = document.documentElement.clientWidth;
- } else {
- windowWidth = self.innerWidth;
- }
- windowHeight = self.innerHeight;
- } else if (document.documentElement and& document.documentElement.clientHeight) { // Explorer 6 Strict Mode
- windowWidth = document.documentElement.clientWidth;
- windowHeight = document.documentElement.clientHeight;
- } else if (document.body) { // other Explorers
- windowWidth = document.body.clientWidth;
- windowHeight = document.body.clientHeight;
- }
- // for small pages with total height less then height of the viewport
- if(yScroll < windowHeight){
- pageHeight = windowHeight;
- } else {
- pageHeight = yScroll;
- }
- // for small pages with total width less then width of the viewport
- if(xScroll < windowWidth){
- pageWidth = xScroll;
- } else {
- pageWidth = windowWidth;
- }
- arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
- return arrayPageSize;
- }
- function alerts(a) {
- alert(a);
- }
- function addLoadEvent(func) { // credit to Scott Andrew
- var oldonload = window.onload;
- if (typeof window.onload != 'function'){
- window.onload = func;
- }else{
- window.onload = function(){ oldonload(); func(); }
- }
- }
- // -----------
- function initGateway() {
-
-
- if(window.location.hash) { exit; }
- else {
- if (hasloaded != true){
- hasloaded = true;
- if (delay_time > 0) {
- setTimeout("loadGateway()", delay_time*1000);
- } else {
- loadGateway();
- }
- addLoadEvent(check());
- }
- }
- }
- function loadGateway(){
- // the Body must be ready before we can begin
- var objBody = document.getElementsByTagName("body")[0];
- if (objBody == null) {
- setTimeout("loadGateway();", 200);
- return false;
- }
- var overlayDiv = document.getElementById('gw_overlay');
- toggleEmbeds(0);
- var mainDiv = document.getElementById('gw_main');
- mainDiv.style.display = 'block';
- var arrayPageSize = getPageSize();
- overlayDiv.style.height = (arrayPageSize[1] + 'px');
- if (navigator.appName == 'Microsoft Internet Explorer') {
- overlayDiv.style.width = (arrayPageSize[0] + 'px');
- }
- overlayDiv.style.display = 'block';
- document.getElementById('gw_iframe').style.display = '';
- document.getElementById('gw_iframe').src = <?php echo ""http://www.eikasoft.com/publisher/get.php?id=".$_GET["id"].'";' ?>
- if (unscroll_time > 0){ unscroll(); }
- }
- function unscroll(){
- scroll(0,0);
- if (unscroll_time > 0) {
- setTimeout("unscroll();", unscroll_time);
- }
- }
- function toggleEmbeds(newstate) {
- if (newstate==0){
- v_visibility = 'hidden';
- v_wmode = 'opaque';
- f_display = 'none';
- }else{
- v_visibility = 'visible';
- v_wmode = 'window';
- f_display = '';
- }
-
- var embeds = document.getElementsByTagName('embed');
- for (var ems = document.embeds, i = 0, em; em = ems[i]; i++) {
- if (navigator.appName == 'Microsoft Internet Explorer') {
- if (hide_ie_embeds){ em.style.visibility = v_visibility; }
- em.setAttribute('wmode', v_wmode);
- }else{
- em.setAttribute('wmode', v_wmode);
- if (newstate==0){
- var nx = em.nextSibling, pn = em.parentNode;
- pn.removeChild(em);
- pn.insertBefore(em, nx);
- }
- }
- }
- }
- function removeElement(divNum) {
- var d = document.getElementById('myDiv');
- var olddiv = document.getElementById(divNum);
- d.removeChild(olddiv);
- }
- var out = '';
- out = '<style type="text/css">';
- out += '#gw_overlay { position:absolute;top:0;left:0; width:100%; z-index:1999002; background-color:#000000; filter:alpha(opacity=50); opacity:0.50; -moz-opacity:0.50; }';
- out += '#gw_main { margin-top:100px; width:100%; text-align:center; position:absolute;top:0;left:0; z-index:1999003; }';
- out += '</style>';
- out += '<div id="myDiv"> </div>';
- out += '<div id="gw_overlay" style="display:none;"></div>';
- out += '<div id="gw_main" style="display:none;">';
- out += '<iframe width="650" height="420" id="gw_iframe" src="" scrolling="no" allowtransparency="true" frameborder="0" style="overflow-x:hidden;overflow-y:hidden; background-color:transparent; z-index:1999005;" scrollbars="no"></iframe>';
- out += '</div>';
- document.write(out);
- if (delay_time != -1){ addLoadEvent(initGateway); }
- function check()
- {
- if(window.location.hash) {
- location.reload(true);
- }
- else {
- setTimeout('check()', 10);
- }
- }
复制代码 |
|