New "Popular recent threads" plugin [renamed to "Active Threads"]

18 Replies, 2380 Views

[ETA: note that in response to the discussion further down in this thread, I renamed this plugin from "Popular recent threads" to "Active threads", and have indicated in this opening post the changes to links that have needed to be made]

In the Idea for a news page in the Wiki section thread, Chris asked:

(2020-01-14, 07:51 AM)Chris Wrote: Would there be an easy way of identifying which threads had most comments during the previous week or fortnight?

I couldn't think of a way to do this through our forum's existing web interface, so I wrote a little plugin to do it, which I've named the "Popular recent threads" plugin. Over the course of a day or two, I've enhanced it so that it now supports a fairly helpful set of features. Other than providing a means for Chris and others to identify which threads have been posted to most over the previous week or fortnight, it can be used for another purpose which I'm very pleased with, because it's bugged me that it's been missing from our MyBB forum software until now.

That purpose is listing in order the most recent post to the most-recently responded-to threads going back a given (and arbitrarily long) period of time. Until now, when logged in, we have had only:
  • The "View New Posts" link, which only shows the most recent posts that have been made since one's last visit - but this is of no use if one wants to dig back further than one's last visit in order.
  • The "View Unread Posts" link, which shows the most recent posts that one has not yet clicked on and loaded (a proxy for having "read" the post(s) in question) - but again, once one has read the posts, there's no way to go back and view the ordered listing.
  • The "View Today's Posts" link, which lists the posts from the past 24 hours - but again, this is of no use if you want to go back further than 24 hours.
  • The "Portal" link, which lists only the most recent opening posts from threads, without regard for any later posts.

Anonymous (non-logged in) users had been left with even fewer options: only the "Portal" link.

The way the plugin I've written supports this function is that it allows for its "Latest post during this period" column to be sorted in descending order: that is, it allows for the ordering of threads by date of latest post to each thread, in order from most recent to earliest. Perhaps the easiest way to demonstrate is by example:

If you click on this link  this link, you will be presented with a listing of threads which have had posts made to them within the past two days (whatever the time happens to be). The threads are ordered in descending order of the date of the most recent post made to them. You can also see the earliest post made to each thread within the past two days, and you can sort by that column if you prefer (just click on the column heading). (Incidentally, there is one other sortable column: that labelled "Number of posts during this period").

I implemented the sorting feature by mimicking the way that the Member listing page supports it.

If you want to arrive at the same link as in that example above manually, here are the steps:

  1. Click on the View Threads by Popularity View Active Threads link in the header. This is the entry point to the plugin's output page.
  2. Once on that page, scroll down to the bottom where there is a section heading "Set the period of interest". Change "Days" to "2", and set "Sort by" to "descending" and "Sort by: date of latest post".
  3. Click "Go".

Alternatively, at step two, skip the final part (setting the "Sort by" fields), and, after step three, when the page reloads, click the "Latest post during this period" column heading, which will sort that column in descending order.

This page is available to anonymous viewers too, so hopefully it enables easier browsing of the forum for non-members. And as a bonus, the plugin adds support for the "View Today's Posts" link for anonymous viewers.

Please let me know of any comments, questions, suggestions, criticisms, etc that you might have about this plugin. I hope that it's useful to you guys, as I suspect it will be for me.
(This post was last modified: 2021-04-20, 01:52 PM by Laird.)
[-] The following 1 user Likes Laird's post:
  • Typoz
Thanks. As well as being exactly what I wanted for purposes of the news page, it is very useful to be able to see a list of active threads within a specified period.

I had just a couple of small queries/suggestions:
(1) The "Before this date-time" option  is also useful, if one wants to look at a particular period in the past. I managed to find the last fortnight on 2019 by putting in a date in MM-DD-YYYY format, but wasn't able to figure out the time format. Not that people will often want the time format, but maybe it would be useful to indicate the required date format in case people don't find it obvious.
(2) It does a lot more than "View Threads by Popularity," so would it be better to call it "View Recent Threads" or something?
[-] The following 1 user Likes Guest's post:
  • Laird
I was wondering whether "View Threads by Popularity" might be better to use the word 'active' or 'most active' rather than 'popular'.

Perhaps the ability to specify the number of seconds is a bit of an overkill?
(This post was last modified: 2020-01-15, 02:53 PM by Typoz.)
[-] The following 1 user Likes Typoz's post:
  • Laird
(2020-01-15, 02:36 PM)Chris Wrote: Thanks. As well as being exactly what I wanted for purposes of the news page, it is very useful to be able to see a list of active threads within a specified period.

