LeaderHeads Web Add-on

 LeaderHeads Web Add-on 3.2.1

LeaderHeads Web Add-on
22-10-02.png


19-56-27.png


The LeaderHeads Web Add-on is a website interface that allows you to show all-time, daily, weekly and monthly leaderboards and player stats from your server on your website.

Features:
  • Easy setup. You can link the plugin to your website in a matter of seconds.
  • Lightning fast load times. The web add-on can easily handle thousands of players. Thanks to the live-update system, the site can display changes in leaderboard dynamically without refreshing the page.
  • Endless possibilities. This add-on hooks into LeaderHeads. This means that you can choose from the list of 520 statistics to show on your website.
  • Easily integrable into your own server website layout. Compatible with Xenforo. Look further down for documentation and examples.
  • Responsive. The leaderboard web pages work fine on all kinds of devices ranging from smartphones to desktops.
  • Extra features like automatic page refreshes, clickable links. These features are completely configurable. Check the configuration example at the bottom of this page for more information.
  • Multiple server support. You can easily show data from multiple of you servers.
  • Stylesheets. The layout of the page is controlled by CSS stylesheets. If you want to edit the layout or let someone make it for you, then use the stylesheets.
Requirements:
  • LeaderHeads
  • A MySQL database
  • A website to host the files
21-13-25.png

The following things are included in this web interface.
Check the following examples show some of the different options that you can use. Make sure to check all of them out to understand the real power of the LeaderHeads Web Add-on.
20-02-29.png


Follow these easy steps to set up the LeaderHeads Web Add-on:
  1. Configure your database.yml in the LeaderHeads folder on your servers and connect it to a MySQL database. It is recommended to use different table names per server if your servers have the same statistics.
  2. Download the Web Add-on, open it and upload the 'leaderheads' folder to your website. You can rename this folder if you want.
  3. To show a statistic on your website, go to the 'statistics' folder in the Leaderheads folder on your Minecraft server and search for this statistic. Open its file and set 'force-update' to true to make sure it sends the data correctly.
  4. Configure your MySQL details in the config.php in the config folder of the Web Add-on.
  5. Navigate to the 'leaderboard.php' and/or 'stats.php' file to check if the MySQL database is connected.
  6. Edit the .yml files in the config folder and follow the comments in the files.
  7. The search bar and clicking on names will not work by default. You need to setup URL rewrite rules to use this feature. For more information, check the "tweaks" section on this page.
20-29-18.png

The leaderboard page and personal stats page both have an advanced configuration file which allows you to change every aspect of the page. You can find the default config here.

Code (Text):

# This is the configuration file for a leaderboard page.


# The description of the page as it appears in a search engine description.
description: "Leaderboards"

# The title of the page as it appears in the tab of your browser.
page_title: "Leaderboard"

# Messages
messages:
# Time options. These are used in the dropdown select menu.
alltime: "all time"
monthly: "this month"
weekly: "this week"
daily: "today"
# High formats as they appear when enabling 'format_high_numbers'.
high_formats:
thousands_format: "k"
millions_format: "M"
billions_format: "B"
trillions_format: "T"
quadrillions_format: "QD"
quintillions_format: "QT"
sextillions_format: "SX"
septillions_format: "SP"
# Time formats
time_formats:
time_format_days: "{days} days, {hours} hours, {minutes} minutes"
time_format_hours: "{hours} hours, {minutes} minutes"
time_format_minutes: "{minutes} minutes"

# Tables that appear as you want. You can remove and add as much tables as you want.
leaderboards:
# Name of the table. This name appears in the header and the caption if no other text is set.
"My Server":
# Columns of the table. You can remove and add as much columns as you want.
# The configuration works on a default-based system. This means that there's a set amount of default values.
# If you didn't specifically set the setting in the config of a column, the default value will be applied.
# If a value has been set for the table, this value will be applied for all columns where this value isn't set.
# Explanation of these settings can be found under the defaults section.
# Tables also use this system, which means that you can specifically set a setting for a certain table.
columns:
# Name of your row as it appears in the first column.
"Time played":
# The name of the statistic as used in-game.
type: "played"
statistic_type: "time"
width: 13%
"Kills":
type: "kills"
"Deaths":
type: "deaths"
"Walked Blocks":
type: "walk"
"Balance":
type: "balance"
format: "${amount}"
format_high_numbers: true
"Level":
type: "bl-score"
"Items dropped":
type: "drop"
settings:
count: 20
enable_search_bar: true
enable_upper_pagination: true
enable_lower_pagination: true
enable_caption: false
enable_header: true
enable_column_select: false
enable_select: true
enable_index_column: true
"My second server":
columns:
"Kills":
type: "kills"
"Deaths":
type: "deaths"
"Walked Blocks":
type: "walk"
"Balance":
type: "balance"
format: "${amount}"
format_high_numbers: true
settings:
count: 20
enable_select: true
defaults:
# Available time periods to select from using the dropdown menu.
available_time_types: ["alltime", "monthly", "weekly", "daily"]
# The width of the table.
table_width: 800px;
# How many players are shown in the table.
count: 20
# Whether there should be a select bar
enable_select: true
# Text in the select bar.
# {time} represents the time select dropdown menu.
# {type} represents the type select dropdown menu.
select_text: "Select for {time} order by {type}"
# Whether there should be a bar to select the page above the table.
enable_upper_pagination: true
# Whether there should be a bar to select the page under the table.
enable_lower_pagination: true
# How many pages appear in the bar to select pages.
pagination_size: 10
# Whether there should be a search bar above the table.
enable_search_bar: true
# Placeholder of the text in this search bar.
search_bar_button_placeholder: "Username"
# Text in the search button of this search bar.
search_bar_button_text: "Search Player"
# URL that this global search bar redirects to.
search_bar_url: "/player/{name}"
# Whether a little image of the player's skull should be displayed next to the player's name.
enable_skull: true
# The URL of the skull.
skull_url: "https://crafatar.com/avatars/{name}"
# Whether there should be a column indicating the index.
enable_index_column: true
# Width of the index column.
index_column_width: 6%
# Text in the header of the index column.
index_column_text: ""
# Format of the index column
index_column_format: "{rank}"
# Width of the player column.
player_column_width: 10%
# Text in the column with the player name.
player_column_text: "Player"
# Whether the table should have a caption or not.
enable_caption: false
# Whether the caption should have custom text instead of the name of the table.
enable_caption_custom_text: false
# Custom text of the caption if 'enable_caption_custom_text' is set to true.
caption_custom_text: "Leaderboard"
# Whether the table should have a header or not. The name of this table will be displayed in the header.
enable_header: true
# Whether you can press the header of the column to order by that statistic.
enable_column_select: false
# Whether you can press on a player's name to go to his profile.
enable_click_name: true
# URL that you get redirected to when clicking on the player's name.
click_name_url: "/player/{name}"
# Default column settings
columns:
# Tables that will be used for looking up data of this column.
tables:
alltime: "leaderheadsplayersdata_alltime"
monthly: "leaderheadsplayersdata_monthly"
weekly: "leaderheadsplayersdata_weekly"
daily: "leaderheadsplayersdata_daily"
# Format of this column.
format: "{amount}"
# Statistic type of this column. Use 'default' for normal statistics and 'time' for time related statistics.
statistic_type: "default"
# How many decimals should be shown after the decimal point.
decimals: 0
# Whether there should be a dot between every 3 digits.
format_3_digits: false
# Whether the statistic should be formatted with the values from 'high_formats'.
format_high_numbers: false
# Width of this column.
width: 8%;
# Whether this column should stay to the time_type from the config, even when the dropdown menu is used
keep_time_type: false
# The selected time period of this statistic. Options are 'alltime', 'monthly', 'weekly' and 'daily'.
time_type: "alltime"
settings:
# Whether there should be a page header above the tables.
enable_page_header: true
# Text of the page header.
page_header_text: "Leaderboards"
# Whether there should be a global search bar above the tables.
enable_global_search_bar: true
# Placeholder of the text in the global search bar.
global_search_bar_button_placeholder: "Username"
# Text in the search button of the global search bar.
global_search_bar_button_text: "Search Player"
# URL that the global search bar redirects to.
global_search_bar_url: "/player/{name}"



Code (Text):

# This is the configuration file for a personal stats page.


# The description of the page as it appears in a search engine description.
description: "Player stats"

# The title of the page as it appears in the tab of your browser.
page_title: "{name} - Stats"

