Announcement

Collapse
No announcement yet.

Header Rotation

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

  • Header Rotation

    Hello all,

    I have 7 diffent header images that I want to use in the header. Each time a page is refreshed or viewed it will show a new header image. Is this possible and how do you do it?


    Thanks,
    Itworx4me

  • #2
    Use a random image generator and place the code where you want the banner to show up.

    Comment


    • #3
      I would imagine you need to insert a javascript in the header replacement to choose a random image.

      Comment


      • #4
        i think this will work, and is template only

        Place this somewhere in Head Insert

        Code:
        <SCRIPT LANGUAGE="JavaScript">
        
        <!-- Begin
        // Set up the image files to be used.
        var theImages = new Array() // do not change this
        // To add more image files, continue with the
        // pattern below, adding to the array.
        
        theImages[0]= 'URL TO IMAGE'
        theImages[1] = 'URL TO IMAGE'
        theImages[2] = 'URL TO IMAGE'
        theImages[3] = 'URL TO IMAGE'
        theImages[4] = 'URL TO IMAGE'
        theImages[5] = 'URL TO IMAGE'
        theImages[6] = 'URL TO IMAGE'
        theImages[7] = 'URL TO IMAGE'
        theImages[8] = 'URL TO IMAGE'
        theImages[9] = 'URL TO IMAGE'
        theImages[10] = 'URL TO IMAGE'
        theImages[11] = 'URL TO IMAGE'
        theImages[12] = 'URL TO IMAGE'
        theImages[13] = 'URL TO IMAGE'
        theImages[14] = 'URL TO IMAGE'
        // do not edit anything below this line
        
        var j = 0
        var p = theImages.length;
        var preBuffer = new Array()
        for (i = 0; i < p; i++){
           preBuffer[i] = new Image()
           preBuffer[i].src = theImages[i]
        }
        var whichImage = Math.round(Math.random()*(p-1));
        function showImage(){
        document.write('<img src="'+theImages[whichImage]+'" border="0">');
        }
        
        //  End -->
        </script>
        and place this in the Header template where u want the header image rotated

        Code:
        <SCRIPT LANGUAGE="JavaScript">
        <!-- Begin
        showImage();
        //  End -->
        </script>
        i'm not sure if this will work, but i think it should

        Comment


        • #5
          Originally posted by ULTIMATESSJ
          i think this will work, and is template only

          Place this somewhere in Head Insert

          Code:
          <SCRIPT LANGUAGE="JavaScript">
          
          <!-- Begin
          // Set up the image files to be used.
          var theImages = new Array() // do not change this
          // To add more image files, continue with the
          // pattern below, adding to the array.
          
          theImages[0]= 'URL TO IMAGE'
          theImages[1] = 'URL TO IMAGE'
          theImages[2] = 'URL TO IMAGE'
          theImages[3] = 'URL TO IMAGE'
          theImages[4] = 'URL TO IMAGE'
          theImages[5] = 'URL TO IMAGE'
          theImages[6] = 'URL TO IMAGE'
          theImages[7] = 'URL TO IMAGE'
          theImages[8] = 'URL TO IMAGE'
          theImages[9] = 'URL TO IMAGE'
          theImages[10] = 'URL TO IMAGE'
          theImages[11] = 'URL TO IMAGE'
          theImages[12] = 'URL TO IMAGE'
          theImages[13] = 'URL TO IMAGE'
          theImages[14] = 'URL TO IMAGE'
          // do not edit anything below this line
          
          var j = 0
          var p = theImages.length;
          var preBuffer = new Array()
          for (i = 0; i < p; i++){
             preBuffer[i] = new Image()
             preBuffer[i].src = theImages[i]
          }
          var whichImage = Math.round(Math.random()*(p-1));
          function showImage(){
          document.write('<img src="'+theImages[whichImage]+'" border="0">');
          }
          
          //  End -->
          </script>
          and place this in the Header template where u want the header image rotated

          Code:
          <SCRIPT LANGUAGE="JavaScript">
          <!-- Begin
          showImage();
          //  End -->
          </script>
          i'm not sure if this will work, but i think it should
          Did anyone try this to see if it worked?
          http://forums.swgstation.com

          Comment


          • #6
            I would not recommend hacking vb in order to use a simple random script. DO a simple search on google to find one and test them. All you should edit in vb is the templates in order to make a random header. This is not the place to discuss hacking, and it's also making it impossible to get official help.

            For something simple, please think twice about hacking your vb files.
            V1 Bad Bunny Emoticons > (For Dark BGs)
            Squarehead V1 Emoticons -
            Let Users select postbit style!

            Comment


            • #7
              If it were me I'd create a new php file called headerimage.php or something, and use the GD functions. Then all I'd need to do is go <img src="headerimage.php">.

              Not a true hack, because you aren't changing any code
              Check this out, it should do the trick:

              http://www.alistapart.com/d/randomizer/rotate.txt
              Matt
              Avatar Generator - The ultimate avatar and banner generation tool. It's a Google Image search mashup.
              Christian Gaming - A forum for Christians who like video games.

              Comment


              • #8
                Unless you were generating the images on the fly, you could just open the file and echo it out. The only problem is that headerimage.php will probably be cached... you could probably send no cache headers... but then you unnecissarily increase bandwidth. A javascript solution solves all of these...unless you're generating images on the fly
                TheologyWeb. We debate theology. srsly.

                Comment

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