FREE or paid need a javascript modified

Discussion in 'JavaScript' started by balzizras, May 11, 2006.

  1. #1
    Im using the below javascript in my php based myspace whore train, but its mucking up the functionality of it because it loads everytime. What I need is for it to use cookies so it will only display the ad to IE users every X minutes. Where X would be say 3 to 5 minutes or so.

    Can anyone help me out? Preferably free.. :) Or well I have a few bucks in my paypal account.. :eek:

    <!--      EXPLORER DESTROYER      -->
    <!--     explorerdestroyer.com    -->
    
    <!--     LEVEL 2:  SEMI-SERIOUS    -->
    
    <!--  To install, follow the instructions that come with the scripts. -->
    
    
    <!-- 
    
    IMPORTANT: Where to place the script
    
    The key part of installing the script is to copy and past the full contents of this file in place of the <body> tag in your html.  
    
    Doing so will put the script code where it belongs and will use the <body> tag that appears directly below this comment in place of the one in your current HTML (you need that javascript bit for the script to work).
    
    -->
    
    <body onLoad="javascript:hasIE_hideAndShow();init()">
    
    
    <!-- 
    
    UNDER 50 SETTING
    
    If you would like to send stats to explorerdestroyer.com about what percentage of your visitors are using IE, set the variable below called 'hasIE_phone_home' to 1.  
    
    Check out the sidebar on explorerdestroyer.com for more info about the 'get under 50' campaign.  If the variable is set to 0, no info will be sent.
    
    -->
    
    
    <script type="text/javascript">
    <!--
    
    var hasIE_phone_home = 0;
    
    
    // This function does the actual browser detection
    function hasIE_hasIE() {
      var ua = navigator.userAgent.toLowerCase();
      return ((ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && 
              (ua.indexOf('webtv') == -1) &&
              (location.href.indexOf('seenIEPage') == -1));
    }
    
    function hasIE_showOnlyLayer(whichLayer)
    {
      if (document.getElementById)
        {
          var style2 = document.getElementById(whichLayer);
        }
      else if (document.all)
        {
          var style2 = document.all[whichLayer];
        }
      else if (document.layers)
        {
          var style2 = document.layers[whichLayer];
        }
      var body = document.getElementsByTagName('body');
      body[0].innerHTML = style2.innerHTML;
    }
    
    function hasIE_showLayer(whichLayer)
    {
      if (document.getElementById)
        {
          var style2 = document.getElementById(whichLayer).style;
          style2.display = "block";
        }
      else if (document.all)
        {
          var style2 = document.all[whichLayer].style;
          style2.display = "block";
        }
      else if (document.layers)
        {
          var style2 = document.layers[whichLayer].style;
          style2.display = "block";
        }
    }
    
    function hasIE_moveAd(adid) {
      if (document.getElementById)
        {
          var ad = document.getElementById('hasIE_ad');
          var adloc = document.getElementById(adid);
        }
      else if (document.all)
        {
          var ad = document.all['hasIE_ad'];
          var adloc = document.all[adid];
        }
      else if (document.layers)
        {
          var ad = document.layers['hasIE_ad'];
          var adloc = document.layers[adid];
        }
      adloc.innerHTML = ad.innerHTML;
    }
    
    // Hides and shows sections of the page based on whether or not it's
    // running in IE
    function hasIE_hideAndShow() {
      if (hasIE_hasIE()) {
        hasIE_showOnlyLayer("hasIE_level2");
              if (hasIE_phone_home == 1)
                hasIE_phoneHome('getIE_pingimage2');
      } else {
        if (hasIE_phone_home == 1)
          hasIE_phoneHome('getIE_pingimage0');
      }
    }
    
    function hasIE_phoneHome(image) {
      if (document.getElementById)
        {
          var img = document.getElementById(image);
        }
      else if (document.all)
        {
          var img = document.all[image];
        }
      else if (document.layers)
        {
          var img = document.layers[image];
        }
      img.setAttribute('src','http://getunder50.com/ping.php?host='+location.host);
    
    }
    
    function hasIE_ContinueWithoutFF() {
        if (location.href.indexOf('?') != -1)
            location.href += '&seenIEPage=1';
        else
            location.href += '?seenIEPage=1';
    }
    
    -->
    </script>
    
    <span style="position:absolute; width: 0px; height:0px; left:-1000px; top: -1000px"><img id="getIE_pingimage0"/></span>
    
    <!-- LEVEL 2: SPLASH WITH CLICK THROUGH --> 
    
    <div id="hasIE_level2" style="display: none;">
    <span style="position:absolute; width: 0px; height:0px; left:-1000px; top: -1000px"><img id="getIE_pingimage2"/></span>
    
    <Br /><Br />
    
    <div style="padding: 20px; background-color: #ffffbb; font-family: arial; font-size: 15px; font-weight: normal; color: #111111; line-height: 17px;">
    
    
    <div style="width: 630px; margin: 0 auto 0 auto;">
    
    <div style="padding-left: 10px; padding-top: 0px; float: right;">
    
    
    <!-- REPLACE THIS BLOCK OF SCRIPT WITH YOUR OWN FIREFOX REFERRAL BUTTON -->
    
    <script type="text/javascript"><!--
    google_ad_client = "pub-0902758782004034";
    google_ad_width = 125;
    google_ad_height = 125;
    google_ad_format = "125x125_as_rimg";
    google_cpa_choice = "CAAQ_f-XhAIaCDgvi727fxoIKK2293M";
    //--></script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    
    <!--                                                   -->
    
    
    </div>
    
    <strong>I see you're using Internet Explorer, which sucks.  I strongly suggest downloading Firefox.  I think you'll like it alot better:</strong>  
    <br /><br />
          <strong>·</strong> Firefox blocks pop-up windows.
    <br />
          <strong>·</strong> It's more secure against viruses and spyware.
    <br />
          <strong>·</strong> It keeps Microsoft from controlling the future of the internet.
    <br />
          <strong>·</strong> It's better for web designers and developers.
    <br />
          <strong>·</strong> Features like tabbed browsing make reading webpages easier.
    <br /> 
    	  <strong>·</strong> MYSPACE will load faster & look better too!
    <br />
          <strong>·</strong> If you use MYSPACE on a regular basis, just gotta get FireFox. You'll be amazed!!
    <br />
          <strong>·</strong> It's 100% FREE and sponsored by google.com!
    
    
    <br /><br />
    Click the button on the right to download Firefox.  It's free.
    <br /><br />
    <a href="http://www.balzizras.1cy.us/test/pages.php?page=home">Continue to the whore train without Firefox >></a>
    
    <br /><br />
    
    </div>
    
    </div>
    
    
    </div> 
    <div align="center">
      <!-- CLOSES LEVEL 2 DISPLAY SECTION -->
      
      
      <!-- ------YOUR NORMAL PAGE CONTENT GOES BELOW THIS LINE------ -->
    Code (markup):
     
    balzizras, May 11, 2006 IP
  2. Logic Ali

    Logic Ali Well-Known Member

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #2
    This should give the right advice to your target audience:

    
    
    <div id='anythingButIE' style="display:none;margin:0;color:#000000;background-color:#ffffa0;padding:10px;border:solid #ff0000; 4;width:50%;max-width:50%;">
     Get <a href="http://my.opera.com/USERNAME/affiliate/"><img src="http://promote.opera.com/small/opera80x15.gif"  width="80" height="15" alt="Opera" /></a> now!<BR><BR>
     All the advantages of Mozilla +
     <ul>
      <li>Enjoy built-in mouse gestures without installing an extension.
      <li>A zoom function like no other!
      <li>Specify any editor for viewing source code!
      <li>A JavaScript console that gives useful messages and can pop-up automatically without installing an extension.
      <li>"Paste & Go" - Load pasted URLs automatically.
     </ul> 
    </div>
    
    <SCRIPT type='text/javascript'>
    var cookieName="IEadviceAd",ref="";
    
    if(window.external && document.getElementById && typeof document.cookie!='undefined' && !new RegExp(cookieName).test(document.cookie))
    {
     var exp=new Date(),cDuration=240;   
     exp.setSeconds(exp.getSeconds()+cDuration);
     document.cookie=cookieName+"=true;expires="+exp.toGMTString();
     ref=document.getElementById('anythingButIE')
     if(ref.style)
       ref.style.display='block';
    }
    
    </SCRIPT>
    
    Code (markup):
     
    Logic Ali, May 12, 2006 IP
  3. balzizras

    balzizras Well-Known Member

    Messages:
    179
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Thanks. But I don't think that script is "in your face" enough to be highly effective. Below is an example of what the explorerdestroyer script does:

    http://explorerdestroyer.com/demo2.html

    As you see it doesnt display the requested page at all. You must click to continue to the page you wanted or click to go download firefox.

    My download rate using it is very high about 60 downloads out of 100 clicks.
     
    balzizras, May 12, 2006 IP