Home

Your premium source for custom modification services for phpBB

  logo

HomeForumsBlogMOD ManagerFAQSearchRegisterLogin

Comments December 14, 2006

Page Permissions

Filed under: MOD Writing — Dave Rathbun @ 7:28 am  

Well over a year ago I started collecting ideas for a MOD called “Page Permissions” on phpbb.com. The idea was simple: people want to set limits on what guests can do on various pages, and phpBB does not offer that option out of the box. Time to start writing some code. :-)

For example, people want to keep their member listing private so that only registered members can view it. And to go along with that they might also want to require a login in order to view a member profile. Both of these options are valid, and you can find MODs released at phpbb.com that perform just those individual functions. I used something similar myself, originally.

Page Permissions evolved into a lot more than that, and as I read entries in the MOD Requests forum I am beginning to see more and more uses for it that I never considered before! It was intended to be a way to set viewing permissions on specific pages to specific levels of users. The levels are guest (anyone not logged in, whether they’re registered or not), registered (users that are logged in), private (requires group membership), moderator (eh, has a loophole but I put it in anyway), and administrator. The net function is a board owner can enter a page - any page - into the Page Permissions table, and then set permissions as to who can view that page.

Oh, and there’s also a min/max post count options.

Oh, and there’s also the ability to disable the page (with a custom disable message) without disabling your entire board.

Oh, and you can count page views for individual pages, and the views are separated by guest versus logged in users. That way you can really get some understanding as to what your most popular pages are. On my largest board I find that certain pages (index, viewforum, viewtopic, and search) are far more popular than other pages. And it’s also interesting to be able to get a breakdown by guest visitors versus registered (logged in) users.

Those are just the basic intended features. But here’s the fun part. You see, in order to allow registrations of new users, you have to allow guests to use the profile.php page. But if you want to restrict guests from viewing existing profiles, well, that’s also profile.php. So the Page Permissions code allows you to set an optional URL parameter (at this time only one) in order to distinguish the function of the page. So you can allow guests to view profile.php?mode=register but keep guests from using profile.php?mode=viewprofile, thus protecting your member’s privacy.

So that was the basic function. But here are some creative uses that folks have posted. One person wanted to allow users to review the list of topics on viewforum, but require registration to actually read the topics. You cannot do this with a standard phpBB permissions setting, but you can with this MOD. You would allow guest access to viewforum.php, and require registered access for viewtopic.php. (And search.php too, actually, as you could read topics that way if you were really creative… and desparate. ;-)) So that worked well. The other day someone asked if there was a way to limit someone from starting new topics until they had a set number of posts. Well, Page Permissions can do that. The file to protect would be posting.php and the url would be mode=newtopic. In addition to setting an access level (most likely registered) you could also provide a minimum number of posts for that feature. If you enter 5, for example, then someone with fewer than 5 posts would only be able to use the reply function (posting.php?mode=reply) and would be prevented from creating new topics (posting.php?mode=newtopic). So there’s yet another unplanned feature in action.

If anyone reading this has implemented the Page Permissions MOD and has a creative use, I would appreciate a comment with the details. 8)

Update, March 21: this post, for whatever reason, seems to be a target for most of the spam comments that are being attempted. For the time being I am going to deactivate the comment form for this post and see what happens. Thanks.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress