Trying to fix this monstrosity #1

This commit is contained in:
Domen Kajdič
2016-09-13 15:38:14 +02:00
parent 0e4b22d99f
commit 2cf2f3c343
22 changed files with 969 additions and 4733 deletions
+2 -2
View File
@@ -111,7 +111,7 @@ $query2 = "SELECT
//$query2;
$result2 = mysql_query($query2) or die(mysql_error());
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
$targetalliance = array();
$neutralarray = array();
@@ -129,7 +129,7 @@ $map_js ='';
$map_gen='';
$map_content='';
while ($donnees = mysql_fetch_assoc($result2)){
while ($donnees = mysqli_fetch_assoc($result2)){
$targetalliance=$donnees["aliance_id"];
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
+25 -25
View File
@@ -2,8 +2,8 @@
<?php
$basearray = $database->getMInfo($_GET['d']);
$uinfo = $database->getVillage($basearray['id']);
$oasis1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysql_real_escape_string($_GET['d']));
$oasis = mysql_fetch_assoc($oasis1);
$oasis1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_real_escape_string($GLOBALS['link'],$_GET['d']));
$oasis = mysqli_fetch_assoc($oasis1);
$access=$session->access;
?>
<h1><?php if($basearray['fieldtype']!=0){
@@ -159,10 +159,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
}
$toWref = $_GET['d'];
if($session->alliance!=0){
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -183,10 +183,10 @@ if($type==18 or $type==19 or $type==20 or $type==21){
<?php }
}else{
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -258,10 +258,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
}
$toWref = $_GET['d'];
if($session->alliance!=0){
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -282,10 +282,10 @@ if($type==18 or $type==19 or $type==20 or $type==21){
<?php }
}else{
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -384,10 +384,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
}
$toWref = $_GET['d'];
if($session->alliance!=0){
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -408,10 +408,10 @@ if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){
<?php }
}else{
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -485,13 +485,13 @@ if($type==18 or $type==19 or $type==20 or $type==21){
<td class="none">
<?php
if($basearray['fieldtype'] == 0){
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysql_escape_string($_GET['d']));
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_escape_string($GLOBALS['link'],$_GET['d']));
}else{
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysql_real_escape_string($_GET['d']));
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysqli_real_escape_string($GLOBALS['link'],$_GET['d']));
}
$data1 = mysql_fetch_assoc($query1);
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
$data2 = mysql_fetch_assoc($query2);
$data1 = mysqli_fetch_assoc($query1);
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
$data2 = mysqli_fetch_assoc($query2);
if($data2['access']=='0' or $data2['access']=='8' or $data2['access']=='9') {
echo "&raquo; ".SENDTROOP." (".BAN.")";
} else if($data2['vac_mode']=='1') {