Allow users to fully ignore/hide other users

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Anti-Spam Guide
tahiti
Registered User
Posts: 9
Joined: Sat Nov 16, 2024 10:33 am

Allow users to fully ignore/hide other users

Post by tahiti »

I am wondering if it is possible to create an extension that would allow my users to fully ignore other users. The friend/foe list is not sufficient for our needs.

This is a group of users who have posted with each other for over 20 years and often fight like siblings. There's no reason to ban anyone but there are times when my users would prefer to ignore another user (either permanently or for some period of time) to improve their personal experience on the forum. Where we originally came from (not a phpbb forum), there was a feature to block another user. If blocked, that user's threads and posts were completely hidden from sight for the user who blocked them, allowing them to have a true out of sight, out of mind experience. As it is, threads and thread topics are still visible and posts are just hidden behind the "show post" option, which clutters the screen for these users. If I could at least hide the thread topics and make them something generic, this would probably be an ok workaround in combination with the friend/foe list, but still not optimal for what we're used to.

I've tried to find something like this in the extensions available and haven't found anything. It looks like this may have existed in (much) older versions of phpbb, but not anymore. If I missed something, I apologize. I've been searching for weeks with different keywords hoping to find something suitable.

I'm on version 3.3.14

Any help would be much appreciated.
Thank you.
User avatar
warmweer
Jr. Extension Validator
Posts: 12113
Joined: Fri Jul 04, 2003 6:34 am
Location: somewhere in the space-time continuum

Re: Allow users to fully ignore/hide other users

Post by warmweer »

tahiti wrote: Sat Jan 04, 2025 1:43 am ...
Where we originally came from (not a phpbb forum), there was a feature to block another user. If blocked, that user's threads and posts were completely hidden from sight for the user who blocked them, allowing them to have a true out of sight, out of mind experience. As it is, threads and thread topics are still visible and posts are just hidden behind the "show post" option, which clutters the screen for these users. If I could at least hide the thread topics and make them something generic, this would probably be an ok workaround in combination with the friend/foe list, but still not optimal for what we're used to.
First of all: phpBB uses flat view. It's not threaded and as such doesn't have threads, nor thread topics (whatever that is).

The issue with post/topic hiding is that it can easily break the flow/continuity. e.g. someone quotes a "foe" or responds to a post made by a foe and others add to that. It take only 3 or 4 replies to create an apparently nonsensical stream of seemingly unrelated posts.
Also a foe could start a topic in which other users post valuable info.
The "show post" option may seem clutter but effectively allows the reader to restore sanity with a simple click.

For the record: there nothing wrong with the extension request but IMHO there should always be a quick way to view the hidden/obscured posts.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Gumboots
Registered User
Posts: 821
Joined: Fri Oct 11, 2019 1:59 am

Re: Allow users to fully ignore/hide other users

Post by Gumboots »

warmweer wrote: Sat Jan 04, 2025 6:28 amFirst of all: phpBB uses flat view. It's not threaded and as such doesn't have threads, nor thread topics (whatever that is).
It's common for people to refer to topics as "threads", even in flat view. I often do it myself.

"Thread topics" would just be the visible topic titles.
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦
User avatar
Gumboots
Registered User
Posts: 821
Joined: Fri Oct 11, 2019 1:59 am

Re: Allow users to fully ignore/hide other users

Post by Gumboots »

tahiti wrote: Sat Jan 04, 2025 1:43 am I am wondering if it is possible to create an extension that would allow my users to fully ignore other users. The friend/foe list is not sufficient for our needs.
I made a similar request a while back: Comprehensive (everywhere) ignore system
No takers so far.
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦
tahiti
Registered User
Posts: 9
Joined: Sat Nov 16, 2024 10:33 am

Re: Allow users to fully ignore/hide other users

Post by tahiti »

warmweer wrote: Sat Jan 04, 2025 6:28 am
tahiti wrote: Sat Jan 04, 2025 1:43 am ...
Where we originally came from (not a phpbb forum), there was a feature to block another user. If blocked, that user's threads and posts were completely hidden from sight for the user who blocked them, allowing them to have a true out of sight, out of mind experience. As it is, threads and thread topics are still visible and posts are just hidden behind the "show post" option, which clutters the screen for these users. If I could at least hide the thread topics and make them something generic, this would probably be an ok workaround in combination with the friend/foe list, but still not optimal for what we're used to.
First of all: phpBB uses flat view. It's not threaded and as such doesn't have threads, nor thread topics (whatever that is).

The issue with post/topic hiding is that it can easily break the flow/continuity. e.g. someone quotes a "foe" or responds to a post made by a foe and others add to that. It take only 3 or 4 replies to create an apparently nonsensical stream of seemingly unrelated posts.
Also a foe could start a topic in which other users post valuable info.
The "show post" option may seem clutter but effectively allows the reader to restore sanity with a simple click.