I had just a couple of small queries/suggestions:
(1) The "Before this date-time" option  is also useful, if one wants to look at a particular period in the past. I managed to find the last fortnight on 2019 by putting in a date in MM-DD-YYYY format, but wasn't able to figure out the time format. Not that people will often want the time format, but maybe it would be useful to indicate the required date format in case people don't find it obvious.

Ah. Thanks for that feedback. I added a "title" attribute to both the label and input box for that option, which reads 'Use a recognisable format such as "2019-01-15 13:08", or leave blank to indicate "now".', but its visibility depends on the user hovering his/her mouse pointer over the option for long enough for it to pop up, which it seems, given that you appear not to have seen it, to be a dependency that is unlikely in practice to be satisfied. I will try to come up with another way to provide that information.

(2020-01-15, 02:36 PM)Chris Wrote: (2) It does a lot more than "View Threads by Popularity," so would it be better to call it "View Recent Threads" or something?

Mmm. Again, thank you for your feedback. I think perhaps Typoz is onto something with his suggestion of the word "Active" rather than "Popular". "Recent" - which is what I am currently using in the plugin's name - mistakenly implies that the "Before this date-time" field must be "Now", which is not necessarily true, even though it is likely to be the most common use case.
(2020-01-15, 02:49 PM)Typoz Wrote: I was wondering whether "View Threads by Popularity" might be better to use the word 'active' or 'most active' rather than 'popular'.

As I've just written in response to Chris, I like this suggestion. I think I'll go with it.

(2020-01-15, 02:49 PM)Typoz Wrote: Perhaps the ability to specify the number of seconds is a bit of an overkill?

Heh. Yes, probably. But now that it's there, should I take it out? ("Seriously, yes, Laird" is a valid answer, btw).
[-] The following 1 user Likes Laird's post:
  • Typoz
(2020-01-15, 03:16 PM)Laird Wrote: Heh. Yes, probably. But now that it's there, should I take it out? ("Seriously, yes, Laird" is a valid answer, btw).
I'm grateful for your efforts, so anything I say is a mere observation, not a definite preference. It was an open question mostly about how useful it might be in practice.
[-] The following 1 user Likes Typoz's post:
  • Laird
(2020-01-15, 03:13 PM)Laird Wrote: I will try to come up with another way to provide that information.

See if you think what I've added would have helped you in the first place, Chris. (An asterisked footnote).
(2020-01-15, 03:21 PM)Typoz Wrote: It was an open question mostly about how useful it might be in practice.

And you're right: in practice, it is unlikely to be useful on even the most populous of MyBB boards. I should probably take it out; I just have this reservation (probably irrational; something vaguely like a sunk costs fallacy) about removing functionality once it's in place.
[-] The following 1 user Likes Laird's post:
  • Typoz
(2020-01-15, 03:39 PM)Laird Wrote: And you're right: in practice, it is unlikely to be useful on even the most populous of MyBB boards. I should probably take it out; I just have this reservation (probably irrational; something vaguely like a sunk costs fallacy) about removing functionality once it's in place.
I was thinking in terms of a different type of cost - the ease-of-use for those unfamiliar with a page layout might depend on keeping things more simple. I'm not insisting mind you, just floating ideas around for others to consider too.
[-] The following 1 user Likes Typoz's post:
  • Laird
(2020-01-15, 03:13 PM)Laird Wrote: Ah. Thanks for that feedback. I added a "title" attribute to both the label and input box for that option, which reads 'Use a recognisable format such as "2019-01-15 13:08", or leave blank to indicate "now".', but its visibility depends on the user hovering his/her mouse pointer over the option for long enough for it to pop up, which it seems, given that you appear not to have seen it, to be a dependency that is unlikely in practice to be satisfied. I will try to come up with another way to provide that information.


Mmm. Again, thank you for your feedback. I think perhaps Typoz is onto something with his suggestion of the word "Active" rather than "Popular". "Recent" - which is what I am currently using in the plugin's name - mistakenly implies that the "Before this date-time" field must be "Now", which is not necessarily true, even though it is likely to be the most common use case.

Thanks - the footnote helps. I think I must have been blind to the "tool tip" or whatever it's called, that appeared when I hovered.

That's true about "recent." Really what I was getting at was that it was a way of viewing threads over a selected period, and that popularity (or rather activity, as Typoz pointed out) was just one way of ordering them. But maybe that's difficult to put into a nutshell.
[-] The following 1 user Likes Guest's post:
  • Laird

  • View a Printable Version
Forum Jump:


Users browsing this thread: 4 Guest(s)