Banner base on forum ID???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • taydu
    Senior Member
    • Oct 2006
    • 168

    Banner base on forum ID???

    it's possible to do this with template edit?? I want to display different banner ads on the forum header base forum id???

    example:

    banner 1 will only display on on forum 1, 4, 18,

    banner 2 on forum 7, 21

    and so on.
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Admin CP -> Styles & Templates -> Style Manager -> Common Templates (in the menu) -> header

    Replace the red code:

    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]">
    		[color=red]&nbsp;[/color]
    	</td>
    </tr>
    </table>
    <!-- /logo -->
    
    <!-- content table -->
    $spacer_open
    
    $_phpinclude_output
    ...with the blue code:

    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]">
    		[color=blue]<if condition="in_array($forumid, array(1,4,18))">
    			[color=red]banner1 code[/color]
    		</if>[/color]
    		[color=blue]<if condition="in_array($forumid, array(7,21))">
    			[color=red]banner2 code[/color]
    		</if>[/color]
    	</td>
    </tr>
    </table>
    <!-- /logo -->
    
    <!-- content table -->
    $spacer_open
    
    $_phpinclude_output
    You can expand on this using the above code as a reference.

    Comment

    • taydu
      Senior Member
      • Oct 2006
      • 168

      #3
      thank jake, i'll try it

      Comment

      • Goldoff
        New Member
        • Oct 2005
        • 18
        • 3.5.x

        #4
        Jake,

        I hava tried it step-by-step, but nothing happen: there are no changes on fora...

        Any idea?
        Thanks


        Originally posted by Jake Bunce
        Admin CP -> Styles & Templates -> Style Manager -> Common Templates (in the menu) -> header

        Replace the red code:

        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]">
                [COLOR=red]&nbsp;[/COLOR]
            </td>
        </tr>
        </table>
        <!-- /logo -->
        
        <!-- content table -->
        $spacer_open
        
        $_phpinclude_output
        ...with the blue code:

        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]">
                [COLOR=blue]<if condition="in_array($forumid, array(1,4,18))">
                    [COLOR=red]banner1 code[/COLOR]
                </if>[/COLOR]
                [COLOR=blue]<if condition="in_array($forumid, array(7,21))">
                    [COLOR=red]banner2 code[/COLOR]
                </if>[/COLOR]
            </td>
        </tr>
        </table>
        <!-- /logo -->
        
        <!-- content table -->
        $spacer_open
        
        $_phpinclude_output
        You can expand on this using the above code as a reference.

        Comment

        • Jake Bunce
          Senior Member
          • Dec 2000
          • 46598
          • 3.6.x

          #5
          Make sure you are editing the same style you are viewing. Check the page source code for the output to make sure it's showing. Note that these conditions can only be true inside of forums.

          Comment

          • Goldoff
            New Member
            • Oct 2005
            • 18
            • 3.5.x

            #6
            Originally posted by Jake Bunce
            Make sure you are editing the same style you are viewing. Check the page source code for the output to make sure it's showing. Note that these conditions can only be true inside of forums.
            Sorry, I did not notice you answered.

            I have checked the page source, and I can see the banner code, but nothing happens...


            Sorry, I don't catch the full meaning of
            these conditions can only be true inside of forums

            Thank you

            Comment

            • Jake Bunce
              Senior Member
              • Dec 2000
              • 46598
              • 3.6.x

              #7
              If you can see the code in the page source then there must be a problem with the code itself.

              I meant that the condition cannot be true on a page like this:



              ...because you are not inside of a forum so there is no forumid.

              Comment

              • Goldoff
                New Member
                • Oct 2005
                • 18
                • 3.5.x

                #8
                Hi Jake,
                Thanks for your patience...

                I found why I couldn't see the banner: it was aligned at right of the forum header and out of sight. I could correct it.

                Now, is it possible to show the banner between the box of threaded answers and the selected answer in a specific forum using that code?

                Where should I put it?

                Thank you again

                Edit: OK I found it by myself:
                Show Thread Templates -> SHOWTHREAD

                Find

                PHP Code:
                 <if condition="$show['threadedmode'] OR $show['hybridmode']">
                <!-- 
                thread posts list -->
                $threadlist
                <!-- /thread posts list -->
                </if> 
                and paste just below
                Last edited by Goldoff; Sun 11 Feb '07, 2:38pm. Reason: I found it!

                Comment

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