For the record: there nothing wrong with the extension request but IMHO there should always be a quick way to view the hidden/obscured posts.
This forum isn't like that. I'm not looking for suggestions on how a forum should be run or operated. I'm trying to find out if this is an extension that is possible.
tahiti
Registered User
Posts: 9
Joined: Sat Nov 16, 2024 10:33 am

Re: Allow users to fully ignore/hide other users

Post by tahiti »

Gumboots wrote: Sat Jan 04, 2025 8:53 pm
tahiti wrote: Sat Jan 04, 2025 1:43 am I am wondering if it is possible to create an extension that would allow my users to fully ignore other users. The friend/foe list is not sufficient for our needs.
I made a similar request a while back: Comprehensive (everywhere) ignore system
No takers so far.
Bummer. Those would be some nice additions to what I'm looking for, as well. Maybe one day. Apparently it was available on older versions. Unfortunately, I'm not a web dev and just started with phpbb a couple months ago.
User avatar
Anișor
Translator
Posts: 394
Joined: Tue Jan 08, 2013 9:36 pm
Location: Angus, Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿
Name: Anișor Neculai

Re: Allow users to fully ignore/hide other users

Post by Anișor »

EDIT: Sorry, I was a bit confused. I will come back with a reply later today.

Edit2:
This edits will affect posts in the topic only.
Open yourstyle/template/viewtopic_body.html, look for:

Code: Select all

<div id="p{postrow.POST_ID}" class="post has-profile <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF --><!-- IF postrow.POSTER_WARNINGS --> warned<!-- ENDIF -->">
Replace with:

Code: Select all

<div id="p{postrow.POST_ID}" class="post has-profile <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF --><!-- IF postrow.POSTER_WARNINGS --> warned<!-- ENDIF --><!-- IF postrow.S_IGNORE_POST --> ignored_post<!-- ENDIF -->">
Open yourstyle/theme/common.css and somewhere at the bottom add:

Code: Select all

.ignored_post {
    display: none;
}
tahiti
Registered User
Posts: 9
Joined: Sat Nov 16, 2024 10:33 am

Re: Allow users to fully ignore/hide other users

Post by tahiti »

Anișor wrote: Sun Jan 05, 2025 8:01 am EDIT: Sorry, I was a bit confused. I will come back with a reply later today.

Edit2:
This edits will affect posts in the topic only.
Open yourstyle/template/viewtopic_body.html, look for:

Code: Select all

<div id="p{postrow.POST_ID}" class="post has-profile <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF --><!-- IF postrow.POSTER_WARNINGS --> warned<!-- ENDIF -->">
Replace with:

Code: Select all

<div id="p{postrow.POST_ID}" class="post has-profile <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF --><!-- IF postrow.POSTER_WARNINGS --> warned<!-- ENDIF --><!-- IF postrow.S_IGNORE_POST --> ignored_post<!-- ENDIF -->">
Open yourstyle/theme/common.css and somewhere at the bottom add:

Code: Select all

.ignored_post {
    display: none;
}
Thanks for your help. It looks like this would give my users the ability to ignore posts but would they have to ignore each one manually? or would this allow them to ignore all posts from a certain user (anyone on their foe list, for instance)?
User avatar
Anișor
Translator
Posts: 394
Joined: Tue Jan 08, 2013 9:36 pm
Location: Angus, Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿
Name: Anișor Neculai

Re: Allow users to fully ignore/hide other users

Post by Anișor »

tahiti wrote: Mon Jan 06, 2025 1:29 am Thanks for your help. It looks like this would give my users the ability to ignore posts but would they have to ignore each one manually? or would this allow them to ignore all posts from a certain user (anyone on their foe list, for instance)?
This will hide the posts made by those who are in your foe list. After you add a user as your foe their posts will be hidden for you only.
All posts will be hidden (posts in a topic not the entire topic).
tahiti
Registered User
Posts: 9
Joined: Sat Nov 16, 2024 10:33 am

Re: Allow users to fully ignore/hide other users

Post by tahiti »

Anișor wrote: Mon Jan 06, 2025 8:23 am
tahiti wrote: Mon Jan 06, 2025 1:29 am Thanks for your help. It looks like this would give my users the ability to ignore posts but would they have to ignore each one manually? or would this allow them to ignore all posts from a certain user (anyone on their foe list, for instance)?
This will hide the posts made by those who are in your foe list. After you add a user as your foe their posts will be hidden for you only.
All posts will be hidden (posts in a topic not the entire topic).
Awesome, thank you! I'll try this out.

You wouldn't happen to have any idea for how to hide entire topics as well for anyone on a user's foe list?
User avatar
Anișor
Translator
Posts: 394
Joined: Tue Jan 08, 2013 9:36 pm
Location: Angus, Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿
Name: Anișor Neculai

