Skip to content
This repository was archived by the owner on Jan 25, 2021. It is now read-only.

Commit d368a92

Browse files
committed
Rewrite
Changelog: Migrated from MySQL to MySQLi. Not sure why I didn't do this sooner. Changed CSS theme Moved players online location Removed footer navbar Removed breadcrumbs since it was useless Fixed avatar URLs Fixed query URL Added database name variable to settings Added lists to the homepage to view the 3 most recent bans, mutes, warnings & IP bans. (Terribly coded, but it works.) Added new background images.
1 parent 09b34cf commit d368a92

18 files changed

+295
-6612
lines changed

bans.php

+13-27
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
1-
<?php
2-
include 'includes/head.php';
3-
include 'includes/header.php';
4-
?>
1+
<?php
2+
include 'includes/head.php';
3+
include 'includes/header.php';
4+
?>
55
<head>
66
<title>Bans/Tempbans - <?php echo $name; ?></title>
77
</head>
88
<?php
9-
// <<-----------------mysql Database Connection------------>> //
9+
// <<-----------------Database Connection------------>> //
1010
require 'includes/data/database.php';
11-
1211
$sql = 'SELECT name, reason, banner, time, expires FROM bans ORDER BY time DESC LIMIT 20';
13-
14-
$retval = mysql_query( $sql, $conn );
15-
if(! $retval )
16-
{
17-
die('Could not get data: ' . mysql_error( $sql, $conn ));
18-
}
12+
$retval = $conn->query($sql);
1913
?>
2014
<body>
21-
<div class="container">
22-
<!-- Example row of columns -->
15+
<div class="container content">
2316
<div class="row">
2417
<div class="col-lg-12">
2518
<h1 class="page-header">Bans</h1>
26-
<ol class="breadcrumb">
27-
<li><a href="index">Home</a></li>
28-
<li class="active">Bans</li>
29-
</ol>
30-
</div>
31-
</div>
32-
<div class="row" style="margin-bottom:60px;">
33-
<div class="col-lg-12">
3419
<table class="table table-hover table-bordered table-condensed">
3520
<thead>
3621
<tr>
@@ -52,7 +37,10 @@
5237
</tr>
5338
</thead>
5439
<tbody>
55-
<?php while($row = mysql_fetch_assoc($retval)) {
40+
<?php while($row = $retval->fetch_assoc()) {
41+
if($row['banner'] == null) {
42+
$row['banner'] = 'Console';
43+
}
5644
// <<-----------------Ban Date Converter------------>> //
5745
$timeEpoch = $row['time'];
5846
$timeConvert = $timeEpoch / 1000;
@@ -73,12 +61,10 @@
7361
echo $expiresResult; }?></td>
7462
</tr>
7563
<?php }
76-
mysql_close($conn);
64+
$conn->close();
7765
echo "</tbody></table>";
7866
?>
7967
</div>
8068
</div>
81-
<?php
82-
include 'includes/footer.php';
83-
?>
69+
<?php include 'includes/footer.php'; ?>
8470
</div>

0 commit comments

Comments
 (0)