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