Jump to content

Hidden post indicator for those who can't see hidden posts


-FP

Recommended Posts

I want to let users who can't see hidden posts know that there was a post that has been hidden.

So at the end of the postContainer template I added this:

{{if $comment->hidden() AND $comment->canUnhide()}}
This message has been hidden.
{{endif}}

To me as an user with permission to view and unhide hidden content, that simply shows "This message has been hidden." after the hidden message.

So then I tried this line:

{{if $comment->hidden() AND !$comment->canUnhide()}}
This message has been hidden.
{{endif}}

Obviously I no longer see the message after the hidden post. But it doesn't show up for users who can't unhide/view hidden messages, and that's what I need.

How can I work around this? The if statement? Work in another template?

Link to comment
Share on other sites

I would try this:

- Create new members group

- Add this group Staff/Moderators

- Edit Staff/This new group ->Content - YES only  'Can view all hidden content?' - and permissions you decide.

- Add to postContainer only the first code. (or second if I misunderstood)

Link to comment
Share on other sites

Ah yeah the first part was just a functionality test. Then I modified it to make it work for people who can't see hidden messages, but it doesn't.

So basically, I want people who can't see hidden messages, to see "This message has been hidden." instead of nothing.

If I do what you suggested, they will see normal post block with the actual message and the modified style to show that it's hidden, and I don't want that.

Link to comment
Share on other sites

Yes, the issue is that if I do that, they will see the normal post block with the post itself, and I don't want that, I only want to show that the message was hidden. Right now nothing is shown to people who can't see hidden messages.

Link to comment
Share on other sites

I added this to the topic template:

vETfiFe.jpg

In the foreach that calls the postContainer template, after that call, I added 2 if statements.

The first one in purpose to test that I, as an user with an account that can unhide stuff, can see the notification of hidden message. Yes I see it below the hidden message:

je0AyCI.jpg

 

So, the second if statement, should show the notification message for users that can't unhide posts. But it doesn't.

I suspect because to begin with hidden comments do not even get into $comment if you don't have the permission to view/unhide them, so the hidden() stuff doesn't work.

Link to comment
Share on other sites

Baaaaaaaaah been trying to do this for hours. I definitely think hidden messages do not get in $comments if the user doesn't have permission to view them.

I guess I would have to modify some php file to get everything in $comments, and then also modify the topic template to only call postContainer for hidden messages if the user can see them, if not just show the custom message.

But not willing to mess with that.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...