MyBB Community Forums

Full Version: Every 10 posts run SQL query
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am making some changes to my forums voting system, where people will earn votes every 10 posts that they make. However, I don't know how I can make this possible. I am not sure if there is a mod for it. If there is, can you please tell me? Thanks!

Basically, every 10 posts a user makes on the forum, it'll run a SQL query to increment their vote count on their stream. How can I make this possible? Thanks!
(2014-09-03, 01:39 AM)Phantomer Wrote: [ -> ]I am making some changes to my forums voting system, where people will earn votes every 10 posts that they make. However, I don't know how I can make this possible. I am not sure if there is a mod for it. If there is, can you please tell me? Thanks!

Basically, every 10 posts a user makes on the forum, it'll run a SQL query to increment their vote count on their stream. How can I make this possible? Thanks!

The fastest way of doing it would be by taking their post count and dividing it by 10.
You could probably run that as a query, every time that a post is created. I can't remember which plugin hook does that.
Thing is, I want to run it every 10 post intervals since the votes reset every month, so simply dividing post count by 10 won't work in this case :/
Create a duplication of the default post count column that doesn't resets.
Ahhh, how can this be done?
Adding a new field on users and set count of total ammount, then you set every 10 count with send post hook and add your own query in this way no matter if delete or stay in or any values persist. Only execute a new functiob on this cases and itsdone
i would suggest you consider removing post counts when a user deletes a post or it gets moderated/removed by staff. post flood control will help with this but its not going to cover moderator actions or pruning or anything like that.
Can someone demonstrate this for me? I am having trouble putting the kit together. So far, I have made the extra database, I also hooked the post increment, now I am not sure how I can increment the vote count every 10 posts via PHP and MySQL
You dont need anything for it at all.

When you want to see user votepoints you simply userpostcount / 10 from last month (dateline)

So you have 'points' and it 'reset' monthly.