[AddonsLab] Post Limit Per Node

[AddonsLab] Post Limit Per Node 2.7.0

No permission to download
Oh, there is another problem:

It count and limit on every node, the setting "Node-based check ID list" is not effect.

Seems to work just fine for us. Here is a screenshot from the local board, showing the same user not being able to post in one forum (a forum NOT listed in node-based check) due to passing the limit of posts, and on the left side the same user can post in another forum, which is listed in the option, and user has 0 posts in that forum (therefore can make another post):

Screenshot at Jan 29 16-27-50.webp

Please make sure your setup is correct and the behavior you observe is not caused by some misconfiguration (e.g. the user you are using to test belongs to two usergroups and the actual limits applied are not as you expect).

Thank you!
 
Seems to work just fine for us. Here is a screenshot from the local board, showing the same user not being able to post in one forum (a forum NOT listed in node-based check) due to passing the limit of posts, and on the left side the same user can post in another forum, which is listed in the option, and user has 0 posts in that forum (therefore can make another post):

View attachment 167689

Please make sure your setup is correct and the behavior you observe is not caused by some misconfiguration (e.g. the user you are using to test belongs to two usergroups and the actual limits applied are not as you expect).

Thank you!

Exactly in my case. User are in two usergroups. I set for permission on one, and the other doesn't set any.

This is my setting at Options:
Screen Shot 2018-01-30 at 10.56.50.webp

Permission on one group permissions:

Screen Shot 2018-01-30 at 10.57.58.webp

And the remain:

Screen Shot 2018-01-30 at 10.57.35.webp

And I got the error: User could not create thread or replies on any node after use all quota in my permission settings.

How to correct them? Thanks!
 
I think the code is wrong in logic:

Code:
    public function getAllThreads($nodeId, $userId, $threadTimeLimit)
    {
        $finder = $this->finder('XF:Thread')
            ->where('user_id', $userId)
            ->where('post_date', '>', $threadTimeLimit)
            ->order('post_date', 'ASC');

        if ($this->_nodeIsNodeBasedLimited($nodeId)) {
            /** @var \XF\Finder\Thread $finder */
            $finder->where('node_id', $nodeId);
        }

        return $finder->fetch();
    }

    /**
     * @param $nodeId
     * @param $userId
     * @param $postTimeLimit
     * @return \XF\Mvc\Entity\ArrayCollection | Post[]
     */
    public function getAllPosts($nodeId, $userId, $postTimeLimit)
    {
        $finder = $this->finder('XF:Post')->with('Thread')
            ->where('user_id', $userId)
            ->where('post_date', '>', $postTimeLimit)
            ->order('post_date', 'ASC');

        if ($this->_nodeIsNodeBasedLimited($nodeId)) {
            $finder->where('Thread.node_id', $nodeId);
        }

        return $finder->fetch();
    }

It should be like that

Code:
    public function getAllThreads($nodeId, $userId, $threadTimeLimit)
    {
        if ($this->_nodeIsNodeBasedLimited($nodeId)) {
            $finder = $this->finder('XF:Thread')
                ->where('user_id', $userId)
                ->where('post_date', '>', $threadTimeLimit)
                ->where('node_id', $nodeId)
                ->order('post_date', 'ASC');
            return $finder->fetch();
        }
        return array();
    }

    /**
     * @param $nodeId
     * @param $userId
     * @param $postTimeLimit
     * @return \XF\Mvc\Entity\ArrayCollection | Post[]
     */
    public function getAllPosts($nodeId, $userId, $postTimeLimit)
    {
        if ($this->_nodeIsNodeBasedLimited($nodeId)) {
            $finder = $this->finder('XF:Post')->with('Thread')
                ->where('user_id', $userId)
                ->where('post_date', '>', $postTimeLimit)
                ->where('Thread.node_id', $nodeId)
                ->order('post_date', 'ASC');
            return $finder->fetch();
        }
        return array();
    }
 
Last edited:
Hello!

Thank you for the code snippet. It is not correct to wrap the entire them in "_nodeIsNodeBasedLimited" as it would return nothing for any forums, which are not limited with per-node option.

Based on your configuration, here is the way I would expect the product to work (assuming the permissions above are on usergroup level, and not in Node Permissions limited to just one node):

1. Go to any forum except 48 and 37.
2. Make two replies, and for the third one, you will see the message, saying you can not post.
3. Go to forum 48, and you will see you still can post a reply. Post two replies, and you will get the error there as well.
4. Go to forum 37, and again, you will see you can still post two replies.

So, the meaning of the option is that if the node is listed in the option, only posts made in that node are counted when deciding the limits.

Please let us know if you still have the issue. Feel free to contact us at https://customers.addonslab.com/submitticket.php and we will keep troubleshooting the issue there.

Thank you!
 
That's mean there are some settings on Node Permission. I did not check node permission, so maybe this is the reason I got un-wanted issue.

As my understanding, I think that the counting and permission is counted only at the forum in the settings.

Any forum except 48 and 37, user could create and reply many as they want. Am I right?
 
