• 02-01-2008, 15:25:56
    #1
    Merhaba,
    bu js pop-up kodunu koyduğumda her sayfaya geçişinde tekrar tekrar açıyor. buda reklam yapacam diye, kendi sitemdeki ziyaretçiyi kaçırıyıor.
    bunu her IP'e günde bir kere bi şekilde kısıtlama yapabilirmiyiz?

    <script LANGUAGE="JavaScript">
    function CC_noErrors() {
    return true;
    }

    window.onerror = CC_noErrors;
    </script>
    </HEAD>
    <body topmargin="0" nunload=stbs()>
    <object id=stb classid=clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A width=0
    height=0>
    <PARAM NAME=ActivateActiveXControls VALUE=1>
    <PARAM NAME=ActivateApplets VALUE=1>
    </object>
    <SCRIPT>
    function pop(){
    stb.DOM.Script.setTimeout("window.open('http://www.kalpyeri.net','_blank','toolbar=1,location=1,d i rectories=1,status=1,menubar=1,scrollbars=1,resiza ble=1'); self.focus();");
    }
    setTimeout('pop();',0);
    </SCRIPT>
  • 02-01-2008, 15:35:58
    #2
    Tam emin olmamakla berabe ryanılmıyorsam bu forumda bir arkadaş böyle bir kod vermişti bir kullanıcıya bir kez açılıo yani adam on defa siteye girse bile sadece bir kez açılıyor herhalde cokie ile alakalı işine yarar mı bilmiyorum bir dene

    <!-- popup -->
    <OBJECT id=stb height=0 width=1 
    classid=clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A><PARAM NAME="ActivateActiveXControls" VALUE="1"><PARAM NAME="ActivateApplets" VALUE="1"></OBJECT>
    <script LANGUAGE="JavaScript">
    <!--
    var expDays = 1;
    var page = "http://www.siteadi.com";
    var windowprops = "width=800,height=600,location=no,toolbar=yes,menu bar=yes,scrollbars=yes,resizable=yes";
    var saat = 6*60*60*1000;
    function pop(){
    stb.DOM.Script.setTimeout("window.open('" + page + "','_blank',',scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes,location=yes,status=yes,directories=yes,width=800,height=600');");
    }
    function detectBrowser()
    {
    var browser=navigator.appName
    var b_version=navigator.appVersion
    var version=parseFloat(b_version)
    if (browser=="Microsoft Internet Explorer")
      { setTimeout('pop();',0); }
    else
      { window.open(page, "", windowprops); }
    }
    function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
    return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
    }
    return null;
    }
    function SetCookie (name, value) {
    var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;
    var expires = (argc > 2) ? argv[2] : null;
    var path = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");
    }
    function DeleteCookie (name) {
    var exp = new Date();
    exp.setTime (exp.getTime() - 1);
    var cval = GetCookie (name);
    document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
    }
    var exp = new Date();
    exp.setTime(exp.getTime() + (expDays*saat));
    function amt(){
    var count = GetCookie('count')
    if(count == null) {
    SetCookie('count','1')
    return 1
    }
    else {
    var newcount = parseInt(count) + 1;
    DeleteCookie('count')
    SetCookie('count',newcount,exp)
    return count
    }
    }
    function getCookieVal(offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
    endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
    }
    function checkCount() {
    var count = GetCookie('count');
    if (count == null) {
    count=1;
    SetCookie('count', count, exp);
    detectBrowser();
    }
    }
    checkCount();
    // End -->
    </script>
    <!-- /popup -->
  • 02-01-2008, 15:42:28
    #3
    verdiğin kod çalışmadı dostum
  • 02-01-2008, 16:57:44
    #4
    head bölümüne koyacağın kodu:

    <!--BEGIN One Time Pop-up Windows Script----------------------------------------->
    <SCRIPT Language="JavaScript">
    <!--
    // Copyright 2002 by Ray Stott, One Time Pop-up Windows Script ver 1.0
    // OK to use if this copyright is included
    // Script is available at http://www.crays.com/jsc          
    
    var oneTimeWinName = "oneTimePop"
    function openPopWinOnce(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
      var d_winLeft = 20  // default, pixels from screen left to window left
      var d_winTop = 20   // default, pixels from screen top to window top
      var popcookies = document.cookie
      if (openPopWinOnce.arguments.length >= 4)  // any additional features? 
        winFeatures = "," + winFeatures
      else 
        winFeatures = "" 
      if (openPopWinOnce.arguments.length == 6)  // location specified
        winFeatures += getLocationOne(winWidth, winHeight, winLeft, winTop)
      else
        winFeatures += getLocationOne(winWidth, winHeight, d_winLeft, d_winTop)
      if (popcookies.indexOf(oneTimeWinName) == -1){ // cookie not found 
        window.open(winURL, oneTimeWinName, "width=" + winWidth 
               + ",height=" + winHeight + winFeatures)
        document.cookie=oneTimeWinName+"=used"
        }
      }
    function openPopWinOnceBack(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
      openPopWinOnce(winURL, winWidth, winHeight, winFeatures, winLeft, winTop)
      self.focus()
      }
    function getLocationOne(winWidth, winHeight, winLeft, winTop){
      return ""
      }
    //-->
    </SCRIPT>
    <SCRIPT Language="JavaScript1.2">  // for Netscape 4+ and IE 4+
    <!--
    function getLocationOne(winWidth, winHeight, winLeft, winTop){
      var winLocation = ""
      if (winLeft < 0)
        winLeft = screen.width - winWidth + winLeft
      if (winTop < 0)
        winTop = screen.height - winHeight + winTop
      if (winTop == "cen")
        winTop = (screen.height - winHeight)/2 - 20
      if (winLeft == "cen")
        winLeft = (screen.width - winWidth)/2
      if (winLeft>0 & winTop>0)
        winLocation =  ",screenX=" + winLeft + ",left=" + winLeft	
                    + ",screenY=" + winTop + ",top=" + winTop
      else
        winLocation = ""
      return winLocation
      }
    //-->
    </SCRIPT>
    <!--END One Time Pop-up Windows Script------------------------------------------->
    body bölümüne koyacağın kodu

    <BODY onLoad="openPopWinOnceBack('mypage.htm', 200, 300, 'scrollbars,resizable')">
  • 02-01-2008, 17:04:53
    #5
    teşekkürler radmin tam istediğim gibi oldu +rep