-Added new functions for custom fields.
-Added new plugins (auto update stats, add custom fields).
Add custom fields
This plugin adds 2 fields on profile page: Realm username and user birthday.
Auto update stats
This plugin automatic update statistics when the page loads. It is possible to setup time when to check for updates for games (for example: every 1 hour), and the maximum number of games to update. It's not recommended to set up more than 30-50 games for updates. Also, there is option to show or not update log for administrators.
Note: it's better to update 10 games every 10 minutes, then 100 games every 30 minutes. It means it's better to update less games in a shorter period of time, then lot of games in shorter/longer period of time.
Auto update stats log:
Using custom fields function:
OS_add_custom_field( $field_id, $field_name , $field_value );
Adds data to 'custom_fields' table. The following fields are inserted: id ($field_id), name ($field_name), value ($field_value).
Note: If the record exists, it will update the same record with the new value.
OS_delete_custom_field( $field_id, $field_name , $field_value );
Deletes data from 'custom_fields' table. field_id (required), field_name (required), field_value (NOT required).
OS_delete_custom_field( 5, "user_birthday");
This will delete record from custom_field table where id (field_id) is 5 (which represents the user ID ) and field name is 'user_birthday'.
OS_get_custom_field( $field_id, $field_name );
Get value from custom field table.
OS_get_custom_field( 5, 'user_birthday' );
If the first parameter is the user ID (5) this will return value where is field name "user_birthday".