Alternating Forum Home Rows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shining Arcanine
    Senior Member
    • Feb 2003
    • 2482
    • 3.0.3

    Alternating Forum Home Rows

    Would someone please tell me how to make the rows on Forum Home alternate colors?

    I've searched vBulletin.com, vBulletin.org, vBulletin-templates.com and google and all I have come up with is a template modification for a vBulletin 3.0.0 Beta version. I didn't even find a documentation of the variables that are used throughout the standard templates.
  • Zachery
    Former vBulletin Support
    • Jul 2002
    • 59097

    #2
    You want alternating row colors instead of collums?

    Comment

    • Shining Arcanine
      Senior Member
      • Feb 2003
      • 2482
      • 3.0.3

      #3
      Yes.

      Comment

      • Zachery
        Former vBulletin Support
        • Jul 2002
        • 59097

        #4
        Ill poke around with some code and see what i can get you

        This is amykhar's code but just updated if you havent modifyed your forumhome_forumbit_level2_post template just replce it with this

        HTML Code:
        <tr align="center">
         <td <if condition="$forum['displayorder'] % 2 == 0">class="alt2"<else />class="alt1"</if>><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
         <td <if condition="$forum['displayorder'] % 2 == 0">class="alt2"<else />class="alt1"</if> align="$stylevar[left]" id="f$forum[forumid]">
          <div>
           <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
           <if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
          </div>
          <if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
          <if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
          <if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
         </td>
         <td <if condition="$forum['displayorder'] % 2 == 0">class="alt2"<else />class="alt1"</if> nowrap="nowrap">$forum[lastpostinfo]</td>
         <td <if condition="$forum['displayorder'] % 2 == 0">class="alt2"<else />class="alt1"</if>>$forum[threadcount]</td>
         <td <if condition="$forum['displayorder'] % 2 == 0">class="alt2"<else />class="alt1"</if>>$forum[replycount]</td>
         <if condition="$vboptions['showmoderatorcolumn']">
         <td <if condition="$forum['displayorder'] % 2 == 0">class="alt2"<else />class="alt1"</if>><div class="smallfont">$forum[moderators]&nbsp;</div></td>
         </if>
        </tr>
        $childforumbits
        Last edited by Zachery; Wed 7 Apr '04, 9:16am.

        Comment

        • Shining Arcanine
          Senior Member
          • Feb 2003
          • 2482
          • 3.0.3

          #5
          That made all of the columns the same color. Also, wouldn't the conditional go into the table row tag rather than the table data tag like in this example:

          HTML Code:
          <tr align="center" <if condition="$forum['displayorder'] % 2 == 0">class="alt2"<else />class="alt1"</if>>
          <td ><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
          <td align="$stylevar[left]" id="f$forum[forumid]">
          <div>
          <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
          <if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
          </div>
          <if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
          <if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
          <if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
          </td>
          <td nowrap="nowrap">$forum[lastpostinfo]</td>
          <td >$forum[threadcount]</td>
          <td >$forum[replycount]</td>
          <if condition="$vboptions['showmoderatorcolumn']">
          <td ><div class="smallfont">$forum[moderators]&nbsp;</div></td>
          </if>
          </tr>
          $childforumbits
          Unfortunately, that doesn't work either.

          Comment

          • Zachery
            Former vBulletin Support
            • Jul 2002
            • 59097

            #6
            No, mine works fine if your forum order is set correcty in the AdminCP > Forums & Modertaors > Forum Manager > they need to in the correct order, ie: 1,2,3,4

            Comment

            • Shining Arcanine
              Senior Member
              • Feb 2003
              • 2482
              • 3.0.3

              #7
              Oh, so that is why, I have mine setup in mutiples of 10. ^_^;;

              Edit: It worked! Thanks. It seems my version also worked.
              Last edited by Shining Arcanine; Wed 7 Apr '04, 4:59pm.

              Comment

              • amykhar
                Senior Member
                • May 2001
                • 579
                • 3.5.x

                #8
                I knew that math degree of mine would come in handy some day
                http://www.eaforums.com

                Comment

                • Zachery
                  Former vBulletin Support
                  • Jul 2002
                  • 59097

                  #9
                  thanks amy

                  Comment

                  • HexOnxOnx
                    Senior Member
                    • Apr 2003
                    • 638
                    • 3.7.x

                    #10
                    Thanks both of you! I was looking for this for a long time as well. I found something months ago on another site but I could never figure out where to put the code. Got it on my forums now.
                    http://www.icecreamforum.com

                    Comment

                    • HexOnxOnx
                      Senior Member
                      • Apr 2003
                      • 638
                      • 3.7.x

                      #11
                      Anyone here know how to do this on forum display as well? Thanks!
                      http://www.icecreamforum.com

                      Comment

                      • amykhar
                        Senior Member
                        • May 2001
                        • 579
                        • 3.5.x

                        #12
                        Originally posted by HexOnxOnx
                        Anyone here know how to do this on forum display as well? Thanks!
                        It's a wee bit trickier on forum display for threads because the thread id won't be sequential. I'll take a peek and see what I can do as a template mod.

                        Amy
                        http://www.eaforums.com

                        Comment

                        • HexOnxOnx
                          Senior Member
                          • Apr 2003
                          • 638
                          • 3.7.x

                          #13
                          Great, thanks!
                          http://www.icecreamforum.com

                          Comment

                          • amykhar
                            Senior Member
                            • May 2001
                            • 579
                            • 3.5.x

                            #14
                            Unfortunately, I don't see a way to do it as a template mod only. This would require a hack, IMO.

                            Amy
                            http://www.eaforums.com

                            Comment

                            • HexOnxOnx
                              Senior Member
                              • Apr 2003
                              • 638
                              • 3.7.x

                              #15
                              Thanks for checking on it anyways Amy!
                              http://www.icecreamforum.com

                              Comment

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