The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Combining a conditional with an array
Hey everyone,
I am trying to hide certain forums from being visible to guests on forumhome. I have the conditional to hide them but I do not know how to keep them hidden for guests only. This is what I have to hide: <vb:if condition="!in_array($forum['forumid'], array(###,###,###,###))"> I believe I add AND $show['member'] but when I do the entire forum home becomes invisible so apparently I am doing it wrong. Thanks everyone! |
#2
|
||||
|
||||
|
#3
|
||||
|
||||
Thanks but I already know about that thread. I am needing to combine an array with another conditional. Not find a conditional.
|
#4
|
||||
|
||||
I'm not at my PC to check but I think it may need to be $GLOBALS['forumid'] not $forum['forumid']
|
#5
|
||||
|
||||
Quote:
Thanks again, Rich |
#6
|
||||
|
||||
I've no idea why, but I've just done a quick search of the site and there are lots of examples of $GLOBALS['forumid'] with an array joined with other conditions.
|
#7
|
||||
|
||||
Quote:
<vb:if condition="!in_array($forum['forumid'], array(494,520,527,528,531,537)) AND $show['member']"> Thanks --------------- Added [DATE]1554759075[/DATE] at [TIME]1554759075[/TIME] --------------- What about this? <vb:if condition="!in_array($GLOBALS['forumid'], array(494,520,527,528,531,537)) AND $bbuserinfo['usergroupid'] != 1"> --------------- Added [DATE]1554819211[/DATE] at [TIME]1554819211[/TIME] --------------- I have not made any progress with this at all. What am I missing? |
#8
|
||||
|
||||
I've just reread your first post, there is no need for a condition, just set the forum permissions to not show to unregistered/not logged in for each forum you want to hide from guests.
|
#9
|
||||
|
||||
You can only hide the content that way. Everyone can still see the forum. Anyways, Dave figured it out for me. I had everything right but he added an empty if statement. Genius. I was pulling my hair out.
|
#10
|
||||
|
||||
Quote:
In the forum permissions manager you can set zero access to everything for any user group. Works perfectly well on my 4.2.5 forums. If you are paranoid about links from private forums being shared on other platforms you can also make a redirect plugin to replace the standard "no permission" message a non credentialed user may receive. EG: Hook: error_fetch Title: Redirect Private Threads Code: Code:
if (!isset($vbulletin->userinfo['userid']) OR $vbulletin->userinfo['userid'] == 0) { $vbulletin->url = 'https://www.whateverpageyouwantotredirectto.com/'; eval(print_standard_redirect('no permission')); } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|