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: 798
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: WTFPLv2
Uploader: ZiNgA BuRgA
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: View New Subscribed Posts
It will make us easier to "track" our Subscribed Threads. Thank you very much, Yumi Smile

06-21-2010 05:20 AM
Find all posts by this user Quote this message in a reply
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #3
RE: View New Subscribed Posts
Great, another Yumi!!! plugin!
Something I can use right away, too.  Smile
Thanks so much...

(06-20-2010 12:24 PM)ZiNgA BuRgA Wrote:  Queries used in this plugin probably only with with MySQL
Safe to assume this includes MySQLi?
07-03-2010 03:59 PM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #4
RE: View New Subscribed Posts
Very nice.

[Image: logo.png]

[Image: twitter.png]
07-03-2010 05:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #5
RE: View New Subscribed Posts
(07-03-2010 03:59 PM)Firefox Wins Wrote:  Safe to assume this includes MySQLi?
Yeah, they're actually the same thing (just a different driver).

My Blog
07-03-2010 06:16 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: View New Subscribed Posts
Found an issue with merging threads.  If MyBB decides to fix this, that'd be good, otherwise, you can do the following code modification (only works with MySQL(i)):
In inc/class_moderation.php, find:

PHP Code:
$db->update_query("threadsubscriptions", $sqlarray, "tid='{$mergetid}'");

Replace with:

PHP Code:
$db->write_query("UPDATE IGNORE ".TABLE_PREFIX."threadsubscriptions SET tid=$tid WHERE tid='{$mergetid}'");
$db->delete_query("threadsubscriptions", "tid='{$mergetid}'");

Note, this fix is not compatible with any fix MyBB issues (unless they decide to place a unique index on tid,uid as suggested in the bug report).


My Blog
(This post was last modified: 07-04-2010 08:34 PM by ZiNgA BuRgA.)
07-04-2010 08:33 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #7
RE: View New Subscribed Posts
Just a small issue, but the header on the downloads template (as used in this thread) is breaking the forum layout. I see the first two code blocks are not getting the frame and so its stretching the forum layout (I have a smallish screen)


[Image: leelink.gif]
MYBB1.6 & XThreads
07-04-2010 10:04 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #8
RE: View New Subscribed Posts
(07-04-2010 10:04 PM)leefish Wrote:  Just a small issue, but the header on the downloads template (as used in this thread) is breaking the forum layout. I see the first two code blocks are not getting the frame and so its stretching the forum layout (I have a smallish screen)

I think it fixed now.

07-05-2010 09:26 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #9
RE: View New Subscribed Posts
Hmm, I've been struggling on getting the CSS right for the code boxes - I'm pretty hopeless at that.  Looks like RateU has done his magic and fixed it Smile  What did you change, by the way?  I suspect this is an issue with my syntax highlighter plugin.

My Blog
(This post was last modified: 07-05-2010 12:08 PM by ZiNgA BuRgA.)
07-05-2010 12:07 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #10
RE: View New Subscribed Posts
I changed .codeblock code class to maximum width 400px. I set it 600px before.

I don't want to call it as an issue, Yumi. I prefer to call it as "easter egg" with your Syntax Highlighter plugin. It will make a different layout if we did it with standard MyBB syntax highlighter Biggrin

07-06-2010 01:42 AM
Find all posts by this user Quote this message in a reply


Forum Jump: