News:

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

Main Menu

View Topic Permissions

Started by hadesflames, April 17, 2010, 12:57:54 PM

Previous topic - Next topic

hadesflames

Link to Mod

Package Information

Latest Version: 1.0
Created by: hadesflames
Built for: SMF 2.0 RC2
Package: View Topic Permissions


What is this?

This modification adds a permission so that the admin can decide if a member can view any topic, only his/her own topic, or no topics at all in certain, or all boards.

Alteration Log

Version 1.0

[!] Confirmed works with 2.0 RC3 - March 08, 2010
[!] Released on March 05, 2010.


Need Help?

If you need help with this modification, please don't hesitate to post in the support thread.

NOTE:
if you do not edit the permissions after installing, none of your members will be able to view any topics!

Bugo

Useful mod :)

Russian translation

Ryuoh

Thanks so much for this mod! I get an error though when i try to install it

   1.     Execute Modification     ./Sources/Display.php     Test successful
      1.    Add After    ./Sources/Display.php    Test successful
*    2.    Execute Modification    ./Sources/ManagePermissions.php    Test successful
      1.    Add Before    ./Sources/ManagePermissions.php    Test successful
      2.    Add Before    ./Sources/ManagePermissions.php    Test successful
*    3.    Execute Modification    ./Sources/MessageIndex.php    Test successful
      1.    Add After    ./Sources/MessageIndex.php    Test successful
      2.    Add After    ./Sources/MessageIndex.php    Test successful
*    4.    Execute Modification    ./Sources/News.php    Test successful
      1.    Replace    ./Sources/News.php    Test successful
      2.    Replace    ./Sources/News.php    Test successful
*    5.    Execute Modification    ./Sources/Printpage.php    Test successful
      1.    Replace    ./Sources/Printpage.php    Test successful
      2.    Add Before    ./Sources/Printpage.php    Test successful
*    6.    Execute Modification    ./Sources/Recent.php    Test failed
      1.    Add Before    ./Sources/Recent.php    Test successful
      2.    Replace    ./Sources/Recent.php    Test failed
*    7.    Execute Modification    ./Sources/Search.php    Test successful
      1.    Replace    ./Sources/Search.php    Test successful
      2.    Add After    ./Sources/Search.php    Test successful
*    8.    Execute Modification    ./Themes/default/Search.template.php    Test successful
      1.    Add After    ./Themes/default/Search.template.php    Test successful
      2.    Add After    ./Themes/default/Search.template.php    Test successful
*    9.    Execute Modification    ./Themes/default/languages/ManagePermissions.english.php    Test successful
      1.    Add Before    ./Themes/default/languages/ManagePermissions.english.php    Test successful
*    10.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful






$smcFunc['db_free_result']($request); // There might be - and are - different permissions between any and own. $permissions = array(
Replace[Select]
if(empty($context['posts'])) fatal_lang_error('recent_empty_error', false); $smcFunc['db_free_result']($request); // There might be - and are - different permissions between any and own. $permissions = array(

hadesflames

#3
You may have to make those changes to recent.php manually, as there may be another mod conflicting with your install. The mod installs fine on a vanilla SMF 2.0 RC3

Quote from: Bugo on April 18, 2010, 03:59:47 AM
Useful mod :)

Russian translation

Thanks for the translation, Russian has been added!

Ryuoh

ah it might be conflicting with one of these ill take a look and see if i can figure it out.

   TinyPortal      1.099       [ Uninstall ]  [ List Files ]  [ Delete ]
2.    Member Color Link    3.0.8    [ Uninstall ] [ List Files ] [ Delete ]
3.    SMF Arcade    2.5 RC1    [ Uninstall ] [ List Files ] [ Delete ]
4.    Aeva Media

hadesflames

Out of those mods, only Member Color Link edits recent.php, so you can have a look at that. Maybe installing view topic permissions first will work, if not you will have to manually install one of them.

Mitii

Hey Hades,

Any chance you could assist me with making the mod work like the 1.1.x version?: http://custom.simplemachines.org/mods/index.php?mod=794

I used that mod to make it so only certain membergroups could see every topic in the board, but people with the permission could ONLY see their topic. If they didn't have a topic in the board, it made it look like the board was empty.

tarpellia

Is it possible to add some additional functionality to this? Something along the lines of this mod? http://www.simplemachines.org/community/index.php?topic=142136.0

I'd like for everyone to be able to view sticky topics, but only for the poster (and moderators) to be able to view their  own topics, and to limit it so that the only topics viewable on the board's topic list are those posted by that user and the sticky topics.

