News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

View Own Topic Only permissions (Personal Support Forum)

Started by Feldon, June 28, 2006, 08:34:17 AM

Previous topic - Next topic

Feldon

After some work I have created my own mod, the "View Own Topic Permissions" mod.  It is made available as is, please don't try to sue me if it doesn't work for you.


FAQ:

Q) What does it do?

A) The View Any Topic Permission Mod adds an additional permission that can be applied to any board.  When enabled, the board operates as normal.  When disabled, the user is unable to view any topics within the board except topics they started, or topics that have been set as Sticky.

Topics are hidden when viewing the board, when viewing a 'Members Last Posts', when viewing 'Recent Posts', when viewing board 'Statistics', when viewing "Unread posts since last visit", when using the 'Search' page and when viewing the RSS feed.

Topics are correctly blocked if a member attempts to directly access them.


Q) If I can view only my own posts, then what's the point?

A) Generally, the intent is that 'Regular Members' would be only able to view their own posts.  However, at the same time, any administrators, moderators, or any other select group can be granted  access to view all posts within the board.  This enables the board to act as a 'Personal Support Helpdesk' page, where a regular user can post a question, and a priviledged member can respond.  It could also be useful in a recruitment forum, where new users can post and moderators can respond, while restricting new users from seeing other new user posts.


Q) Is there not another mod that already does this?

A) No other mod currently hides entire topics from view.  While similar mods may hide the posts from view, it is still possible to view the topic title, topic starter and other relevant information. 

Clearly, if privacy is desired, this simpler functionality is not adequate.


Q) Have you hidden the topics everywhere?  Is it still possible to find a back-door in to viewing a topic?

A) It should not be possible to view the actual post if its supposed to be hidden.  This is because that particular permission is centralized.  However, I can not guarantee that I have hidden the topic everywhere it may be displayed.  I'm fairly new to SMF and this is my first mod so I may have missed something.  Additionally, other mods may have opened up new places for topics to be displayed.  As such, I make no guarantees.  This mod is delivered as-is.


Q) What about topic/post counts, are they correct?

A) I have modified the topic/post counts when a user simply views categories and boards.  However, total topic/post counts will still be displayed in the Statistics page.  As such, I recommend disabling Post counting for any boards where the permission is disabled.


Q) What version of SMF is this for?

A) The mod has been tested specifically for SMF 1.1.1 and it appears to work correctly in SMF 1.1.2.


Q) Have you asked that this be included in SMF as standard?

A) I have additionally posted this as a feature request at this location: http://www.simplemachines.org/community/index.php?topic=17239.0


DOWNLOADS:

The SMF 1.1.2 version is available from http://custom.simplemachines.org/mods/index.php?mod=687

Hakker

yay you made my day... this works like it should.

maybe you could continue develop it with some small additions of removing the topic pages ;)
And I haven't checked if they are still visible in the recent topics list with tinyportal.

Seriously 2 thumbs up for this mod.

Feldon

Yah, unfortunately, because of the way my code works, any mod which opens up other functionality (such as a topics list with TinyPortal) will not be protected.

If TinyPortal hasn't changed the code very much, I would expect the recent posts would still be ok, but the entirely new section "Topics List" won't be ok, heh.

Feldon

While I had originally thought I wouldn't support it, the change for SMF 1.1.1 was so simple I couldn't help but do it.

Updated for SMF 1.1.1.

GC

To stop guests from viewing a post itself but allowed to see the posts listed inside the board then just do this:

Open Display.php

Find:

// What are you gonna display if these are empty?!
if (empty($topic))
fatal_lang_error('smf232', false);


Add before:

// We don't care if the option is off, because Guests should NEVER get past here.
is_not_guest();


Very simple :)

babjusi

It seems cool this mod. Is it approved by the guys at the Mod Team?


Feldon

Quote from: GC on January 18, 2007, 11:26:38 PM
To stop guests from viewing a post itself but allowed to see the posts listed inside the board then just do this:

Open Display.php

Find:

// What are you gonna display if these are empty?!
if (empty($topic))
fatal_lang_error('smf232', false);


Add before:

// We don't care if the option is off, because Guests should NEVER get past here.
is_not_guest();


Very simple :)
This is similar to the "Read Topic Permission" mod.  The goal of my mod is to prevent guests or regular members from even seeing posts started by other users (except sticky posts).


Quote from: babjusi on January 18, 2007, 11:43:54 PM
It seems cool this mod. Is it approved by the guys at the Mod Team?
Not approved, I've just done it and if people want to use it they can.  This was my first mod, and while it works as far as I can tell, there may be a better way to achieve the same effect.
Update: The mod has now been approved.

FYI, the only thing I've found so far that this mod doesn't do as I would like, is it doesn't recalculate the Total Post/Topic count for the entire board (all individual boards, even special ones, are correct).  Hence, the only breach of privacy is that a user could estimate the number of posts/topics within the special board.

Quote from: Marlon on January 18, 2007, 11:45:16 PM
For anyone that's interested, this should work for you.

Hidden Applications (for Guild Websites)
That's an interesting solution.  I haven't tried yours, but I wonder if it hide things like the Recent Posts page, or the Latest Posts section of member profiles, and if it calculates post/topic counts correctly?

IngeJones

I do hope this works for me - I am *desperate* for this feature!!   We have an "any questions" forum for members to reply to would-be members before applying and all these people are using it as a way to slag off our site and everyone is reading all their lies.

Coldfx

With this mod, I am using this as a cheap version of a "thread moderation".  Set "view on topics only", allow views of polls, and block posting polls from regular users.  Then an admin can simply change a topic to a poll, and boom, it shows up :)

