Thứ Ba, 3 tháng 9, 2013

Code tạo quảng cáo popup xuất hiện 1 lần/1 ngày/1 ip

Published by Unknown on Thứ Ba, 3 tháng 9, 2013  | No comments

6. Code tạo quảng cáo popup xuất hiện 1 lần/1 ngày/1 ip



Tìm đến thẻ <body> và thay thế thành như bên dưới

<body onclick='popunder();'>

<script>
/* <![CDATA[ */
function Set_Cookie(a,b,c,e,f,g){var d=new Date;d.setTime(d.getTime());d=new Date(d.getTime()+c);document.cookie=a+"="+escape(b)+(c?";expires="+d.toGMTString():"")+(e?";path="+e:"")+(f?";domain="+f:"")+(g?";secure":"")}function Get_Cookie(a){var b=document.cookie.indexOf(a+"="),c=b+a.length+1;if(!b&&a!=document.cookie.substring(0,a.length)||-1==b)return null;a=document.cookie.indexOf(";",c);-1==a&&(a=document.cookie.length);return unescape(document.cookie.substring(c,a))} function Delete_Cookie(a,b,c){Get_Cookie(a)&&(document.cookie=a+"="+(b?";path="+b:"")+(c?";domain="+c:"")+";expires=Mon, 11-November-2020 00:00:01 GMT")}
function popunder(){null==Get_Cookie("cucre")&&(Set_Cookie("cucre","cucre Popunder","1","/","",""),
pop=window.open("http://ngheseovip.blogspot.com","windowcucre"),
pop.blur(),window.focus())}function addEvent(a,b,c){a.attachEvent?a.attachEvent("on"+b,c):a.addEventListener?a.addEventListener(b,c,!0):a["on"+b]=c} addEvent(window,"load",function(){addEvent(document.body,"click",function(){popunder()})});
/* ]]> */</script>

Hoặc bạn có thể dùng đoạn code sau:

<script>
    //<![CDATA[
function Set_Cookie(name, value, expires, path, domain, secure) {
    var today = new Date();
    today.setTime(today.getTime());
    var expires_date = new Date(today.getTime() + (expires));

    document.cookie = name + "=" + escape(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
}

function Get_Cookie(name) {

    var start = document.cookie.indexOf(name + "=");
    var len = start + name.length + 1;
    if ((!start) &&
(name != document.cookie.substring(0, name.length))) {
        return null;
    }
    if (start == -1) return null;
    var end = document.cookie.indexOf(";", len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len, end));
}

function Delete_Cookie(name, path, domain) {
    if (Get_Cookie(name)) document.cookie = name + "=" +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
";expires=Mon, 11-November-1989 00:00:01 GMT";
}

function popunder() {
 if (Get_Cookie('cucre') == null) {
     Set_Cookie('cucre', 'cucre Popunder', '1', '/', '', '');
        var url = "http://ngheseovip.blogspot.com";
        pop = window.open(url, 'windowcucre');
  pop.blur();

        window.focus();
    }
}

function addEvent(obj, eventName, func) {
    if (obj.attachEvent) {
        obj.attachEvent("on" + eventName, func);
    }
    else if (obj.addEventListener) {
        obj.addEventListener(eventName, func, true);
    }
    else {
        obj["on" + eventName] = func;
    }
}

addEvent(window, "load", function (e) {
    addEvent(document.body, "click", function (e) {
        popunder();
    });
});
    //]]>
</script>
<body onclick='popunder();'> 

Filed in :
About the Author

Write admin description here..

0 nhận xét:

© 2013 dich vu seo. SEO UY TÍN Theme-junkie converted by Dịch vụ seo
DỊCH VỤ SEO. DỊCH VỤ SEO SEO.
back to top