Answer the question
In order to leave comments, you need to log in
System of "levels (exping)" for wordpress. What is the best way to organize data storage in mysql?
Hello!
I don’t know how to formulate the essence of the question more correctly, I’ll try to explain what I want to do:
I have 2 functions for converting exp to level and level to exp:
//Кол-во опыта на уровень
function getExpLevel($level) {
return pow($level, 10/7) * 100;
}
//Уровень по опыту
function getLevelExp($exp) {
return pow($exp / 100, 7/10);
}
Answer the question
In order to leave comments, you need to log in
Everything can be (and reasonably) implemented with built-in tools.
1. Store data in wp_usermeta table
2. Use WP_User_Query , namely meta_query to get data by levels/experience + date_query to group and sort results by period.
PS: This is the case if your user-players are also accounts (users) of WordPress. If not, for example the player is a custom post type - then use WP_Query.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question