Announcement

Collapse
No announcement yet.

rotating banner

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

  • rotating banner

    i know the search button is like god (it knows everything) , but it could not come up with an answer on my question, which is;

    How do I ad a randomly rotating banner to my main forumpage instead of the vbulletin logo?

    In the admin panel i can ad a single logo, but i would like to have it rotating (each time one visits a different banner). Even better would be the integration with phpads or something.

    Let me know! Thanks for your time.

  • #2
    A possibility would be to use this in the phpinclude template:
    $randomnumber = rand(1, 10);

    Then place ten different logos in your images directory, each with the name ending in the numbers 1 to 10, for an example logo1.jpg .

    Then change source from the <img> tag which calls the logo to something like this:
    logo$randomnumber.jpg

    Then each time a page loads, a randomly selected logo out of the 10 logos would be displayed. However, this is not tested.

    Comment


    • #3
      HTML Code:
      <SCRIPT LANGUAGE="JAVASCRIPT">
      <!-- 
        var Banners = new Array("banners/firstBanner.gif","banners/secondBanner.gif" (etc) )
        var hotLinks = new Array("http://www.url1.com","http://www.url2.com")
        var linkTexts = new Array("text1","text2")
      
        var bnrCntr = 0
      
        function bancycle() {
          bnrCntr = bnrCntr + 1
          if (bnrCntr >= 2) { bnrCntr = 0 }
      
          document.Banner.src = Banners[bnrCntr]
          document.Link.value = hotLinks[bnrCntr]
          setTimeout("bancycle()",12000)
        }
      // -->
      </SCRIPT>
      Some of this doesn't work right (I never had time to play with it), but it's close. The actual banner display works perfectly however. Each banner shows for 12 seconds. This code would go in the "headinclude" template of a specific style.

      Note that in this case, the "banners" directory would be directly under your base web directory.

      Comment


      • #4
        would it matter where you place the script in the headinclude template? because i am just going to place it at the very bottom

        also, would you change in:

        var hotLinks = new Array("http://www.url1.com","http://www.url2.com"

        the "http://www.url1.com","http://www.url2.com"

        directing them to your image locations like
        http://www.yousuck.com/banners/firstBanner.gif
        and http://www.yousuck.com/banners/secondBanner.gif

        or would you just put the link to your forum index?
        Last edited by KenshinRyuSe; Thu 30 Dec '04, 10:10am.

        Comment


        • #5
          Nope. Anywhere within the (head) (/head) tags is fine.

          Comment


          • #6
            ah, and the answer to my second question??

            Comment


            • #7
              hotLinks is the array that contains the place the user will be taken to, if they click a specific banner during it's view period. (I may not have the right syntax for that bit, but it's darn close...)

              Comment


              • #8
                i see, and what would i do if my banner is not just one gif pic, but different segmented gifs that all come together to make one whole banner?

                Comment


                • #9
                  Well, by definition a banner is a single image. I really don't know how you'd process a multiple.

                  Comment


                  • #10
                    its because i have certain buttons like Register and New Posts, etc. in the header along with the banner -_-

                    Comment


                    • #11
                      Well, that's a different issue. You can "map" certain areas of a static image to be used like buttons. When a user clicks in the designated area, the action is taken.

                      For example, the code below maps "hot" areas of a static image:

                      HTML Code:
                      <div align="center">
                        <center>
                        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1" width="700">
                          <tr>
                            <td width="110" align="left">
                      
                      <map name="tb2kmapvert">
                      <area href="http://www.YourURL.com/vb/forumdisplay.php?s=&forumid=9" shape="rect" coords="0, 0, 92, 16" alt="Click here to switch to the main discussion board.">
                      <area href="http://www.YourURL.com/vb/forumdisplay.php?s=&forumid=91" shape="rect" coords="0, 17, 92, 33" alt="Post sensitive information here. Things that you only want members to read">
                      <area href="http://www.YourURL.com/vb/forumdisplay.php?s=&forumid=10" shape="rect" coords="0, 34, 92, 50" alt="Share your wealth of knowledge with other avid sportsmen and shooters.">
                      <area href="http://www.YourURL.com/vb/forumdisplay.php?s=&forumid=11" shape="rect" coords="0, 51, 92, 67" alt="The Religion SIG is ideal for in-depth discussions, debates, and group study.">
                      <area href="http://www.YourURL.com/vb/forumdisplay.php?s=&forumid=45" shape="rect" coords="0, 68, 92, 84" alt="Trading Post">
                      <area href="http://www.YourURL.com/vb/forumdisplay.php?s=&forumid=51" shape="rect" coords="0, 85, 92, 101" alt="Group for coordinating and planning in-person member meetings and regional assistance in case of emergencies.">
                      <area href="http://www.YourURL.com/vb/forumdisplay.php?s=&forumid=85" shape="rect" coords="0, 102, 92, 118" alt="Indulge in 'off-the-wall' discussions and explore unexplained phenomena in the Alternative Topics Lounge">
                      <area href="http://www.YourURL.com/vb/forumdisplay.php?s=&forumid=86" shape="rect" coords="0, 119, 92, 135" alt="A place for members to express themselves through creative writing and storytelling">
                      <area href="http://www.YourURL.com/vb/forumdisplay.php?s=&forumid=83" shape="rect" coords="0, 136, 92, 152" alt="Comm/Tech/PC Help">
                      <area href="http://www.YourURL.com/vb/forumdisplay.php?s=&forumid=46" shape="rect" coords="0, 153, 92, 169" alt="A lightly moderated forum where members can 'let it all hang out'">
                      </map>
                      <img border="0" src="http://www.YourURL.com/graphic_images/TB2Ksigs7_vert.gif" usemap="#tb2kmapvert" width="92" height="169" align="center"></td>
                            <td width="590" align="center">
                            <img border="0" src="http://www.YourURL.com/graphic_images/TB2K_Logo4.gif" align="center" width="587" height="176"></td>
                          </tr>
                        </table>
                        </center>
                      </div><br>
                      The above code is placed in the HEADER template (for this example). For reference, below is attached the actual static gif that gets mapped.
                      Attached Files
                      Last edited by Dennis Olson; Thu 30 Dec '04, 10:48am.

                      Comment


                      • #12
                        no no, i mean this:


                        http://www.animetunes.com/forums

                        when the header is loading, do you notice that there are different gifs being loaded to make one banner, not just one single whole?

                        Comment


                        • #13
                          Yeah I understand. You're talking about the $navbar at the bottom of your image, right?

                          Comment


                          • #14
                            What exactly do you want to do then? One logo that changes with each pageload or that changes while the page is being displayed? Because that JS code does the latter.

                            Comment


                            • #15
                              one logo that changes with each pageload

                              i am talking about the are where it says www.vbdesigns.de

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X