HTML page visible only for logged users.
3 posters
Page 1 of 1
HTML page visible only for logged users.
Hello.
I created a page in "HTML pages management".
This page is now visible for everyone.
How can I hide it for everyone, that it will be visible only for users who are logged-in on my forum?
I created a page in "HTML pages management".
This page is now visible for everyone.
How can I hide it for everyone, that it will be visible only for users who are logged-in on my forum?
Re: HTML page visible only for logged users.
There is no way you can do this. All pages you make are visible to all, if they wish to see it.
Sanket- ForumGuru
- Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai
Re: HTML page visible only for logged users.
If you ticked use header and footer, you can keep people away with this Javascript:
- Code:
if('{*USERNAME}'==='Guest') window.location = '/';
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: HTML page visible only for logged users.
Would that counter this as well?LGforum wrote:If you ticked use header and footer, you can keep people away with this Javascript:(remove the *)
- Code:
if('{*USERNAME}'==='Guest') window.location = '/';
http://www.webartzforum.com/-h6.htm If i just go on adding the numbers from h6 to any other number, it gives the html page?
Sanket- ForumGuru
- Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai
Re: HTML page visible only for logged users.
Unfortunately it doesn't work on my forum...LGforum wrote:If you ticked use header and footer, you can keep people away with this Javascript:(remove the *)
- Code:
if('{*USERNAME}'==='Guest') window.location = '/';
I ticked to "use your forum header and footer", removed " * " and changed window location href...
I tried on all internet browsers. Any other ideas?
Re: HTML page visible only for logged users.
I don't think it parsed in HTML pages actually is it.
You'd have to have this somewhere where it is parsed:
It needs to go in an announcement or widget, and will work on HTML pages with header and footer activated. And needs to be in script tags too obviously.
You'd have to have this somewhere where it is parsed:
- Code:
if('{*USERNAME}'==='Guest' && /\/h\d+-.*/.test(window.location.pathname)) window.location = '/';
It needs to go in an announcement or widget, and will work on HTML pages with header and footer activated. And needs to be in script tags too obviously.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: HTML page visible only for logged users.
- Code:
<script type="text/javascript">
if('{*USERNAME}'==='Guest' && /\/h\d+-.*/.test(window.location.pathname)) window.location = 'http://mysite.forummotion.com/login';
</script>
I added it to Modules/Javascript codes management And I selected to display it "In all the pages". But it still doesn't work when I'm logged off.
I also tried in widgets, but gives same issue.
What else can I do?
Re: HTML page visible only for logged users.
Well no it won't work in Javascript management.
It needs to go in an announcement or widget. And it will work only on pages that include the announcement or widget (that contains the code).
It needs to go in an announcement or widget. And it will work only on pages that include the announcement or widget (that contains the code).
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: HTML page visible only for logged users.
LGforum, could you send me a link to your HTML page? I'd like to view the source of your site, to find where is the problem.
Re: HTML page visible only for logged users.
That won't really help. All my HTML pages which have the header and footer in, you can not access because of a similar code to this.
It would be more beneficial to provide the HTML page you are making which this code isn't working for you.
It would be more beneficial to provide the HTML page you are making which this code isn't working for you.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: HTML page visible only for logged users.
Thanks Rideem3.
I found a solution
I created javascript which detect if cookie "fa_www_yourforum_forumotion_com_sid" exists. If not it will automatically redirect you to /login page
I hope it helps
I found a solution
I created javascript which detect if cookie "fa_www_yourforum_forumotion_com_sid" exists. If not it will automatically redirect you to /login page
- Code:
<script>
if (document.cookie.indexOf('fa_www_yourforum_forumotion_com_sid') != -1) { ; }
else { window.location = "http://yourforum.forumotion.com/login"; }
</script>
I hope it helps
Similar topics
» HTML page accessible only to logged in users
» Restrict HTML page to logged-in users?
» HTML pages should be visible only when logged in*
» HTML Page only for users
» How do I create things which can only be viewed by either logged in or logged out users?
» Restrict HTML page to logged-in users?
» HTML pages should be visible only when logged in*
» HTML Page only for users
» How do I create things which can only be viewed by either logged in or logged out users?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum