Announcement

Collapse
No announcement yet.

How to have a rotating banner/logo?

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

  • How to have a rotating banner/logo?

    I want to be able to have a roating banner/logo for the main forum and specific banners for my subforums. How do I go about doing this?

    I found this post http://www.vbulletin.com/forum/showt...ghlight=banner

    but there are more options in 3.6 I guess than 3.5 for the plugin (Hook Location, Execution Order) and was unable to get it to work by making the changes in that post.

  • #2

    Comment


    • #3
      I can't think of any reason why the Quick Tip you just pointed to wouldn't work on 3.6.

      Hook Locations haven't changed from 3.5 to 3.6 and execution order is not really that important either in this case.

      Comment


      • #4
        This is what i have so far: Admin CP -> vBulletin Options -> Plugins & Products -> Plugin Manager

        Product - vBulletin
        Hook Location - ajax_start
        Title - Banner
        Execution Order - 5
        Plugin PHP Code

        Code:
        random_number = rand(1, 2, 3, 4, 5);
        
        $random_banner[1] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner1.gif" alt="" border="0" /></a>';
        $random_banner[2] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner2.gif" alt="" border="0" /></a>';
        $random_banner[3] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner3.gif" alt="" border="0" /></a>';
        $random_banner[4] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner4.gif" alt="" border="0" /></a>';
        $random_banner[5] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner5.gif" alt="" border="0" /></a>';
        Plugin is Active - Yes

        Comment


        • #5
          Ok just changed the hook location to - parse_templates

          and this is the error i get on top of my page

          Parse error: syntax error, unexpected '=' in /home/tedrapp/public_html/global.php(550) : eval()'d code on line 1

          this error when i enter a forum

          Code:
          Unable to add cookies, header already sent.
          File: /home/tedrapp/public_html/global.php(550) : eval()'d code
          Line: 1
          this is the code in my header
          Code:
          <!-- logo -->
          <a name="top"></a>
          <table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
          <tr>
              <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
              <td align="$stylevar[right]">
                  $random_banner[$random_number]
              </td>
          </tr>
          </table>
          <!-- /logo -->
          
          <!-- content table -->
          $spacer_open
          
          $_phpinclude_output
          Last edited by TedR719; Fri 1 Dec '06, 8:47am.

          Comment


          • #6
            You are not following the instructions.

            random_number = rand(1, 2, 3, 4, 5); is not valid for several reasons.

            random_number is meaningless.
            $random_number is a variable.

            rand(1, 2, 3, 4, 5) is meaningless.
            rand(1, 5) is a random number between (and including) 1 and 5.

            Please VERY carefully follow every direction in that Quick Tip.

            Comment


            • #7
              Hi

              We had this issue. The thing that we needed was to have a whole banner system so we could report on the banner stats. We implemented PHPAds to solved the problem and just put the code at the top of each board.
              It's a bit of set up, but so far has been working well for us.

              Just a suggestion. Might be easier then altering code etc every time you want to change a banner.

              BFM
              -----
              Brandon
              Chief Angler at Tidal Fish
              Over 61,500 anglers talking fishing

              Comment


              • #8
                Originally posted by feldon23 View Post
                You are not following the instructions.

                random_number = rand(1, 2, 3, 4, 5); is not valid for several reasons.

                random_number is meaningless.
                $random_number is a variable.

                rand(1, 2, 3, 4, 5) is meaningless.
                rand(1, 5) is a random number between (and including) 1 and 5.

                Please VERY carefully follow every direction in that Quick Tip.
                Ok so i changed that part, but I still get an error or maybe im overlooking somthing, here is the code i have now

                Code:
                random_number = rand(1, 5);
                
                $random_banner[1] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner1.gif" alt="" border="0" /></a>';
                $random_banner[2] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner2.gif" alt="" border="0" /></a>';
                $random_banner[3] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner3.gif" alt="" border="0" /></a>';
                $random_banner[4] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner4.gif" alt="" border="0" /></a>';
                $random_banner[5] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner5.gif" alt="" border="0" /></a>';

                Comment


                • #9
                  Yes you're overlooking something. My instructions.

                  Comment


                  • #10
                    Originally posted by feldon23 View Post
                    Yes you're overlooking something. My instructions.
                    I dont understand what i need to change, could you please break it down for me (sorry im pretty much a beginner at this).

                    What should the code look like?

                    Comment


                    • #11
                      Code:
                      $random_number = rand(1, 5);
                      
                      $random_banner[1] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner1.gif" alt="" border="0" /></a>';
                      $random_banner[2] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner2.gif" alt="" border="0" /></a>';
                      $random_banner[3] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner3.gif" alt="" border="0" /></a>';
                      $random_banner[4] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner4.gif" alt="" border="0" /></a>';
                      $random_banner[5] = '<a href="http://www.sportstimeout.com/"><img src="images/misc/banner5.gif" alt="" border="0" /></a>';

                      Comment


                      • #12
                        Thanks so much, now its working!

                        Since I have the banner working now I had to get rid the main logo, I removed the path for the image but it still has a link on the upper left hand corner, do i need to edit the header code so there is no path for it?

                        Comment


                        • #13
                          Sorry to hijack, but I'm having the same problem. The banners don't appear and I've checked everything.

                          - Plugin/Hook System is enabled
                          - Plug in via Plugin manager is active
                          - ajax start

                          Code is as follows:

                          PHP Code:
                          $random_number rand(15);

                          $random_banner[1] = '<a href="http://www.clubscuderia.com/"><img src="images/banners/banner1.gif" alt="" border="0" /></a>';
                          $random_banner[2] = '<a href="http://www.clubscuderia.com/"><img src="images/banners/banner2.gif" alt="" border="0" /></a>';
                          $random_banner[3] = '<a href="http://www.clubscuderia.com/"><img src="images/banners/banner3.gif" alt="" border="0" /></a>';
                          $random_banner[4] = '<a href="http://www.clubscuderia.com/"><img src="images/banners/banner4.gif" alt="" border="0" /></a>';
                          $random_banner[5] = '<a href="http://www.clubscuderia.com/"><img src="images/banners/banner5.gif" alt="" border="0" /></a>'
                          Inserted the additional code in the header:

                          $random_banner[$random_number]


                          The banners are on the web server.

                          What am i doing wrong???

                          Comment


                          • #14
                            The correct Plugin hook is parse_templates, not ajax_start.

                            Also make sure you are editing the same style you're viewing.

                            Comment


                            • #15
                              How do I remove the path for the site in the left hand corner, so the banner displays centered.

                              www.sportstimeout.com

                              Comment

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