Announcement

Collapse
No announcement yet.

Why won't this code work anymore?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why won't this code work anymore?

    Prior to my vb3 upgrade I was using this code in my navbar templete to rotate banners. It was such a simple code that required very little maintenance but now I can't get it to work. Can someone look at it and see if you might know why its not working anymore?

    PHP Code:
    <if condition="THIS_SCRIPT == 'index'"
    <
    p align="left"><script language="JavaScript"
    // Copyright 1996, Infohiway, Inc. ([url]http://www.infohiway.com[/url]) 
    // Courtesy of SimplytheBest.net ([url]http://simplythebest.net/info/dhtml_scripts.html[/url]) 
    <!-- 
    function 
    adArray() { 
    for (
    i=0i*2<adArray.arguments.lengthi++) { 
      
    this[i] = new Object(); 
      
    this[i].src adArray.arguments[i*2]; 
      
    this[i].href adArray.arguments[i*2+1]; 

    this.length i

    function 
    getAdNum() { 
    dat = new Date(); 
    dat = (dat.getTime()+"").charAt(8); 
    if (
    dat.length == 1
      
    ad_num dat%ads.length
    else 
      
    ad_num 0
    return 
    ad_num

    var 
    ads = new adArray
    "http://www.gamingevolved.com/forums/adrotations/GEebaylogo.jpg","http://cgi6.ebay.com/ws/eBayISAPI.dll?ViewSellersOtherItems&include=0&userid=gamingevolved&sort=3&rows=25&since=-1&rd=1"
    "http://www.gamingevolved.com/forums/adrotations/premiummembership.jpg","http://www.gamingevolved.com/forums/pages/premium.html"
    "http://www.gamingevolved.com/forums/adrotations/gamegenbanner.jpg","http://www.gamegeneration.net/forums"
    var 
    ad_num getAdNum(); 
    document.write('<TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD ' 
    +'ALIGN=CENTER><FONT SIZE=2 FACE=Arial>' 
    +'</FONT></TD><TR></TR><TD><A HREF="'+ads[ad_num].href+'"><IMG SRC="'+ads[ad_num].src+'" ' 
    +'WIDTH="468" HEIGHT="60" BORDER=0 name=js_ad></A></TD></TR></TABLE>'); 
    link_num document.links.length-1
    function 
    rotateSponsor() { 
    if (
    document.images) { 
      
    ad_num = (ad_num+1)%ads.length
      
    document.js_ad.src ads[ad_num].src
      
    document.links[link_num].href ads[ad_num].href
      
    setTimeout("rotateSponsor()",15000); 


    setTimeout("rotateSponsor()",15000); 
    // --> 
    </script></p
    </if> 

  • #2
    Everything looks good, and I don't see any old vB2 variables that need to be updated.

    Unfortunately I am not very good with javascript. If it still isn't working then I recommend you post in the PHP / MySQL / JS / HTML forum on www.vbulletin.org for help.

    Comment


    • #3
      How isnt it working?

      Comment


      • #4
        absolutely nothing shows up. The code is in and it just does nothing. Below is a screenshot of where it used to show up and where it should be now.
        Attached Files
        Last edited by KCMO; Mon 14 Jun '04, 2:22pm.

        Comment


        • #5
          try this
          HTML Code:
          <if condition="THIS_SCRIPT == index"> 
          <p align="left"><script language="JavaScript"> 
          // Copyright 1996, Infohiway, Inc. ([url]http://www.infohiway.com[/url]) 
          // Courtesy of SimplytheBest.net ([url]http://simplythebest.net/info/dhtml_scripts.html[/url]) 
          <!-- 
          function adArray() { 
          for (i=0; i*2<adArray.arguments.length; i++) { 
            this[i] = new Object(); 
            this[i].src = adArray.arguments[i*2]; 
            this[i].href = adArray.arguments[i*2+1]; 
          } 
          this.length = i; 
          } 
          function getAdNum() { 
          dat = new Date(); 
          dat = (dat.getTime()+"").charAt(8); 
          if (dat.length == 1) 
            ad_num = dat%ads.length; 
          else 
            ad_num = 0; 
          return ad_num; 
          } 
          var ads = new adArray( 
          "http://www.gamingevolved.com/forums/adrotations/GEebaylogo.jpg","http://cgi6.ebay.com/ws/eBayISAPI.dll?ViewSellersOtherItems&include=0&userid=gamingevolved&sort=3&rows=25&since=-1&rd=1", 
          "http://www.gamingevolved.com/forums/adrotations/premiummembership.jpg","http://www.gamingevolved.com/forums/pages/premium.html", 
          "http://www.gamingevolved.com/forums/adrotations/gamegenbanner.jpg","http://www.gamegeneration.net/forums"; 
          var ad_num = getAdNum(); 
          document.write('<TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD ' 
          +'ALIGN=CENTER><FONT SIZE=2 FACE=Arial>' 
          +'</FONT></TD><TR></TR><TD><A HREF="'+ads[ad_num].href+'"><IMG SRC="'+ads[ad_num].src+'" ' 
          +'WIDTH="468" HEIGHT="60" BORDER=0 name=js_ad></A></TD></TR></TABLE>'); 
          link_num = document.links.length-1; 
          function rotateSponsor() { 
          if (document.images) { 
            ad_num = (ad_num+1)%ads.length; 
            document.js_ad.src = ads[ad_num].src; 
            document.links[link_num].href = ads[ad_num].href; 
            setTimeout("rotateSponsor()",15000); 
          } 
          } 
          setTimeout("rotateSponsor()",15000); 
          // --> 
          </script></p> 
          <else /> 
          test
          </if>

          Comment


          • #6
            no dice

            Comment


            • #7
              you dont even see test ?

              Comment


              • #8
                ok, here is whats weird about it now. It still doesn't show up at all on the forum index. but do me a favor and go inside any forum on the board then look at the navbar...you'll see the test you added in

                Keep in mind this is the exact spot I had the code prior to the vb3 upgrade.

                http://www.gamingevolved.com/forums

                Comment


                • #9
                  This means youve put it inside of a conditional.

                  If you want pm me an admin account and ill get the banner code in the right place

                  Comment


                  • #10
                    PM sent.....I've only got the code up in the default style. If you get it in the right place there I can transfer it over to all my other styles. Thanks Zach

                    Comment


                    • #11
                      Well, this is weird, are you 100% sure you have the right bit of code? i cant even make this work outside of vB at all.

                      Comment


                      • #12
                        its the code you told me to try The first bit of code that I posted was what I was using prior to upgrading to version 3. So its looking like a lost cause huh?

                        Comment


                        • #13
                          No i mean, the code from the first post you have, ive tried it in just an html file, it DOESNT work at all, are you sure the code is still the same?

                          Comment


                          • #14
                            yup, I downloaded a copy of the templete before I upgraded to vb3 back when it went gold and I'm just getting around to adding it back in. Templete has sat untouched since I downloaded it.

                            Comment


                            • #15
                              well, try adding it to a static html page to see if it works.

                              Comment

                              Loading...
                              Working...
                              X