That's mean there are some settings on Node Permission. I did not check node permission, so maybe this is the reason I got un-wanted issue.

As my understanding, I think that the counting and permission is counted only at the forum in the settings.

Any forum except 48 and 37, user could create and reply many as they want. Am I right?

No, setting the permissions in Usergroups page sets the permission for all nodes. The option field just changes the way number of posts is counted - does the limit apply based on ALL posts user had in last let's say 24 hours, or based on posts only in the current forum.

So, if you want to apply the permission check to forums 48 and 37, and allow unrestricted access to all other forums, set 0 for the permissions in Usergroups page and set the permissions you need under Node Permission page, for each node separately.

Thank you!
 
Thanks so much for your detail explain. I will follow your instruction. However, I tried to modify your code and it runs as I wanted :D
 
Thanks so much for your detail explain. I will follow your instruction. However, I tried to modify your code and it runs as I wanted :D

No problem! Yes, it is just because your modifications basically turns off the add-on for any forum except 48 and 37, which is practically the behavior you need now.
 
What we'd like is to be able to limit the number of open threads in specific nodes based on usergroup. Is this something this can do (or might be able to do in the future)?

Might be out of the scope of this addon, but since it's similar, I figured I'd ask :)
 
What we'd like is to be able to limit the number of open threads in specific nodes based on usergroup. Is this something this can do (or might be able to do in the future)?

Might be out of the scope of this addon, but since it's similar, I figured I'd ask :)

It is not supported in the add-on now. Unfortunately, we do not have much time now to continue building new features for this add-on. If you are interested in the implementation of this feature as a funded project, please contact us https://customers.addonslab.com/submitticket.php and we can discuss the terms.

Thank you!
 
Hello if I pass in 2.0 I must also redownload the addon in 2.0? or will it update from version 1.5? the case and it possible to save its configuration? before updating
 
Hello, @beepdotpw !

We didn't test the update of product from 1.x to 2.x version, will do so and confirm here, if the settings are kept. Anyway, after update you have to download the 2.x compatible version of the add-on, and install it just like any other XenForo 2.x product.

Thank you!
 
AddonsLab updated [AddonsLab] Post Limit Per Node with a new update entry:

Version update

With this release, we have just updated the version of the product 2.x to allow upgrading from 1.x version to 2.x without losing usergroup permission settings.

Simply upload the files form this package and you can find the add-on under upgradable XenForo 1.x add-ons. Running the update will enable the add-on and will keep usergroup permissions you had setup in XenForo 1.x

Feel free to report any issues you have and they will be addressed asap.

Please consider posting a review if you are...

Read the rest of this update entry...
 
Hello if I pass in 2.0 I must also redownload the addon in 2.0? or will it update from version 1.5? the case and it possible to save its configuration? before updating

Just tested 1.x to 2.x upgrade, applied a fix and released the 2.x version now. In our test it does keep product settings and usergroup configuration.

Just let us know if you have any other questions.

Thank you!
 
Ah this might be the solution I need to work around this request

Could this do the following
  • Have, say no more than one thread a week if someone only has 50 posts and within a user group
  • If someone is part of an upgraded user group, say 100 posts, this addon will then allow them to post 2 threads per week?
 
Ah this might be the solution I need to work around this request

Could this do the following
  • Have, say no more than one thread a week if someone only has 50 posts and within a user group
  • If someone is part of an upgraded user group, say 100 posts, this addon will then allow them to post 2 threads per week?

The product handles usergroup permissions just as you described, it can limit the number of posts/thread in any given time interval. Using usergroup promotions allows to assign users to different usergroups based on number of posts they have, so the scenario described should work.

Just let us know if you need anything else.

Thank you!
 
@AddonsLab it is good but it will become great if you can add extra a option so it can limit post threads/links/images base on post count ( number of replies) when a member has enough replies they can post a new thread or adding links/image.
 
@AddonsLab it is good but it will become great if you can add extra a option so it can limit post threads/links/images base on post count ( number of replies) when a member has enough replies they can post a new thread or adding links/image.

Limiting the number of links/images posted is out of the scope if the add-on and would require a completely different approach, in case we get some time, we will develop it as a separate add-on, but no ETA for now. And as mentioned in the post above, limits based on post count can easily be achieved by setting up usergroup promotions to change user's user usergroup based on their post count, and configure different usergroups with different limits.

Thank you!
 
we will develop it as a separate add-on, but no ETA for now

I am expecting to use this your addon soon :)

Thanks!

And as mentioned in the post above, limits based on post count can easily be achieved by setting up usergroup promotions to change user's user usergroup based on their post count, and configure different usergroups with different limits.

I knew this but I don't like using it or don't use it on my forum because as I know it runs via a cron job. I like the function to notice the user when they submit their posts/threads immediately.
 
I see what you mean. The possible fix in this case would be to ensure, that user's usergroup changes immediately, when their post count changes. I am not completely sure, how this works now, but even if it is not like that, it could be implemented. Feel free to contact us at https://customers.addonslab.com/submitticket.php if you need a custom solution for this.

Thank you!
 
Top Bottom