This repository was archived by the owner on Sep 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·114 lines (108 loc) · 4.43 KB
/
index.php
File metadata and controls
executable file
·114 lines (108 loc) · 4.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
include "functions.php";
include "SQLHandler.php";
try
{
$configuration = simplexml_load_file("config.xml");
}
catch(Exception $e)
{
$error = "[ERROR]: " .$e->getMessage();
WritetoFile("logs/general_error.log", $error);
trigger_error("We're facing some techincal issues.", E_USER_ERROR);
}
$SQLHandler = new SQL\Handler(array('hostname' => $configuration->db->hostname, 'username' => $configuration->db->username, 'password' => $configuration->db->password, 'dbname' => $configuration->db->dbname, 'dbtable' => $configuration->db->dbtable, 'dbprefix' => $configuration->db->dbprefix));
error_reporting($configuration->general->errorlogging);
set_error_handler("OnERRORDetected");
date_default_timezone_set($configuration->general->timezone);
//$SQLHandler->SQLDrop(5);
?>
<!DOCTYPE HTML>
<html>
<head>
<title><?= $configuration->general->servernick ?> Gaming's Announcements Managing Module</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="style.css" />
<link href="favicon.ico" rel="shortcut icon" />
</head>
<body>
<div id="page-wrapper">
<div id="headbar">
<?php
if(isset($_GET["annc"]))
{
$query = $SQLHandler->SQLQuery("SELECT * FROM `" .$configuration->db->dbprefix.$configuration->db->dbtable. "` WHERE ID = '" .$_GET['annc']. "' ORDER BY ID DESC");
if($query && (is_bool($query) ? False : mysqli_num_rows($query) >= 1))
{
while ($row = mysqli_fetch_array($query, MYSQL_ASSOC))
{
echo $configuration->general->servernick. " Gaming's Announcements Managing Module - " .$row['Subject'];
}
}
else
{
echo $configuration->general->servernick. " Gaming's Announcements Managing Module - Home";
unset($_GET["annc"]);
}
}
else
{
echo $configuration->general->servernick. " Gaming's Announcements Managing Module - Home";
}
?>
<a href="admin.php" class="button force-right">Admin</a>
</div>
<div id="announcements">
<?php
if(empty($_GET["annc"]))
{
$query = $SQLHandler->SQLQuery("SELECT * FROM `" .$configuration->db->dbprefix.$configuration->db->dbtable. "` ORDER BY ID DESC");
echo '<table id="anncms">';
echo "<th>Subject</th><th>Announcement</th><th>Date</th><tr>";;
if($query && (is_bool($query) ? False : mysqli_num_rows($query) >= 1))
{
while ($row = mysqli_fetch_array($query, MYSQL_ASSOC))
{
$id = $row['ID'];
echo "<tr>";
echo "<td>" .$row['Subject']. "</td>";
echo "<td>" .mb_strimwidth(htmlspecialchars_decode(stripslashes($row["Announcement"])), 0, 23, "..."). " <a href=\"?annc=".$id."\" class=\"read-link\">More info</a></td>";
echo "<td>" .$row['Date']. "</td>";
echo "</tr>";
}
}
else
{
echo '<div class="warning">There isn\'t any kind of Valid Announcements.</div><script type="text/javascript">document.getElementById("anncms").style.display = "none";</script>';
}
echo "</table>";
}
else
{
echo "</div><div id=\"showannouncement\">";
$query = $SQLHandler->SQLQuery("SELECT * FROM `" .$configuration->db->dbprefix.$configuration->db->dbtable. "` WHERE ID = '" .$_GET['annc']. "' ORDER BY ID DESC");
if($query && (is_bool($query) ? False : mysqli_num_rows($query) >= 1))
{
while ($row = mysqli_fetch_array($query, MYSQL_ASSOC))
{
echo "<div class=\"success\">Watching announcement about <b>".$row['Subject']."</b> from <b>".$row['Date']."</b>.</div>";
echo htmlspecialchars_decode(stripslashes($row['Announcement']));
}
}
else
{
echo "<div class=\"error\">Invalid Announcement ID: " .$_GET['annc']. "</div>";
}
echo "</div><a href=\"index.php\" class=\"button\" style=\"margin-top: 7px;padding: 3px 23px 10px 6px;\">Go back to Homepage</a>";
}
?>
</div>
</div>
<div class="footer" style="margin-top:60px;">
<?php
echo '<p style="font-size: 15px;">Copyright <strong onclick="var win = window.open(\'https://www.br-gaming.ovh/?p=1.0\', \'_blank\');win.focus();">' .$configuration->general->servernick. ' Gaming\'s Announcements Managing Module</strong>™ © 2015-' .date('Y'). ' All Rights Reserved.</p>';
?>
</div>
</body>
</html>