PDA

View Full Version : Conditional to hide specific forums on forumhome


Tim Wheatley
10-23-2013, 02:20 PM
Hi,

I have the main English forums, then I have some other language forums.

I have setup a user profile field with some selectable options to show all, show none, or show a specific language only (plus English, as those are our main ones).

I haven't yet managed to get any of it working.

Editing in forumhome_forumbit_level1_post

<vb:if condition="$bbuserinfo[field26] == 'Show English only'">
<vb:if condition="!in_array($forumid, array(19,28,34,144))">hides foreign?</vb:if>
<vb:else />
shows normal forums
</vb:if>

Can anybody tell me what I am doing wrong?

Thanks,

Tim.

kh99
10-23-2013, 02:27 PM
You can only use $forumid if it's registered to the template you're putting that code in. If that's the problem, you could try using $GLOBALS[forumid].

Edit: oh, I see now you said which template you're editing. You could also try using $forum[forumid].

Tim Wheatley
10-23-2013, 11:07 PM
Thank you. I made a profile field with options to show english only, and show all of them (to show the foreign languages).

Then I used:
<vb:if condition="$bbuserinfo[field26] == 'Show English only'">
<vb:if condition="!in_array($forum[forumid], array(19,28,34,144))">
forum code
<vb:else />
-this is the blank bit-
</vb:if>
<vb:else />
forum code
</vb:if>