Post Limit Per Node by AddonsLab

Post Limit Per Node by AddonsLab 1.6.1

No permission to download
Those are indeed many nested conditionals.
Is this code suited for highly active big boards?
It does seem to me that there has to be a simpler way to approach this.
 
Those are indeed many nested conditionals.
Is this code suited for highly active big boards?
It does seem to me that there has to be a simpler way to approach this.

Yes, the conditions are to take care of all possible cases including singular/plural. If you don't need all the cases, feel free to remove them and put your message. Anyway, this template is used and will always be used just to show this message, so you don't need to worry about compatibility with further versions of the add-on.

The add-on is not specifically tested on a large board by us, but we did not get any reports about performance issues. The add-on is coded with performance in mind, it does one single query which uses indexes each time a forum or thread page loads to check for user's permission to see the new thread/reply buttons. The query is done only if user has permission to post otherwise and if there is some limit configured for the current forum.

I am not sure about which part you mean there should be a simpler approach, PHP implementation or the template provided. Feel free to provide more details for us to review such possibility.

Thank you!
 
What message do members get when they hit the posting limit?
It would be nice to let members know that they can lift the limit with an accoutn upgrade. And include a link to the account upgrade.
 
What message do members get when they hit the posting limit?
It would be nice to let members know that they can lift the limit with an accoutn upgrade. And include a link to the account upgrade.

Here is the description posted before as answer to your question regarding the message shown:

Sure, it works with adding a usergroup as well. The limits are implemented as XenForo "integer" permissions and default XenForo implementation of such permissions apply, when a user has different usergroups. In general, the usergroup with higher value for the permission gets higher priority, and "unlimited" option applies with highest priority. So, in your case, the limited usergroup should have the values defined, and the "upgraded" usergroup should set it to "unlimited".

The message is shown instead of XenForo's default message about not having permission to post a thread:

View attachment 162437

The message is too much complicated to be one single phrase, as it many cases it has to shown different content (e.g. the time to wait is only 1 minutes, it does not make sense to write that 0 days, 0 hours and 1 minutes are left).

If you want to have all these details in your message, than you need a template with several phrases and conditions as well. Here is the content of the template. Feel free to suggest if you more optimal way to implement this, that would match your needs and the needs of users who use it its current form.

Code:
<span class="element">(
<xen:if is="{$posts}">
  {xen:phrase alpl_you_can_post_in_this_thread}
  <xen:else />
  {xen:phrase alpl_you_can_post_in_this_forum}
</xen:if>
<xen:if is="{$postedTimeInfo.days}">
{$postedTimeInfo.days}
    <xen:if is="{$postedTimeInfo.days} ==1">
        {xen:phrase alpl_day}
    <xen:else />
        {xen:phrase alpl_days}
    </xen:if>
</xen:if>
<xen:if is="{$postedTimeInfo.hours}">
{$postedTimeInfo.hours}
    <xen:if is="{$postedTimeInfo.hours} ==1">
          {xen:phrase alpl_hour}
    <xen:else />
        {xen:phrase alpl_hours}
    </xen:if>
</xen:if>
<xen:if is="{$postedTimeInfo.minutes}">
{$postedTimeInfo.minutes}
    <xen:if is="{$postedTimeInfo.minutes} ==1">
          {xen:phrase alpl_minute}
    <xen:else />
            {xen:phrase alpl_minutes}
    </xen:if>
</xen:if>
<xen:if is="{$postedTimeInfo.seconds}">
{$postedTimeInfo.seconds}
   <xen:if is="{$postedTimeInfo.seconds} ==1">
          {xen:phrase alpl_second}
   <xen:else />
            {xen:phrase alpl_seconds}
   </xen:if>
</xen:if>
)</span>

Thank you!

If users hit the limit they just don't see the New Thread button. If they follow a direct link to create new thread page, they get a usual no permission error message.

Feel free to test the add-on and let us know your suggestions.

Thank you!
 
There are two limits:
- thread posting
- replying

The text states that the member has no posting rights at all in that forum for the next X hours. However, they may still have rights to reply to existing threads. This needs to be clear.
I'd suggest:

Registered Members are limited to post only 1 thread and 7 replies in 72 hours in this forum. To lift this restriction buy an account upgrade.

You can post a new thread in this forum in X days, Y hours and Z seconds.
You can post a reply in this forum in X days, Y hours and Z seconds.
 
There are two limits:
- thread posting
- replying

The text states that the member has no posting rights at all in that forum for the next X hours. However, they may still have rights to reply to existing threads. This needs to be clear.
I'd suggest:

Registered Members are limited to post only 1 thread and 7 replies in 72 hours in this forum. To lift this restriction buy an account upgrade.

You can post a new thread in this forum in X days, Y hours and Z seconds.
You can post a reply in this forum in X days, Y hours and Z seconds.

Thank you for the suggestion. We will implement it as soon as we possible.

Thank you!
 
I am running into problems with this addon. Analyze permissions show the following is true:
  • Limit number of threads within time defined below: 1
  • Time limit for threads (in hours): 24
  • Limit number of posts within time defined below: 5
  • Time limit for posts (in hours): 24
The user has 0 posts in the node. Yet, the user has sent me screenshots of no permissions messages with ever changing time limits.

This seems to be a bug.
 
I am running into problems with this addon. Analyze permissions show the following is true:
  • Limit number of threads within time defined below: 1
  • Time limit for threads (in hours): 24
  • Limit number of posts within time defined below: 5
  • Time limit for posts (in hours): 24
The user has 0 posts in the node. Yet, the user has sent me screenshots of no permissions messages with ever changing time limits.

This seems to be a bug.

It seems you need to configure the setting "Node-based check ID list" in product options. By default, the permissions are tweaked node-based (and general usergroup permissions if no node-specific permissions are specified), but the number of posts is counted board-wide. If you want to count the number of posts/threads in the current forum only, you should specify forum ID in product's settings page.

Thank you!
 
I like the idea to have one private thread per user. With 1 thread per time limit, i can choose unlimited to have this?
Ok, i have found the answer some posts above. Nice! Thank you.
 
Top Bottom