Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 08 Apr 2019, 14:49
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
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!
__________________

Let us take care of your forum, seo, seo reports, maintenance, what ever you need.

Reply With Quote
  #2  
Old 08 Apr 2019, 15:41
In Omnibus's Avatar
In Omnibus In Omnibus is online now
 
Join Date: Apr 2010
Real name: Kris
This might help you out:

https://www.vbulletin.org/forum/showthread.php?t=231525
Reply With Quote
  #3  
Old 08 Apr 2019, 16:07
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
Thanks but I already know about that thread. I am needing to combine an array with another conditional. Not find a conditional.
__________________

Let us take care of your forum, seo, seo reports, maintenance, what ever you need.

Reply With Quote
  #4  
Old 08 Apr 2019, 19:32
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Location: Lancashire, UK
I'm not at my PC to check but I think it may need to be $GLOBALS['forumid'] not $forum['forumid']
__________________
Better VB.org search
Reply With Quote
  #5  
Old 08 Apr 2019, 19:35
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
Originally Posted by z3r0 View Post
I'm not at my PC to check but I think it may need to be $GLOBALS['forumid'] not $forum['forumid']
Thanks, the array part works alone as far as hiding those forums from the forum page but I cannot get them to show for members only. Is that way? Because I am not suing $GLOABALS?

Thanks again,
Rich
__________________

Let us take care of your forum, seo, seo reports, maintenance, what ever you need.

Reply With Quote
  #6  
Old 08 Apr 2019, 19:48
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Location: Lancashire, UK
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.
__________________
Better VB.org search
Reply With Quote
  #7  
Old 08 Apr 2019, 19:52
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
Originally Posted by z3r0 View Post
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.
I will try that but I think I have this wrong even if I make that change.

<vb:if condition="!in_array($forum['forumid'], array(494,520,527,528,531,537)) AND $show['member']">

Thanks

--------------- Added 08 Apr 2019 at 21:31 ---------------

What about this?

<vb:if condition="!in_array($GLOBALS['forumid'], array(494,520,527,528,531,537)) AND $bbuserinfo['usergroupid'] != 1">

--------------- Added 09 Apr 2019 at 14:13 ---------------

I have not made any progress with this at all. What am I missing?
__________________

Let us take care of your forum, seo, seo reports, maintenance, what ever you need.

Reply With Quote
  #8  
Old 09 Apr 2019, 16:31
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Location: Lancashire, UK
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.
__________________
Better VB.org search
Reply With Quote
  #9  
Old 09 Apr 2019, 21:36
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
Originally Posted by z3r0 View Post
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.
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.
__________________

Let us take care of your forum, seo, seo reports, maintenance, what ever you need.

Reply With Quote
  #10  
Old 10 Apr 2019, 15:32
Kane@airrifle's Avatar
Kane@airrifle Kane@airrifle is offline
 
Join Date: Jun 2011
Real name: Kane
Originally Posted by RichieBoy67 View Post
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.


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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Attached Images
File Type: jpg forum_perms.jpg (20.8 KB, 6 views)
Reply With Quote
  #11  
Old 10 Apr 2019, 15:34
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
Originally Posted by Kane@airrifle View Post


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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Yes, no access but those forums will still be visible, just not the threads. I wanted the forums to be completely invisible to guests which is accomplished now.

Thanks for the reply.
__________________

Let us take care of your forum, seo, seo reports, maintenance, what ever you need.

Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 14:53.

Layout Options | Width: Wide Color: