Announcement

Collapse
No announcement yet.

How to have a different header image in different sub forum?

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

  • [Forum] How to have a different header image in different sub forum?

    We have a forum with different games, and we'd like to have the game logo on top of each sub forum of course. I know how to change this per template, but per sub forum seems more difficult. I found this over at vbulletin.org:

    Code:
    <if condition="$foruminfo[forumid] == 16">
    // code for logo 2
    <else />
    // code for logo 1
    </if>
    But I'm just not sure what to substitute the comments for.
    I tried asking over there but have not gotten any reply. Any pointers?

  • #2
    If you want to change images, then you would put in image code -
    HTML Code:
    <img src="angry.gif" alt="Angry face" />
    http://www.w3schools.com/tags/tag_IMG.asp

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools &lt;- awesome site for html/css help

    Comment


    • #3
      Originally posted by Lynne View Post
      If you want to change images, then you would put in image code -
      HTML Code:
      <img src="angry.gif" alt="Angry face" />
      http://www.w3schools.com/tags/tag_IMG.asp
      Oh! That was easy... I looked in the header template code and it looked very complicated.
      Thank you!

      Comment


      • #4
        I've added this in the additional css template:

        Code:
        <vb:if condition="$foruminfo[forumid] == 96">
        <img src="victoria_logo_350.jpg" alt="logo" />
        <vb:else />
        <img src="{vb:stylevar titleimage}" alt="{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}}" />
        </vb:if>
        That did nothing, so then I tried to add the same thing in the header template right after class="logo-image">, but nothing happens. I've tried another browser too to rule out cookie issues. What am I doing wrong?

        Comment


        • #5
          The additional.css template is for CSS only, not your code. You need to add that to the header template
          Vote for:

          - *Admin Settable Paid Subscription Reminder Timeframe*
          -
          *PM - Add ability to reply to originator only*
          - Add Admin ability to auto-subscribe users to specific channel(s)
          - Highlight the correct navigation tab when you are on a custom page
          - "Quick Route" Interface...
          - Allow to use custom icons for individual forums

          Comment


          • #6
            Solved now. What I actually put in looks a bit different, so I just thought I'd add it here if anyone else wants to do this.
            After class="logo-image"> in the header template, I entered this:
            Code:
            <vb:if condition="((int) $_SERVER['QUERY_STRING']) == 96">
            <img src="images/misc/vbulletin3_logo_white.gif" alt="Image för forum 96" />
            <vb:elseif condition="((int) $_SERVER['QUERY_STRING']) == 323" />
            <img src="images/EU3.jpg" alt="Image för forum 323" />
            <vb:else />
            <img src="{vb : stylevar titleimage}" alt="{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}}" />
            </vb:if>
            Which gives me different headers for two forums, and a third option for all others. This works fine!
            Thanks for all the help!

            Comment


            • #7
              So, we have this working in our sub-forum. Is there a way to get this to work on the thread view on threads that are posted within the sub-forum?

              Comment


              • #8
                Originally posted by DAzz View Post
                So, we have this working in our sub-forum. Is there a way to get this to work on the thread view on threads that are posted within the sub-forum?
                I'm in the same boat. I've got this working fine (the Newcastle Jets subforum at http://www.marathonstadium.com if anyone is interested) but of course this doesn't work for the threads posted within that sub-forum.

                I'm struggling to think of a way that this mod could be adapted to do that, since threads are only identified by their own ID, not the ID of what forum they are in. Can anyone help with a solution?

                Comment

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