# Messages
messages:
# Time options. These are used in the dropdown select menu.
alltime: "all time"
month: "this month"
week: "this week"
day: "today"
# High formats as they appear when enabling 'format_high_numbers'.
high_formats:
thousands_format: "k"
millions_format: "M"
billions_format: "B"
trillions_format: "T"
quadrillions_format: "QD"
quintillions_format: "QT"
sextillions_format: "SX"
septillions_format: "SP"
# Last seen time message
last_seen:
year_ago: "%y year ago"
years_ago: "%y years ago"
month_ago: "%m month ago"
months_ago: "%m months ago"
day_ago: "%d day ago"
days_ago: "%d days ago"
hour_ago: "%h hour ago"
hours_ago: "%h hours ago"
minute_ago: "%i minute ago"
minutes_ago: "%i minutes ago"
just_now: "just now"
never_joined: "Never joined"
# Last seen message.
last_seen_message: "Last seen: {time}"
# The message that appears instead of the name if the searched player doesn't exist.
not_exist: "This player does not exist"

# Tables that appear as you want. You can remove and add as much tables as you want.
tables:
# Name of the table. This name appears in the header and the caption if no other text is set.
"My first server":
# Rows of the table. You can remove and add as much rows as you want.
# The configuration works on a default-based system. This means that there's a set amount of default values.
# If you didn't specifically set the setting in the config of a row, the default value will be applied.
# Explanation of these settings can be found under the defaults section.
# Tables also use this system, which means that you can specifically set a setting for a certain table.
rows:
# Name of your row as it appears in the first column
"Kills":
# The name of the statistic as used in-game
type: "kills"
"Deaths":
type: "deaths"
"Walked Blocks":
type: "walk"
"Balance":
type: "balance"
format: "${amount}"
format_high_numbers: true
settings:
table_width: 400px;
"My second server":
rows:
"Weekly blocks walked":
type: "kills"
time_type: "weekly"
"Deaths":
type: "deaths"
"Level":
type: "bl-level"
"Items dropped":
type: "drop"
settings:
table_width: 400px;
"My third server":
rows:
"Time played":
type: "played"
statistic_type: "time"
"Blocks mined":
type: "ez-blocks"
"Walked Blocks":
type: "walk"
settings:
table_width: 400px
defaults:
# The width of the table.
table_width: 400px;
# Whether the table should have a caption or not.
enable_caption: false
# Whether the caption should have custom text instead of the name of the table.
enable_caption_custom_text: false
# Custom text of the caption if 'enable_caption_custom_text' is set to true.
caption_custom_text: "Leaderboard"
# Whether the table should have a header or not. The name of this table will be displayed in the header.
enable_header: true;
# Width of the column where the name of the statistic appears.
index_width: 50%
# Messages for formatting time
messages:
time_format_days: "%a days, %h hours, %i minutes"
time_format_hours: "%h hours, %i minutes"
time_format_minutes: "%i minutes"
# Default row settings
rows:
# Tables that will be used for looking up data of this row.
tables:
alltime: "leaderheadsplayersdata_alltime"
monthly: "leaderheadsplayersdata_monthly"
weekly: "leaderheadsplayersdata_weekly"
daily: "leaderheadsplayersdata_daily"
# Format of this row.
format: "{amount}"
# Statistic type of this row. Use 'default' for normal statistics and 'time' for time related statistics.
statistic_type: "default"
# The selected time period of this statistic. Options are 'alltime', 'monthly', 'weekly' and 'daily'.
time_type: "alltime"
# How many decimals should be shown after the decimal point.
decimals: 0
# Whether there should be a dot between every 3 digits.
format_3_digits: false
# Whether the statistic should be formatted with the values from 'high_formats'.
format_high_numbers: false
# Width of the statistic column of this row.
width: 50%;

settings:
# Whether there should be a page header above the tables.
enable_page_header: true
# Text of the page header.
page_header_text: "Player Statistics"
# Whether there should be a global search bar above the tables.
enable_global_search_bar: true
# Placeholder of the text in the global search bar.
global_search_bar_button_placeholder: "Username"
# Text in the search button of the global search bar.
global_search_bar_button_text: "Search Player"
# URL that the global search bar redirects to.
global_search_bar_url: "/player/{name}"
# Interval in minutes for when a player will be seen as 'just now' online.
last_seen_interval: 2
# URL of the player picture that appears.
player_picture: "https://crafatar.com/renders/body/{name}?overlay=true"





22-26-06.png

  • Setting up URL's
If you want to use custom URL's, you need to set those up.
Here are some examples of custom URL's:
www.robindebaets.be/leaderboard
www.robindebaets.be/player/RobiRami

If you want to be able to click on a player's name on the leaderboard, you also need to set this up.

If your website is running Apache, you need to edit the .htaccess file which can be found in your server root.
Creating a rewrite rule like '/leaderboard' is easy. Use this example as a reference.
Code (Text):
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^leaderboard/?$ /leaderheads/leaderboard.php [L,NC]
You can use a site like this one or read the documentation to set up the URL rule for the personal stats page.

Here's the full example from a site running Apache in the .htaccess file.
If you are using a system like Wordpress, Xenforo etc, just paste this before at the TOP of the file.
Code (Text):

# LEADERHEADS BEGIN
RewriteEngine on
Options +FollowSymLinks
RewriteRule ^leaderboard/?$ /leaderheads/leaderboard.php [L,NC]
RewriteRule ^player/([^/]+)/?$ /leaderheads/stats.php?player=$1 [L,QSA,NC]
# LEADERHEADS END

Here's the full example from a site running nginx in the /etc/nginx/sites-available/default file.

Code (Text):
server {
...
rewrite ^/leaderboard/?$ /leaderheads/leaderboard.php;
rewrite ^/player/([^/]+)/?$ /leaderheads/stats.php?player=$1 last;
...
}


For servers running other software like nginx, the setup is pretty much the same, but your rewrite rules will be different. When using nginx, you can convert the previous .htaccess example using this converter.

  • Integrating into your website
To integrate the leaderboard into your own server forum page, you can either just add a direct to it or directly integrate it in the website and put your own navigation bar in it. To display a leaderboard on a page of your forum, you must use an iframe. Here's an example:
Code (Text):
<iframe src="http://ww.robindebaets.be/leaderheads/leaderboard.php" width="100%" height="300px" scrolling="no" frameborder="0"></iframe>
To show stats on a player's Xenforo profile, follow this setup. Keep in mind that these stats are currently only name based so this will only work if the Xenforo profile name is the same as his Minecraft username.

Go to the Xenforo control panel, go to Appearance and select 'Templates'.
Search for the 'member_view' of your Xenforo theme and go to the editor.
I recommend making a backup first so you don't break your installation.
Search for an 'ul' element with the class "mainTabs". This 'ul' should contain several 'li' elements. Add a new 'li' add the end to make a link to the stats interface.
After changing the code, it should look something like this.

Code (Text):
<ul class="tabs mainTabs Tabs" data-panes="#ProfilePanes > li" data-history="on">
...
<li><a href="{$requestPaths.requestUri}#stats">{xen:phrase Stats}</a></li>
...
</ul>
Now that the link is done, we need to add the actual interface.

Search for the 'ul' with id 'ProfilePanes', add in a new 'li' at the end to show the stats interface.
After changing the code, it should look something like this. Make sure to add the correct URL of the the personal stats page.

Code (Text):
<ul id="ProfilePanes">
...
<li id="stats" class="profileContent">
<iframe src="http://www.robindebaets.be/player/{$user.username}" width="100%" height="1000px" scrolling="no" frameBorder="0"></iframe>
</li>
...
<ul>

If you want to be able to go to a user's Xenforo profile by clicking on his name in the leaderboard, use a Xenforo add-on like this one.

Contact me if you have any issues with this setup.

Latest reviews

thank you, its working! please update
update plz

Similar resources

LeaderHeads Web Add-on K
A user-friendly solution to show statistics and leaderboards on your website
0.00 star(s) 0 ratings
Downloads
283
Updated
CONARTIST LEAKS|PREMIUM|LeaderHeads| CONARTIST
0.00 star(s) 0 ratings
Downloads
150
Updated
LeaderHeads K
A full-fledged solution to manage statistics and create leaderboards
5.00 star(s) 4 ratings
Downloads
4,371
Updated
BlackSpigot General Chat
Rules Help Users
    Yaobi @ Yaobi: can i get a refund for the spigot VIP ?
    Top