mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 08:29:06 +00:00
Fix empty pages
This commit is contained in:
parent
40b132a686
commit
5ccda17ad9
4
bans.php
4
bans.php
@ -10,8 +10,8 @@ $page->print_check_form();
|
||||
|
||||
$page->table_begin();
|
||||
|
||||
$result = $page->run_query();
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$rows = $page->run_query();
|
||||
foreach ($rows as $row) {
|
||||
$player_name = $page->get_name($row['uuid']);
|
||||
if ($player_name === null) continue;
|
||||
|
||||
|
14
inc/page.php
14
inc/page.php
@ -135,9 +135,11 @@ class Page {
|
||||
|
||||
$st->execute();
|
||||
|
||||
$rows = $st->fetchAll();
|
||||
|
||||
$st->closeCursor();
|
||||
|
||||
return $st;
|
||||
return $rows;
|
||||
} catch (PDOException $ex) {
|
||||
Settings::handle_error($this->settings, $ex);
|
||||
}
|
||||
@ -221,12 +223,16 @@ class Page {
|
||||
|
||||
$history = $this->settings->table['history'];
|
||||
$stmt = $this->conn->prepare("SELECT name FROM $history WHERE uuid=? ORDER BY date DESC LIMIT 1");
|
||||
$result = null;
|
||||
|
||||
if ($stmt->execute(array($uuid)) && $row = $stmt->fetch()) {
|
||||
$banner = $row['name'];
|
||||
$this->uuid_name_cache[$uuid] = $banner;
|
||||
return $banner;
|
||||
$name = $row['name'];
|
||||
$this->uuid_name_cache[$uuid] = $name;
|
||||
$result = $name;
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
if ($result !== null) return $result;
|
||||
|
||||
$this->uuid_name_cache[$uuid] = null;
|
||||
return null;
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ $page->print_check_form();
|
||||
|
||||
$page->table_begin();
|
||||
|
||||
$result = $page->run_query();
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$rows = $page->run_query();
|
||||
foreach ($rows as $row) {
|
||||
$player_name = $page->get_name($row['uuid']);
|
||||
if ($player_name === null) continue;
|
||||
|
||||
|
@ -10,8 +10,8 @@ $page->print_check_form();
|
||||
|
||||
$page->table_begin();
|
||||
|
||||
$result = $page->run_query();
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$rows = $page->run_query();
|
||||
foreach ($rows as $row) {
|
||||
$player_name = $page->get_name($row['uuid']);
|
||||
if ($player_name === null) continue;
|
||||
|
||||
|
@ -10,8 +10,8 @@ $page->print_check_form();
|
||||
|
||||
$page->table_begin();
|
||||
|
||||
$result = $page->run_query();
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$rows = $page->run_query();
|
||||
foreach ($rows as $row) {
|
||||
$player_name = $page->get_name($row['uuid']);
|
||||
if ($player_name === null) continue;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user