-
Notifications
You must be signed in to change notification settings - Fork 4
/
members.php
207 lines (168 loc) · 6.37 KB
/
members.php
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<?php
include"main.php";
database_con();
/*
if($_GET['action'] == "h") {
die("Æsj, du fant den! Her er koden til modul 4: <b>module.swap(calm)</b>");
}
*/
if($_GET['action'] == "egref" && !in_array("ese1", $user['itemsx'])) {
mysql_query("UPDATE usersystem SET items = '".$user['items']."ese1,' WHERE username='".$user['name']."'");
die("Du fant påskeegg nummer 1!");
}
if($settings['maintenance'] == "yes" && $user['level'] != "4") {
die("<meta http-equiv='refresh' content='0; url=maintenance.php'>"); }
if(defined("ONLINE")) {
pagetop("".$settings['site_name']." brukerliste");
include"includes/subheader.php";
pagemid();
echo"<table border='0' width='100%'>";
echo"<tr style='
font-family: Verdana;
font-size: 11px;
font-weight: normal;
color: #000000;
border: 1px solid #999;
' height='10'>
<th style='border: 1px solid #999;'>Brukernavn</th>
<th style='border: 1px solid #999;'>Habbonavn</th>
<th style='border: 1px solid #999; width: 100px;'>Rank</th>
</tr>";
/*
echo"<tr><td id='td'><a href='?action=h'>mohahahaha</a></td>";
echo"<td id='td' style='color: red;'>Ikke bry deg</td>";
echo"<td id='td'>Kongen!</td>";
*/
if(!isset($_POST['search'])) {
if($user['level'] >= "4") {
$t = mysql_query("SELECT * FROM usersystem");
} else {
$t = mysql_query("SELECT * FROM usersystem WHERE userlevel > '1'");
}
$a = mysql_fetch_object($t);
$total_items = mysql_num_rows($t);
$limit = $_GET['limit'];
$type = $_GET['type'];
$page = $_GET['page'];
//set default if: $limit is empty, non numerical, less than 10, greater than 50
if((!$limit) || (is_numeric($limit) == false) || ($limit < 10) || ($limit > 50)) {
$limit = 30; //default
}
//set default if: $page is empty, non numerical, less than zero, greater than total available
if((!$page) || (is_numeric($page) == false) || ($page < 0) || ($page > $total_items)) {
$page = 1; //default
}
//calcuate total pages
$total_pages = ceil($total_items / $limit);
$set_limit = $page * $limit - ($limit);
if($user['level'] >= "4") {
$result = mysql_query("SELECT * FROM usersystem ORDER BY userlevel DESC LIMIT $set_limit, $limit");
} else {
$result = mysql_query("SELECT * FROM usersystem WHERE userlevel > '1' ORDER BY userlevel DESC LIMIT $set_limit, $limit");
}
} else {
if($user['level'] >= "4") {
$t = mysql_query("SELECT * FROM usersystem WHERE username LIKE '%".mysql_real_escape_string($_POST['search'])."%'");
} else {
$t = mysql_query("SELECT * FROM usersystem WHERE userlevel > '1' AND username LIKE '%".mysql_real_escape_string($_POST['search'])."%'");
}
$a = mysql_fetch_object($t);
$total_items = mysql_num_rows($t);
$limit = $_GET['limit'];
$type = $_GET['type'];
$page = $_GET['page'];
//set default if: $limit is empty, non numerical, less than 10, greater than 50
if((!$limit) || (is_numeric($limit) == false) || ($limit < 10) || ($limit > 50)) {
$limit = 30; //default
}
//set default if: $page is empty, non numerical, less than zero, greater than total available
if((!$page) || (is_numeric($page) == false) || ($page < 0) || ($page > $total_items)) {
$page = 1; //default
}
//calcuate total pages
$total_pages = ceil($total_items / $limit);
$set_limit = $page * $limit - ($limit);
if($user['level'] >= "4") {
$result = mysql_query("SELECT * FROM usersystem WHERE username LIKE '%".mysql_real_escape_string($_POST['search'])."%' ORDER BY userlevel DESC LIMIT $set_limit, $limit");
} else {
$result = mysql_query("SELECT * FROM usersystem WHERE userlevel > '1' AND username LIKE '%".mysql_real_escape_string($_POST['search'])."%' ORDER BY userlevel DESC LIMIT $set_limit, $limit");
}
}
while($row = mysql_fetch_array($result))
{
echo"<tr><td id='td'><a href='profile.php?id=".$row['id']."'>".$row['username']."</a></td>";
if($row['verified_habbo'] == "yes") {
echo"<td id='td'>".$row['habboname']."</td>";
} else {
echo"<td id='td' style='color: red;'>Ikke verifisert</td>";
}
if(empty($row['title'])) {
$bad_entities = array("1", "2", "3", "4");
$safe_entities = array("Utestengt", "Bruker", "VIP", "Administrator");
$userlevel1 = str_replace($bad_entities, $safe_entities, $row['userlevel']);
} else {
$userlevel1 = str_replace(" ", " ", $row['title']);
}
if($row['userlevel'] != "1") {
echo"<td id='td'>".$userlevel1."</td>";
} else {
echo"<td id='td' style='color: red;'>".$userlevel1."</td>";
}
}
echo"</tr></table><br/>";
$number1=$page-3;
$number2=$page-2;
$number3=$page-1;
$number4=$page;
$prev_page = $page - 1;
if($prev_page >= 1) {
echo("<b>«</b> <a href='?page=$prev_page'><b>Forrige</b></a> | ");
if($number1 == 1 || $number2 == 1 || $number3 == 1 || $number4 == 1) {
} else { echo"<a href='?page=1'>1</a> ... "; }
}
for($a = 1; $a <= $total_pages; $a++)
{
$number1=$page-1;
$number2=$page-2;
$number3=$page+1;
$number4=$page+2;
$number5=$page-3;
$number6=$page+3;
if($a == $number1 || $a == $number2 || $a == $number3 || $a == $number4 || $a == $page || $a == $number5 || $a == $number6) {
if($a == $page) {
echo("<b>$a</b> "); //no link
} else {
echo("<a href='?page=$a'>$a</a> ");
} }
}
$number1=$page+3;
$number2=$page+2;
$number3=$page+1;
$number4=$page;
$next_page = $page + 1;
if($next_page <= $total_pages) {
if($number1 == $total_pages || $number2 == $total_pages || $number3 == $total_pages || $number4 == $total_pages) {
} else { echo"... <a href='?page=$total_pages'>$total_pages</a>"; }
echo(" | <a href='?page=$next_page'><b>Neste</a> »</b>");
}
echo"<br/><br/>";
$result = mysql_query("SELECT * FROM usersystem");
$users = mysql_num_rows($result);
echo"| Antall registrerte brukere: <b>".$users."</b> |";
$result = mysql_query("SELECT * FROM usersystem ORDER BY id DESC LIMIT 1");
while($row = mysql_fetch_array($result))
{
echo" Siste medlem: <b><a href='profile.php?id=".$row['id']."'>".$row['username']."</a></b> |";
}
if(in_array("es_2", $user['itemsx']) && !in_array("ese1", $user['itemsx'])) {
echo" Antall egg: <b><a href='?action=egref' style='color:black;'>1</a></b> |";
}
echo" <br/><br/>
<form method='post'><b>Søk: </b><input type='text' id='textinput' name='search' style='width:200px;'> <input type='submit' id='button' value='Søk'>
</form>";
pagebot($settings['footer']);
} else {
header("Location:index.php");
die();
}
?>