I've searched through the mods, and there are several that combined will do what I need, but they aren't for 2.0. :(

Arantor

Or for a bigger version of it you could do worse than www.simpledesk.net for their helpdesk mod which is for 2.0 ;)

tarpellia

It's a nice system; perhaps a bit overkill for my needs though. :)

Thanks for the link. I'll check it out.

hadesflames

Quote from: Mitigation on April 22, 2010, 01:50:41 PM
Hey Hades,

Any chance you could assist me with making the mod work like the 1.1.x version?: http://custom.simplemachines.org/mods/index.php?mod=794

I used that mod to make it so only certain membergroups could see every topic in the board, but people with the permission could ONLY see their topic. If they didn't have a topic in the board, it made it look like the board was empty.

I would ask for help in the coding discussion board. (reason why stated below)

Quote from: tarpellia on April 22, 2010, 09:35:27 PM
Is it possible to add some additional functionality to this? Something along the lines of this mod? http://www.simplemachines.org/community/index.php?topic=142136.0

I'd like for everyone to be able to view sticky topics, but only for the poster (and moderators) to be able to view their  own topics, and to limit it so that the only topics viewable on the board's topic list are those posted by that user and the sticky topics.

I've searched through the mods, and there are several that combined will do what I need, but they aren't for 2.0. :(

I'm not really interested in adding more functionality to it than it has right now, mainly because I'm working on a bigger (much bigger) mod right now. Maybe in the future (though not likely)

tarpellia

I figured out a workaround using the topic approval system that will give me the privacy I need for this particular board. Good luck with your other mod!

Acans

For my forum you can still see the topics but just can't view them for replys, ect. Is it ment to be like this.

I was under the impression that it if only view your own topics was checked, you couldn't even see if other topics where made in that board?
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

hadesflames

Yes, the way I intended it to be was that you could only see your own topics (or none at all, depending on permissions) but you could still them inside the board.

Acans

is their a way to hide the other topics within the board if you do not have the permissions to see them?

The board type I want to setup is like a applications board, and i don't want others the ability to see if somebody else has submitted a application.
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Bugo

Quote from: hadesflames on April 20, 2010, 11:30:25 PM
Quote from: Bugo on April 18, 2010, 03:59:47 AM
Useful mod :)

Russian translation

Thanks for the translation, Russian has been added!
Look at screenshot. It's not normal russian :) Please add both russian files - ansi & utf8 *.xml into package...

hadesflames

Quote from: α¢αηѕ on April 29, 2010, 11:14:42 PM
is their a way to hide the other topics within the board if you do not have the permissions to see them?

The board type I want to setup is like a applications board, and i don't want others the ability to see if somebody else has submitted a application.

It can be done, but it's not how the mod was intended to work, so I won't do it. But you can see how it gets hidden from action=recent for example in the recent.php file and try to do something similar for your boards.

Quote from: Bugo on April 30, 2010, 01:47:42 AM
Quote from: hadesflames on April 20, 2010, 11:30:25 PM
Quote from: Bugo on April 18, 2010, 03:59:47 AM
Useful mod :)

Russian translation

Thanks for the translation, Russian has been added!
Look at screenshot. It's not normal russian :) Please add both russian files - ansi & utf8 *.xml into package...

I'll take a look when I get home tonight.

Acans

Hey, I've just discovered a problem with the view topic permissions mod.

Its started causing errors in my forum whenever i try to navigate to the 2nd page of one of my boards. It gives this error.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't.id_member_started = 1
ORDER BY is_sticky DESC, id_last_msg DESC
LIMIT 20' at line 3
File: /home/blazesca/public_html/project377/Sources/MessageIndex.php
Line: 375


Can you please take a look at my MessageIndex.php?
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

the giox

Me too give the same error.

I have to de-install the mod.
When i click on the page 2 or 3 or other page i have the same error.
I can navigate only on the first page

Slug1

Anyone know if this mod is to be updated for v2.0?

Any other mod similar to what this one does developed that I can be pointed to?

Thank you!
Slug1--out

~My blessings are as many as the miles I marched all these years~

Slug1

Anyone at all get this to work properly in v2.0?
Slug1--out

~My blessings are as many as the miles I marched all these years~

Grosraisin

#21
Hi,
I will put you in the attachment function in SMF 2.0 mods.

Too bad it lacks certainne option.

Thank you to the author of the mods malgas that his support is finished.

Edite: Suppression du mod :/

SMF / Le Partage et l'Entraide
SMF / Sharing and Caring


Mes modifications de Mods / Templates



ahruncev

Quote from: Grosraisin on September 13, 2011, 05:10:28 PM
Hi,
I will put you in the attachment function in SMF 2.0 mods.

Too bad it lacks certainne option.