Re: Allow users to fully ignore/hide other users

Post by Anișor »

I do know how but not only using HTML. That will require an extension as you want to exclude the posts from the user's view.
It has loopholes tho. One would be accessing it by direct link (if someone sends you the link in PM for example).
This can be checked and to return an error such as "This user "username" is currently in your foes list please remove them to see the topic", etc.
Then you want to exclude them from the search results. Then you need to exclude them from the forumlist view (last post).
My method was simple using the available variable to return if the poster is or isn't your foe. If you're thinking of writing an extension you can hide those posts directly from the database with no HTML edits.
You can even exclude them from the online users list, member list, block their profiles entirely. So you will never see them again.

I am not sure if I want to get involved in such extension but I will keep that in mind.
User avatar
privet.fun
Registered User
Posts: 127
Joined: Sun May 07, 2023 8:46 pm
Location: https://privet.fun

Re: Allow users to fully ignore/hide other users

Post by privet.fun »

I have these features implemented on my forum since mid-2023:

1. Global ignore: thread in Russian. It is basically a script running in the browser that hides all foes' replies (for some reason, phpBB does not do that out of the box).

Code: Select all

<script>

function removeAnnoyingQuotes(foes)
{
    var count = 0;
    for (var userInd = 0; userInd < foes.length; userInd ++) {
        let userLink = "./memberlist.php?mode=viewprofile&u=" + foes[userInd][0]
        var quoteNodes = document.evaluate(
            "//a[@href='" + userLink + "']",
            document,
            null,
            XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
            null);
        for (var i = 0; i < quoteNodes.snapshotLength; i++) {
            var authorElement = quoteNodes.snapshotItem(i);
            let p1 = authorElement.parentElement;
            if (p1 && p1.nodeName === "CITE") {
                let p2 = p1.parentElement;
                if (p2) {
                    p2.innerHTML = blockedUserQuoteText(p2, foes[userInd][1]);
                    count++; 
                }
            }
        }
    }
    return count;
}

function removeAnnoyingFuzzyQuotes(foes)
{
    var count = 0;
    var quoteNodes = document.evaluate(
        "//cite",
        document,
        null,
        XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
        null);
    for (var i = 0; i < quoteNodes.snapshotLength; i++) {
        var el = quoteNodes.snapshotItem(i);
        if (el.parentElement.nodeName === "DIV" && el.parentElement.parentElement.nodeName === "BLOCKQUOTE") {
            var title = el.textContent
            for (var userInd = 0; userInd < foes.length; userInd ++) {
                if (title.startsWith(foes[userInd][1] + " ")) {
                    var foeBlock = el.parentElement;
                    foeBlock.innerHTML = blockedUserQuoteText(foeBlock, foes[userInd][1]);
                    count++;
                    break;
                }
            }
        }
    }
    return count;
}

var ignoreQuoteId = 0;

function blockedUserQuoteText(parent, foeName) {

  ignoreQuoteId = ignoreQuoteId + 1;

  var result = '<div id="quote_hidden' + ignoreQuoteId +  '">The author of <a class="display_hidden_quote" data-quote-id="' + ignoreQuoteId + '" href="./viewtopic.php">message</a> является <b>' + foeName + '</b>, is in your foe list.</div><div id="quote_content' + ignoreQuoteId + '" style="display: none;">' + parent.innerHTML + '</div>';

  return result;
}

(function() {
    'use strict';

    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
         if (this.readyState == 4 && this.status == 200) {
             let text = this.responseText;
             let ind1 = text.indexOf("<select name=\"usernames[]\"");
             if (ind1 != -1) {
                 let optSearch = "<option value=\"";
                 let ind2 = text.indexOf("</select>", ind1);
                 let foeBlob = text.substring(ind1, ind2);
                 // console.log("FOE " + foeBlob);
                 var ind = 0;
                 var foes = Array();
                 while (true) {
                     ind = foeBlob.indexOf(optSearch, ind);
                     if (ind == -1) {
                         break;
                     }
                     var endIdInd = foeBlob.indexOf("\">", ind);
                     var foeId = foeBlob.substring(ind + optSearch.length, endIdInd);
                     var endNameInd = foeBlob.indexOf("</option>", endIdInd)
                     var foeName = foeBlob.substring(endIdInd + 2, endNameInd);
                     foes.push([foeId, foeName]);
                     ind = endNameInd;
                 }
                 if (foes.length > 0) {
                     var count = removeAnnoyingQuotes(foes);
                     count = count + removeAnnoyingFuzzyQuotes(foes);

                      if(count) {
                         $('.display_hidden_quote').on('click', function(e) {
                        	e.preventDefault();
                     	 	var quoteId = $(this).attr('data-quote-id');
                     	 	$('#quote_content' + quoteId).show();
                       	 	$('#quote_hidden' + quoteId).hide();
                       });
                     }
                 }
             }
         }
    };
    // workaround to get list of foes -- we fetch the entire page and parse it to get a list of foes
    xhttp.open("GET", "/ucp.php?i=ucp_zebra&mode=foes", true);
    xhttp.send();
})();

