2016-01-10 11:01:49 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class beta5_alliance_getId {
|
|
|
|
|
2024-12-31 00:25:05 +01:00
|
|
|
public function __construct($lib) {
|
2016-01-10 11:01:49 +01:00
|
|
|
$this->lib = $lib;
|
|
|
|
$this->db = $this->lib->game->db;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Get alliance identifier by tag
|
|
|
|
function run($tag) {
|
|
|
|
$q = $this->db->query("SELECT id FROM alliance WHERE LOWER(tag)='" . addslashes(strtolower($tag)) . "'");
|
|
|
|
if (!($q && dbCount($q) == 1)) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
list($id) = dbFetchArray($q);
|
|
|
|
return $id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|