-
Notifications
You must be signed in to change notification settings - Fork 9
Installation
a646767 edited this page Mar 10, 2012
·
5 revisions
- Download the latest version.
- Extract the zip archive and copy the
lbwebstats
folder to your webserver. - Open the
config.php
with the text editor of your choice and edit the MySQL config. When your webserver is on the same machine as your Minecraft server, you use the same values as in the LogBlock configuration. You can also select the language. Currently available areen
andde
. Save the config, and upload it, in case you edited it locally. - Add write access for
lbwebstats/players
to that user that runs the webserver (www-data
in most cases), to allow caching of player images. - You can easily customize the background with a screenshot of your world: Just replace the
bg.png
file. You may have to cut the height a bit, to support widescreen monitors. - If you want the webstats to fit into a webpage, you can easily use a page with an iframe. Depending on your CMS, there are some very similar ways (ask someone who knows about your CMS, when you aren't sure).
HTML:
<iframe id="lbwebstats" style="width: 100%; border: 0" src="lbwebstats/index.php" scrolling="no"></iframe>
<script type="text/javascript">
function resizeIframe(dynheight) {
document.getElementById("lbwebstats").height = parseInt(dynheight) + 10;
}
</script>
PHP:
<?php
echo '<iframe id="lbwebstats" style="width: 100%; border: 0" src="lbwebstats/index.php" scrolling="no"></iframe>
<script type="text/javascript">
function resizeIframe(dynheight) {
document.getElementById("lbwebstats").height = parseInt(dynheight) + 10;
}
</script>';
?>
Adding these indices can speed up the select time by up to 10 times, depending on the database size. This won't harm LB, but could cause inserts to be processed slower. If you worry about insert sepeed or database size don't add the seconds webstats index, it will still speed up selects by 5 to 6 times.
ALTER TABLE `lb-world` DROP INDEX playerid, ADD INDEX webstats1 (playerid, type, replaced), ADD INDEX webstats2 (playerid, replaced, type);