Restrict thread & post visibility to Topic Starter & Team only in one board

Started by FireDitto, September 07, 2012, 10:51:39 PM

Previous topic - Next topic

Unruler

Quote from: Suki on December 07, 2012, 11:52:45 AM
The topic creator is already added to the list of persons capable of see the topic so you don't need to type your name on it, try adding someone else name, the mod includes an autosuggest feature that will detect the name your type and will give you possible usernames.

Now, I'm trying it after reinstallation of a mod and it works. Except if I edit topics and change the tick in the checkbox the settings won't change.

Prime32

This mod interests me greatly, but the link is dead. Any chance you could post another?

Suki

I upload a new version tomorrow, it looks like I finally hunted down the annoying bug with childboards and grandchilds boards, it is not a pretty fix though.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Suki

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Prime32

Thank you. I had to modify an "AND" to "WHERE" before it would install on a base 2.0.1 setup, but I assume that's something from 2.0.2+.

Is there any way to give the Moderator membergroup access to the "Can always see private topics" permission? i.e. let local moderators see private topics, but only in the sections they moderate.

Suki

Yes, since 2.0.3 introduces a change on SSI.php, the current package won't work on a 2.0.2 or lower versions.

You can apply permission groups for your boards independently, you can create a permission group where moderators can have the "Can always see private topics" permission and apply that to some board, this board will have custom permissions that won't be available outside that board
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Prime32

If you mean Permission Profiles, the permission isn't available there for Moderators (as in, the people you select when creating a board, membergroup 3) any more than in general. A standard group like Global Moderator doesn't accomplish what I wanted to do. :-\

I was looking to enable Private Topics on a few dozen boards, each used for a game, where the Game Master is a local mod and can see all private topics; however, the GM of one game board may be a player in others, and shouldn't be able to see private topics there. I could do this by creating a membergroup and permission profile for each board, but that's both messy and tedious.

FireDitto

Apologies if you haven't attacked the error yet, but I saw the files have been updated so I installed and gave it a shot. It is still not loading the parent boards; Children work if they don't have their own children, otherwise the grandchildren work, but any board that is a parent isn't loading still.

An observation (not an issue to me but I'll mention it) if a Private topic is the last on a board, it naturally shows up to those that can see it - however, for those that can't, the "last post" block is completely empty. That could be related to the error cropping up with parent boards. I haven't looked into it, but I can poke around on my forum and see if you want :)

Hope you had a good holiday!
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Suki

Quote from: Prime32 on February 01, 2013, 07:59:07 PM
If you mean Permission Profiles, the permission isn't available there for Moderators (as in, the people you select when creating a board, membergroup 3) any more than in general. A standard group like Global Moderator doesn't accomplish what I wanted to do. :-\

I was looking to enable Private Topics on a few dozen boards, each used for a game, where the Game Master is a local mod and can see all private topics; however, the GM of one game board may be a player in others, and shouldn't be able to see private topics there. I could do this by creating a membergroup and permission profile for each board, but that's both messy and tedious.

There is no reason why the permissions shlund't appear, there are regular permissions that are ported to permissions profiles just like any other.

Quote from: FireDitto on February 03, 2013, 02:00:54 AM
Apologies if you haven't attacked the error yet, but I saw the files have been updated so I installed and gave it a shot. It is still not loading the parent boards; Children work if they don't have their own children, otherwise the grandchildren work, but any board that is a parent isn't loading still.

An observation (not an issue to me but I'll mention it) if a Private topic is the last on a board, it naturally shows up to those that can see it - however, for those that can't, the "last post" block is completely empty. That could be related to the error cropping up with parent boards. I haven't looked into it, but I can poke around on my forum and see if you want :)

Hope you had a good holiday!

Is this the same issue or another?

There should be no error since I moved the logic from the sources to the template, child boards are loaded intact and is in the template where the logic is applied.

I need more details... like the exact error or a demo forum where I can see the error, "doesn't show" isn't exactly helpful.

The last post field been empty is part of the fix, if a topic is private then it shouldn't appear, makes no sense to show it to those who can't see private topics.  And no, showing the "las topic a person can see" is just too much, will eat too much resources and this mod already hurts performance with all those LEFT JOINs.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Prime32

Quote from: Suki on February 03, 2013, 08:50:38 AMThere is no reason why the permissions shlund't appear, there are regular permissions that are ported to permissions profiles just like any other.
It shows up under "General Permissions", a section which the Moderator group and profile groups don't have.
EDIT: That is, the heading above "Default Board Profile Permissions" which contains permissions like "Read personal messages"; not the tab next to Board Permissions/Edit Profiles/Settings.

FireDitto

Quote from: Suki on February 03, 2013, 08:50:38 AM
Is this the same issue or another?

There should be no error since I moved the logic from the sources to the template, child boards are loaded intact and is in the template where the logic is applied.

I need more details... like the exact error or a demo forum where I can see the error, "doesn't show" isn't exactly helpful.

It is the same issue. I've included an image showing a series of screenshots down from parent board through to the grandchild so that you can see what I am talking about.

I uninstalled, re downloaded and reinstalled the mod in case I'd been a dweeb and installed the wrong one, but I am receiving the same error. Everything installed clean - or, rather, there were no alerts and aside from the boards not functioning correctly, I'm not having any issues.


The Error Log is reading;

Type of error: Critical
URL: {Site}/index.php?board=61.0
message: The database value you're trying to insert does not exist: topic
Function: doGet
File: {details}/Sources/PrivateTopics.php
Line: 112

lines 101 to 122; the ); on its own is line 112

	
	
/* Use the cache when possible */
	
	
if ((
$this->_return cache_get_data(self::$name .':'$this->_topic120)) == null)
	
	
{
	
	
	
$this->_request $smcFunc['db_query']('''
	
	
	
	
SELECT users, topic_id
	
	
	
	
FROM {db_prefix}private_topics
	
	
	
	
WHERE topic_id = {int:topic}
	
	
	
	
LIMIT 1'
,
	
	
	
	
array(
	
	
	
	
	
'topic' => $this->_topic,
	
	
	
	
)
	
	
	
);

	
	
	
$temp $smcFunc['db_fetch_assoc']($this->_request);

	
	
	
if (!empty(
$temp))
	
	
	
	
$this->_return explode(','$temp['users']);

	
	
	
else
	
	
	
	
$this->_return 'no';

	
	
	
	
/* Cache this beauty */
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Suki

Unfortunately, a screenshot does not help, I need to know how you setup your boards, if the parent is an empty shell of does contain post, if the child is an empty shell or does contain post.

I need ot knoe in roder to properly reproduce this, I checked the last fix with grandchilds and I couldn't reproduce this.

The error is not on the code you posted, that is just where it shows and its only showing that $this->_topic is empty which shouldn't be.

Function doGet() is called in several files, without knowing which specific file/action is not passing the topic ID it would be pretty difficult to address this, specially if I already moved the logic from sources, meaning there is absolutely no way for an error like that to appear.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Suki

OK, I'm going to start all over with this, the separate table approach wasn't the best approach, might be better to add another column to the topics table to avoid all those nasty LEFT JOINS.

I'm still unsure about how to handle grandchild boards, all the ideas I have for it are rather ugly since I do not wish to re-factor the entire function, that will only cause more things to break since there is no modularity.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

pastorvictor

Thank you for trying, Suki. I am following the progress of this mod. I really need this in one of my boards, as I'd like my staff to offer private counseling/advice to members but not through PM. Good luck!

Suki

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Advertisement: