Quote:
Originally Posted by sarettah
Where you have this:
Change to:
And then change the initialization at the top to var stagedPopFrequency = "10 minutes";
You do not need to say days or minutes or anything in there actually, the script is only using the integer part.
The code is also using toGMTString which is deprecated and should be changed to toUTCString
This is still not a wonderful solution in my mind because now it is hardcoded for minutes instead of days as it was before.
If you truly wanted this to use the passed in value 1 days, 1 hours, 1 minutes,.... where you could set it however you wanted on the fly it would take some additional work.
.
|
changed everything like you said.. still dont work
please help me out i just want to promote a music video of my daugther with this pop. thanks!
var stagedPopFrequency = "1 minutes";
var stagedCookieName = "__name";
if (!document.currentStage)
document.currentStage = 0;
document.currentStage++;
if (document.currentStage == 1) {
function stagedGetCookie(Name) {
var search = Name + "=";
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search);
if (offset != -1) { // if cookie exists
offset += search.length;
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue = unescape(document.cookie.substring(offset, end));
}
}
return returnvalue;
}
function stagedSetCookie(Name, Value, Expire) {
if (Expire != null) {
var expireDate = new Date();
expireDate.setMinutes(expireDate.getMinutes() + parseInt(Expire));
document.cookie = Name+"="+Value+";path=/;expires=" + expireDate.toGMTString();
} else {
document.cookie = Name+"="+Value+";path=/";
}
}
function stagedResetCookie(Name) {
var expireDate = new Date();
expireDate.setMinutes(expireDate.getMinutes() - 10);
document.cookie = Name+"=;path=/;expires=" + expireDate.toGMTString();
}
function stagedPopUnder() {
if (stagedGetCookie(stagedCookieName) == '') {
var thisStage = 1;
var stageFunc = eval('window.popUnderStage'+thisStage);
if (stageFunc != undefined) {
stageFunc();
stagedSetCookie(stagedCookieName, thisStage + 1, stagedPopFrequency);
}
} else {
var thisStage = parseInt(stagedGetCookie(stagedCookieName));
var stageFunc = eval('window.popUnderStage'+thisStage);
if (stageFunc != undefined) {
stageFunc();
stagedSetCookie(stagedCookieName, thisStage + 1, stagedPopFrequency);
}
}
}
function stagedAttachBody() {
if (document.body) {
if (document.all) {
document.body.attachEvent('onclick', stagedPopUnder);
} else {
document.body.addEventListener('click', stagedPopUnder, false);
}
} else {
setTimeout('stagedAttachBody()', 200);
}
} stagedAttachBody();
}
if( parseInt(navigator.appVersion) > 3 )
{
winWidth = screen.availWidth;
winHeight = screen.availHeight;
}
else
{
winWidth = "1024";
winHeight = "768";
}
var stagedTmpFunc = function() {
var pu = window.open("https://youtube.com/watch?v=BRdq0GdkqlE", "_blank", "width=" + winWidth + ",height=" + winHeight + ",scrollbars=1,resizable=1,menubar=1");
pu.blur();
window.focus();
}
eval('window.popUnderStage'+document.currentStage+ ' = stagedTmpFunc;');
stagedTmpFunc = null;