mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-24 08:52:45 +00:00
Some fixes
This commit is contained in:
parent
992370b447
commit
208191d11a
@ -3,8 +3,6 @@ require './includes/head.php';
|
|||||||
require './includes/header.php';
|
require './includes/header.php';
|
||||||
require_once './includes/settings.php';
|
require_once './includes/settings.php';
|
||||||
|
|
||||||
//litebans_connect();
|
|
||||||
|
|
||||||
class Page {
|
class Page {
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$settings = new Settings();
|
$settings = new Settings();
|
||||||
@ -30,10 +28,9 @@ class Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_avatar($name) {
|
function get_avatar($name) {
|
||||||
return "<img src='https://cravatar.eu/avatar/" . $name . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $name;
|
return "<img src='https://cravatar.eu/avatar/$name/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />$name";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_name($uuid) {
|
function get_name($uuid) {
|
||||||
if (array_key_exists($uuid, $this->uuid_name_cache)) return $this->uuid_name_cache[$uuid];
|
if (array_key_exists($uuid, $this->uuid_name_cache)) return $this->uuid_name_cache[$uuid];
|
||||||
$time = microtime(true);
|
$time = microtime(true);
|
||||||
@ -41,10 +38,10 @@ class Page {
|
|||||||
if ($stmt->execute(array($uuid)) && $row = $stmt->fetch()) {
|
if ($stmt->execute(array($uuid)) && $row = $stmt->fetch()) {
|
||||||
echo('<!-- Query executed in ' . (microtime(true) - $time) . ' sec -->');
|
echo('<!-- Query executed in ' . (microtime(true) - $time) . ' sec -->');
|
||||||
$banner = $row['name'];
|
$banner = $row['name'];
|
||||||
$uuid_name_cache[$uuid] = $banner;
|
$this->uuid_name_cache[$uuid] = $banner;
|
||||||
return $banner;
|
return $banner;
|
||||||
}
|
}
|
||||||
$uuid_name_cache[$uuid] = null;
|
$this->uuid_name_cache[$uuid] = null;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user