The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to make portal visible only to certain group members?

2 posters

Go down

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

Post by yayayes November 27th 2014, 14:15

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
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 November 27th 2014, 15:58

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
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

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

Post by yayayes November 29th 2014, 00:54

Thank you for your kind advice, Ange Tuteur!  rendeer
yayayes
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 November 29th 2014, 03:28

You're welcome ^^

Topic archived
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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