Resource icon

No Increase In Post Count for Short Posts 1.0a

No permission to download

Chris D

XenForo developer
Staff member
Chris Deeming submitted a new resource:

No Increase In Post Count for Short Posts (version 1.0) - Posts not reaching the character limit are not counted towards the user's post count.

This release can be installed and upgraded using the Add-On Installer by Chris Deeming
autoinstall.png


Please consider donating if you find this add-on useful.
...

Read more about this resource...
 
Hi Chris. Will this add-on alter current post counts if the posts don't hit the character limit already, or is it just for future posts once the add-on has been installed?
 
Hm,,,,, sorry i can't resist:

I wouldn't code it this way:P
Instead of adding an second query to remove the added +1, you could should set XenForo_DataWriter_Discussion::OPTION_CHANGE_USER_MESSAGE_COUNT to false

Another reason for this is, if you create an post and the standard dw adds +1 & your addons removes -1 and you delete the post again, you'll lose another post because it's ,...

so if i make 10 posts and delete them, my new counter will be -20 ;)


sooo, change it as suggested, OR AT LEAST include an check for isDelete inside of _updateUserMessageCount ;) and don't remove -1 again
(if it sounds rude, i'm sorry, don't want to criticise anybody, it sounds just so because of my bad english :)
 
Hi Chris. Will this add-on alter current post counts if the posts don't hit the character limit already, or is it just for future posts once the add-on has been installed?
Just once the add-on has been installed, HoddzDJ.
 
Hm,,,,, sorry i can't resist:

I wouldn't code it this way:p
Instead of adding an second query to remove the added +1, you could should set XenForo_DataWriter_Discussion::OPTION_CHANGE_USER_MESSAGE_COUNT to false

Another reason for this is, if you create an post and the standard dw adds +1 & your addons removes -1 and you delete the post again, you'll lose another post because it's ,...

so if i make 10 posts and delete them, my new counter will be -20 ;)


sooo, change it as suggested, OR AT LEAST include an check for isDelete inside of _updateUserMessageCount ;) and don't remove -1 again
(if it sounds rude, i'm sorry, don't want to criticise anybody, it sounds just so because of my bad english :)
ragtek, I would never think you sound rude - even if you were being rude, I'd not take offence because I like having the opportunity to learn from experts like you :)

I tried a few ways to get this working (even before your post) to affect a change to stop it from being counted at all, but I was unsuccessful. That's why I went down the route of the query.

I have just fixed the double delete issue. I see now that my query to -1 was running on both posts being added and also posts being hidden from view as well.

My code is now wrapped in:

PHP:
if ($this->get('message_state') == 'visible' && $this->getExisting('message_state') != 'visible')

This makes it only run for new posts.

Thanks so much for your help.
 
What do you mean by only select from nodes, I can't get it working.
And what will happen if the chars limit is 7 and a user write one letter with spaces for example ?
:
 
In the options (Admin CP > Options) you can select which forums you want this to apply to.

The forums that you select will not allow the post count to be increased if the post is too short.

A space counts as a character, but the XenForo editor automatically strips out subsequent spaces. T plus 5 spaces plus a full stop (7 characters) will actually simply truncate to "T ." (T plus 1 space plus a full stop) which is 3 characters.

But it's a pretty bad example, because not many people will make posts like that. But yeah, spaces do count so:

Hello my name is Chris

is 12 characters.

Due to encoding and multibyte characters, it may be the case that letters such as áéíóú count as two characters.
 
In the options (Admin CP > Options) you can select which forums you want this to apply to.

The forums that you select will not allow the post count to be increased if the post is too short.

A space counts as a character, but the XenForo editor automatically strips out subsequent spaces. T plus 5 spaces plus a full stop (7 characters) will actually simply truncate to "T ." (T plus 1 space plus a full stop) which is 3 characters.

But it's a pretty bad example, because not many people will make posts like that. But yeah, spaces do count so:

Hello my name is Chris

is 12 characters.

Due to encoding and multibyte characters, it may be the case that letters such as áéíóú count as two characters.

Thanks for the awnser Chris, and what will happen for linebreaks ?
 
I think each line break is counted as one or two characters.

I can't be entirely sure.
 
First of all, thanks a lot for the add-on. :)

One of my users has reported a small issue--for posts below the character count (therefore, that do not get the +1 to message count), if they are deleted, the user will still see a -1 to their message count. I tested it and it appears to be true.

I understand if this takes you a while to fix as I know you've got plenty of other more important projects but I thought I'd notify you! Thanks again.
 
Top Bottom