View New Subscribed Posts
Author Message
This is a simple plugin which adds a new link, next to the "View New Posts" link in the header, which will show all new posts since the user's last visit, but only those in threads they have subscribed to.
This can be useful, say, when combined with setting the default subscription mode for threads, for users to view updates to threads they've posted in.

If you have a modified header_welcomeblock_member template, the plugin may not be able to perform the correct modifications, so you may need to edit that template yourself.  The link for viewing new subscribed threads is:

Code:
search.php?action=getnew&subscriptionsonly=1

(replace "&" with "&" if putting in template)

This plugin will actually also filter for today's posts as well (but won't put a link for it)

Code:
search.php?action=getdaily&subscriptionsonly=1




Issues
  • Known problem with merging threads - see here for a solution
  • Small issue: this plugin uses a nested sub-query to do its work, as it's much easier to develop than a complex hack to get a joined query.  This may have a slight impact on performance, but I doubt it'll be much.
    Googling "mysql sub-query vs join performance" seems to show some people condemning sub-queries, with others saying the difference is practically nothing.
    The plugin uses a query similar to the following:

    SQL Code
    SELECT t.tid FROM mybb_threads t WHERE t.lastpost >='9999999' AND tid IN (SELECT tid FROM mybb_threadsubscriptions WHERE uid=1) AND t.visible>-1 AND t.closed NOT LIKE 'moved|%'

    as opposed to something like

    SQL Code
    SELECT t.tid FROM mybb_threads t LEFT JOIN mybb_threadsubscriptions s ON s.tid=t.tid WHERE t.lastpost >='9999999' AND t.visible>-1 AND t.closed NOT LIKE 'moved|%' AND s.uid=1

  • This plugin will add a unique index to the threadsubscriptions table, to try to help lessen the impact of the above mentioned speed reduction.  Ideally, MyBB should've included this key for data integrity reasons, but they didn't.  As such, the plugin needs to check for duplicates in the table before adding the index, and, if any are found, it will remove the duplicates.  If you don't want this, you can stop it by opening up the plugin file and deleting the line:

    PHP Code:
    define('LATESTSUBSCRIBE_ADD_INDEX', 1);

  • Queries used in this plugin probably only with with MySQL(i)
(This post was last modified: 12-08-2014 08:27 PM by ZiNgA BuRgA.)
Find all posts by this user
Quote this message in a reply
Download: latestsubscribe.php (3.64 KB)
Plugin Version: 1.1
Last Updated: 12-08-2014, 08:27 PM

Downloads: 837
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: WTFPLv2
Uploader: ZiNgA BuRgA
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #11
RE: View New Subscribed Posts
That's interesting...  Well, that certainly wasn't intentional, lol, but thanks Smile

My Blog
07-06-2010 09:16 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #12
RE: View New Subscribed Posts
v1.1: MyBB 1.8 compatibility

My Blog
12-08-2014 08:27 PM
Find all posts by this user Quote this message in a reply


Forum Jump: