This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/main/rankings/library/getAll.inc

28 lines
474 B
PHP
Raw Permalink Normal View History

2016-01-10 11:01:49 +01:00
<?php
class main_rankings_getAll {
function main_rankings_getAll($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
function run($type, $top = null) {
if (is_null($top)) {
$qs = "";
} else {
$qs = "AND ranking<=$top";
}
$rs = array();
$q = $this->db->query("SELECT id,points,ranking FROM ranking WHERE r_type=$type $qs ORDER BY ranking ASC,id ASC");
while ($r = dbFetchHash($q)) {
array_push($rs, $r);
}
return $rs;
}
}
?>