Good job on the mod!  

Feldon

I found a small bug and fixed it today.

Without the fix, a Database Error might occur in the event that all the boards in the forum have the View Any Topic permission disabled (or if there are no boards in your forum period).

IngeJones


Feldon

Uninstall the mod, then re-download it from the link below, and install it again.  You will have to re-assign the permissions.

If you have a lot of permissions to re-assign, then you can try to make the changes manually:

Open Sources/Profile.php, search for:
$normal_boards = array();
Immediately below it add the line:
$normal_boards[] = -1

Do the same thing with Sources/Recent.php and Sources/Search.php.

Astute php coders will probably recognize that I could have replaced $normal_boards = array() with $normal_boards = array(-1) rather than adding the second line, but I was in a hurry to fix it, and I doubt it has much performance impact anyways.

Hopefully that works for you.

Feldon

I have discovered and fixed two more issues:

1) There were two functions in SSI.php (ssi_recentPosts and ssi_recentTopics) that I had not altered.  Fixing this fixes the "Recent Posts" block in TinyPortal, so you should be able to use TinyPortal safely now.

2) There was an additional function in Recent.php related to unread posts that I had not altered.  Fixing this ensures no posts are incorrectly made visible by clicking the "View unread posts since last visit." link.

I also took the opportunity and repalced all instances of:

$normal_boards = array();
$normal_boards[] = -1;

with
$normal_boards = array(-1);
which I believe is the same thing, but slightly more efficient.

This brings the mod to version 1.4.

Note: If you caught this post over the last few hours, you can now safely download and install the mod.

Feldon

This mod has now been approved, all be it under the name View Any Topic Permission mod.

http://custom.simplemachines.org/mods/index.php?mod=687

babjusi

Where can the permission for this mod be set, thank u.

Feldon

Go to Admin->Permissions.  Click Settings.  Ensure the "Enable advanced by-board permissions" is checked.
Go to Admin->Permissions.  Click Permissions by Board.  Select the "Local" option next to the board of your choice.  Select the board name.  Hit the Modify button for the user group whose permissions you want to alter.  Underneath the Topics category there should be a new permission called "View Any Topic".

When enabled (the default setting), the board will act as normal.  That is, the user group can 'view any topic'.
When disabled, users in that group will only be able to see topics in that board that they started (i.e. their own topics), or topics that have been stickied.


As an example.  I have a forum that contains two boards, General and Personal Support.  The General board acts as normal, while the Personal Support board utilizes the permission.  Regular Members have the View Any Topic permission disabled within the Personal Support board.  Moderators, Administrators, and the "Problem Solvers" user group have the permission enabled in all boards.  This ensures that Regular Members can only see their own topics within the Personal Support board, while the other user groups can see and respond to all topics.

Hope that helps!

babjusi

Quote from: Feldon on March 10, 2007, 12:08:34 PM
Go to Admin->Permissions.  Click Settings.  Ensure the "Enable advanced by-board permissions" is checked.
Go to Admin->Permissions.  Click Permissions by Board.  Select the "Local" option next to the board of your choice.  Select the board name.  Hit the Modify button for the user group whose permissions you want to alter.  Underneath the Topics category there should be a new permission called "View Any Topic".

When enabled (the default setting), the board will act as normal.  That is, the user group can 'view any topic'.
When disabled, users in that group will only be able to see topics in that board that they started (i.e. their own topics), or topics that have been stickied.


As an example.  I have a forum that contains two boards, General and Personal Support.  The General board acts as normal, while the Personal Support board utilizes the permission.  Regular Members have the View Any Topic permission disabled within the Personal Support board.  Moderators, Administrators, and the "Problem Solvers" user group have the permission enabled in all boards.  This ensures that Regular Members can only see their own topics within the Personal Support board, while the other user groups can see and respond to all topics.

Hope that helps!

yes, it helped Feldon. Thank you very much for you explanation, I appreciate it

babjusi

Quote from: Feldon on March 10, 2007, 12:08:34 PM
Go to Admin->Permissions.  Click Settings.  Ensure the "Enable advanced by-board permissions" is checked.
Go to Admin->Permissions.  Click Permissions by Board.  Select the "Local" option next to the board of your choice.  Select the board name.  Hit the Modify button for the user group whose permissions you want to alter.  Underneath the Topics category there should be a new permission called "View Any Topic".

When enabled (the default setting), the board will act as normal.  That is, the user group can 'view any topic'.
When disabled, users in that group will only be able to see topics in that board that they started (i.e. their own topics), or topics that have been stickied.


As an example.  I have a forum that contains two boards, General and Personal Support.  The General board acts as normal, while the Personal Support board utilizes the permission.  Regular Members have the View Any Topic permission disabled within the Personal Support board.  Moderators, Administrators, and the "Problem Solvers" user group have the permission enabled in all boards.  This ensures that Regular Members can only see their own topics within the Personal Support board, while the other user groups can see and respond to all topics.

Hope that helps!

I did exactly as you said but I couldn''t find the permission "View Any Topic" underneath the Topics category

Feldon

Hmmm, I'm sorry you're experiencing difficulty.

Here's a link to a picture of what the appropriate admin screen should look like.

http://chris.paing.com/ViewAnyTopicPermissionScreen.png


If the permission is not there, then it must not be installing correctly.  Try to uninstall the package, then re-install it.  If that doesn't work, uninstall it, then try to manually install it by following the instructions in the file "ViewAnyTopicPermission.xml" inside the pacakge.

Advertisement: