[TH] Ignore More [Deleted]

upload_2014-6-30_17-29-4-png.122524


Can the option to select forums like this be disabled? I like the plugin but would like to disable this feature.
 
Hi...

My members surely like this add-on. However, they do not like it being in the main menu bar at the top as it makes the menu bar too long with Threads You Ignore & Forums You Ignor at the end of it. (Especially for mobile users.)

Seeing these two options are NOT used a lot. Can they PLEASE be moved, or give us the option, to have them inside the user Drop Down control panel. It makes much more sense to have the in that area as, as mention, those two options are not used a lot.

I also agree with CHCKED By Default as that is they reason you are clicking it anyway.

Thank you.
 
Is there a way to restrict this to certain forums? Thanks.
Hello @MikesSite,

I am sure that you can set user group permissions for each forum in the forum category menu which would only allow users with said permissions assigned to ignore such forums selected. If you have any issues setting this up please do not hesitate to reply to this post.
 
Hello @MikesSite,

I am sure that you can set user group permissions for each forum in the forum category menu which would only allow users with said permissions assigned to ignore such forums selected. If you have any issues setting this up please do not hesitate to reply to this post.
Thanks for the reply. I'm not 100% sure what you mean, but I need the ability to exclude certain forums from being able to be ignored.
 
Are there any plans to update this add-on? Ignored forums aren't respected in the forum sidebar widget, nor are they respected in widget framework widgets. Ignored threads are, but the number of "New Posts" in the sidebar widget is simply reduced rather than other posts being added in the ignored posts place. The functionality just isn't consistent.
 
Suggestion: In addition to "left" and "right" placements for the ignored threads/forums, how about "none". The entire reason I want the ability to ignore forums is people who find stuff upsetting and have a hard time not checking up on it. (Mental health recovery forums have weird problems, I know.) So, having entries for those in navigation is really counterproductive... And also breaks the display for people on mobile.
 
Our server was getting an error "Too many connections" and the site went down for about 15 minutes.

Got this email from our server support team:


upload_2017-5-25_12-46-10.webp

This is the offending code:

(in Class ThemeHouse_IgnoreMore_Extend_XenForo_Model_Thread -> getThreadIdsIgnoredByUser() )

Code:
                SELECT thread.thread_id
                        FROM xf_thread AS thread
                LEFT JOIN xf_thread_ignore_th AS thread_ignore ON
                    (thread.thread_id = thread_ignore.thread_id AND thread_ignore.user_id = '0')
                LEFT JOIN xf_forum_ignore_th AS forum_ignore ON
                    (thread.node_id = forum_ignore.node_id AND forum_ignore.user_id = '0')

Any thoughts on how this can be improved?

EDIT: Looks like this happens when the user isn't logged in. Maybe check for the user's ID > 0 before executing that query?
 
Our server was getting an error "Too many connections" and the site went down for about 15 minutes.

Got this email from our server support team:


View attachment 152809

This is the offending code:

(in Class ThemeHouse_IgnoreMore_Extend_XenForo_Model_Thread -> getThreadIdsIgnoredByUser() )

Code:
                SELECT thread.thread_id
                        FROM xf_thread AS thread
                LEFT JOIN xf_thread_ignore_th AS thread_ignore ON
                    (thread.thread_id = thread_ignore.thread_id AND thread_ignore.user_id = '0')
                LEFT JOIN xf_forum_ignore_th AS forum_ignore ON
                    (thread.node_id = forum_ignore.node_id AND forum_ignore.user_id = '0')

Any thoughts on how this can be improved?

EDIT: Looks like this happens when the user isn't logged in. Maybe check for the user's ID > 0 before executing that query?
Update released and it will not trigger that query unless the user is logged in :)

If it's simply related to performance (I haven't seen any issues currently on my end but each situation is different) I'll see about changing it.
 
The query was taking so long with userId = 0 that it was opening connections and not closing them fast enough, resulting in too many connections on the server. Obviously, any efficiency improvements would be greatly appreciated, as we have thousands of active users every day.

These two blocks are slightly concerning, as they don't seem to take whether the user is logged in into account, either before calling `getThreadIdsIgnoredByUser()`, but I'm not sure if/when this is invoked:


PHP:
    public function getUnreadThreadIds($userId, array $fetchOptions = array(), $watchedOnly = false)
    {
        $unreadThreadIds = parent::getUnreadThreadIds($userId, $fetchOptions, $watchedOnly);
       
        $xenOptions = XenForo_Application::get('options');
       
        if ($xenOptions->th_ignoreMore_newPostsShowIgnoredContent) {
            return $unreadThreadIds;
        }
       
        $ignoredThreadIds = $this->getThreadIdsIgnoredByUser($userId);
       
        return array_diff($unreadThreadIds, $ignoredThreadIds);
    }

    public function getThreadIdsIgnoredByUser($userId)
    {
        return $this->_getDb()->fetchCol(
            '
                SELECT thread.thread_id
                FROM xf_thread AS thread
                LEFT JOIN xf_thread_ignore_th AS thread_ignore ON
                    (thread.thread_id = thread_ignore.thread_id AND thread_ignore.user_id = ?)
                LEFT JOIN xf_forum_ignore_th AS forum_ignore ON
                    (thread.node_id = forum_ignore.node_id AND forum_ignore.user_id = ?)
                WHERE thread_ignore.ignore_new_posts = 1 OR forum_ignore.ignore_new_posts = 1
            ', array(
                $userId,
                $userId
            ));
    }

I would suggest initializing $ignoredThreadIds as an empty array, checking for if($userId), then calling getThreadIdsIgnoredByUser if true. Then you could compare the empty array to the $unreadThreadIds array. Does that make sense, or is that unnecessary?
 
The query was taking so long with userId = 0 that it was opening connections and not closing them fast enough, resulting in too many connections on the server. Obviously, any efficiency improvements would be greatly appreciated, as we have thousands of active users every day.

These two blocks are slightly concerning, as they don't seem to take whether the user is logged in into account, either before calling `getThreadIdsIgnoredByUser()`, but I'm not sure if/when this is invoked:


PHP:
    public function getUnreadThreadIds($userId, array $fetchOptions = array(), $watchedOnly = false)
    {
        $unreadThreadIds = parent::getUnreadThreadIds($userId, $fetchOptions, $watchedOnly);
      
        $xenOptions = XenForo_Application::get('options');
      
        if ($xenOptions->th_ignoreMore_newPostsShowIgnoredContent) {
            return $unreadThreadIds;
        }
      
        $ignoredThreadIds = $this->getThreadIdsIgnoredByUser($userId);
      
        return array_diff($unreadThreadIds, $ignoredThreadIds);
    }

    public function getThreadIdsIgnoredByUser($userId)
    {
        return $this->_getDb()->fetchCol(
            '
                SELECT thread.thread_id
                FROM xf_thread AS thread
                LEFT JOIN xf_thread_ignore_th AS thread_ignore ON
                    (thread.thread_id = thread_ignore.thread_id AND thread_ignore.user_id = ?)
                LEFT JOIN xf_forum_ignore_th AS forum_ignore ON
                    (thread.node_id = forum_ignore.node_id AND forum_ignore.user_id = ?)
                WHERE thread_ignore.ignore_new_posts = 1 OR forum_ignore.ignore_new_posts = 1
            ', array(
                $userId,
                $userId
            ));
    }
It's invoked in the same class so just search for `getThreadIdsIgnoredByUser` and you'll see it's now only doing it if there's a user ID present :)
 
I saw that change, and appreciate that! I was wondering about the function `getUnreadThreadIds()`. I guess that's not invoked by XenForo itself? I'm fairly new to MVC and PHP in general, so sometimes I don't understand what I'm reading!
 
I saw that change, and appreciate that! I was wondering about the function `getUnreadThreadIds()`. I guess that's not invoked by XenForo itself? I'm fairly new to MVC and PHP in general, so sometimes I don't understand what I'm reading!
Yeah it's not invoked by XenForo but a custom method (you can tell by the XFCP in the class extender and if it's calling the parent method using parent::<methodName> if it's modifying a XenForo add-on).
 
Top Bottom