query(get_query($table));
} catch (PDOException $ex) {
die($ex->getMessage());
}
return $result;
}
function get_avatar($name) {
return "
" . $name;
}
function get_banner_name($banner) {
if ($banner === "CONSOLE") {
return "Console";
}
return $banner;
}
function millis_to_date($millis) {
date_default_timezone_set("UTC");
return date('F j, Y, g:i a', $millis / 1000);
}
/**
* Prepares text to be displayed as a ban reason.
* @param $text
*/
function clean($text) {
$text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
if (strstr($text, "\xa7") || strstr($text, "&")) {
$regex = "/(?i)(\xa7|&)[0-9A-FK-OR]/";
$text = preg_replace($regex, "", $text);
}
if (strstr($text, "\n")) {
$text = preg_replace("/\n/", "
", $text);
}
return $text;
}
?>