Announcement

Collapse
No announcement yet.

Quick question about template conditional.

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

  • Quick question about template conditional.

    Is there some kind of template conditional that I could use to display a "random" image from a set of images?

    I want to show a slightly different header image randomly across the forum.

  • #2
    If you've got your random header images in /images/headers/ and they are named 1.jpg, 2.jpg, 3.jpg, 4.jpg, 5.jpg Then you can do this:

    Plugin code at the global_start hook location:
    PHP Code:
    $headerimagepath 'images/headers/' mt_rand(15) . '.jpg'
    Then in your header template:
    HTML Code:
    <img src="$headerimagepath" border="0" alt="" />
    ~~~~~

    Comment


    • #3
      This is awesome, thanks!

      Comment

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