</script>
I added above script to /styles/prosilver/template/viewtopic_body.html

2. Hide Foe Topics v1.0.0 https://github.com/privet-fun/phpbb_hidefoetopics

I was contemplating combining both into a single plugin but never got around to doing that.

BTW it's still not an optimal solution as in my experience it's not that easy to completely cut a foe out from the topic conversation thread.
This is because of the "flat" structure of phpBB topics/threas where a user can quote multiple people in one post.
Ideally you would want to hide replies from other users to the post made by a foe (perhaps this could be an option) but it's not that simple since a user can quote multiple people in a post.
In a tree-like conversation structure like the ones on Twitter you can simply cut a foe's reply and all the replies linked downwards.
User avatar
privet.fun
Registered User
Posts: 127
Joined: Sun May 07, 2023 8:46 pm
Location: https://privet.fun

Re: Allow users to fully ignore/hide other users

Post by privet.fun »

Gumboots wrote: Sat Jan 04, 2025 8:53 pm
tahiti wrote: Sat Jan 04, 2025 1:43 am I am wondering if it is possible to create an extension that would allow my users to fully ignore other users. The friend/foe list is not sufficient for our needs.
I made a similar request a while back: Comprehensive (everywhere) ignore system
No takers so far.
Hey, join my forum and give a try to what we have there, if you like I can help you to add it to your board or perhaps turn it into proper plugin.
User avatar
Gumboots
Registered User
Posts: 821
Joined: Fri Oct 11, 2019 1:59 am

Re: Allow users to fully ignore/hide other users

Post by Gumboots »

Subject: Allow users to fully ignore/hide other users
privet.fun wrote: Wed Jan 08, 2025 11:58 pm
Gumboots wrote: Sat Jan 04, 2025 8:53 pm
I made a similar request a while back: Comprehensive (everywhere) ignore system
No takers so far.
Hey, join my forum and give a try to what we have there, if you like I can help you to add it to your board or perhaps turn it into proper plugin.
Hi. Looks interesting. Basic posts within topics is not an issue. I've already used custom CSS to change the default presentation of those, and everyone is happy with the result (you're welcome to a look at that if you want). My solution is to minimise what is visible by default, so that all anyone sees is "Ignored post" (in place of the thread title, foe name, blurb, etc) and the "View post" link. This looks clean and takes up minimal space without screwing any functionality. Deleted posts are handled the same way.

But your way of dealing with quotes is inventive, and we still get a few grumbles about those. I can't help thinking though that it should be possible to deal with quotes via PHP on the back end. You'd just need to assign some sort of IS_FOE tag to the quote parent element so it could be dealt with by the same classes that handle normal ignored posts.

That seems to me to be the cleanest way of doing it. Arguably it should even be a default feature (maybe in phpBB 73.2.98). It's already done for posts, so doing it for quotes should not be particularly difficult. You'd still be stuck with replies to the hidden quotes being visible, but that should be acceptable to any sane members. The insane ones can go rot. :lol:

I haven't looked at the code for your topic hiding extension yet, but I assume it does something similar.
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦
User avatar
Anișor
Translator
Posts: 394
Joined: Tue Jan 08, 2013 9:36 pm
Location: Angus, Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿
Name: Anișor Neculai

Re: Allow users to fully ignore/hide other users

Post by Anișor »

Gumboots wrote: Thu Jan 09, 2025 9:25 pm ...

But your way of dealing with quotes is inventive, and we still get a few grumbles about those. I can't help thinking though that it should be possible to deal with quotes via PHP on the back end. You'd just need to assign some sort of IS_FOE tag to the quote parent element so it could be dealt with by the same classes that handle normal ignored posts.

That seems to me to be the cleanest way of doing it. Arguably it should even be a default feature (maybe in phpBB 73.2.98). It's already done for posts, so doing it for quotes should not be particularly difficult. You'd still be stuck with replies to the hidden quotes being visible, but that should be acceptable to any sane members. The insane ones can go rot. :lol:

I haven't looked at the code for your topic hiding extension yet, but I assume it does something similar.
Quotes are saved in the POST_TEXT column in the phpbb_posts table as plain text which are eventually parsed.

You can't do that unless you will save the quotes in a different table in some format such as:
id, post_id, author, time, user_id, quote_text and then you check the records against your foe list and post id.

Even then I am not entirely sure it will work as intended since you won't be able to position the quotes in the posts form as you do now. You will have to make a separate query to show them at the end of the post or something since they will be stored separately and independent from the post_text.

Return to “Extension Requests”