Jump to content
Fórum Script Brasil
  • 0

Ajuda com Pop Under?


rascal91
 Share

Question

Olá pessoal,

Estou utilizando um código para POP UNDER mas ele só abre em POP UP. alguém sabe me dizer o que está errado?

Agradeço desde já.

OBS: Tentei inserir a code box mas tá dando error 404 O.o

Código:

addEventHandler = function (element, eventName, eventHandler) {

if (element.attachEvent) {

element.attachEvent("on" + eventName, eventHandler)

} else if (element.addEventListener) {

element.addEventListener(eventName, eventHandler, false)

} else {

var oldEvent = element["on" + eventName];

element["on" + eventName] = function () {

if (oldEvent) {

oldEvent()

}

eventHandler();

return true

}

}

};

getName = function (arr) {

var ret = '';

//for (var i = 0; i < arr.length; i++) {

// ret += String.fromCharCode(arr)

//}

return arr

};

Cookie = function (cookiename) {

var name = cookiename;

this.create = function (value, domainName, days) {

if (days) {

var date = new Date();

date.setTime(date.getTime() + (days * 24 * 60 * 60 * 5));

var expires = "; expires=" + date.toGMTString();

var domain = "; domain=" + domainName

} else {

var expires = ""

}

document.cookie = name + "=" + value + expires + domain + "; path=/"

};

this.read = function () {

var nameEQ = name + "=";

var ca = document.cookie.split(';');

for (var i = 0; i < ca.length; i++) {

var c = ca;

while (c.charAt(0) == ' ') {

c = c.substring(1, c.length)

}

if (c.indexOf(nameEQ) == 0) {

return c.substring(nameEQ.length, c.length)

}

}

return null

};

this.erase = function () {

this.create(name, "", -1)

}

};

var arrU = 'ero speed';

var arrJ = 'ero speed';

var windowName = 'propaganda';

var urlPublicidade = "(?:" + getName(arrU) + "|" + getName(arrJ) + "" + getName(arrU) + ")";

var urlDC = 'URL AQUI';

var urlDU = urlDC;

var jaClicou = false;

var wProps;

var wOpen;

var excludes = [];

var u = "n.u.l.l";

var cookieName = "dcPopunder";

var cookie;

var vlrCookie;

var cookieDuration = 24 / 24;

function initPopunder(codContrato, urlExc, modo) {

cookie = new Cookie(cookieName);

vlrCookie = cookie.read();

if (vlrCookie == null) {

if (codContrato) {

if (urlDC.toLowerCase().substr(urlDC.length - 12) == "codcontrato=") urlDC += codContrato;

if (urlDU.toLowerCase().substr(urlDU.length - 12) == "codcontrato=") urlDU += codContrato

}

var w = screen.availWidth;

var h = screen.availHeight;

wProps = "width=" + w + ",height=" + h + ",toolbar=yes,location=yes,directories=0,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0";

if (modo == 'dc' || modo == 'du') {

if (modo != 'du') {

openPopunder()

}

if (!wOpen) {

addEventHandler(document, "click", openPopunder);

if (modo == 'du') {

addEventHandler(window, "load", brs);

addEventHandler(window, "beforeunload", ext)

}

}

} else {

if (urlExc instanceof Array) {

excludes = urlExc

}

parseLinks();

addEventHandler(window, "load", parseLinks)

}

}

};

function parseLinks() {

var verifUrl = (excludes.length > 0) ? true : false;

for (i = 0; i < document.links.length; i++) {

var lnk = document.links;

var bool = lnk.onclick ? true : false;

if (verifUrl) {

for (j = 0; j < excludes.length; j++) {

bool = bool || (lnk.href == excludes[j])

}

}

if (!bool && !lnk.href.match(urlPublicidade)) {

addEventHandler(lnk, "click", openPopunder)

}

}

};

function openPopunder(urlDest) {

if (!jaClicou) {

if (typeof urlDest != 'string') urlDest = urlDC;

if (urlDest != '') {

wOpen = window.open(urlDest, windowName, wProps);

if (wOpen) {

wOpen.blur();

cookie.create("1", document.domain, cookieDuration);

jaClicou = true

}

} else {

jaClicou = true

}

}

return true

};

function ext() {

if (!jaClicou) {

var iie = document.getElementById("iie");

try {

iie.launchURL(urlDU);

cookie.create("1", document.domain, cookieDuration)

} catch (e) {

openPopunder(urlDU)

}

jaClicou = true

}

};

function brs() {

};

cookieName = 'Pop feito';

initPopunder(124, [], 'du');

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      150.9k
    • Total Posts
      648.8k
×
×
  • Create New...