-FP Posted October 1, 2015 Share Posted October 1, 2015 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 More sharing options...
Adlago Posted October 1, 2015 Share Posted October 1, 2015 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 More sharing options...
-FP Posted October 1, 2015 Author Share Posted October 1, 2015 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. Link to comment Share on other sites More sharing options...
Adlago Posted October 1, 2015 Share Posted October 1, 2015 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. Link to comment Share on other sites More sharing options...
-FP Posted October 1, 2015 Author Share Posted October 1, 2015 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 More sharing options...
Adlago Posted October 1, 2015 Share Posted October 1, 2015 If your code first condition to perform Staff team, then create this new group and its members for this condition Link to comment Share on other sites More sharing options...
-FP Posted October 1, 2015 Author Share Posted October 1, 2015 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 More sharing options...
Adlago Posted October 1, 2015 Share Posted October 1, 2015 I think this is the only option that easily experiment Link to comment Share on other sites More sharing options...
Tom S. Posted October 1, 2015 Share Posted October 1, 2015 Do you know what canUnhide() returns? If it is just true or false then maybe try using syntax canUnhide() == false Link to comment Share on other sites More sharing options...
-FP Posted October 1, 2015 Author Share Posted October 1, 2015 I added this to the topic template: 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: 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 More sharing options...
-FP Posted October 2, 2015 Author Share Posted October 2, 2015 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.