Ignore This Thread

Offer your ideas on how to improve the site or report problems.
User avatar
cafeIKE
Posts: 4726
Joined: 18 years ago

#1: Post by cafeIKE »

Would be most useful to exclude some threads from View Unread

User avatar
HB
Admin
Posts: 22031
Joined: 19 years ago

#2: Post by HB »

I didn't find any previously coded phpBB mods for ignoring threads. Ignoring selected users, yes. I've thought of adding forum-based filtering, would that help?
Dan Kehn

User avatar
cafeIKE (original poster)
Posts: 4726
Joined: 18 years ago

#3: Post by cafeIKE (original poster) »

I've thought of adding forum-based filtering, would that help?
Dunno...

The previous solution, del.icio.us, you recommended to my request is so brilliant that I'm sure you'll provide something equally stunning.

Thanks for the great forum.

User avatar
HB
Admin
Posts: 22031
Joined: 19 years ago

#4: Post by HB »

In terms of filtering, I think along the lines of filtering entire forums (e.g., if you're not a homeroaster, you may choose to skip all posts in that forum), or filtering/highlighting particular users. phpBB 3.0 has the notion of "friends and foes"; you can select board members whose posts will have special highlighting so you won't miss them, and others whose posts will not be shown (the same feature prevents said persons from sending you PMs).

I really like the remembered unread topics because I can never read all posts in one sitting (before this modification, all topics were marked as read on logout). One drawback is that you must explicitly request topics be marked unread, which can be tiresome if there's an entire forum you wish to "ignore".

I'll keep this one in mind while I follow how well phpBB V3's release candidates progress.
Dan Kehn

User avatar
cafeIKE (original poster)
Posts: 4726
Joined: 18 years ago

#5: Post by cafeIKE (original poster) »

Bump. :x :evil: :twisted:

Would be most useful to exclude some threads from View EVER !!!

Top current candidate How many tampers do you own?

geoffbeier
Posts: 151
Joined: 15 years ago

#6: Post by geoffbeier »

I've considered this before, but never been so annoyed as to act. Seeing this thread made me think of it again, and it's actually not too hard to address this in your browser, assuming you're using firefox with greasemonkey or some compatible way of running userscripts. (I've heard that there are compatible things for other browsers but I've never investigated.)

To start with, here's my script:
// ==UserScript==
// @name           H-B Helper
// @namespace      geoff.mollyandgeoff.com
// @description    Topic ignore feature for home-barista. Based on PhpBB enhancer from Alekc (http://userscripts.org/scripts/show/57924)
// @author         geoff@mollyandgeoff.com
// @version        1.0.1
// @include        /*
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==

var phpbb_prefs;
var debug = false;

debugLog("Begin userscript execution");

jQuery(document).ready(function() {
	try{
	debugLog("Ready");
    if (jQuery("body#phpbb").length != 1){
		debugLog("This isn't even a phpBB forum.");
        return false;
    }
    
	debugLog("Initializing JQuery");
    var $j = jQuery.noConflict();
    var regex = /t=(\d+)/g;

	debugLog("Loading blocked thread list");
    phpbb_prefs = eval(GM_getValue("hb_helper_prefs" + jQuery(document).attr("domain"),{hiddenTopics:{}}));
    GM_log(phpbb_prefs.toSource());

	debugLog("Searching for threads");
    $j("li.row").each(function(){
        var topicId = $j(this).find("a.topictitle").attr("href").match(/t=(\d+)/);
        if(topicId == null) {
	        topicId = $j(this).find("a.topictitle").attr("href").match(/-t(\d+)\.html/);
		}
        debugLog(topicId);
        if (phpbb_prefs.hiddenTopics[topicId[1]] == true){           
            $j(this).hide();
        } else {
            $j(this).find("dt").css("position","relative").append("<div style='position:absolute;top:0px;right:0px;'><a class='pbe' href='" + topicId[1] + "' title=\"Ignore this thread\">[x]</a></div>");
        }
    });

    $j("a.pbe").click(function(e){
        try{
            $j(this).parents("li").hide("slow");

            phpbb_prefs.hiddenTopics[$j(this).attr("href")] = true;
            GM_setValue("hb_helper_prefs" + jQuery(document).attr("domain"), phpbb_prefs.toSource());
        } catch (err){GM_log(err.toSource());}
        return false;
    });
	} catch (err){GM_log("Fatal exception inspecting topic:" + err.toSource());}
});

function debugLog(msg){
	if (debug){
		GM_log("H-B Helper: " + msg);
	}
}
Edit: minor revision to make description/credit clearer, add tooltip to "x" on topics

It's completely derived from this script, with a few changes. Main changes: accommodate specific differences between the author's target and H-B, a couple changes to help me understand the script, log messages -> english, and not require an image from some 3rd party server in order to run. I also chose a new namespace so anyone running this and the original won't see a conflict and changed the authorship info (leaving in a credit) so anyone who looks for help won't bother the original author with my changes.

For ease of installation, I've placed a copy of the above on my server. Users with greasemonkey installed can click here to install the script. Obviously, inspect the source. It's the same as what I posted in this post. You can also copy and paste that into a file that ends in .user.js then open it in firefox to install from a local source if that makes you more comfortable. (Dan, if you want to host a copy locally, let me know and I'll edit this post to point to your copy instead.)

Once installed, topic listings will look like this:

Clicking that new little X will cause the topic to disappear and prevent it from being listed in future visits (from the same browser, anyway).

Hidden topics are stored locally in your user preferences for Firefox. If you've hidden one in error, or just want to clear out your list, you can enter "about:config" in your location bar, click through the warning about voiding your warranty, filter on hb_helper and edit the list.


It's also completely safe to right-click that value and choose "reset" to unblock all topics.

Let me know if you find this useful, think it's a terrible idea, see any bugs or just have any suggestions. And please report don't bother the original author about anything; it's practically certain that any bugs here are mine, not his 8)

User avatar
cafeIKE (original poster)
Posts: 4726
Joined: 18 years ago

#7: Post by cafeIKE (original poster) »

Awesome !!!

When I get back to LA, going to implement ASAP

10^6 thanks

jannar85
Posts: 1
Joined: 14 years ago

#8: Post by jannar85 »

Hi. Just wanted to say thanks for that script. It works good on other forums too. But you know why some boards don't have the x ? Is there anything wrong with the script?

For the bumping, sorry. I just wanted to show some appreciation.

User avatar
Compass Coffee
Posts: 2844
Joined: 19 years ago

#9: Post by Compass Coffee »

Nothing to add, just NOT Ignoring This Thread! :D (While taking a break from taste testing some new espresso blends under development....)
Mike McGinness

geoffbeier
Posts: 151
Joined: 15 years ago

#10: Post by geoffbeier »

jannar85 wrote:Hi. Just wanted to say thanks for that script. It works good on other forums too. But you know why some boards don't have the x ? Is there anything wrong with the script?

For the bumping, sorry. I just wanted to show some appreciation.
Glad you like it. I'll send you a PM about the other boards so we don't keep bumping this thread with offtopic discussion :)

Post Reply