There are two ways you could go with this.
1) When the person posts a new post, check the number of posts they've posted and, if needed, adjust their rank. So if a user just posted their 50th post, your code would detect that and change their status in the database.
2) The more common method is to write a function that calculates the person's rank each time it's requested. So if I just requested a post or profile by John Doe, a function like calcRank would be called and respond with John Doe's proper rank.
An even more efficient method would be to write a SQL query that automatically joined the ranks table to the members table every time you needed both a person's name and rank. But that would be a fairly advanced SQL query and I wouldn't know exactly how to do that for your specific case.
Hope this information was helpful in some way.
Chris
|