mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-07-09 15:27:32 +00:00
Fix mutes.php and warnings.php
This commit is contained in:
parent
b0fa7236cb
commit
6167f1f400
10
mutes.php
10
mutes.php
@ -7,7 +7,7 @@
|
|||||||
// <<-----------------mysql Database Connection------------>> //
|
// <<-----------------mysql Database Connection------------>> //
|
||||||
require 'includes/data/database.php';
|
require 'includes/data/database.php';
|
||||||
|
|
||||||
$sql = 'SELECT name, reason, muter, time, expires FROM mutes ORDER BY time DESC LIMIT 20';
|
$sql = 'SELECT time,until,reason,name,banned_by_name FROM mutes INNER JOIN history on mutes.uuid=history.uuid WHERE active=1 GROUP BY name ORDER BY time DESC LIMIT 20';
|
||||||
|
|
||||||
$retval = mysql_query($sql, $conn);
|
$retval = mysql_query($sql, $conn);
|
||||||
if (!$retval) {
|
if (!$retval) {
|
||||||
@ -22,7 +22,7 @@ if (!$retval) {
|
|||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<h1 class="page-header">Mutes</h1>
|
<h1 class="page-header">Mutes</h1>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li><a href="index">Home</a></li>
|
<li><a href="index.php">Home</a></li>
|
||||||
<li class="active">Mutes</li>
|
<li class="active">Mutes</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
@ -47,16 +47,16 @@ if (!$retval) {
|
|||||||
$timeConvert = $timeEpoch / 1000;
|
$timeConvert = $timeEpoch / 1000;
|
||||||
$timeResult = date('F j, Y, g:i a', $timeConvert);
|
$timeResult = date('F j, Y, g:i a', $timeConvert);
|
||||||
// <<-----------------Expiration Time Converter------------>> //
|
// <<-----------------Expiration Time Converter------------>> //
|
||||||
$expiresEpoch = $row['expires'];
|
$expiresEpoch = $row['until'];
|
||||||
$expiresConvert = $expiresEpoch / 1000;
|
$expiresConvert = $expiresEpoch / 1000;
|
||||||
$expiresResult = date('F j, Y, g:i a', $expiresConvert);
|
$expiresResult = date('F j, Y, g:i a', $expiresConvert);
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo "<img src='https://minotar.net/avatar/" . $row['name'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['name']; ?></td>
|
<td><?php echo "<img src='https://minotar.net/avatar/" . $row['name'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['name']; ?></td>
|
||||||
<td><?php echo "<img src='https://minotar.net/avatar/" . $row['banner'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['banner']; ?></td>
|
<td><?php echo "<img src='https://minotar.net/avatar/" . $row['banned_by_name'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['banned_by_name']; ?></td>
|
||||||
<td style="width: 30%;"><?php echo $row['reason']; ?></td>
|
<td style="width: 30%;"><?php echo $row['reason']; ?></td>
|
||||||
<td><?php echo $timeResult; ?></td>
|
<td><?php echo $timeResult; ?></td>
|
||||||
<td><?php if ($row['expires'] == 0) {
|
<td><?php if ($row['until'] == 0) {
|
||||||
echo 'Permanent Mute';
|
echo 'Permanent Mute';
|
||||||
} else {
|
} else {
|
||||||
echo $expiresResult;
|
echo $expiresResult;
|
||||||
|
10
warnings.php
10
warnings.php
@ -7,11 +7,11 @@
|
|||||||
// <<-----------------mysql Database Connection------------>> //
|
// <<-----------------mysql Database Connection------------>> //
|
||||||
require 'includes/data/database.php';
|
require 'includes/data/database.php';
|
||||||
|
|
||||||
$sql = 'SELECT name, reason, banner, expires FROM warnings ORDER BY expires DESC LIMIT 20';
|
$sql = 'SELECT time,until,reason,name,banned_by_name FROM warnings INNER JOIN history on warnings.uuid=history.uuid WHERE active=1 GROUP BY name ORDER BY time DESC LIMIT 20';
|
||||||
|
|
||||||
$retval = mysql_query($sql, $conn);
|
$retval = mysql_query($sql, $conn);
|
||||||
if (!$retval) {
|
if (!$retval) {
|
||||||
die('Could not get data: ' . mysql_error());
|
die('Could not get data: ' . mysql_error($conn));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<body>
|
<body>
|
||||||
@ -50,15 +50,15 @@ if (!$retval) {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php while ($row = mysql_fetch_assoc($retval)) {
|
<?php while ($row = mysql_fetch_assoc($retval)) {
|
||||||
// <<-----------------Expiration Time Converter------------>> //
|
// <<-----------------Expiration Time Converter------------>> //
|
||||||
$expiresEpoch = $row['expires'];
|
$expiresEpoch = $row['until'];
|
||||||
$expiresConvert = $expiresEpoch / 1000;
|
$expiresConvert = $expiresEpoch / 1000;
|
||||||
$expiresResult = date('F j, Y, g:i a', $expiresConvert);
|
$expiresResult = date('F j, Y, g:i a', $expiresConvert);
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo "<img src='https://minotar.net/avatar/" . $row['name'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['name']; ?></td>
|
<td><?php echo "<img src='https://minotar.net/avatar/" . $row['name'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['name']; ?></td>
|
||||||
<td><?php echo "<img src='https://minotar.net/avatar/" . $row['banner'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['banner']; ?></td>
|
<td><?php echo "<img src='https://minotar.net/avatar/" . $row['banned_by_name'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['banned_by_name']; ?></td>
|
||||||
<td style="width: 30%;"><?php echo $row['reason']; ?></td>
|
<td style="width: 30%;"><?php echo $row['reason']; ?></td>
|
||||||
<td><?php if ($row['expires'] == 0) {
|
<td><?php if ($row['until'] == 0) {
|
||||||
echo 'Permanent Warning';
|
echo 'Permanent Warning';
|
||||||
} else {
|
} else {
|
||||||
echo $expiresResult;
|
echo $expiresResult;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user