Skip to main content

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:

  1. Navigate to Integrations > (Select the game) > Plugins and add a new plugin named Custom Leaderboards.
  2. 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 or steam_id.
    • Sort by: Specify the column name to sort by.
    • Sort Order: Choose between ascending (ASC) or descending (DESC).
  3. 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
danger

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:

  1. Display Name: The label users will see.
  2. Column Name: The name of the column from your table to be displayed.
  3. Display Value: How the value is presented, using placeholders like %points% for calculations.
  4. Show in Summary Table: Whether to show this row in the main table view.
  5. Show in Detail View: Whether to show this row in the modal detail view.
  6. Enabled: If unchecked, the row will not be displayed.
  7. 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.
info

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:

  1. id (primary key)
  2. SteamId
  3. kills
  4. date

Adding New Custom Leaderboards

  1. Set the Table Name to players_kills.
  2. Set the Primary Key Column to id.
  3. Click the Save/Add button.

Adding Values to the Table

  1. Click the button Manage for the Custom Leaderboards.
  2. 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)
  3. 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

  1. date: Used to display date if the time is in Unix format.