diff options
Diffstat (limited to 'html/pages/admin/plm.php')
-rw-r--r-- | html/pages/admin/plm.php | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/html/pages/admin/plm.php b/html/pages/admin/plm.php index 1ea9f52..be26f71 100644 --- a/html/pages/admin/plm.php +++ b/html/pages/admin/plm.php @@ -13,25 +13,25 @@ function merge_players($mplayer1, $mplayer2) { $mp1name = small_query("SELECT name FROM uts_pinfo WHERE id = $mplayer1");
$mp2name = small_query("SELECT name FROM uts_pinfo WHERE id = $mplayer2");
- mysql_query("DELETE FROM uts_pinfo WHERE id = $mplayer2") or die(mysql_error());
- mysql_query("UPDATE uts_player SET pid = $mplayer1 WHERE pid = $mplayer2") or die(mysql_error());
- mysql_query("UPDATE uts_weaponstats SET pid = $mplayer1 WHERE pid = $mplayer2") or die(mysql_error());
- mysql_query("DELETE FROM uts_weaponstats WHERE pid = $mplayer2") or die(mysql_error());
- mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid = '$mplayer1'") or die(mysql_error());
+ mysqli_query($GLOBALS["___mysqli_link"], "DELETE FROM uts_pinfo WHERE id = $mplayer2") or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ mysqli_query($GLOBALS["___mysqli_link"], "UPDATE uts_player SET pid = $mplayer1 WHERE pid = $mplayer2") or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ mysqli_query($GLOBALS["___mysqli_link"], "UPDATE uts_weaponstats SET pid = $mplayer1 WHERE pid = $mplayer2") or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ mysqli_query($GLOBALS["___mysqli_link"], "DELETE FROM uts_weaponstats WHERE pid = $mplayer2") or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ mysqli_query($GLOBALS["___mysqli_link"], "DELETE FROM uts_weaponstats WHERE matchid='0' AND pid = '$mplayer1'") or die(mysqli_error($GLOBALS["___mysqli_link"]));
- $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$mplayer1' GROUP BY weapon") or die(mysql_error());
- while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) {
- mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='$mplayer1', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error());
+ $q_weaponstats = mysqli_query($GLOBALS["___mysqli_link"], "SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$mplayer1' GROUP BY weapon") or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ while ($r_weaponstats = mysqli_fetch_array($q_weaponstats)) {
+ mysqli_query($GLOBALS["___mysqli_link"], "INSERT INTO uts_weaponstats SET matchid='0', pid='$mplayer1', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysqli_error($GLOBALS["___mysqli_link"]));
}
- mysql_query("UPDATE uts_match SET firstblood = $mplayer1 WHERE firstblood = $mplayer2") or die(mysql_error());
- mysql_query("UPDATE uts_rank SET pid = $mplayer2 WHERE pid= $mplayer1") or die(mysql_error());
+ mysqli_query($GLOBALS["___mysqli_link"], "UPDATE uts_match SET firstblood = $mplayer1 WHERE firstblood = $mplayer2") or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ mysqli_query($GLOBALS["___mysqli_link"], "UPDATE uts_rank SET pid = $mplayer2 WHERE pid= $mplayer1") or die(mysqli_error($GLOBALS["___mysqli_link"]));
$sql_nrank = "SELECT SUM(time) AS time, pid, gid, AVG(rank) AS rank, AVG(prevrank) AS prevrank, SUM(matches) AS matches FROM uts_rank WHERE pid = $mplayer2 GROUP BY pid, gid";
- $q_nrank = mysql_query($sql_nrank) or die(mysql_error());
- while ($r_nrank = mysql_fetch_array($q_nrank)) {
+ $q_nrank = mysqli_query($GLOBALS["___mysqli_link"], $sql_nrank) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ while ($r_nrank = mysqli_fetch_array($q_nrank)) {
- mysql_query("INSERT INTO uts_rank SET time = '$r_nrank[time]', pid = $mplayer1, gid = $r_nrank[gid], rank = '$r_nrank[rank]', prevrank = '$r_nrank[prevrank]', matches = $r_nrank[matches]") or die(mysql_error());
+ mysqli_query($GLOBALS["___mysqli_link"], "INSERT INTO uts_rank SET time = '$r_nrank[time]', pid = $mplayer1, gid = $r_nrank[gid], rank = '$r_nrank[rank]', prevrank = '$r_nrank[prevrank]', matches = $r_nrank[matches]") or die(mysqli_error($GLOBALS["___mysqli_link"]));
}
- mysql_query("DELETE FROM uts_rank WHERE pid = $mplayer2") or die(mysql_error());
+ mysqli_query($GLOBALS["___mysqli_link"], "DELETE FROM uts_rank WHERE pid = $mplayer2") or die(mysqli_error($GLOBALS["___mysqli_link"]));
}
// If debugmode is on, get start time
@@ -52,9 +52,9 @@ if($_GET['manignore'] == "true") { echo "<P>Stopped ignore ip's</P>";
foreach($_POST as $key=>$value) {
if($key !='submit') {
- $key = mysql_real_escape_string(str_replace("_",".",$key));
+ $key = mysqli_real_escape_string($GLOBALS["___mysqli_link"], str_replace("_",".",$key));
$query = "DELETE FROM uts_ignoreips WHERE ip = (INET_ATON('".$key."'))";
- mysql_query($query) or die(mysql_error());
+ mysqli_query($GLOBALS["___mysqli_link"], $query) or die(mysqli_error($GLOBALS["___mysqli_link"]));
echo "<br>$key";
}
}
@@ -63,13 +63,13 @@ if($_GET['manignore'] == "true") { echo '<P>Ignored ip\'s in range '.htmlentities($_POST['from']).' to '.htmlentities($_POST['to']).'<br><I>If you want to stop ignoring some ip\'s, because for example you accidently ignored these, check these and press the button at the lower end to confirm this</I></P>';
echo '<FORM METHOD="POST" ACTION="admin.php?key='.$adminkey.'&action=plm&manignore=true" target="_blank">';
- $from = mysql_real_escape_string($_POST['from']);
- $to = mysql_real_escape_string($_POST['to']);
+ $from = mysqli_real_escape_string($GLOBALS["___mysqli_link"], $_POST['from']);
+ $to = mysqli_real_escape_string($GLOBALS["___mysqli_link"], $_POST['to']);
- $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to') ORDER BY ip ASC");
+ $ignore_ips = mysqli_query($GLOBALS["___mysqli_link"], "SELECT ip FROM uts_ignoreips WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to') ORDER BY ip ASC");
- if(mysql_num_rows($ignore_ips) > 0) {
- while ($r_pipcheck = mysql_fetch_array($ignore_ips)) {
+ if(mysqli_num_rows($ignore_ips) > 0) {
+ while ($r_pipcheck = mysqli_fetch_array($ignore_ips)) {
$playerip = $r_pipcheck[ip];
$trueplayerip = long2ip($playerip);
@@ -79,8 +79,8 @@ if($_GET['manignore'] == "true") { // Query for player names and ids associated to that ip during the cycle
$sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country";
- $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error());
- while ($r_pcheck = mysql_fetch_array($q_pcheck)) {
+ $q_pcheck = mysqli_query($GLOBALS["___mysqli_link"], $sql_pcheck) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ while ($r_pcheck = mysqli_fetch_array($q_pcheck)) {
echo '<br><a class="darkhuman" href="admin.php?key='.$adminkey.'&action=pinfo&pid='.$r_pcheck[pid].'">'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).'</a> ';
}
echo '<br />';
@@ -99,9 +99,9 @@ if($_GET['manignore'] == "true") { echo '<P>Ignored ip\'s<br><I>If you want to stop ignoring some ip\'s, because for example you accidently ignored these, check these and press the button at the lower end to confirm this</I></P>';
echo '<FORM METHOD="POST" ACTION="admin.php?key='.$adminkey.'&action=plm&manignore=true" target="_blank">';
- $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips ORDER BY ip ASC");
- if(mysql_num_rows($ignore_ips) > 0) {
- while ($r_pipcheck = mysql_fetch_array($ignore_ips)) {
+ $ignore_ips = mysqli_query($GLOBALS["___mysqli_link"], "SELECT ip FROM uts_ignoreips ORDER BY ip ASC");
+ if(mysqli_num_rows($ignore_ips) > 0) {
+ while ($r_pipcheck = mysqli_fetch_array($ignore_ips)) {
$playerip = $r_pipcheck[ip];
$trueplayerip = long2ip($playerip);
@@ -111,8 +111,8 @@ if($_GET['manignore'] == "true") { // Query for player names and ids associated to that ip during the cycle
$sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country";
- $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error());
- while ($r_pcheck = mysql_fetch_array($q_pcheck)) {
+ $q_pcheck = mysqli_query($GLOBALS["___mysqli_link"], $sql_pcheck) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ while ($r_pcheck = mysqli_fetch_array($q_pcheck)) {
echo '<br><a class="darkhuman" href="admin.php?key='.$adminkey.'&action=pinfo&pid='.$r_pcheck[pid].'">'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).'</a> ';
}
echo '<br />';
@@ -128,9 +128,9 @@ if($_GET['manignore'] == "true") { echo "<P>Ignored ips</P>";
foreach($_POST as $key=>$value) {
if($key !='submit') {
- $key = mysql_real_escape_string(str_replace("_",".",$key));
+ $key = mysqli_real_escape_string($GLOBALS["___mysqli_link"], str_replace("_",".",$key));
$query = "INSERT INTO uts_ignoreips (ip) VALUES (INET_ATON('".$key."'))";
- mysql_query($query) or die(mysql_error());
+ mysqli_query($GLOBALS["___mysqli_link"], $query) or die(mysqli_error($GLOBALS["___mysqli_link"]));
echo "<br>$key";
}
}
@@ -140,10 +140,10 @@ if($_GET['manignore'] == "true") { } else if(substr($_POST['submit'],0,8) == "merge - ") {
echo "<P>Merge nicks with shared ip</P>";
- $ip = mysql_real_escape_string(str_replace("_",".",substr($_POST['submit'],8)));
+ $ip = mysqli_real_escape_string($GLOBALS["___mysqli_link"], str_replace("_",".",substr($_POST['submit'],8)));
$sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player WHERE ip = INET_ATON('$ip') GROUP BY ip ORDER BY ip ASC";
- $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error());
- while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) {
+ $q_pipcheck = mysqli_query($GLOBALS["___mysqli_link"], $sql_pipcheck) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ while ($r_pipcheck = mysqli_fetch_array($q_pipcheck)) {
$playerip = $r_pipcheck[ip];
$trueplayerip = long2ip($playerip);
@@ -157,8 +157,8 @@ if($_GET['manignore'] == "true") { // Query for player names and ids associated to that ip during the cycle
$sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country";
- $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error());
- while ($r_pcheck = mysql_fetch_array($q_pcheck)) {
+ $q_pcheck = mysqli_query($GLOBALS["___mysqli_link"], $sql_pcheck) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ while ($r_pcheck = mysqli_fetch_array($q_pcheck)) {
echo '<br><a class="darkhuman" href="./?p=pinfo&pid='.$r_pcheck[pid].'">'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).'</a> ';
$options .= '<OPTION value="'.$r_pcheck[pid].'">'.$r_pcheck['name'].'</OPTION>';
}
@@ -172,11 +172,11 @@ if($_GET['manignore'] == "true") { } else if($_POST['submit'] == "Player merge") {
echo "<P>Merging nicks with shared ip</P>";
- $ip = mysql_real_escape_string(str_replace("_",".",$_POST['ip']));
- $merge_to_pid = mysql_real_escape_string($_POST['merge_to']);
+ $ip = mysqli_real_escape_string($GLOBALS["___mysqli_link"], str_replace("_",".",$_POST['ip']));
+ $merge_to_pid = mysqli_real_escape_string($GLOBALS["___mysqli_link"], $_POST['merge_to']);
$sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player WHERE ip = INET_ATON('$ip') GROUP BY ip ORDER BY ip ASC";
- $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error());
- while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) {
+ $q_pipcheck = mysqli_query($GLOBALS["___mysqli_link"], $sql_pipcheck) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ while ($r_pipcheck = mysqli_fetch_array($q_pipcheck)) {
$playerip = $r_pipcheck[ip];
$trueplayerip = long2ip($playerip);
@@ -189,9 +189,9 @@ if($_GET['manignore'] == "true") { // Query for player names and ids associated to that ip during the cycle
$sql_pcheck = "SELECT p.pid FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country";
- $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error());
+ $q_pcheck = mysqli_query($GLOBALS["___mysqli_link"], $sql_pcheck) or die(mysqli_error($GLOBALS["___mysqli_link"]));
$i=0;
- while ($r_pcheck = mysql_fetch_array($q_pcheck)) {
+ while ($r_pcheck = mysqli_fetch_array($q_pcheck)) {
if($r_pcheck['pid'] != $merge_to_pid) {
$pid_from[$i] = $r_pcheck['pid'];
echo $pid_from[$i].'<br>';
@@ -211,13 +211,13 @@ if($_GET['manignore'] == "true") { } else if($_GET['onlyrange'] == "true") {
if($_POST['submit'] == "Confirm") {
echo "<P>Showing all ip's in range ".htmlentities($_POST['from'])." to ".htmlentities($_POST['to'])."<br><I>If you want to ignore some ip's, because for example different but unrelated nicks are associated with it, check these and press the button at the lower end to confirm this</I></P>";
- $from = mysql_real_escape_string($_POST['from']);
- $to = mysql_real_escape_string($_POST['to']);
+ $from = mysqli_real_escape_string($GLOBALS["___mysqli_link"], $_POST['from']);
+ $to = mysqli_real_escape_string($GLOBALS["___mysqli_link"], $_POST['to']);
- $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to')");
+ $ignore_ips = mysqli_query($GLOBALS["___mysqli_link"], "SELECT ip FROM uts_ignoreips WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to')");
$extended_query = "WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to')";
$i=0;
- while($ignore_ips_array = mysql_fetch_array($ignore_ips)) {
+ while($ignore_ips_array = mysqli_fetch_array($ignore_ips)) {
$ip = $ignore_ips_array[0];
$extended_query .= " AND ";
$extended_query .= "ip <> '".$ip."'";
@@ -229,9 +229,9 @@ if($_GET['manignore'] == "true") { // Query for list of unique ips and player ids
$sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player ".$extended_query." GROUP BY ip ORDER BY ip ASC";
- $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error());
- if(mysql_num_rows($q_pipcheck) > 0) {
- while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) {
+ $q_pipcheck = mysqli_query($GLOBALS["___mysqli_link"], $sql_pipcheck) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ if(mysqli_num_rows($q_pipcheck) > 0) {
+ while ($r_pipcheck = mysqli_fetch_array($q_pipcheck)) {
$playerip = $r_pipcheck[ip];
$trueplayerip = long2ip($playerip);
@@ -244,8 +244,8 @@ if($_GET['manignore'] == "true") { // Query for player names and ids associated to that ip during the cycle
$sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country";
- $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error());
- while ($r_pcheck = mysql_fetch_array($q_pcheck)) {
+ $q_pcheck = mysqli_query($GLOBALS["___mysqli_link"], $sql_pcheck) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ while ($r_pcheck = mysqli_fetch_array($q_pcheck)) {
echo '<br><a class="darkhuman" href="admin.php?key='.$adminkey.'&action=pinfo&pid='.$r_pcheck[pid].'">'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).'</a> ';
}
echo "<br><INPUT TYPE=\"SUBMIT\" VALUE=\"merge - $trueplayerip\" NAME=\"submit\">";
@@ -270,10 +270,10 @@ if($_GET['manignore'] == "true") { } else {
echo "<P>IP's linked with more than one nick<br><I>If you want to ignore some ip's, because for example different but unrelated nicks are associated with it, check these and press the button at the lower end to confirm this</I></P>";
- $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips");
+ $ignore_ips = mysqli_query($GLOBALS["___mysqli_link"], "SELECT ip FROM uts_ignoreips");
$extended_query = "";
$i=0;
- while($ignore_ips_array = mysql_fetch_array($ignore_ips)) {
+ while($ignore_ips_array = mysqli_fetch_array($ignore_ips)) {
$ip = $ignore_ips_array[0];
if($i==0)
$extended_query = " WHERE ";
@@ -288,9 +288,9 @@ if($_GET['manignore'] == "true") { // Query for list of unique ips and player ids
$sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player ".$extended_query." GROUP BY ip ORDER BY ip ASC";
- $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error());
- if(mysql_num_rows($q_pipcheck) > 0) {
- while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) {
+ $q_pipcheck = mysqli_query($GLOBALS["___mysqli_link"], $sql_pipcheck) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ if(mysqli_num_rows($q_pipcheck) > 0) {
+ while ($r_pipcheck = mysqli_fetch_array($q_pipcheck)) {
$playerip = $r_pipcheck[ip];
$trueplayerip = long2ip($playerip);
@@ -303,8 +303,8 @@ if($_GET['manignore'] == "true") { // Query for player names and ids associated to that ip during the cycle
$sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country";
- $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error());
- while ($r_pcheck = mysql_fetch_array($q_pcheck)) {
+ $q_pcheck = mysqli_query($GLOBALS["___mysqli_link"], $sql_pcheck) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ while ($r_pcheck = mysqli_fetch_array($q_pcheck)) {
echo '<br><a class="darkhuman" href="admin.php?key='.$adminkey.'&action=pinfo&pid='.$r_pcheck[pid].'">'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).'</a> ';
}
echo "<br><INPUT TYPE=\"SUBMIT\" VALUE=\"merge - $trueplayerip\" NAME=\"submit\">";
|