Welcome to Geeklog, Anonymous Wednesday, December 25 2024 @ 02:48 pm EST
Geeklog Forums
Requiring User Login for links to certain static pages.
Anonymous
Anonymous
I'd like to add this requirement to some static pages I've been creating and I am including the links in a block, such as including a Photos & Videos page link in an "About Us" block. How do I go about implementing this into the pages so that they will be taken to the standard GL "Login Required" page when they are an Anonymous visitor?
I definitely want them to still see the links, because I am trying to encourage registration to my site, plus I'd rather not allow any webcrawler do their thing, thinking it is a free-for-all. I want the same thing for a menu item that I've created. Is there some code that checks login that I can embed into the static pages themselves?
Thanks,
Matthew
5
5
Quote
Anonymous
Anonymous
I'm using this plugin, in fact, I'm the one who found the form bug that
Tom has been working on. I don't see any options to make the page a
required login. When removing read permissions for an anonymous
user, it only makes the entire page blank (everything including the sides
and menus). It does not bring the user to the standard "GL Login
Required" page. Maybe I'm doing something wrong here or missing an
option along the way.
Thanks,
--Matthew
4
22
Quote
Anonymous
Anonymous
Hey Tom, I've got the 1.5 plugin installed, but am trying to figure out
how to use it. Also, I love the Stats plugin you came up with. I've been
able to track and ban quite a few search engines from my site already.
Thanks,
--Matthew
3
5
Quote
Anonymous
Anonymous
It also removes the link from the menu, which I don't want it to do. I
want my links to act just like the main ones up on top when an
anonymoust user is on the site. The links need to be visible, but also
need to redirect them to the Login Required Page.
5
5
Quote
Status: offline
tomw
Forum User
Full Member
Registered: 08/12/02
Posts: 300
It can get rather confusing until you get your head around how it works. Post specific questions and I will answer them -- Though it would be better to post a new article and start a new thread, this is rather off topic.
5
4
Quote
Status: offline
tomw
Forum User
Full Member
Registered: 08/12/02
Posts: 300
Fixed it so that it works like it should. Here is how to do it.
One Caveat, This will not work like this if you have user menus turned on.
1) Make a menu entry with only anonymous access (root will still be able to edit it). This should point to a page telling them they have to log in to get access.
2) Make another entry with member access and no anonymous access. This should point to real place.
Then anonymous users will see 1 and members will see 2.
I have made the change to the distributions on my site or you can make it manually. In functions.inc the last function MNU_getPerms on line 11 of that function is a line that reads:
$where = "((" . $table . "perm_anon >= $access)";
Change that to read:
if ($uid <= 1) {
$where = "((" . $table . "perm_anon >= $access)";
} else {
$where = "((" . $table . "perm_anon >= 3)";
}
Tom
23
5
Quote
Anonymous
Anonymous
Hey Tom,
This workaround seems to work very well. I've set it up and tested it
and so far so good.
Ultimately it would be nice to just have an option (like a checkbox in the
permissions area) on each of the items requiring a Login to the Website
to view, like each of the block items or static pages. That way, it would
really eliminate the cluttered layouts when logging into the Web site as
the main admin. I've got duplicate blocks and menu items with each
thing I've set up this way. Maybe this can be on the wish list for the next
major version of Geeklog?
Anyway, thanks again for coming to the rescue.
Also, any ideas yet on what might be preventing the javascript from
functioning with the static pages after your fix to the form issue?
--Matthew
http://www.MAUSdesign.com
5
5
Quote
All times are EST. The time is now 02:48 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content