lwb5-in-2025/scripts/game/main/forums/library/getAdministrator.inc

27 lines
462 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class main_forums_getAdministrator {
2024-12-31 00:50:29 +01:00
public function __construct($lib) {
2016-01-10 11:01:49 +01:00
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
function run($uid) {
$q = $this->db->query("SELECT category FROM f_admin WHERE \"user\"=$uid");
$a = array();
while ($r = dbFetchArray($q)) {
if (is_null($r[0])) {
$q = $this->db->query("SELECT id FROM f_category");
$a = array();
} else {
array_push($a, $r[0]);
}
}
return $a;
}
}
?>