Hide entire post if ignored?

Started by samborabora, July 12, 2014, 02:18:13 PM

Previous topic - Next topic

samborabora

I've read through many topics over the last two days and can't seem to find an easy way to NOT display the entire block of a user's post if they are ignored. The default theme doesn't even spoiler it, it just tells me "you are ignoring this user" at the top of the block and proceeds to display the post. I know, there are speed trade offs, I know, it's a big query and I know, logically there is probably no good reason for ignoring them completely, but what's the actual way of not printing the entire row containing a users post and info from a thread if they are ignored?

Arantor

It does spoiler it unless your theme or JavaScript break it.

Illori

you have to enable "Hide messages posted by members on my ignore list." in the members setting for the theme or in the profile.

samborabora

Thanks, I've done both of those, and for some reason my default theme doesn't work, nor does my derivative theme that I based upon it. The text still shows up anyways that says 'click to show post' and I actually don't want the posts to be printed at all, no javascript hide, just the entire ignored users block to never reach html for whoever has blocked them. As far as I can tell from the template, it always writes it and just gives you the option to show it at your discretion, and it shows the row for the post anyways.

Arantor

Of course it always writes it. It would be daft to show 19 (or less) posts on page when the user asked for 20.

And rewriting the logic to completely ignore such users raises serious performance issues.

samborabora

Quote from: ‽ on July 12, 2014, 03:54:44 PM
Of course it always writes it. It would be daft to show 19 (or less) posts on page when the user asked for 20.

And rewriting the logic to completely ignore such users raises serious performance issues.

It wouldn't really matter if you ignored someone, you could assume for yourself the missing posts. How does it raise performance issues when it already adds a line to to tell you that you've ignored them? All it's going to do is NOT write the row instead OF writing you've ignored them?

Arantor

Well done for yet again misinterpreting what I said.

If you don't display the entire box, that's fine, there's no performance overhead - but people will notice that the reply numbers won't match up right.

If, however, you tell it to skip posts so that pagination and so on is correct and you always get 20 posts per page and physically ignore those, it raises serious performance issues at the point where it identifies what posts to get.

samborabora

Quote from: ‽ on July 12, 2014, 04:14:51 PM
Well done for yet again misinterpreting what I said.

Patronisation dressed up in sarcasm appreciated.

QuoteIf you don't display the entire box, that's fine, there's no performance overhead - but people will notice that the reply numbers won't match up right.

The only people who'd notice are the one's who have others on ignore, that posted in the same thread as they were reading. Somehow, I think they could live with things not lining up. I just want the actual post to not be readable in any way by whoever is on ignore, no javascript or css hides, just withholding outputting the row to the user. But I can't get the code to work.

Arantor

That's just it, people do notice. Especially if they start referring to reply numbers, e.g. your previous post being reply 7... because that will suddenly be quite wrong for anyone who has anyone on ignore.

I also wouldn't have to be sarcastic if I didn't have to reiterate myself multiple times.

Antechinus

You can fairly easily change the display so it hides a lot more than it does by default. I do that anyway in custom themes, since people usually grumble about the amount of crud that SMF shows them in default form. This just requires minor markup and js tweaks.

IMO it's still handy to not get rid of absolutely everything. For example, if someone is an idiot a staff member may well have them on ignore. It's also likely that said idiot will have posts reported at some point. When that happens, a staff member will often want a quick and easy way of accessing the reported post in the actual thread. That's impossible if the whole thing is hidden.

I do something like this (live code example):


samborabora

To be honest, I don't even display post numbers, so it wouldn't bother me much, and I suppose for an admin or mod it would be nice to have, say a pre-collapsed box that could be expanded instead, but I don't think an admin would really be ignoring people, if they were that bad they could just ban them. Just for experimentation purposes, what is the code that would just effectively comment out the post for anyone who had that user on ignore? Something like:

if ($ignoring)
echo ' ';

