StealthBravo
Member
Trying to implement a player count script from GitHub. Finally got the actual script in order, but it still seems to not be callable?
I am using this script: https://github.com/NoxNebula/Minecraft-Server-Status
MinecraftServerStatus.class.php is in the same folder as players.php (library/players)
library/players/players.php
What I'm using in the template:
I've tried using getHtml, etc. to no avail.
The exact error I get is:
Any ideas?
I am using this script: https://github.com/NoxNebula/Minecraft-Server-Status
MinecraftServerStatus.class.php is in the same folder as players.php (library/players)
library/players/players.php
PHP:
<?php
require_once('MinecraftServerStatus.class.php');
class Players {
protected $minecraft_server;
protected $ip = '158.69.22.115';
public function __construct()
{
$this->minecraft_server = new MinecraftServerStatus($ip);
}
public function getNumplayers()
{
return $this->minecraft_server->Get('numplayers');
}
}
echo (new Players)->getNumplayers();
?>
What I'm using in the template:
HTML:
<div id="news">
<div class="news-red">
<xen:callback class="players_Players" method="getNumplayers"></xen:callback>
</div>
</div>
I've tried using getHtml, etc. to no avail.
The exact error I get is:
Could not execute callback players_Players::getNumplayers() - Not callable.
Any ideas?