Jump to content

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


-FP

Recommended Posts

Posted

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?

Posted

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)

Posted

Hey, the issue is that I don't want them to see the content of the message. I only want to notify that there was a message that has been hidden.

Posted

You said: '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. '

This new group should see this message.

 

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Archived

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

  • Recently Browsing   0 members

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