RedWingFan
09-03-2011, 09:20 PM
I'm adding something to the postbit templates for our discussion board. Here's what I'm after: if the specific forum is visible to the public, whether or not a user is logged in, I want the item (an icon in an <img> tag) to display in the postbit. If it is a non-public forum, then I do not want anything to display. Also, I noticed that this item also shows up in the postbit for private messaging, which we also don't want.
I had thought of doing a conditional like this:
<if condition="$forum[forumid] == 28">
However, I would need to specify each forum number in this conditional somehow. This would work, but it seems cumbersome...and I no longer remember the syntax for it.
I cannot base it on usergroup, since the item will need to appear whether or not a user is logged in.
Is there a conditional I can use that would accomplish what I'm looking for? Hopefully I have described it well enough.
I did create a conditional for iTrader, so that it shows up only in our Classifieds forum (which is where I grabbed my conditional sample from, above). I also have a custom navigation system that changes whether or not a user is logged in, but the code I need cannot be based on the customer's logged-in status.
--------------- Added 1315088619 at 1315088619 ---------------
This might work:
<if condition="in_array($forum['forumid'], array(1,2,3,6))"></if>
I just have to list the forum IDs. But I am thinking there is a simpler way.
And, would this prevent it displaying in the private message postbit as well?
I had thought of doing a conditional like this:
<if condition="$forum[forumid] == 28">
However, I would need to specify each forum number in this conditional somehow. This would work, but it seems cumbersome...and I no longer remember the syntax for it.
I cannot base it on usergroup, since the item will need to appear whether or not a user is logged in.
Is there a conditional I can use that would accomplish what I'm looking for? Hopefully I have described it well enough.
I did create a conditional for iTrader, so that it shows up only in our Classifieds forum (which is where I grabbed my conditional sample from, above). I also have a custom navigation system that changes whether or not a user is logged in, but the code I need cannot be based on the customer's logged-in status.
--------------- Added 1315088619 at 1315088619 ---------------
This might work:
<if condition="in_array($forum['forumid'], array(1,2,3,6))"></if>
I just have to list the forum IDs. But I am thinking there is a simpler way.
And, would this prevent it displaying in the private message postbit as well?