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/forums/library/getAdministrator.inc

26 lines
472 B
PHP

<?php
class main_forums_getAdministrator {
function main_forums_getAdministrator($lib) {
$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;
}
}
?>