if (if (!empty($ignoring))
echo 'POST FOO';

samborabora

Is

if ($ignoring)
echo ' ';

if (if (!empty($ignoring))
echo 'POST FOO';

not the correct way to test for if the user is ignored or not? I'd like to try this out and see how it goes, server-load-wise as well as how it affects the users, but I can't get the syntax right, is $ignoring not accepted?

Arantor

$ignoring is special. And no, if(if...)) is not accepted.

Except it's much more complicated than that to make happen in practice.

samborabora

Quote from: ‽ on July 19, 2014, 01:21:14 PM
$ignoring is special. And no, if(if...)) is not accepted.

Except it's much more complicated than that to make happen in practice.
How come? What makes it more difficult to only display a particular post or skip displaying it depending on whether or not some variable is satisfied?

margarett

If you really don't care about numbers and stuff, you can do this:
// Are we ignoring this message?
if (!empty($message['is_ignored']))
{
$ignoring = true;
$ignoredMsgs[] = $message['id'];
continue;
}

Although it should be wiser to try to understand why it doesn't work in your theme. Because the theme *IS* supposed to handle that...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

Quote from: margarett on July 20, 2014, 07:06:17 PM
If you really don't care about numbers and stuff, you can do this:
// Are we ignoring this message?
if (!empty($message['is_ignored']))
{
$ignoring = true;
$ignoredMsgs[] = $message['id'];
continue;
}

Although it should be wiser to try to understand why it doesn't work in your theme. Because the theme *IS* supposed to handle that...

Halfway there! This completely cuts out the post, but I'd like to cut it from the top of the message, from cat_bar down to the bottom of the row. Should I change the $message['id'] part? If so, what to?

margarett

Can you take a printscreen and make a rectangle on what you want to keep or remove?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

Quote from: margarett on July 21, 2014, 12:13:35 PM
Can you take a printscreen and make a rectangle on what you want to keep or remove?

Anything between the two
<hr class="post_separator">
markers. I can give a screenshot if you need? The full code I need ignoring would be:

<div class="cat_bar">
<h3 class="catbg">
</h3>
          </div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="post_wrapper">
<div class="poster">
<h4>
<a href="?u=3" title="View the profile of samborabora">samborabora</a>
</h4>
<ul class="reset smalltext" id="msg_267_extra_info">
<li class="avatar">
<a href="profile/?u=3">
<img class="avatar" src="?action=dlattach;attach=17;type=avatar" alt="">
</a>
</li>
<li><strong>Location:</strong></li>
<li class="postcount"><strong>Posts:</strong> 57</li>
</ul>
</div>
<div class="postarea">
<div class="flow_hidden">
<div class="keyinfo">
<div class="smalltextdate"> A week ago</div>
</div>
<ul class="reset smalltext quickbuttons">
<li class="quote_button"><a href="?action=post;quote=267;last_msg=267" onclick="return oQuickReply.quote(267);">Quote</a></li>
<li class="modify_button"><a href="/?action=post;msg=267">Edit</a></li>
<li class="remove_button"><a href="?action=deletemsg;msg=267;ff5b8c22=77c07aafd09276001ece800fa7d37bec" onclick="return confirm('Remove this message?');">Delete</a></li>
</ul>
</div>
<div class="post">
<div class="inner" id="msg_267">bump!</div>
</div>
<img src="modify_inline.gif" alt="Modify message" title="Modify message" class="modifybutton" id="modify_button_267" style="cursor: pointer;" onclick="oQuickModify.modifyMsg('267')">
</div>
<div class="moderatorbar">
<div class="smalltext modified" id="modified_267">
</div>
<div class="smalltext reportlinks">
<a href="?action=reporttm;msg=267">Report</a> &nbsp;
</div>
</div>
</div>
<span class="botslice"><span></span></span>
</div>


So, basically, not just the message content, but the actual entire post, between each seperator ;)

margarett

The code I gave you actually hides the full post, at least in my default theme...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

Quote from: margarett on July 21, 2014, 01:50:33 PM
The code I gave you actually hides the full post, at least in my default theme...

I'm using what I remember being the default theme too, I'm pretty sure it was 'default' I originally modified. Where is it defined the entirety of the post?

Advertisement: