News:

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

Main Menu

Private Topics

Started by All Colours Sam, February 07, 2013, 03:42:35 PM

Previous topic - Next topic

All Colours Sam

Link to Mod

Private topics mod
by: Suki

License


/*
* Version: MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
*/


Description

Allows users with permissions to mark topics as private and invite people to it, the mod also has a permission to see all topics marked as private without the need to be invited.

This mod only covers a vanilla SMF installation, if you have mods that adds their own queries to fetch topics then you need to manually apply the appropiate check to that code.

for SMF 2.0.x only

Laguage
-English


ChangeLog
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

All Colours Sam

ugh! I sent this before I realized the mess with grandchild boards.

If you are planing on using this, keep in mind that it doesn't play well with child and grandchild boards (and I have no idea how to properly add support for it) and it does add a performance hit, it is not recommended to use this on a busy site.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

littlenicki

Oh! That's a great idea! Would you mind doing a SMF 1.1 Version of this mod please Mr. Suki? Thank you!
Fomer SMF user. Switched to Invision Power Board and VBulletin

All Colours Sam

I'm sorry, I do not write mods for outdated versions and I ain't a Mr ;)  but since the mod is open source, anyone can write a version for 1.1.x
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Thels

Hi,

It seems like an interesting mod, but I'm a little confused about how to get it to work.

Would it be possible to automatically mark all threads on a specific board as private, so for that board, people can only see and reply to the thread they made themselves, except for global moderators who are able to view and reply to all threads?

Kind regards,
Thels.

All Colours Sam

Welcome, first of all, the annoying captcha goes away at 10 posts.

Well, I specifically added a check so the users can chose for themselves whether or not mark any of their topics as private, the mark as private option will only be available on the boards you specified in the mod's settings admin page.

You can change this on your theme's Post.template.php

<input type="checkbox" id="ptenable" name="ptenable"', !empty($context['ptenable']) ? ' checked="checked"' : '', ' class="input_check" />


with this:

<input type="checkbox" id="ptenable" name="ptenable"', !empty($context['ptenable']) || !empty($ptBoard) ? ' checked="checked"' : '', ' class="input_check" />


And it will make the check as marked by default.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

pastorvictor

Thank you, Suki, this sounds like a great mod! So if I don't have any subforums, I shouldn't have any issues with it?

All Colours Sam

Only the server load been increased, if you have a pretty busy forum then I don't recommend adding this.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

pastorvictor

It actually hasn't opened yet, so I'm not sure how busy it will be yet. I do know that I want to have a board where my staff can offer private counseling to the users but not through PM, so this sounds like the way to go. Would this use even more resources than, say, AJAX Chat?

All Colours Sam

No, any chat will add far more load to the server than this mod. This mod will only become an issue when you have literally thousands of users requesting topics.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

pastorvictor

Oh okay, thanks again Suki. This sounds like the way to go, at least for now. I'm *hoping* to have thousands of members, of course, but it will still take some time for that to happen :)

pastorvictor

Suki, where it says "type a user ID," is that for the user to allow non-moderators to view it? If so, can this be disabled?

All Colours Sam

Your users can leave that field as empty and then only the topic author and whoever has the permission to see any topic will be able to see it.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Skaty

#13
Very usefull mod and i need it but it is really work in "vanilla smf".  cant make it work in custom theme.  does anyone can use it in custom theme ?


ps:  now i tried with fresh smf and it is gave me the same error, i think there is something else to make it work.

The error is, when i create a private topic it given me ''The database value you're trying to insert does not exist: topic_id'' and can't reach some of my mods it is given me another error.

is there any solution for this ? if this is a bug i can send a demo acc for test :)

All Colours Sam

Thing is, I cannot reproduce this on my local installation, I already tried several times with no luck...

Can you please tell me step by steps all the changes you did, including the boards where you are enabling this, whos member is having the issues, do you set the permissions correctly? are your boards childboards or grand childboards?  all details you can provide would help.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Skaty

I can't explane all of these with my english :) i thing it would be better to sent you a demo acc (did it).

All Colours Sam

a demo acc at this point isn't going to help since I just don't know the steps you did for the error to appear, that is why I want to know which steps you did.

doesn't matter if you can't explain it in English, post it on your native language, google will do the rest, the point here is to know all the steps you did.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Skaty

Okay then, i will tell the steps and you can try them with demo acc.

The mod is active in board number 1. So first try to open new thread in here. chech the box and don't write any member id.
it will give this error ''The database value you're trying to insert does not exist: topic_id''

but the post will open. and appear for everyone.

the board error doesn't appear now. i will give more information later.

All Colours Sam

OK, thanks, that gives me an idea on where I need to look, hopefully this "undefined topic" error will finally stop hunting me!

Will take a look when I have some time.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Skaty

Quote from: Suki on March 05, 2013, 08:39:46 PM
OK, thanks, that gives me an idea on where I need to look, hopefully this "undefined topic" error will finally stop hunting me!

Will take a look when I have some time.

Okay  :laugh:

Advertisement: