diff --git a/bans.php b/bans.php
index 01c2f2f..4d41b61 100644
--- a/bans.php
+++ b/bans.php
@@ -7,9 +7,11 @@
// <<-----------------mysql Database Connection------------>> //
require 'includes/data/database.php';
-$sql = 'SELECT time,until,reason,name,banned_by_name FROM ' . $table_bans . ' INNER JOIN ' . $table_history . ' on ' . $table_bans . '.uuid=' . $table_history . '.uuid WHERE active=1 GROUP BY name ORDER BY time DESC LIMIT 20';
+$table = $table_bans;
+$sql = 'SELECT * FROM ' . $table . ' INNER JOIN ' . $table_history . ' on ' . $table . '.uuid=' . $table_history . '.uuid ' . $active_query .
+ ' GROUP BY name ORDER BY time DESC LIMIT ' . $limit_per_page;
-if(!$result = $conn->query($sql)) {
+if (!$result = $conn->query($sql)) {
die('Query error [' . $conn->error . ']');
}
@@ -51,7 +53,7 @@ if(!$result = $conn->query($sql)) {
- fetch_assoc()){
+ fetch_assoc()) {
// <<-----------------Ban Date Converter------------>> //
date_default_timezone_set("UTC");
$timeEpoch = $row['time'];
@@ -63,17 +65,25 @@ if(!$result = $conn->query($sql)) {
$expiresResult = date('F j, Y, g:i a', $expiresConvert);
?>
+
" . $banned; ?> |
+ echo "
" . $banned; ?>
+
" . $banner ?> |
+ echo "
" . $banner ?>
+
|
|
- |
+
+
+ |
free();
diff --git a/includes/data/database.php b/includes/data/database.php
index 2123057..f7d8af5 100644
--- a/includes/data/database.php
+++ b/includes/data/database.php
@@ -1,6 +1,6 @@
connect_errno > 0) {
- die('Unable to connect to database [' . $conn->connect_error . ']');
+if ($conn->connect_errno > 0) {
+ die('Unable to connect to database: ' . $conn->connect_error);
+}
+
+$active_query = "WHERE active=1";
+if ($show_inactive_bans) {
+ $active_query = "";
}
?>
\ No newline at end of file
diff --git a/includes/footer.php b/includes/footer.php
index 653a39b..2186150 100644
--- a/includes/footer.php
+++ b/includes/footer.php
@@ -21,29 +21,5 @@ $data = json_decode(file_get_contents('https://mcapi.ca/v2/query/info/?ip=' . $s
-
diff --git a/includes/head.php b/includes/head.php
index 8d79ef6..315940f 100644
--- a/includes/head.php
+++ b/includes/head.php
@@ -5,7 +5,7 @@ include 'includes/data/settings.php';
-
+
diff --git a/mutes.php b/mutes.php
index 58f6eb3..17374ee 100644
--- a/mutes.php
+++ b/mutes.php
@@ -7,9 +7,11 @@
// <<-----------------mysql Database Connection------------>> //
require 'includes/data/database.php';
-$sql = 'SELECT time,until,reason,name,banned_by_name FROM ' . $table_mutes . ' INNER JOIN ' . $table_history . ' on ' . $table_mutes . '.uuid=' . $table_history . '.uuid WHERE active=1 GROUP BY name ORDER BY time DESC LIMIT 20';
+$table = $table_mutes;
+$sql = 'SELECT * FROM ' . $table . ' INNER JOIN ' . $table_history . ' on ' . $table . '.uuid=' . $table_history . '.uuid ' . $active_query .
+ ' GROUP BY name ORDER BY time DESC LIMIT ' . $limit_per_page;
-if(!$result = $conn->query($sql)) {
+if (!$result = $conn->query($sql)) {
die('Query error [' . $conn->error . ']');
}
?>
@@ -40,7 +42,7 @@ if(!$result = $conn->query($sql)) {
- fetch_assoc()){
+ fetch_assoc()) {
// <<-----------------Ban Date Converter------------>> //
date_default_timezone_set("UTC");
$timeEpoch = $row['time'];
@@ -57,11 +59,16 @@ if(!$result = $conn->query($sql)) {
echo "
" . $banner; ?>
|
|
- |
+
+
+ |
free();
diff --git a/warnings.php b/warnings.php
index 09ed916..9be1be7 100644
--- a/warnings.php
+++ b/warnings.php
@@ -7,7 +7,9 @@
// <<-----------------mysql Database Connection------------>> //
require 'includes/data/database.php';
-$sql = 'SELECT time,until,reason,name,banned_by_name FROM ' . $table_warnings . ' INNER JOIN ' . $table_history . ' on ' . $table_warnings . '.uuid=' . $table_history . '.uuid WHERE active=1 ORDER BY time DESC LIMIT 20';
+$table = $table_warnings;
+$sql = 'SELECT * FROM ' . $table . ' INNER JOIN ' . $table_history . ' on ' . $table . '.uuid=' . $table_history . '.uuid ' . $active_query .
+ ' GROUP BY name ORDER BY time DESC LIMIT ' . $limit_per_page;
if(!$result = $conn->query($sql)) {
die('Query error [' . $conn->error . ']');
@@ -60,11 +62,16 @@ if(!$result = $conn->query($sql)) {
" . $banner; ?> |
|
- |
+
+
+ |
free();