How do I make it so only a guest can see a certain forum?
3 posters
Page 1 of 1
How do I make it so only a guest can see a certain forum?
So not long ago I created my forum and I basically want it to be private to where someone that isn't logged in or isn't a member and is a guest can't see any of the categories and forums. I made a category that says "If you see this your a guest!" and then the forum attached to it says to register an account to view the contents of the forum and so on. The problem is that it wont let me make it so only guests can see because what members can't do guest can't because the role is higher. And I don't want members to have to always see it because it would be annoying for them and such. How do I work around this?
Last edited by TheSmallestOpp on October 13th 2023, 6:54 pm; edited 1 time in total
TheSmallestOpp- New Member
- Posts : 3
Reputation : 1
Language : English
Re: How do I make it so only a guest can see a certain forum?
what if you gather all the members in a group
called "forum members"
Minimum Posts : 1
and then go to that category settings and uncheck the possibility to read view and post
called "forum members"
Minimum Posts : 1
and then go to that category settings and uncheck the possibility to read view and post
Re: How do I make it so only a guest can see a certain forum?
If I do that then anyone who's a member would need to have at least 1 post which some would probably just want to lurk and not have to post anything, is there an alternative to having to have 1 post?skouliki wrote:what if you gather all the members in a group
called "forum members"
Minimum Posts : 1
and then go to that category settings and uncheck the possibility to read view and post
TheSmallestOpp- New Member
- Posts : 3
Reputation : 1
Language : English
Re: How do I make it so only a guest can see a certain forum?
Good morning!
1) AP - General - Categories and forums
If you already have a category (not a forum!) for guests - edit it. If not, create one
Category name: enter the following in this field
NAME CATEGORY - Your title for this category.
Save.
Next, create forums in this section for guests.
2) AP - Display - Colors&CSS - CSS Stylesheet
Insert this code:
Save.
3) AP - Modules - Javascript codes management - Create a new Javascript
Title: any
Placement: In all the pages
Javascript Code:
Save.
In this code
instead of Admin, specify your nickname ( in quotes) to have access to the guest sections.
Result:
View for admin
View for users:
View for guests:
P.S. script works with this hierarchy (AP - Display - Structure and hierarchy):
1) AP - General - Categories and forums
If you already have a category (not a forum!) for guests - edit it. If not, create one
Category name: enter the following in this field
- Code:
<div class='guest__category'>NAME CATEGORY</div>
NAME CATEGORY - Your title for this category.
Save.
Next, create forums in this section for guests.
2) AP - Display - Colors&CSS - CSS Stylesheet
Insert this code:
- Code:
.forumline {
visibility: hidden;
}
Save.
3) AP - Modules - Javascript codes management - Create a new Javascript
Title: any
Placement: In all the pages
Javascript Code:
- Code:
$(document).ready(function() {
window.addEventListener('DOMContentLoaded', function() {
const logOut = document.querySelector('#logout');
const forumCategories = document.querySelectorAll('.forumline');
const userNick = window._userdata.username;
const adminNick = 'Admin';
if (userNick === adminNick) {
forumCategories.forEach((item) => {
item.style.visibility = 'visible';
});
} else {
forumCategories.forEach((item) => {
if (item.querySelector('div.guest__category') && logOut) {
item.style.display = 'none';
} else {
item.style.visibility = 'visible';
}
});
}
});
});
Save.
In this code
|
instead of Admin, specify your nickname ( in quotes) to have access to the guest sections.
Result:
View for admin
View for users:
View for guests:
P.S. script works with this hierarchy (AP - Display - Structure and hierarchy):
Razor12345- Support Moderator
- Posts : 1594
Reputation : 270
Language : Ukr, Rus, Eng
Location : Ukraine
skouliki, Ape, TonnyKamper and TheSmallestOpp like this post
Re: How do I make it so only a guest can see a certain forum?
This ended up working, thank you very much!Razor12345 wrote:Good morning!
1) AP - General - Categories and forums
If you already have a category (not a forum!) for guests - edit it. If not, create one
Category name: enter the following in this field
- Code:
<div class='guest__category'>NAME CATEGORY</div>
NAME CATEGORY - Your title for this category.
Save.
Next, create forums in this section for guests.
2) AP - Display - Colors&CSS - CSS Stylesheet
Insert this code:
- Code:
.forumline {
visibility: hidden;
}
Save.
3) AP - Modules - Javascript codes management - Create a new Javascript
Title: any
Placement: In all the pages
Javascript Code:
- Code:
$(document).ready(function() {
window.addEventListener('DOMContentLoaded', function() {
const logOut = document.querySelector('#logout');
const forumCategories = document.querySelectorAll('.forumline');
const userNick = window._userdata.username;
const adminNick = 'Admin';
if (userNick === adminNick) {
forumCategories.forEach((item) => {
item.style.visibility = 'visible';
});
} else {
forumCategories.forEach((item) => {
if (item.querySelector('div.guest__category') && logOut) {
item.style.display = 'none';
} else {
item.style.visibility = 'visible';
}
});
}
});
});
Save.
In this code
- Code:
const adminNick = 'Admin';
instead of Admin, specify your nickname ( in quotes) to have access to the guest sections.
Result:
View for admin
View for users:
View for guests:
P.S. script works with this hierarchy (AP - Display - Structure and hierarchy):
TheSmallestOpp- New Member
- Posts : 3
Reputation : 1
Language : English
Re: How do I make it so only a guest can see a certain forum?
This ended up working, thank you very much!
You are welcome!
If your request is complete, please mark it as Solved.
----------
Problem solved & topic archived.
|
Razor12345- Support Moderator
- Posts : 1594
Reputation : 270
Language : Ukr, Rus, Eng
Location : Ukraine
TheSmallestOpp likes this post
Similar topics
» Why do I get PMs from guest on the forum?
» how to make guest message
» Guest on a closed forum
» close forum to guest but how?
» Is there a way I can make it so only I, an admin, can make threads in a specific forum?
» how to make guest message
» Guest on a closed forum
» close forum to guest but how?
» Is there a way I can make it so only I, an admin, can make threads in a specific forum?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum