The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to make portal visible only to certain group members?

View previous topic View next topic Go down

Solved How to make portal visible only to certain group members?

Post by yayayes on November 27th 2014, 1:15 pm

Hi guys, I would like to know if it's possible to make the portal visible only to a certain group?

My Forum: http://thelosteden.com/forum
My Portal Page: http://thelosteden.com
Forum Version: Invision

Also, I have been wondering about my forum URL. After I added a portal to my forum, the domain name directs me straight to the portal instead of the forum itself. I know that at some point it wasn't like this. The portal page used to have something like '/portal' after the domain name and that the domain name would link to actual the forum. Can I change it back to this perhaps?

Thank you, appreciate it!

yayayes
Forumember

Female Posts : 49
Reputation : 1
Language : Thai
Location : Bangkok, London & Hong Kong

Back to top Go down

Solved Re: How to make portal visible only to certain group members?

Post by Ange Tuteur on November 27th 2014, 2:58 pm

Hello yayayes,

You can choose where the forum redirects here :
Administration Panel > Display > Generalities > Your forum redirects to

The only thing I could come up with for allowing only certain people to view the portal would be this :
Go to Administration Panel > Modules > JavaScript codes management > Create a new script

Title : Your choice
Placement : In the portal
Paste the code below :
Code:
$(function() {
 var allowed = [1,2,3], redirect = '/forum';
 document.body.style.display = 'none';
 for (i=0; i<allowed.length; i++) {
  if (_userdata.user_id == allowed[i]) document.body.style.display = '';
  else if (i == allowed.length - 1) checkState();
 }
 function checkState() { if (/none/.test(document.body.style.display)) window.location.pathname = redirect };
});

There's two things you can edit :

allowed : this is the list of users allowed to view the portal. You should use their user id which is visible by their profile URL. Each user id should be separated by a comma. example :
Code:
allowed = [1,2,3, 6, 13, 100, 6001, 2003, 452]

redirect : this is the pathname that members who are not allowed are redirected to. Currently it is set to /forum

Now, members can get past this by disabling JavaScript. So, if you want to combat that you can create a new widget with the following content, and place it on your portal.

Title : Your choice
Use a table type : No
Code:
<noscript><meta http-equiv="refresh" content="0;/forum"/></noscript>

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to make portal visible only to certain group members?

Post by yayayes on November 28th 2014, 11:54 pm

Thank you for your kind advice, Ange Tuteur! rendeer

yayayes
Forumember

Female Posts : 49
Reputation : 1
Language : Thai
Location : Bangkok, London & Hong Kong

Back to top Go down

Solved Re: How to make portal visible only to certain group members?

Post by Ange Tuteur on November 29th 2014, 2:28 am

You're welcome ^^

Topic archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum