Conditional to detect Categories (Not resigning yet)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Acido
    Member
    • Sep 2003
    • 45

    Conditional to detect Categories (Not resigning yet)

    Hello

    I'm looking for a way to detect when a forum is a category (can't containg messages or act as forum = no) through the templates, and i had not luck.
    The only way that i can found in the vbulletin forums is set a conditional in array to place the forum's id's like this:

    PHP Code:
    <if condition="in_array($forumid, array(27,28,29,30,31,32,33,34,35,36))"
    Well, having more than 100 forums, that is a hard way to set the proper code on the templates. Don't talk about create new forums when the community grow.

    I can't believe that this is so difficult.
    Really need code modification to do that?

    If someone can give a little light on this issue, i'll be grateful.
    Thanx in advance
  • Lats
    Senior Member
    • Mar 2002
    • 3671

    #2
    How many categories do you have? That may be easier to manage.
    Lats...

    Comment

    • Acido
      Member
      • Sep 2003
      • 45

      #3
      Originally posted by Lats
      How many categories do you have? That may be easier to manage.
      I have 50 categories aprox. I don't know if it is a lot or a little, but what if i want add more? I need edit the array each time?
      Honestly i think that using array is not the best way.

      Comment

      • Lats
        Senior Member
        • Mar 2002
        • 3671

        #4
        Okay, use this instead...
        Code:
        <if condition="$foruminfo[parentid]==-1">I'm a category</if>
        Lats...

        Comment

        • Acido
          Member
          • Sep 2003
          • 45

          #5
          Originally posted by Lats
          Okay, use this instead...
          Code:
          <if condition="$foruminfo[parentid]==-1">I'm a category</if>
          Thank You Lat.! That really help.

          However the depth categories don't work with that. What i need is translate this code to vbulletin 3.6:

          Originally posted by Jake Bunce
          This code will check the current forum in the FORUMDISPLAY template:
          Code:
          <if condition="$foruminfo[options] & $_FORUMOPTIONS[cancontainthreads]">
              CODE IF IT'S A FORUM
          <else />
              CODE IF IT'S A CATEGORY
          </if>
          That code is for vbulletin 3.0.x

          I was reading this article about coding vb3.5 from 3.0 and there is a quote to call that entitie ($_FORUMOPTIONS) but i'm still having trouble to get the correct code.

          Any help to keep the Jake Bunce code running on vb 3.6 will be apreciated.

          Comment

          • Lats
            Senior Member
            • Mar 2002
            • 3671

            #6
            Just been setting up some sub forums, and unless I'm doing something wrong (it is late ), this seems to work...
            Code:
            $navbar
            <if condition="$foruminfo[parentid]==-1">I'm a category</if>
            <if condition="$foruminfo[cancontainthreads]">I can have a thread</if>
            It shows up when it can have threads. I left the category test in for comparison.
            Lats...

            Comment

            • Acido
              Member
              • Sep 2003
              • 45

              #7
              Originally posted by Lats
              <if condition="$foruminfo[cancontainthreads]">I can have a thread</if>[/code]It shows up when it can have threads. I left the category test in for comparison.
              <if condition="$foruminfo['cancontainthreads']"> = That's is what i need!

              Usually, forums that can contain threads are not categories. Sure not always. But in my case that comparison is the solution.

              Thank you very Much Lats!

              Comment

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