Make an HTML page viewable to Registered members Only
4 posters
Page 1 of 1
Make an HTML page viewable to Registered members Only
Is it possible to make an HTML page so you have to be logged into the forum to be able to view it?
My forum is open for Guests to read and I want to keep it that way, but I was wondering if there was a code I could use that would restrict it to only the members can view it when they are logged in. Its not that important that it be that way but I would like to make it like that if it is possible.
Here is my HTML page, I am using Invision:
http://runawayhorses.alldiscussion.net/h1-cbox
My forum is open for Guests to read and I want to keep it that way, but I was wondering if there was a code I could use that would restrict it to only the members can view it when they are logged in. Its not that important that it be that way but I would like to make it like that if it is possible.
Here is my HTML page, I am using Invision:
http://runawayhorses.alldiscussion.net/h1-cbox
Last edited by runawayhorses on September 8th 2012, 1:10 am; edited 1 time in total
Re: Make an HTML page viewable to Registered members Only
What if the guests don't have the link?
Surprisingly, the page is not opening just with this.
http://runawayhorses.alldiscussion.net/h1
Earlier, it used to open.
Surprisingly, the page is not opening just with this.
http://runawayhorses.alldiscussion.net/h1
Earlier, it used to open.
Sanket- ForumGuru
- Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai
Re: Make an HTML page viewable to Registered members Only
Will that link you posted is not the entire URL this is:
http://runawayhorses.alldiscussion.net/h1-cbox
This is the URL to my forum index page:
http://runawayhorses.alldiscussion.net/
The link to the HTML page is in my nav bar but good point because its hidden from guests. Still I was wondering because someone could bookmark the HTML page. I don't necessarily care that much but would prefer only people logged in view it.
That link you posted:
http://runawayhorses.alldiscussion.net/h1
doesn't go to anything there is not a page with that address.
http://runawayhorses.alldiscussion.net/h1-cbox
This is the URL to my forum index page:
http://runawayhorses.alldiscussion.net/
The link to the HTML page is in my nav bar but good point because its hidden from guests. Still I was wondering because someone could bookmark the HTML page. I don't necessarily care that much but would prefer only people logged in view it.
That link you posted:
http://runawayhorses.alldiscussion.net/h1
doesn't go to anything there is not a page with that address.
Re: Make an HTML page viewable to Registered members Only
Well I don't use the widgets and don't have the widgets activated.
Re: Make an HTML page viewable to Registered members Only
Sanket you getting confused, the shorthand link would be /h1-
The dash is necessary. It's part of the regex in mod_rewrite.
If you look at how I answered this: http://www.avacweb.com/t412-help-me
You'd be able to apply it to do what you want, as long as you have header an footer activated for the HTML page.
The dash is necessary. It's part of the regex in mod_rewrite.
If you look at how I answered this: http://www.avacweb.com/t412-help-me
You'd be able to apply it to do what you want, as long as you have header an footer activated for the HTML page.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Make an HTML page viewable to Registered members Only
I tried that LG and it didn't do anything, nothing showed anywhere, and yes I have the header and footer activated for the html page, and I logged out to test it. Even if it had worked it seems to me that code was supposed to add a login reminder to the entire forum (global variable) and I just want the html page blocked from view if you aren't logged in not the entire forum. The "Login popup" is for the entire forum and serves as a login reminder and I already been using that and have it activated.. Even at best that code wouldn't block the page from being viewed just add a login reminder message.
That's my understanding of what that code would do had it worked, and I wouldn't want it applied to the entire forum just the html page. I have my entire forum open for guests to read, I want to keep it that way with the exception of the html page.
On another note, if I wanted to block the entire forum from being viewed by guests I would simply make all the forums viewable for members only in AP>>Categories and forums>>Forum Permissions Control, by doing that the html page would require you login to view it as well. The reason I know that is because I used to have my forum set to be viewed by members only, that were of course logged in, and I had an html page and it wasn't accessible either unless you were logged in.
That's my understanding of what that code would do had it worked, and I wouldn't want it applied to the entire forum just the html page. I have my entire forum open for guests to read, I want to keep it that way with the exception of the html page.
On another note, if I wanted to block the entire forum from being viewed by guests I would simply make all the forums viewable for members only in AP>>Categories and forums>>Forum Permissions Control, by doing that the html page would require you login to view it as well. The reason I know that is because I used to have my forum set to be viewed by members only, that were of course logged in, and I had an html page and it wasn't accessible either unless you were logged in.
Re: Make an HTML page viewable to Registered members Only
I just tried your suggestion Rideem and it didn't work, I could still access the page without being logged in.
There is no reason to believe I would know how to manipulate the element using LG's code by needing to include a code similar to the one Rideem just posted, if I needed more code to make it work why wasn't it included? In any case it didn't work. I don't think it should be automatically assumed people know what to do with incomplete pieces of code. That's no reflection on anyone here, just making an observation, but if the shoe fits wear it. Topics would get solved in a more timely fashion if the complete code (answer) was given.
thanks for trying.
There is no reason to believe I would know how to manipulate the element using LG's code by needing to include a code similar to the one Rideem just posted, if I needed more code to make it work why wasn't it included? In any case it didn't work. I don't think it should be automatically assumed people know what to do with incomplete pieces of code. That's no reflection on anyone here, just making an observation, but if the shoe fits wear it. Topics would get solved in a more timely fashion if the complete code (answer) was given.
thanks for trying.
Re: Make an HTML page viewable to Registered members Only
Yep, i forgot it was with the dash.LGforum wrote:Sanket you getting confused, the shorthand link would be /h1-
The dash is necessary. It's part of the regex in mod_rewrite.
If you look at how I answered this: http://www.avacweb.com/t412-help-me
You'd be able to apply it to do what you want, as long as you have header an footer activated for the HTML page.
I remember there was another thread where you had replied about this, but you didn't respond to me in that thread so i was confused on the issue whether it could be done or not. Thanks for clarifying.
Sanket- ForumGuru
- Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai
Re: Make an HTML page viewable to Registered members Only
Well there is no complete code really, it depends what you want to do with it.
I expected you to understand what you could do with that code, because well I said in the thread.
What it does is provide a javascript variable, which is true if the user is logged in.
So think about this:
Now with that in mind... this code will keep guests off the HTML page:
Hope that now makes sense.
And Rideems code was an example, that's not what anyone expected you to do.
I expected you to understand what you could do with that code, because well I said in the thread.
What it does is provide a javascript variable, which is true if the user is logged in.
So think about this:
- Code:
if(USER_LOGGED_IN) {
do this stufff...
}
else {
do this stuff...
}
Now with that in mind... this code will keep guests off the HTML page:
- Code:
<script>
if(USER_LOGGED_IN) {
// the user is logged in... they are allowed on the HTML page.
}
else {
// the user is not logged in... redirect them.
window.location = '/';
}
Hope that now makes sense.
And Rideems code was an example, that's not what anyone expected you to do.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Make an HTML page viewable to Registered members Only
Well its keeping the users off the html page even when they are logged in.
In that thread I didn't see any mention of what to do other than add the code to the description. I just added the code above and like I said it keeps everyone off even when they are logged in. Oh well.
In that thread I didn't see any mention of what to do other than add the code to the description. I just added the code above and like I said it keeps everyone off even when they are logged in. Oh well.
Re: Make an HTML page viewable to Registered members Only
Well do you have the thing in your site description. When I look at you forum, I don't see it there.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Make an HTML page viewable to Registered members Only
Yes I did have it in the site description when I tested it, and I added the code above to the HTML page, but I removed it all when it didn't work.
Re: Make an HTML page viewable to Registered members Only
You give up very easily, for something pretty easy to achieve.
If you stick it back, I'll check why it might not have worked.
If you stick it back, I'll check why it might not have worked.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Make an HTML page viewable to Registered members Only
I'm not giving up easily I just wanted to free up the page so it could be accessed. lol
Ok, look now I added the codes back.
Ok, look now I added the codes back.
Re: Make an HTML page viewable to Registered members Only
Your missing the end script tag.
Well actually, I'm missing it. I forgot it in the code above. There should be a closing script tag at the end.
Well actually, I'm missing it. I forgot it in the code above. There should be a closing script tag at the end.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Make an HTML page viewable to Registered members Only
There is an ending tag in there, here is the code I copied from the description:
OH the HTML page..OK I'll go add it..lol
Edit: OK I added the ending script tag </script> to the html page, and I logged out and tested it, and I can still access the html page.
- Code:
<script>IS_LOGGED_IN=('Using php in posts is called being a smart [Language]... Stop it'!=='Guest')</script>
OH the HTML page..OK I'll go add it..lol
Edit: OK I added the ending script tag </script> to the html page, and I logged out and tested it, and I can still access the html page.
Re: Make an HTML page viewable to Registered members Only
Ha I must apologize. I've been a dope, and its something we both should have spotted.
In the site description code I used 'IS_LOGGED_IN' and then in that code I used 'USER_LOGGED_IN'.
They have to be the same, just change one of them so its the same the other.
In the site description code I used 'IS_LOGGED_IN' and then in that code I used 'USER_LOGGED_IN'.
They have to be the same, just change one of them so its the same the other.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Make an HTML page viewable to Registered members Only
Yes it works now! Thank you very much LG I really appreciate it.
Re: Make an HTML page viewable to Registered members Only
Good. That variable can be used for many other things that involve doing something different for guests and members.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Make an HTML page viewable to Registered members Only
That's cool, I might can find another use for it sometime, that's great. Sorry for getting irritated before I know it showed in my earlier posts in this topic, I was just getting frustrated I guess, my humble apologies. You're a genius in my book and I will always respect what you do. You're a good friend as well.
Thanks a lot.
edit: I on the other-hand am not a genius, I had to correct the word "genius" I spelled it wrong.. lol
Thanks a lot.
edit: I on the other-hand am not a genius, I had to correct the word "genius" I spelled it wrong.. lol
Re: Make an HTML page viewable to Registered members Only
Topic Solved & Locked |
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» Way to make a catergory viewable by certain groups?
» How to Embed a Google Docs Form into an HTML page using HTML Pages Management
» Forum just for registered members
» [Help] HTML Page: Space between Header and top of page.
» Switch user page out with a html page
» How to Embed a Google Docs Form into an HTML page using HTML Pages Management
» Forum just for registered members
» [Help] HTML Page: Space between Header and top of page.
» Switch user page out with a html page
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum