$totoRetrieved = $controller->_input->filterSingle('toto', XenForo_Input::STRING);
self::get_GlobalList($totoRetrieved);
//players.php
if(isset($_GET['input']) {
require_once('/inc/player.php');
$player = new Player($_GET['input']);
$kills = $player->getTotalKill();
echo $kills;
class Player {
private $input;
function __construct( $input ) {
$this->input = $id;
}
function getTotalKills() {
$query = //do stuff
return $query;
}
// I assumed you were retrieving an unsigned (otherwise you'd change UINT to somthg else)
$inputCleaned = $controller->_input->filterSingle('input', XenForo_Input::UINT);
if($inputCleaned)
{
require_once('/inc/player.php');
$player = new Player($inputCleaned);
$kills = $player->getTotalKill();
echo $kills;
}
<?php
class Leaderboards_GlobalList_Callback
{
private static $leaders = Array();
private static $output;
private static function get_GlobalList()
{
$global_list = new Leaderboards_GlobalList_Query();
self::$leaders = $global_list->get_GlobalList();
unset($global_list);
}
private static function format_GlobalList()
{
self::$output = "";
if(is_array(self::$leaders) && count(self::$leaders) > 0)
{
foreach (self::$leaders as $leader)
{
self::$output .= '<tr>';
self::$output .= '<td width="150">' . $leader['name'] . '</td>';
self::$output .= '<td width="70">' . $leader['pvp_kills'] . '</td>';
self::$output .= '<td width="70">' . $leader['pvp_deaths'] . '</td>';
self::$output .= '<td width="70">' . $leader['current_streak'] . '</td>';
self::$output .= '<td width="70">' . $leader['max_streak'] . '</td>';
self::$output .= '</tr>';
}
}
else
{
// if some reason the query didn't work output a message to user
self::$output = "<li> No members found </li>";
}
self::$output = '<table id="stats_table"><tr><th>Name</th><th>Kills</th><th>Deaths</th><th>Current Streak</th><th>Best Streak</th></tr>' . self::$output . '</table>';
}
/**
* Get the Members by user groups and return the values back to the template
* @param XenForo_ControllerPublic_Abstract $controller
* @param XenForo_ControllerResponse_Abstract $response
*/
public static function respond(XenForo_Controller_Public_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
{
$inputRetrieved = $controller->_input->filterSingle('input', XenForo_Input::STRING);
self::get_GlobalList();
self::format_GlobalList();
$response->templateName = "test"; //name of the template to use
$response->params['output'] = self::$output; //html text to insert into the template
$response->params['input'] = $inputRetrieved;
}
}
?>
We use essential cookies to make this site work, and optional cookies to enhance your experience.