Custom Leaderboards
Our platform provides a simple interface for custom leaderboards, including a table view and a modal page view to show detailed information without overloading the main page. You can control which rows are displayed from your database using our placeholder syntax.
Setup Instructions
To set up Custom Leaderboards:
- Navigate to Integrations > (Select the game) > Plugins and add a new plugin named Custom Leaderboards.
- Click the button to add new Custom Leaderboards. A modal will appear with several options:
- Table Name: Enter the name of the database table.
- Primary Key Column: Enter the name of the primary key column, such as
id
orsteam_id
. - Sort by: Specify the column name to sort by.
- Sort Order: Choose between ascending (ASC) or descending (DESC).
- Define Table Relationships if needed by clicking the Add Relationship button and specifying the join table and join condition.
Define Table Relationships
Link your primary table with other related tables. Provide the name of the table to join and the condition for the join. For example:
- Join Table: stats
- Join Condition: table1.steam_id = table2.steam_id
A basic understanding of SQL JOIN statements is required.
Managing the Plugin
After adding the Custom Leaderboards, you can manage the rows to be displayed by clicking manage next to the plugin, then Add new row and configure the following:
- Display Name: The label users will see.
- Column Name: The name of the column from your table to be displayed.
- Display Value: How the value is presented, using placeholders like
%points%
for calculations. - Show in Summary Table: Whether to show this row in the main table view.
- Show in Detail View: Whether to show this row in the modal detail view.
- Enabled: If unchecked, the row will not be displayed.
- Allow Search: If checked, users can search by this column.
Calculation Syntax
Use our calculation syntax for dynamic values. For example:
{%kills%+%deaths%}
: Sum of kills and deaths columns.{%kills%*%deaths%}
: Multiplication of kills and deaths columns.{%kills%/%deaths%*100}%
: Kill/death ratio as a percentage.
Placeholder Syntax
This is useful for Display Value if you want to make something custom. Use placeholders to dynamically replace parts of the text with data from your database columns:
%deaths%
: This will be replaced with the value from the deaths column.%steam_personaname%
: This acts as a placeholder and will be replaced with the value from the steam_personaname column.
Replace placeholders with your actual column names.
Steam Placeholders
To use Steam data in your leaderboards, employ the following placeholders:
%steam_personaname%
: The player's Steam persona name.%steam_profileurl%
: The URL to the player's Steam profile.%steam_avatar%
: The URL to the player's Steam avatar image.%steam_avatarmedium%
: The URL to the player's medium-sized Steam avatar image.%steam_avatarfull%
: The URL to the player's full-sized Steam avatar image.%steam_realname%
: The player's real name as provided in their Steam profile.
You must have a column named one of the following:
- steam_id
- steamid
- steamId
- SteamId
If you have a different column for Steam ID, please contact us.
Example
Let's pretend you have a table that stores players' kills for each day, named players_kills
. That table has the following columns:
- id (primary key)
- SteamId
- kills
- date
Adding New Custom Leaderboards
- Set the Table Name to
players_kills
. - Set the Primary Key Column to
id
. - Click the Save/Add button.
Adding Values to the Table
- Click the button Manage for the Custom Leaderboards.
- Click Add new row and enter:
- Display Name: Player Name
- Column Name: steam_id
- Display Value:
%steam_personaname%
(this will display the player name from Steam API)
- Add additional columns for kills and date as needed.
Functions Syntax
These functions are pre-built to make the display value more custom.
Example
If you have a column that is a Unix timestamp, you can display the date as follows:
{%time_unix% | date(H:i:s Y-m-d)}
Functions
- date: Used to display date if the time is in Unix format.