MyBB Community Forums

Full Version: Help plugin on post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way with plugins to make them do something on each post?
I mean, when user posts, I want to update a value in the database, is that possibile? And of course, how? Sad
I'll attach a plugin file here that should give you the idea of how it should be done. You have to read the comments.
Thank you very much. Helpful as always Smile

BTW, another thing i saw, making a custom plugin, is that when i have a really great ['postnum'] value, instead of reading it as 1256, at example, it reads it as 1. I can't figure why. It happens just when the posts number is larger than 999.
I don't see your code so I can't comment it. Maybe you read the pre modified value of it, we do have a number "prettifier" within MyBB you know. If you validate it as int then it will become 1. As 1,000 is not an int.
Actually that was the problem. I solved with a str_replace. Thanks Smile