Thank you to the author of the mods malgas that his support is finished.

Thanks for the Attachment. I have installed the mod which worked okay. When using this mod under the permissions there is the 2 spaces to tick the boxes for the mod but there is no text associated with those boxes. I assumed they were for the Mod.

Anyone else had this issue, or is there a fix for this?

Grosraisin

#23
Sorry for the inconvenience there had the French language to implement the mod is for her that you do voyer with the comment.

Here is the correct version.

Edite: Suppression du mod :/

SMF / Le Partage et l'Entraide
SMF / Sharing and Caring


Mes modifications de Mods / Templates



drguild

#24
Great mod we are using it on a forum for admin/mod chats to players on our game server.

One guy asked if we can only show there posts in the forum and not list ones from other players fo we can have more privacy with the threads.

I dunno if this can be done by anyone.

We also found a bug.

QuoteFound a bug.

When viewing all the posts of a particular user, you can see their posts that have been made inside the Staff Chat forum.

rousseauxy

I'm also trying to achieve that, think I found the where, now I just need to adapt the how, not sure if hadeflames or any1 else can assyst with this?

I think it's just a matter of adjusting the query that grabs the appropriate topic information (in MessageIndex.php)

domilolo

Tested on smf 2.0.5 and work perfect  ;)
only a small difference : in Printpage.php
find
// Split the topics up so we can print them.
$request = $smcFunc['db_query']('', '
SELECT subject, poster_time, body, IFNULL(mem.real_name, poster_name) AS poster_name
FROM {db_prefix}messages AS m
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
WHERE m.id_topic = {int:current_topic}' . ($modSettings['postmod_active'] && !allowedTo('approve_posts') ? '
AND (m.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR m.id_member = {int:current_member}') . ')' : '') . '
ORDER BY m.id_msg',
array(
'current_topic' => $topic,
'is_approved' => 1,
'current_member' => $user_info['id'],
)
);


remplace by :
// Split the topics up so we can print them.
$request = $smcFunc['db_query']('', '
SELECT b.id_board, m2.id_member AS id_first_member, m.subject, m.poster_time, m.body, IFNULL(mem.real_name, m.poster_name) AS poster_name
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
INNER JOIN {db_prefix}messages AS m2 ON (m2.id_msg = t.id_first_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
WHERE m.id_topic = {int:current_topic}' . ($modSettings['postmod_active'] && !allowedTo('approve_posts') ? '
AND (m.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR m.id_member = {int:current_member}') . ')' : '') . '
ORDER BY m.id_msg',
array(
'current_topic' => $topic,
'is_approved' => 1,
'current_member' => $user_info['id'],
)
);

Lilariel

Can confirm what domilolo posted, that fix works!

I have updated and attached a .zip with a working version of this mod by implementing his fix, tested and confirmed to be working in 2.0.9 and I have yet to encounter any breaking bugs. Only problem is that while you cannot open topics where you are not allowed to, the topics will still display in the boards list. Not ideal, but it's better than nothing.

You will need to emulate the installation for 2.0 RC3, and it should install quite nicely - at least it worked without a hitch for me!

Lilariel

Nevermind, don't use that, found a dealbreaker. Works almost perfectly, but breaks whenever you try to go to page 2 on any forum section. Probably a relatively easy fix, but I cba trying to hack away at it.

Reywind

Does anyone know of a mod like this that works for v2.0.9? I would LOVE to have this feature, and I've been searching for over an hour trying to find one that works with 2.0.9 and haven't been very successful.

My forum is for an online game guild website, and I have a board where potential members can post an application, as a new topic in the board. But I want to set this board so that if someone posts a new topic, only guild members and the original poster can see it - guests and registered users cannot.

hadesflames

Quote from: Reywind on April 12, 2015, 09:51:44 AM
Does anyone know of a mod like this that works for v2.0.9? I would LOVE to have this feature, and I've been searching for over an hour trying to find one that works with 2.0.9 and haven't been very successful.

My forum is for an online game guild website, and I have a board where potential members can post an application, as a new topic in the board. But I want to set this board so that if someone posts a new topic, only guild members and the original poster can see it - guests and registered users cannot.

This mod isn't really necessary. That's why I archived it years ago. You can emulate this functionality with 2.0 out of the box, no mods necessary. Just define a custom permission profile for the board you want people to post applications to. In the permission profile, set it so that no one can post topic without requiring approval, unless they're in the guild members membergroup. Set the guild members membergroup to be able to approve posts in that board. Now, every topic/post posted in that board will require to be approved before it gets posted, and only the topic starter and guild members will be able to see that topic/posts. Just make sure no one ever approves a post. There you go.

Advertisement: