try to simply replace the removed mysql calls with mysqli replacesments (functional way)

main
hecht 8 years ago
parent e2f198084f
commit 192c09e8d2

@ -36,7 +36,7 @@ if($char_1['besitzer'] != $user['id']) {
}
// Ermittle den Abholcode (Eingefuehrt um das nutzen von Bots zu erschweren!)
$code_row = mysql_fetch_assoc(mysql_query('Select * from char_abholcodes where charid = '.$char_id));
$code_row = mysqli_fetch_assoc(db_query('Select * from char_abholcodes where charid = '.$char_id));
if($code_row){
$abholstring = 'char_id='.$char_id.'&code='.$code_row['code'];
} else{
@ -45,7 +45,7 @@ if($code_row){
#######################Kampf
if($ab == "Kampf") {
$kampf_a = mysql_fetch_array(mysql_query("SELECT char1, char2, id, dauer FROM kampf WHERE db_satz='$char_id' order by id DESC LIMIT 1"));
$kampf_a = mysqli_fetch_array(db_query("SELECT char1, char2, id, dauer FROM kampf WHERE db_satz='$char_id' order by id DESC LIMIT 1"));
$kampf_a1 = getChar($kampf_a['char1']);
$kampf_a2 = getChar($kampf_a['char2']);
@ -143,7 +143,7 @@ $zeit_in_sek = getEventStatusBlocked($char_id);
#######################Schatz Suche Kampf
if($ab == "Schatz Suche") {
$kampf_a = mysql_fetch_array(mysql_query('select Timestampdiff(Second,now(),dauer) as dauer, Timestampdiff(Second,now(),cancel) as cancel from quests where charid = '.$char_id));
$kampf_a = mysqli_fetch_array(db_query('select Timestampdiff(Second,now(),dauer) as dauer, Timestampdiff(Second,now(),cancel) as cancel from quests where charid = '.$char_id));
$zeit_in_sek = $kampf_a['dauer'];
$cancel_zeit_in_sek = $kampf_a['cancel'];

@ -39,19 +39,19 @@ if(isset($user_ida['nickname'])){
}
// Wechsel der IP
if($_SESSION['anon_ip'] != $_SERVER['REMOTE_ADDR']){
mysql_query('Update anon_chatter set ip = \''.$_SERVER['REMOTE_ADDR'].'\' where ip = \''.$_SESSION['anon_ip'].'\'');
db_query('Update anon_chatter set ip = \''.$_SERVER['REMOTE_ADDR'].'\' where ip = \''.$_SESSION['anon_ip'].'\'');
$_SESSION['anon_ip'] = $_SERVER['REMOTE_ADDR'];
}
$usr = mysql_fetch_assoc(mysql_query('Select * from anon_chatter where ip = \''.$_SESSION['anon_ip'].'\''));
$usr = mysqli_fetch_assoc(db_query('Select * from anon_chatter where ip = \''.$_SESSION['anon_ip'].'\''));
while(!$usr){
mysql_query('Insert into anon_chatter(ip, anon_id) values(\''.$_SESSION['anon_ip'].'\', '.mt_random_wrapper(90000,99999).')');
$usr = mysql_fetch_assoc(mysql_query('Select * from anon_chatter where ip = \''.$_SESSION['anon_ip'].'\''));
db_query('Insert into anon_chatter(ip, anon_id) values(\''.$_SESSION['anon_ip'].'\', '.mt_random_wrapper(90000,99999).')');
$usr = mysqli_fetch_assoc(db_query('Select * from anon_chatter where ip = \''.$_SESSION['anon_ip'].'\''));
}
$user_ida['id'] = $usr['anon_id'];
$user_ida['nickname'] = 'anon_' . $usr['anon_id'];
$anon_block = $usr['muted']==0?false:true;
mysql_query('UPDATE anon_chatter SET online = now() WHERE anon_ip = '.$usr['anon_id']);
db_query('UPDATE anon_chatter SET online = now() WHERE anon_ip = '.$usr['anon_id']);
}
//

@ -22,7 +22,7 @@ $serial = validateString($_GET['serial']);
$charm = $_GET['charm'];
if($charm) {
$user_k = mysql_fetch_assoc(mysql_query('SELECT * FROM user_activation WHERE username=\''.$nick_name.'\' AND code=\''.$serial.'\''));
$user_k = mysqli_fetch_assoc(db_query('SELECT * FROM user_activation WHERE username=\''.$nick_name.'\' AND code=\''.$serial.'\''));
if(!$user_k['username']) {
displayErrorMessage(NULL,'Account konnte nicht aktiviert werden!', displayHistoryBackLink());
exit;
@ -30,11 +30,11 @@ if($charm) {
#########USER AKTIVIERUNG
mysql_query('INSERT INTO user(nickname, mail, passwort, agb) values(\''.$user_k['username'].'\',\''.$user_k['mail'].'\', \''.$user_k['passwort'].'\', \'ja\')');
$user_ida_nach = mysql_fetch_array(mysql_query('SELECT id FROM user WHERE nickname=\''.$nick_name.'\''));
db_query('INSERT INTO user(nickname, mail, passwort, agb) values(\''.$user_k['username'].'\',\''.$user_k['mail'].'\', \''.$user_k['passwort'].'\', \'ja\')');
$user_ida_nach = mysqli_fetch_array(db_query('SELECT id FROM user WHERE nickname=\''.$nick_name.'\''));
$sql = 'INSERT arena(besitzer, exp) values (\''.$user_ida_nach['id'].'\', \'0,'.calculateRequiredExpArena(1).'\')';
mysql_query($sql);
mysql_query('DELETE from user_activation where username = \''.$user_k['username'].'\'');
db_query($sql);
db_query('DELETE from user_activation where username = \''.$user_k['username'].'\'');
displayErrorMessage(NULL,'Account wurde aktiviert!', '<a href="index.php?as=login">weiter</a>');
sendMessage('Die Animegame Crew', $user_ida_nach['id'], 'Herzlich Willkommen bei AG', 'Herzlich Willkommen beim Animegame,'."\n".' dem Spiel in dem die Welten von One Piece und Dragonball aufeinanderprallen.'."\n\n".'Zu Anfang sieht AnimeGame ziemlich kompliziert aus, deshalb liest Du dir am besten erstmal den Anfängerguide in unserem Wiki durch:'."\n".'[url='.$GLOBALS['noobguide_url'].'][color=yellow]Anfängerguide[/color][/url]'."\n\n".'Wenn danach noch Fragen offen sind, findest Du bestimmt eine Antwort in der FAQ-Abteilung:'."\n".'[url='.$GLOBALS['faq_url'].'][color=red]Häufig gestellte Fragen[/color][/url]'."\n\n".'Falls du danach immer noch Fragen haben solltest, kannst du diese auch gerne im Chat oder im Forum stellen. Die anderen Mitspieler werden dir bestimmt gerne weiterhelfen.'."\n\n".'Viel Spass'."\n".'Das Animegame Team');
exit;

@ -66,10 +66,10 @@ if ($charm) {
$sql = 'SELECT nickname,mail FROM user WHERE nickname=\'' . $nick_name . '\' OR mail=\'' . $mail . '\'';
//echo $sql.'<br>';
$user_a = mysql_fetch_assoc(mysql_query($sql));
$user_a = mysqli_fetch_assoc(db_query($sql));
$sql = 'SELECT username,mail FROM user_activation WHERE username=\'' . $nick_name . '\' OR mail=\'' . $mail . '\'';
//echo $sql.'<br>';
$user_b = mysql_fetch_assoc(mysql_query($sql));
$user_b = mysqli_fetch_assoc(db_query($sql));
if ($user_a != FALSE || $user_b != FALSE) {
if ($user_a['nickname'] == $nick_name || $user_b['username'] == $nick_name) {
@ -101,7 +101,7 @@ if ($charm) {
$pw_1 = md5($pw_1);
mysql_query('INSERT INTO user_activation(username, code, passwort, mail, registerdate) values(\'' . $nick_name . '\', \'' . $serial_1 . '\', \'' . $pw_1 . '\', \'' . $mail . '\', now())');
db_query('INSERT INTO user_activation(username, code, passwort, mail, registerdate) values(\'' . $nick_name . '\', \'' . $serial_1 . '\', \'' . $pw_1 . '\', \'' . $mail . '\', now())');
displayErrorMessage(NULL, 'Erfolgreich angemeldet | Schauen sie in ihr Postfach', '<a href="index.php?as=login">weiter</a>');
exit;

@ -171,9 +171,9 @@ function displayAusbau2($user, $arena, $arena_name, $steh, $sitz, $loge, $vermoe
} else{
$sql = 'UPDATE arena set name = \''.$arena_name.'\', steh = '.$steh.', sitz = '.$sitz.', loge = '.$loge.' WHERE id = '.$arena['id'];
// echo $sql;
mysql_query($sql);
if(mysql_affected_rows() > 0){
mysql_query('UPDATE user set geld = geld - '.$gesamtkosten.' where id = '.$user['id']);
db_query($sql);
if(db_affected_rows() > 0){
db_query('UPDATE user set geld = geld - '.$gesamtkosten.' where id = '.$user['id']);
displayErrorMessage(NULL, 'Umbau durchgef&uuml;hrt!', '<a href="'.$_SERVER['PHP_SELF'].'?as=arena">weiter</a>');
} else{
displayErrorMessage(NULL, 'Umbau konnte nicht durchgef&uuml;hrt werden!', displayHistoryBackLink());
@ -248,9 +248,9 @@ if($charmax !== NULL || $hausmeister !== NULL || $luxus !== NULL){
} else{
$n_skill = $arena['skill'] - ($cm + $hm + $lu);
$sql = 'Update arena SET skill = '.$n_skill.', hausmeister = '.($arena['hausmeister']+$hm).', luxus = '.($arena['luxus']+$lu).' WHERE id = '.$arena['id'];
mysql_query($sql);
db_query($sql);
if($cm != 0){
mysql_query('Update user SET char_max = '.($user['char_max']+$cm).' WHERE id = '.$user['id']);
db_query('Update user SET char_max = '.($user['char_max']+$cm).' WHERE id = '.$user['id']);
}
displayErrorMessage(NULL, 'Die Skill-Points wurden erfolgreich verteilt!', '<a href="'.$_SERVER['PHP_SELF'].'?as=arena&skill1">weiter</a>');
}
@ -306,8 +306,8 @@ function renovate($user, $arena, $vermoegen){
if($costs > $vermoegen){
displayErrorMessage(NULL, 'Nicht genug Geld f&uuml;r die Renovierung!', displayHistoryBackLink());
} else{
mysql_query('Update user set geld = geld - '.$costs.' WHERE id = '.$user['id']);
mysql_query('Update arena set zustand = 1 WHERE id = '.$arena['id']);
db_query('Update user set geld = geld - '.$costs.' WHERE id = '.$user['id']);
db_query('Update arena set zustand = 1 WHERE id = '.$arena['id']);
displayErrorMessage(NULL, 'Renovierung durchgef&uuml;hrt!', displayHistoryBackLink());
}
}
@ -315,7 +315,7 @@ function renovate($user, $arena, $vermoegen){
$arena = getArena($user_ida['id']);
$auktionensumme = mysql_fetch_assoc(mysql_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$user_ida['id'].' GROUP BY bieter'));
$auktionensumme = mysqli_fetch_assoc(db_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$user_ida['id'].' GROUP BY bieter'));
$auktionensumme = $auktionensumme['summe'];
$vermoegen = $user['geld'] - $auktionensumme;
$unterhalt = calculateUnterhaltsKosten($arena);
@ -325,9 +325,9 @@ if($action == 'miete'){
if($vermoegen < $unterhalt){
displayErrorMessage(NULL, 'Du hast nicht genug Geld um die Unterhaltskosten zu bezahlen!', displayHistoryBackLink());
} else{
mysql_query('Update user set geld = geld - '.$unterhalt.' WHERE id = '.$user_ida['id']);
mysql_query('Update arena set mietlasten = 0, steuerlasten = 0 WHERE id = '.$arena['id']);
$arena = mysql_fetch_assoc(mysql_query('SELECT * FROM arena where besitzer = \''.$user_ida['id'].'\''));
db_query('Update user set geld = geld - '.$unterhalt.' WHERE id = '.$user_ida['id']);
db_query('Update arena set mietlasten = 0, steuerlasten = 0 WHERE id = '.$arena['id']);
$arena = mysqli_fetch_assoc(db_query('SELECT * FROM arena where besitzer = \''.$user_ida['id'].'\''));
displayArena($arena);
}
} else if($action == 'ausbau1'){

@ -19,14 +19,14 @@ $firstLetter = validateString($_GET['firstLetter']);
if($firstLetter == 'Numeric'){
$auser = mysql_query('SELECT * FROM user where SUBSTRING(nickname,1,1) < \'a\' order by nickname ASC LIMIT '.($pagenum*50).', 50');
$total = mysql_fetch_assoc(mysql_query('SELECT count(id) as anzahl FROM user where SUBSTRING(nickname,1,1) < \'a\''));
$auser = db_query('SELECT * FROM user where SUBSTRING(nickname,1,1) < \'a\' order by nickname ASC LIMIT '.($pagenum*50).', 50');
$total = mysqli_fetch_assoc(db_query('SELECT count(id) as anzahl FROM user where SUBSTRING(nickname,1,1) < \'a\''));
} else if($firstLetter == null){
$auser = mysql_query('SELECT * FROM user order by nickname ASC LIMIT '.($pagenum*50).', 50');
$total = mysql_fetch_assoc(mysql_query('SELECT count(id) as anzahl FROM user'));
$auser = db_query('SELECT * FROM user order by nickname ASC LIMIT '.($pagenum*50).', 50');
$total = mysqli_fetch_assoc(db_query('SELECT count(id) as anzahl FROM user'));
} else{
$auser = mysql_query('SELECT * FROM user where nickname like \''.$firstLetter.'%\' order by nickname ASC LIMIT '.($pagenum*50).', 50');
$total = mysql_fetch_assoc(mysql_query('SELECT count(id) as anzahl FROM user where nickname like \''.$firstLetter.'%\''));
$auser = db_query('SELECT * FROM user where nickname like \''.$firstLetter.'%\' order by nickname ASC LIMIT '.($pagenum*50).', 50');
$total = mysqli_fetch_assoc(db_query('SELECT count(id) as anzahl FROM user where nickname like \''.$firstLetter.'%\''));
}
$total = $total['anzahl'];
@ -53,7 +53,7 @@ $total = $total['anzahl'];
<td width="157" height="30" align="center"><b>Homepage</b></td>
</tr>
<?php
while($row = mysql_fetch_array($auser)) {
while($row = mysqli_fetch_array($auser)) {
if(!$row['icq']) { $row['icq'] = 'Kein ICQ'; }
if(!$row['homepage']) { $row['homepage'] = 'Keine Homepage'; }
?>

@ -370,7 +370,7 @@ function handleThirdPhaseForTester($type, $name, $char_lvl, $random, $user){
<?php
}
$user_daten= mysql_fetch_assoc(mysql_query("SELECT char_max, id FROM user WHERE nickname='".$_COOKIE['name']."' LIMIT 1"));
$user_daten= mysqli_fetch_assoc(db_query("SELECT char_max, id FROM user WHERE nickname='".$_COOKIE['name']."' LIMIT 1"));
// FIXME: Check if thi works!
$anzahl_spezialchars = 0;
$all_chars = getCharsOfUser($user_daten['id']);

@ -48,8 +48,8 @@ foreach($chars as $my_charz){
$mpleft[$char_zahl] = 0;
}
$exptemp = explode(",", $my_charz['exp']);
$room = mysql_query('SELECT ci.name FROM clan_item ci inner join clan_ware cw on ci.id = cw.item_id WHERE cw.id='.$my_charz['clan_train']);
$clanroom=mysql_fetch_assoc($room);
$room = db_query('SELECT ci.name FROM clan_item ci inner join clan_ware cw on ci.id = cw.item_id WHERE cw.id='.$my_charz['clan_train']);
$clanroom=mysqli_fetch_assoc($room);
if($clanroom['name']=="")
$clanroom['name']="kein";
@ -65,7 +65,7 @@ foreach($chars as $my_charz){
if($my_charz['kampf_item'] != NULL && $my_charz['kampf_item'] != ',,,,'){
// echo 'Problematic Entry = '.$chara_1['kampf_item'].'<br>';
$char1_buffs = mysql_fetch_assoc(mysql_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN (' . $my_charz['kampf_item'] . ')'));
$char1_buffs = mysqli_fetch_assoc(db_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN (' . $my_charz['kampf_item'] . ')'));
}
$c_starke = ($char1_buffs['starke']==0)?$my_charz['starke']:($my_charz['starke']).' (+'.$char1_buffs['starke'].')';
$c_verteidigung = ($char1_buffs['verteidigung']==0)?$my_charz['verteidigung']:($my_charz['verteidigung']).' (+'.$char1_buffs['verteidigung'].')';
@ -83,11 +83,11 @@ foreach($chars as $my_charz){
} elseif($my_charz['status'] == 'Angemeldet' OR $my_charz['status'] == 'Kampf erstellt') {
$temp = 'Status: '.$my_charz['status'];
} elseif($my_charz['status'] == 'Kampf') {
$kampf_a = mysql_fetch_assoc(mysql_query("SELECT dauer FROM kampf WHERE db_satz='".$my_charz['id']."' order by id DESC LIMIT 1"));
$kampf_a = mysqli_fetch_assoc(db_query("SELECT dauer FROM kampf WHERE db_satz='".$my_charz['id']."' order by id DESC LIMIT 1"));
$zeit_in_sek[$char_zahl] = $kampf_a['dauer'] - time();
$temp = '<a href="index.php?as=abholen&ab='.$statustemp.'&char_id='.$my_charz['id'].'" id="popup">Status: '.$my_charz['status'].'</a><br /><span id="timer_'.$char_zahl.'"></span>';
} elseif($my_charz['status'] == 'Schatz Suche') {
$kampf_a = mysql_fetch_array(mysql_query('select Timestampdiff(Second,now(),dauer) as dauer from quests where charid = '.$my_charz['id']));
$kampf_a = mysqli_fetch_array(db_query('select Timestampdiff(Second,now(),dauer) as dauer from quests where charid = '.$my_charz['id']));
$zeit_in_sek[$char_zahl] = $kampf_a['dauer'];
$temp = '<a href="index.php?as=abholen&ab='.$statustemp.'&char_id='.$my_charz['id'].'" id="popup">Status: '.$my_charz['status'].'</a><br /><span id="timer_'.$char_zahl.'"></span>';
} else {

@ -51,11 +51,11 @@ function stelledar($char_id,$user_ida,$name) {
$normfight_attset_name = getAttackNames($normfight_attset);
//Rüstung laden
$e_schuhe = mysql_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Schuhe' AND i.level <='$char_1[level]' group by i.name order by i.level desc");
$e_schwert = mysql_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Schwert' AND i.level <='$char_1[level]' group by i.name order by i.level desc");
$e_rustung = mysql_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Ruestung' AND i.level <='$char_1[level]' group by i.name order by i.level desc");
$e_schild = mysql_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Schild' AND i.level <='$char_1[level]' group by i.name order by i.level desc");
$e_helm = mysql_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Helm' AND i.level <='$char_1[level]' group by i.name order by i.level desc");
$e_schuhe = db_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Schuhe' AND i.level <='$char_1[level]' group by i.name order by i.level desc");
$e_schwert = db_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Schwert' AND i.level <='$char_1[level]' group by i.name order by i.level desc");
$e_rustung = db_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Ruestung' AND i.level <='$char_1[level]' group by i.name order by i.level desc");
$e_schild = db_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Schild' AND i.level <='$char_1[level]' group by i.name order by i.level desc");
$e_helm = db_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Helm' AND i.level <='$char_1[level]' group by i.name order by i.level desc");
$checked = explode(',',$char_1['kampf_item']);
?>
<body>
@ -251,7 +251,7 @@ function stelledar($char_id,$user_ida,$name) {
<td height="25" width="392">&nbsp; <select id="input" name="helm_e">
<option value="0">Nix</option>
<?php
while($helm_e_w = mysql_fetch_array($e_helm)) {
while($helm_e_w = mysqli_fetch_array($e_helm)) {
if($checked[0] == $helm_e_w['id'] && !$checked_helm) { $checked_helm = 'selected'; }
else { $checked_helm=''; }
echo '<option value="'.$helm_e_w['id'].'" '.$checked_helm.'>'.$helm_e_w['name'].' (Level: '.$helm_e_w['level'].')</option>';
@ -266,7 +266,7 @@ function stelledar($char_id,$user_ida,$name) {
name="rustung_e">
<option value="0">Nix</option>
<?php
while($rustung_e_w = mysql_fetch_array($e_rustung)) {
while($rustung_e_w = mysqli_fetch_array($e_rustung)) {
if($checked[1] == $rustung_e_w['id'] && !$checked_rustung) { $checked_rustung = 'selected'; }
else { $checked_rustung=''; }
echo '<option value="'.$rustung_e_w['id'].'" '.$checked_rustung.'>'.$rustung_e_w['name'].' (Level: '.$rustung_e_w['level'].')</option>';
@ -281,7 +281,7 @@ function stelledar($char_id,$user_ida,$name) {
name="schild_e">
<option value="0">Nix</option>
<?php
while($schild_e_w = mysql_fetch_array($e_schild)) {
while($schild_e_w = mysqli_fetch_array($e_schild)) {
if($checked[2] == $schild_e_w['id'] && !$checked_schild) { $checked_schild = 'selected'; }
else { $checked_schild=''; }
echo '<option value="'.$schild_e_w['id'].'" '.$checked_schild.'>'.$schild_e_w['name'].' (Level: '.$schild_e_w['level'].')</option>';
@ -296,7 +296,7 @@ function stelledar($char_id,$user_ida,$name) {
name="schwert_e">
<option value="0">Nix</option>
<?php
while($schwert_e_w = mysql_fetch_array($e_schwert)) {
while($schwert_e_w = mysqli_fetch_array($e_schwert)) {
if($checked[3] == $schwert_e_w['id'] && !$checked_schwert) { $checked_schwert = 'selected'; }
else { $checked_schwert=''; }
echo '<option value="'.$schwert_e_w['id'].'" '.$checked_schwert.'>'.$schwert_e_w['name'].' (Level: '.$schwert_e_w['level'].')</option>';
@ -311,7 +311,7 @@ function stelledar($char_id,$user_ida,$name) {
name="schuhe_e">
<option value="0">Nix</option>
<?php
while($schuhe_e_w = mysql_fetch_array($e_schuhe)) {
while($schuhe_e_w = mysqli_fetch_array($e_schuhe)) {
if($checked[4] == $schuhe_e_w['id'] && !$checked_schuhe) { $checked_schuhe = 'selected'; }
else { $checked_schuhe=''; }
echo '<option value="'.$schuhe_e_w['id'].'" '.$checked_schuhe.'>'.$schuhe_e_w['name'].' (Level: '.$schuhe_e_w['level'].')</option>';
@ -378,7 +378,7 @@ function eintragen($char_id,$name,$user_ida) {
'attacken=\''.implode(',', $attset_nf).'\', '.
'attacken2=\''.implode(',', $attset_nf).'\', '.
'bild=\''.$bild11.'\' WHERE id='.$char['id'].' LIMIT 1';
mysql_query($qry);
db_query($qry);
//neues updaten von Attacken
updateAttackSet($char_id, CLANKAMPF, $attset_cf);

@ -45,8 +45,8 @@ if ($action == 'accept') {
<th height="30" colspan="2" class="content">Reagieren</th>
<?php
$sql = 'SELECT * FROM user_clan_invitations WHERE userid = '.$user_ida['id'].' and valid > now();';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)){
?>
@ -108,9 +108,9 @@ if ($action == 'accept') {
</tr>
<?php
$sql = 'SELECT c.clanz_pre, c.clanz_suff, c.clanname, c.geld, c.info, c.id, c.leader FROM clan c ORDER BY '.$poll1.' '.$poll2.' LIMIT '.($pagenum*20).',20';
$clan = mysql_query($sql);
while ($row = mysql_fetch_array($clan)) {
$mitglieder = mysql_num_rows(mysql_query('SELECT id FROM user WHERE clan='.$row['id']));
$clan = db_query($sql);
while ($row = mysqli_fetch_array($clan)) {
$mitglieder = mysqli_stmt_num_rows(db_query('SELECT id FROM user WHERE clan='.$row['id']));
$z_v = array($row['clan_pre'], $row['clan_suff']);
?>
@ -133,7 +133,7 @@ if ($action == 'accept') {
<?php
// TODO: Seitenzahlen aus Designfunctions benutzen!!!
}
$Total = mysql_num_rows(mysql_query('SELECT id FROM clan'));
$Total = mysqli_stmt_num_rows(db_query('SELECT id FROM clan'));
$url = '<a href="'.$_SERVER['PHP_SELF'].'?as=clan/add&pagenum=###PAGE###">###LABEL###</a>';
?>
<tr>

@ -22,7 +22,7 @@ $charm = $_GET['charm'];
if($charm == 3)
{
$item_info = mysql_fetch_assoc(mysql_query("SELECT * FROM clan_item WHERE id='$item_id' LIMIT 1"));
$item_info = mysqli_fetch_assoc(db_query("SELECT * FROM clan_item WHERE id='$item_id' LIMIT 1"));
$user = getClan($user_ida['clan']);
if($user['leader'] != $user_ida['id'] AND $user['co_leader'] != $user_ida['id']) {
@ -46,24 +46,24 @@ if($charm == 3)
$new_geld = $user['geld'] - $item_info['preis'];
mysql_query("UPDATE clan_item SET anzahl=anzahl-1 WHERE id=".$item_info[id]." LIMIT 1");
mysql_query("UPDATE clan SET geld='$new_geld' WHERE id=".$user[id]." LIMIT 1");
mysql_query("INSERT INTO clan_ware SET item_id='".$item_info[id]."', clan='".$user[id]."'");
db_query("UPDATE clan_item SET anzahl=anzahl-1 WHERE id=".$item_info[id]." LIMIT 1");
db_query("UPDATE clan SET geld='$new_geld' WHERE id=".$user[id]." LIMIT 1");
db_query("INSERT INTO clan_ware SET item_id='".$item_info[id]."', clan='".$user[id]."'");
$fehler_m = "$item_name[name] erfolgreich gekauft<br>&nbsp;<br>Geld: $user[geld] - $item_info[preis] = $new_geld";
displayErrorMessage(NULL,$fehler_m, '<a href="'.$_SERVER['PHP_SELF'].'?as=clan/c_markt">weiter</a>');
exit;
} else if($charm == 5){
$user = mysql_Fetch_array(mysql_query("SELECT leader, co_leader, geld, id FROM clan WHERE id='$user_ida[clan]'"));
$user = mysqli_fetch_array(db_query("SELECT leader, co_leader, geld, id FROM clan WHERE id='$user_ida[clan]'"));
if($user['leader'] != $user_ida['id'] AND $user['co_leader'] != $user_ida['id']) {
displayErrorMessage(NULL,'Nur der Leader und der Co-Leader kann Clanitems abreissen!', displayHistoryBackLink());
exit;
}
mysql_query('Delete from clan_ware where clan = '.$user_ida['clan'].' and item_id = '.$item_id);
if(mysql_affected_rows() > 0){
db_query('Delete from clan_ware where clan = '.$user_ida['clan'].' and item_id = '.$item_id);
if(db_affected_rows() > 0){
displayErrorMessage(NULL,'Abreissen erfolgreich!', '<a href="'.$_SERVER['PHP_SELF'].'?as=clan/c_markt">weiter</a>');
} else{
displayErrorMessage(NULL,'Abreissen ist fehlgeschlagen!', displayHistoryBackLink());
@ -98,15 +98,15 @@ if(!$charm)
<th align="center">Kaufen</th>
</tr>
<?php
$item_name = mysql_query('SELECT * FROM clan_item order by preis');
$clan_items_query = mysql_query('SELECT * FROM clan_ware where clan = '.$user_ida['clan']);
while($row = mysql_fetch_assoc($clan_items_query)){
$item_name = db_query('SELECT * FROM clan_item order by preis');
$clan_items_query = db_query('SELECT * FROM clan_ware where clan = '.$user_ida['clan']);
while($row = mysqli_fetch_assoc($clan_items_query)){
$c_item[$row['item_id']] = 1;
}
$clan = getClan($user_ida['clan']);
while($row = mysql_fetch_array($item_name))
while($row = mysqli_fetch_array($item_name))
{
$info = '';
$info .= $row['staerke']!=0?' +'.$row['staerke'].' Str':'';

@ -36,7 +36,7 @@ if ($wahl == 'geld') {
$sql = 'SELECT i.level, i.siege, i.leader, i.niederlagen, i.geld, i.clanname, i.id, u.nickname, (Select count(*) from user u1 where clan = i.id) as member, (Select 10 - count(*) from user u2 where clan = i.id and ((i.leader is null || i.leader != u2.id) and (i.co_leader is null ||i.co_leader != u2.id))) as freeslots, (select sum(spende) as summe from user_clan where clanid = i.id) as summe, elo FROM clan i LEFT JOIN user u ON(i.leader=u.id) ORDER BY i.'.$wahl.' DESC LIMIT 50';
//echo $sql . '<br>';
$char_s = mysql_query($sql);
$char_s = db_query($sql);
?>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="1">
@ -88,7 +88,7 @@ $char_s = mysql_query($sql);
</tr>
<?php
$x=1;
while($row = mysql_fetch_assoc($char_s)) {
while($row = mysqli_fetch_assoc($char_s)) {
echo '<tr>'."\n";
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.$x.'</th>'."\n";
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center"><a href="index.php?as=clan/clan_info&clan_id='.$row['id'].'">'.$row['clanname'].'</a></th>'."\n";

@ -17,8 +17,8 @@
<th align="center">Nachricht</th>
</tr>
<?php
$ticks_qry = mysql_query('SELECT * FROM clan_ticker WHERE clanid ='.$user_ida['clan'].' ORDER BY `date` DESC LIMIT 20');
while($tick = mysql_fetch_assoc($ticks_qry)){
$ticks_qry = db_query('SELECT * FROM clan_ticker WHERE clanid ='.$user_ida['clan'].' ORDER BY `date` DESC LIMIT 20');
while($tick = mysqli_fetch_assoc($ticks_qry)){
echo '<tr><td align="center">'.$tick['date'].'</td><td>'.$tick['text'].'</td></tr>';
}
?>

@ -29,7 +29,7 @@ if($charm == 1) {
}
$char = getChar($char_id, false);
$clan_items = mysql_query("SELECT ci.name, ci.type, cw.id, 1/(1+exp(3-$char[level]/12)) * nutzung as nutzkosten FROM clan_ware cw LEFT JOIN clan_item ci ON(cw.item_id=ci.id) WHERE cw.clan='$user_ida[clan]'");
$clan_items = db_query("SELECT ci.name, ci.type, cw.id, 1/(1+exp(3-$char[level]/12)) * nutzung as nutzkosten FROM clan_ware cw LEFT JOIN clan_item ci ON(cw.item_id=ci.id) WHERE cw.clan='$user_ida[clan]'");
if(!isUserOwnerOf($user_ida['id'], $char_id)){
// Legacy (Datei muss ueberarbeitet werden)
$char = null;
@ -54,7 +54,7 @@ if(!isUserOwnerOf($user_ida['id'], $char_id)){
<?php
$chars = getCharsOfUser($user_ida['id'], false);
foreach($chars as $char) {
$clan_items = mysql_query("SELECT ci.name, ci.type, cw.id, 1/(1+exp(3-$char[level]/12)) * nutzung as nutzkosten FROM clan_ware cw LEFT JOIN clan_item ci ON(cw.item_id=ci.id) WHERE cw.clan='$user_ida[clan]'");
$clan_items = db_query("SELECT ci.name, ci.type, cw.id, 1/(1+exp(3-$char[level]/12)) * nutzung as nutzkosten FROM clan_ware cw LEFT JOIN clan_item ci ON(cw.item_id=ci.id) WHERE cw.clan='$user_ida[clan]'");
?>
<tr>
@ -65,7 +65,7 @@ if(!isUserOwnerOf($user_ida['id'], $char_id)){
<select id="input" name="c_ware_<?php echo $char['id']; ?>">
<option value="0">W&auml;hle Kampf Raum</option>
<?php
while($row = mysql_Fetch_array($clan_items)) {
while($row = mysqli_fetch_array($clan_items)) {
$save="";
if($row['id'] == $char['clan_train']) {
$save = 'Selected';

@ -71,10 +71,10 @@ if((isset($_GET['value1']) || isset($_GET['value2']) || isset($_GET['edited']))
}
function displayClanProfileReadOnly($clan, $ownclan, $userid){
$member_qry = mysql_query('Select id from user where clan = '.$clan['id']);
$count = mysql_num_rows($member_qry);
$member_qry = db_query('Select id from user where clan = '.$clan['id']);
$count = mysqli_stmt_num_rows($member_qry);
$member = array();
while($row = mysql_fetch_assoc($member_qry)){
while($row = mysqli_fetch_assoc($member_qry)){
$tmp = generateUserLinkByID($row['id']);
if($row['id'] == $userid){
$member[] = $tmp.' (<a href="index.php?as=clan/clan_info&action=fire&member='.$row['id'].'">verlassen</a>)';
@ -89,10 +89,10 @@ function displayClanProfileReadOnly($clan, $ownclan, $userid){
}
}
$inv_qry = mysql_query('SELECT userid, TIMESTAMPDIFF(HOUR, now(), valid) as till FROM user_clan_invitations WHERE clanid = '.$clan['id'].' and valid > now()');
$inv_qry = db_query('SELECT userid, TIMESTAMPDIFF(HOUR, now(), valid) as till FROM user_clan_invitations WHERE clanid = '.$clan['id'].' and valid > now()');
$invited = array();
while($row = mysql_fetch_assoc($inv_qry)) {
while($row = mysqli_fetch_assoc($inv_qry)) {
$invited[] = generateUserLinkByID($row['userid']) . ' (noch ' . $row['till'] . 'h gültig)';
}
@ -256,10 +256,10 @@ function displayClanProfileReadOnly($clan, $ownclan, $userid){
}
function displayClanProfileEditable($clan, $userid){
$member_qry = mysql_query('Select id from user where clan = '.$clan['id']);
$member_qry = db_query('Select id from user where clan = '.$clan['id']);
$member = array();
$count = mysql_num_rows($member_qry);
while($row = mysql_fetch_assoc($member_qry)){
$count = mysqli_stmt_num_rows($member_qry);
while($row = mysqli_fetch_assoc($member_qry)){
$tmp = generateUserLinkByID($row['id']);
$kickable = true;
@ -278,10 +278,10 @@ function displayClanProfileEditable($clan, $userid){
}
}
$inv_qry = mysql_query('SELECT userid, TIMESTAMPDIFF(HOUR, now(), valid) as till FROM user_clan_invitations WHERE clanid = '.$clan['id'].' and valid > now()');
$inv_qry = db_query('SELECT userid, TIMESTAMPDIFF(HOUR, now(), valid) as till FROM user_clan_invitations WHERE clanid = '.$clan['id'].' and valid > now()');
$invited = array();
while($row = mysql_fetch_assoc($inv_qry)) {
while($row = mysqli_fetch_assoc($inv_qry)) {
$invited[] = generateUserLinkByID($row['userid']) . ' (noch ' . $row['till'] . 'h gültig, <a href="index.php?as=clan/clan_info&action=reject&member='.$row['userid'].'">zurückziehen</a>)';
}
@ -498,23 +498,23 @@ function setProfile($user, $what, $value1, $value2, $clanid, $rootlvl){
}
switch($what){
case 'Homepage':
mysql_query('UPDATE clan SET homepage = \''.$value1.'\' where id = '.$clanid);
db_query('UPDATE clan SET homepage = \''.$value1.'\' where id = '.$clanid);
return NULL;
case 'Clanzeichen':
if(strlen($value1.$value2) > MAX_CHARS_CLANSIGN) {
return 'Clanzeichen sind ungültig: Summe aus beiden Teilen darf nicht größer als '.MAX_CHARS_CLANSIGN.' Zeichen sein!';
}
mysql_query('UPDATE clan SET clanz_pre = \''.$value1.'\', clanz_suff = \''.$value2.'\' where id = '.$clanid);
db_query('UPDATE clan SET clanz_pre = \''.$value1.'\', clanz_suff = \''.$value2.'\' where id = '.$clanid);
return NULL;
case 'Banner':
mysql_query('UPDATE clan SET banner = \''.$value1.'\' where id = '.$clanid);
db_query('UPDATE clan SET banner = \''.$value1.'\' where id = '.$clanid);
return NULL;
case 'Info':
mysql_query('UPDATE clan SET Info = \''.$value1.'\' where id = '.$clanid);
db_query('UPDATE clan SET Info = \''.$value1.'\' where id = '.$clanid);
return NULL;
case 'Background':
if(isClanBackgroundAvailable($clanid)) { mysql_query('UPDATE clan SET background = \''.$value1.'\' where id = '.$clanid) ;}
if(isClanBackgroundAvailable($clanid)) { db_query('UPDATE clan SET background = \''.$value1.'\' where id = '.$clanid) ;}
return NULL;
case 'Leadership':
$clan = getClan($clanid);
@ -537,11 +537,11 @@ function setProfile($user, $what, $value1, $value2, $clanid, $rootlvl){
if($rootlvl == 1){ // the co leader may only set the co leader XD
$sql = 'UPDATE clan SET co_leader = '.$value2.' where id = '.$clanid;
//echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
} else if($rootlvl == 2) { // the leader may set the leader and the co leader
$sql = 'UPDATE clan SET leader = '.$value1.', co_leader = '.$value2.' where id = '.$clanid;
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
}
return NULL;
case 'Member':
@ -588,10 +588,10 @@ function displayEdit($what, $clanid, $rootlvl){
$content = '<tr><td colspan="2"><input class="input" name="value1" value="'.$clan['banner'].'"/></td></tr>';
break;
case 'Leadership':
$member_qry = mysql_query('Select id, nickname from user where clan = '.$clanid);
$member_qry = db_query('Select id, nickname from user where clan = '.$clanid);
$member[] = '<option value="0" selected>Niemand</option>';
$member2[] = '<option value="0" selected>Niemand</option>';
while($row = mysql_fetch_assoc($member_qry)){
while($row = mysqli_fetch_assoc($member_qry)){
if($row['id'] == $clan['leader']) {
$member[] = '<option value="'.$row['id'].'" selected="selected">'.$row['nickname'].'</option>';
} else {
@ -618,11 +618,11 @@ function displayEdit($what, $clanid, $rootlvl){
$content .= '<table width="100%">'.PHP_EOL;
$content .= '<tr><th align="center">Member</th><th align="center" width="75px">Kick</th><th align="center" width="75px">CF Rechte</th></tr>'.PHP_EOL;
$content .= '<tr><td align="center" colspan="3"><hr /><input type="hidden" name="edited" value="1"></td></tr>'.PHP_EOL;
$member_qry = mysql_query('Select id from user where clan = '.$clan['id']);
$member_qry = db_query('Select id from user where clan = '.$clan['id']);
$authorized = getAuthorizedClanfightCoordinatorIDs($clanid);
$leader = NULL;
$coleader = NULL;
while($row = mysql_fetch_assoc($member_qry)){
while($row = mysqli_fetch_assoc($member_qry)){
$row['nickname'] = generateUserLinkByID($row['id'], false);
if($row['id'] == $clan['leader']){
$leader = $row;
@ -704,7 +704,7 @@ if($action !== NULL) { // this is done to not require to reprogramm the whole st
switch ($action) {
case 'edit':
$errorMsg = NULL;
$row = mysql_fetch_assoc(mysql_query('SELECT leader, co_leader from clan where id = '.$user_ida['clan']));
$row = mysqli_fetch_assoc(db_query('SELECT leader, co_leader from clan where id = '.$user_ida['clan']));
if($row['leader'] != $user_ida['id'] && $row['co_leader'] != $user_ida['id']){
displayErrorMessage(NULL, 'Du bist weder Leader noch Co-Leader des Clans!', displayHistoryBackLink());
$displayMore = false;

@ -30,9 +30,9 @@ function getEventChars($challenge_id, $event_id) {
$sql = 'SELECT * FROM clan_challenge_participants ccp INNER JOIN event_chars ec ON ccp.char_id=ec.event_char_id
INNER JOIN event_fights ef ON ccp.slot=ef.event_fight_id
WHERE ccp.clan_challenge_id = '.$challenge_id.' AND ec.event_id= '.$event_id.' AND ef.event_id= '.$event_id.' ORDER BY slot;';
$qry = mysql_query($sql);
$qry = db_query($sql);
$chars = array();
while($row = mysql_fetch_array($qry)) {
while($row = mysqli_fetch_array($qry)) {
$chars[] = $row;
}
return $chars;
@ -41,9 +41,9 @@ function getEventChars($challenge_id, $event_id) {
function getChallengeClans($challenge_id) {
$sql = 'SELECT ccc.id, c.clanname, ccc.elo_change, ccc.exp_change, c.id as clan_id, ccc.points FROM clan_challenge_clans ccc INNER JOIN clan c ON ccc.clan_id=c.id WHERE clan_challenge_id='.$challenge_id.';';
$qry = mysql_query($sql);
$qry = db_query($sql);
$clans = array();
while($row = mysql_fetch_array($qry)) {
while($row = mysqli_fetch_array($qry)) {
$clans[$row['id']] = array('name' => $row['clanname'], 'id' => $row['clan_id'], 'elo' => $row['elo_change'], 'xp' => $row['exp_change'], 'points' => $row['points']);
}
return $clans;

@ -231,7 +231,7 @@ function displayShowChallenge($clan_challenge_id, $user) {
<?php if($authorized) {
$qry = db_query('SELECT user.id AS user_id, chars.id AS char_id, user.nickname AS user_name, chars.name AS char_name FROM user inner join chars on user.id = chars.besitzer where clan = '.$user['clan'].' and user.id NOT IN (Select besitzer from chars inner join clan_challenge_participants on chars.id = clan_challenge_participants.char_id WHERE clan_challenge_id = '.$clan_challenge_id.' and clan_id = '.$user['clan'].')');
$users = array();
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
if(!isset($users[$row['user_id']])){
$users[$row['user_id']] = array('user_name' => $row['user_name']);
}

@ -52,7 +52,7 @@ if ($charm == 1) {
$sql = 'SELECT id, clanname FROM clan WHERE clanname = \'' .$clan_name. '\'';
// echo $sql.'<br>';
$dup = mysql_fetch_assoc(mysql_query($sql));
$dup = mysqli_fetch_assoc(db_query($sql));
if($dup) {
// we have a clan that has the same name!!
@ -62,14 +62,14 @@ if ($charm == 1) {
if($error == null) {
$sql = 'INSERT into clan(clanname,clanz_pre,clanz_suff,info, leader) values(\''.$clan_name.'\', \''.$clan_for.'\', \''.$clan_back.'\', \''.$clan_info.'\', '.$user_ida['id'].')';
// echo $sql.'<br>';
mysql_query($sql);
if(mysql_affected_rows() > 0){ // Erstellen des Clans geglueckt
$c_id = mysql_fetch_assoc(mysql_query('Select * from clan where clanname = \''.$clan_name.'\''));
mysql_query('UPDATE user SET clan='.$c_id['id'].', geld = geld - '.CLAN_CREATION_FEE.' WHERE id='.$user_ida['id']);
db_query($sql);
if(db_affected_rows() > 0){ // Erstellen des Clans geglueckt
$c_id = mysqli_fetch_assoc(db_query('Select * from clan where clanname = \''.$clan_name.'\''));
db_query('UPDATE user SET clan='.$c_id['id'].', geld = geld - '.CLAN_CREATION_FEE.' WHERE id='.$user_ida['id']);
displayErrorMessage(NULL, 'Clan erfolgreich Erstellt.', '<a href="index.php?as=clan/clan_info">weiter...</a>');
} else{
$sql = 'Select * from clan where clanname = \''.$clan_name.'\'';
$c_id = mysql_fetch_assoc(mysql_query($sql));
$c_id = mysqli_fetch_assoc(db_query($sql));
if($c_id){
$error = 'Clanname besteht schon!';
} else{

@ -29,7 +29,7 @@ function handleInvitation($user, $username, $clan){
displayErrorMessage(NULL, 'Fehler! Nutzer existiert nicht!');
return false;
}
$row = mysql_fetch_assoc(mysql_query('SELECT * FROM user where nickname = \''. $username.'\''));
$row = mysqli_fetch_assoc(db_query('SELECT * FROM user where nickname = \''. $username.'\''));
$userid = $row['id'];
if($row['clan'] == $user['clan']){
displayErrorMessage(NULL, 'Fehler! Nutzer ist schon in deinem Clan!', displayHistoryBackLink());
@ -39,12 +39,12 @@ function handleInvitation($user, $username, $clan){
if($row){
$sql = 'INSERT INTO user_clan_invitations(userid, clanid, valid) values('.$userid.','.$user['clan'].',TIMESTAMPADD(DAY, 5, now()))';
// echo $sql.'<br>';
mysql_query($sql);
if(mysql_affected_rows() <= 0){ // Fehler?
db_query($sql);
if(db_affected_rows() <= 0){ // Fehler?
$sql = 'UPDATE user_clan_invitations SET valid = TIMESTAMPADD(DAY, 5, now()) where userid = '.$userid.' and clanid = '.$user['clan'];
// echo $sql.'<br>';
mysql_query($sql);
if(mysql_affected_rows() <= 0){ // Fehler?
db_query($sql);
if(db_affected_rows() <= 0){ // Fehler?
displayErrorMessage(NULL, 'Fehler! Konnte Nutzer nicht einladen!', displayHistoryBackLink());
return false;
} else{
@ -64,8 +64,8 @@ function sendClanNewsletter($user, $clan, $text){
return;
}
$sql = 'SELECT id FROM user WHERE clan='.$clan['id'];
$clans = mysql_query($sql);
while($row = mysql_fetch_assoc($clans)) {
$clans = db_query($sql);
while($row = mysqli_fetch_assoc($clans)) {
sendMessage($user['id'], $row['id'], $clan['clanname'].' Nachricht', $text);
}
displayErrorMessage(NULL,'Nachricht erfolgreich verschickt', '<a href="index.php?as=clan/post">weiter...</a>');
@ -76,8 +76,8 @@ function revertInvitation($user, $clan, $userid){
displayErrorMessage(NULL, 'Nur der Leader, bzw. der Co-Leader kann Einladungen zur&uuml;ckziehen!!', displayHistoryBackLink());
return false;
}
mysql_query('DELETE FROM user_clan_invitations WHERE clan = '.$clan['id'].' AND userid = '.$userid);
if(mysql_affected_rows() > 0){
db_query('DELETE FROM user_clan_invitations WHERE clan = '.$clan['id'].' AND userid = '.$userid);
if(db_affected_rows() > 0){
displayErrorMessage('Zur&uuml;ckgezogen','Du hast die Einladung erfolgreich zur&uuml;ckgezogen!','<a href="index.php?as=clan/post">weiter</a>');
} else{
displayErrorMessage(NULL,'Einladung konnte nicht zur&uuml;ckgezogen werden!',displayHistoryBackLink());
@ -87,7 +87,7 @@ function revertInvitation($user, $clan, $userid){
}
$clan = mysql_fetch_assoc(mysql_query('SELECT * from clan where id = '.$user_ida['clan']));
$clan = mysqli_fetch_assoc(db_query('SELECT * from clan where id = '.$user_ida['clan']));
if($action == 'newsletter') {
sendClanNewsletter($user_ida, $clan, $text);
@ -126,8 +126,8 @@ if($action == 'newsletter') {
<th height="30" colspan="2" class="content">Aktion</th>
<?php
$sql = 'SELECT * FROM user_clan_invitations WHERE clanid = '.$user_ida['clan'].' and valid > now();';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)){
?>
<tr>
<td height="30" align="center" class="content"><?php echo displayUserLinkById($row['userid']); ?></td>

@ -18,12 +18,12 @@ $charm=$_GET['charm'];
$mindestchar = 12;
$clan = mysql_fetch_array(mysql_query("SELECT geld FROM clan WHERE id='$user_ida[clan]' LIMIT 1"));
$user = mysql_fetch_array(mysql_Query("SELECT nickname, geld FROM user WHERE id='$user_ida[id]' LIMIT 1"));
$clan = mysqli_fetch_array(db_query("SELECT geld FROM clan WHERE id='$user_ida[clan]' LIMIT 1"));
$user = mysqli_fetch_array(db_query("SELECT nickname, geld FROM user WHERE id='$user_ida[id]' LIMIT 1"));
if ($charm == 1) {
if($clan_geld <= 0) {
mysql_query("INSERT INTO cheater values('$user_ida[id]','Versuchte mehr weniger als 0 zu Spenden! (Eingabe:".$clan_geld.")',now())");
db_query("INSERT INTO cheater values('$user_ida[id]','Versuchte mehr weniger als 0 zu Spenden! (Eingabe:".$clan_geld.")',now())");
displayErrorMessage(NULL,'Geld darf nicht unter 0 sein!', '<a href="index.php?as=clan/spende">weiter...</a>');
exit;
}
@ -33,19 +33,19 @@ if ($charm == 1) {
// Um Pufferueberlaeufe zu vermeiden, einfach die Laenge der Zeichenkette abfragen, ab der 8ten stelle also uerbe 99 Mio geht nicht aufeinmal!
if(strlen($clan_geld)>8) {
mysql_query("INSERT INTO cheater values('$user_ida[id]','Versuchte mehr als 99.999.999 aufeinmal zu Spenden! (Eingabe:".$clan_geld.")',now())");
db_query("INSERT INTO cheater values('$user_ida[id]','Versuchte mehr als 99.999.999 aufeinmal zu Spenden! (Eingabe:".$clan_geld.")',now())");
displayErrorMessage(NULL,'Es kann nicht mehr als 99.999.999 aufeinmal gespendet werden!', '<a href="index.php?as=clan/spende">weiter...</a>');
exit;
}
if($clan_geld <= 0) {
mysql_query("INSERT INTO cheater values('$user_ida[id]','Versuchte mehr weniger als 0 zu Spenden! (Eingabe:".$clan_geld.")',now())");
db_query("INSERT INTO cheater values('$user_ida[id]','Versuchte mehr weniger als 0 zu Spenden! (Eingabe:".$clan_geld.")',now())");
displayErrorMessage(NULL,'Geld darf nicht unter 0 sein!', '<a href="index.php?as=clan/spende">weiter...</a>');
exit;
}
// Damit das minus nicht ausgenutzt wird!!
$auktionensumme = mysql_fetch_assoc(mysql_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$user_ida['id'].' GROUP BY bieter'));
$auktionensumme = mysqli_fetch_assoc(db_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$user_ida['id'].' GROUP BY bieter'));
$auktionensumme = $auktionensumme['summe'];
@ -54,12 +54,12 @@ if($clan_geld+$auktionensumme>$user['geld']) {
exit;
}
mysql_query("UPDATE clan SET geld=geld+'$clan_geld' WHERE id='$user_ida[clan]'");
mysql_query('Update user SET geld=geld-'.$clan_geld.' WHERE id='.$user_ida['id']);
mysql_query('UPDATE user_clan SET spende = spende + '.$clan_geld.' WHERE clanid = '.$user_ida['clan'].' and userid = '.$user_ida['id']);
db_query("UPDATE clan SET geld=geld+'$clan_geld' WHERE id='$user_ida[clan]'");
db_query('Update user SET geld=geld-'.$clan_geld.' WHERE id='.$user_ida['id']);
db_query('UPDATE user_clan SET spende = spende + '.$clan_geld.' WHERE clanid = '.$user_ida['clan'].' and userid = '.$user_ida['id']);
if(mysql_affected_rows() == 0){
mysql_query('INSERT INTO user_clan(spende,clanid,userid) values('.$clan_geld.','.$user_ida['clan'].','.$user_ida['id'].')');
if(db_affected_rows() == 0){
db_query('INSERT INTO user_clan(spende,clanid,userid) values('.$clan_geld.','.$user_ida['clan'].','.$user_ida['id'].')');
}
displayErrorMessage(NULL,'An Clan Erfolgreich Gespendet', '<a href="index.php?as=clan/spende">weiter...</a>');
@ -125,10 +125,10 @@ function stopp()
//$sql = 'SELECT miete as mietkosten, item_id from clan_ware inner join clan_item on clan_item.id = clan_ware.item_id where clan = '.$user_ida['clan'].' group by clan';
$sql ='SELECT miete, item_id, name, clan_ware.id from clan_ware inner join clan_item on clan_item.id = clan_ware.item_id where clan = '.$user_ida['clan'].' order by item_id asc';
//echo $sql.'<br>';
$qry = mysql_query($sql);
$qry = db_query($sql);
$clanraum = array();
$clanraum_a = array();
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
$clanraum[$row['id']] = $row;
// print_r($row);
$clanraum_a[] = $row;
@ -137,10 +137,10 @@ $raumanzahl = count($clanraum_a);
//echo 'Raumanzahl = '.$raumanzahl.'<br>';
$sql = 'SELECT chars.clan_train, count(chars.id) as anzahl from chars inner join user on chars.besitzer = user.id where user.clan = '.$user_ida['clan'].' and chars.clan_train != 0 group by chars.clan_train';
//echo $sql.'<br>';
$qry = mysql_query($sql);
$qry = db_query($sql);
$clanrauminfo = array();
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
$clanrauminfo[$row['clan_train']] = $row;
}
@ -148,25 +148,25 @@ while($row = mysql_fetch_assoc($qry)){
$sql = 'select clan_ware.id as clan_warenid, user.id as userid, count(chars.id) as anzahl, clan.id as clanid from clan inner join clan_ware on clan.id = clan_ware.clan inner join clan_item on clan_item.id = clan_ware.item_id inner join user on clan.id = user.clan left join chars on user.id = chars.besitzer and clan_ware.id = chars.clan_train where clan.id = '.$user_ida['clan'].' group by userid, clan_warenid order by userid, clan_warenid';
//echo $sql.'<br>';
$qry = mysql_query($sql);
$qry = db_query($sql);
$user_raum = array();
// Anzahl der Chars pro Raum pro User
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
$user_raum[$row['userid']][$row['clan_warenid']] = $row;
}
//print_r($user_raum);
$clans_spend = mysql_query('SELECT spende, nickname, user.id as userid FROM user left join user_clan on user.id = user_clan.userid and user.clan = user_clan.clanid WHERE user.clan = '.$user_ida['clan'].' ORDER BY spende DESC');
$member = mysql_num_rows($clans_spend);
$clans_spend = db_query('SELECT spende, nickname, user.id as userid FROM user left join user_clan on user.id = user_clan.userid and user.clan = user_clan.clanid WHERE user.clan = '.$user_ida['clan'].' ORDER BY spende DESC');
$member = mysqli_stmt_num_rows($clans_spend);
$sql = 'select besitzer, round(sum(1/(1+exp(3-level/12)) * nutzung)) as nutzkosten from user inner join chars on chars.besitzer = user.id inner join clan_ware on chars.clan_train = clan_ware.id inner join clan_item on clan_ware.item_id = clan_item.id where user.clan = clan_ware.clan and user.clan = '.$user_ida['clan'].' group by besitzer order by besitzer';
//echo $sql.'<br>';
$qry = mysql_query($sql);
$qry = db_query($sql);
$user_nutz = array();
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
$user_nutz[$row['besitzer']] = $row;
}
@ -208,7 +208,7 @@ $cols = 4;
</tr>
<?php
$summe = 0;
while($row = mysql_fetch_assoc($clans_spend)) {
while($row = mysqli_fetch_assoc($clans_spend)) {
?>
<tr>
<th align="center"><?php echo $row['nickname']; ?></th>
@ -240,8 +240,8 @@ while($row = mysql_fetch_assoc($clans_spend)) {
<th><?php echo $member; ?> Member</th>
<th><?php
$sql = 'SELECT sum(spende) as summe FROM user_clan WHERE clanid ='.$user_ida['clan'];
$qry = mysql_query($sql);
$row_s = mysql_fetch_assoc($qry);
$qry = db_query($sql);
$row_s = mysqli_fetch_assoc($qry);
echo displayMoney($row_s['summe']);
?></th>
<?php

@ -25,43 +25,43 @@ $h_name = validateName($_GET['h_name']);
// Nicht viel aber eine große Auswirkung
function wuenscheGeld($user){
mysql_query('UPDATE user SET geld=geld+10000000 WHERE id='.$user['id']);
db_query('UPDATE user SET geld=geld+10000000 WHERE id='.$user['id']);
return true;
}
function wuenschePotaras($user){
mysql_query('INSERT sp_ware SET item=1, user='.$user['id']);
mysql_query('INSERT sp_ware SET item=1, user='.$user['id']);
db_query('INSERT sp_ware SET item=1, user='.$user['id']);
db_query('INSERT sp_ware SET item=1, user='.$user['id']);
return true;
}
function wuenscheTeufelsfrucht($user){
$teufelsseele = mysql_fetch_assoc(mysql_query('SELECT count(id) as anzahl FROM sp_ware WHERE item=33 AND user='.$user['id']));
$teufelsseele = mysqli_fetch_assoc(db_query('SELECT count(id) as anzahl FROM sp_ware WHERE item=33 AND user='.$user['id']));
if($teufelsseele['anzahl'] <= 0) {
displayErrorMessage(NULL,'Du besitzt das benötigte Item nicht!!',displayHistoryBackLink());
return false;
}
mysql_query('DELETE FROM sp_ware WHERE item=33 AND user='.$user['id'].' LIMIT 1');
db_query('DELETE FROM sp_ware WHERE item=33 AND user='.$user['id'].' LIMIT 1');
$sum = mysql_fetch_assoc(mysql_query('SELECT sum(verteilung) as gesamt FROM wochen_markt WHERE art=\'natur\''));
$sum = mysqli_fetch_assoc(db_query('SELECT sum(verteilung) as gesamt FROM wochen_markt WHERE art=\'natur\''));
if($sum['gesamt'] != 100){
displayErrorMessage(NULL,'Die Wahrscheinlichkeit eine Frucht zu bekommen entspricht nicht 100%, Melde dich bei einem der GM!!',displayHistoryBackLink());
return false;
}
$natur_frucht = mysql_query('SELECT item, id,verteilung FROM wochen_markt WHERE art=\'natur\' order by id'); ///wieviel TF gibt es?.
$natur_frucht = db_query('SELECT item, id,verteilung FROM wochen_markt WHERE art=\'natur\' order by id'); ///wieviel TF gibt es?.
$value = mt_random_wrapper(1,100);
$peak = 0;
while($row = mysql_fetch_assoc($natur_frucht)){
while($row = mysqli_fetch_assoc($natur_frucht)){
$peak += $row['verteilung'];
if($value <= $peak){
break;
}
}
displayErrorMessage(NULL,'Du hast eine '.$row['item'].' bekommen!!','');
mysql_query('INSERT wochen_ware SET item='.$row['id'].', user='.$user['id']);
db_query('INSERT wochen_ware SET item='.$row['id'].', user='.$user['id']);
return true;
}
@ -81,8 +81,8 @@ function wuenscheSpecialChar($user, $specialcharname, $newname = ''){
}
// Hat der User überhaupt das Item ???
$qry = mysql_query('SELECT count(*) AS anzahl FROM sp_ware WHERE item='.$spitem.' AND user='.$user['id']);
$row = mysql_fetch_assoc($qry);
$qry = db_query('SELECT count(*) AS anzahl FROM sp_ware WHERE item='.$spitem.' AND user='.$user['id']);
$row = mysqli_fetch_assoc($qry);
if($row['anzahl'] < 1){
// Er hat das Item garnicht!!
displayErrorMessage(NULL,'Du kannst dir einen '.$specialcharname.' nur mit dem richtigen Item wünschen!!',displayHistoryBackLink());
@ -105,7 +105,7 @@ function wuenscheSpecialChar($user, $specialcharname, $newname = ''){
}
// Slotüberprüfung beendet!
mysql_query('DELETE FROM sp_ware WHERE item='.$spitem.' AND user='.$user['id'].' LIMIT 1');
db_query('DELETE FROM sp_ware WHERE item='.$spitem.' AND user='.$user['id'].' LIMIT 1');
return true;
}
@ -116,8 +116,8 @@ function wuenscheUserRename($user, $newname){
return false;
}
$sql = 'Insert into user_rename(pre_name, post_name, datum, userid, wunsch) values(\''.$user['nickname'].'\', \''.$newname.'\', now(), '.$user['id'].', 1)';
mysql_query($sql);
mysql_query('Update user set nickname = \''.$newname.'\' WHERE id = '.$user['id']);
db_query($sql);
db_query('Update user set nickname = \''.$newname.'\' WHERE id = '.$user['id']);
return true;
}
@ -129,7 +129,7 @@ function worker($charm,$wunsch,$user,$newname){
return;
}
$dragonballs = mysql_fetch_assoc(mysql_query('SELECT count(id) as anzahl FROM sp_ware WHERE user='.$user['id'].' AND item=11'));
$dragonballs = mysqli_fetch_assoc(db_query('SELECT count(id) as anzahl FROM sp_ware WHERE user='.$user['id'].' AND item=11'));
if($dragonballs['anzahl'] < 7) {
displayErrorMessage(NULL,'Du hast keine 7 Dragonballs!!',displayHistoryBackLink());
semaphoreDown($ressource);
@ -137,7 +137,7 @@ function worker($charm,$wunsch,$user,$newname){
}
$sql = 'DELETE FROM sp_ware WHERE item=11 AND user='.$user['id'].' LIMIT 7';
mysql_query($sql);
db_query($sql);
$result = true;
if($charm == 1) {
@ -158,13 +158,13 @@ function worker($charm,$wunsch,$user,$newname){
if($result){
displayErrorMessage('&Auml;nderungen &uuml;bernommen!','Dragonballs erfolgreich eingesetzt!!','<a href="index.php?as=dragonballs">weiter</a>');
} else{
mysql_query('INSERT sp_ware SET item=11, user='.$user['id']); // 1
mysql_query('INSERT sp_ware SET item=11, user='.$user['id']); // 2
mysql_query('INSERT sp_ware SET item=11, user='.$user['id']); // 3
mysql_query('INSERT sp_ware SET item=11, user='.$user['id']); // 4
mysql_query('INSERT sp_ware SET item=11, user='.$user['id']); // 5
mysql_query('INSERT sp_ware SET item=11, user='.$user['id']); // 6
mysql_query('INSERT sp_ware SET item=11, user='.$user['id']); // 7
db_query('INSERT sp_ware SET item=11, user='.$user['id']); // 1
db_query('INSERT sp_ware SET item=11, user='.$user['id']); // 2
db_query('INSERT sp_ware SET item=11, user='.$user['id']); // 3
db_query('INSERT sp_ware SET item=11, user='.$user['id']); // 4
db_query('INSERT sp_ware SET item=11, user='.$user['id']); // 5
db_query('INSERT sp_ware SET item=11, user='.$user['id']); // 6
db_query('INSERT sp_ware SET item=11, user='.$user['id']); // 7
}
semaphoreDown($ressource);
return;
@ -172,7 +172,7 @@ function worker($charm,$wunsch,$user,$newname){
function displayWuensche($user){
$items = mysql_query('SELECT distinct(i1.id) FROM sp_ware i INNER JOIN sp_item i1 ON(i.item=i1.id) WHERE i.user='.$user['id']);
$items = db_query('SELECT distinct(i1.id) FROM sp_ware i INNER JOIN sp_item i1 ON(i.item=i1.id) WHERE i.user='.$user['id']);
?>
@ -192,7 +192,7 @@ $items = mysql_query('SELECT distinct(i1.id) FROM sp_ware i INNER JOIN sp_item i
<option value="6">Nutzernamen &auml;ndern</option>
<?php
while($row = mysql_fetch_assoc($items)) {
while($row = mysqli_fetch_assoc($items)) {
if($row['id'] == 3) { ?>
<option value="3">Kaioshin befreien</option>
<?php

@ -46,13 +46,13 @@ include_once(ROOT_PATH.'/gm/include/tournament.inc.php');
function logaction($message){
$sql = 'Insert into gm_actions(userid, time, message, ip) values('.$_SESSION['user'].', now(), \''.$message.'\', \''.$_SERVER['REMOTE_ADDR'].'\')';
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
}
function showActionLog(){
$qry = mysql_query('Select g.time, u.nickname, g.ip, g.message from gm_actions as g inner join user as u on g.userid = u.id order by time desc LIMIT 100');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('Select g.time, u.nickname, g.ip, g.message from gm_actions as g inner join user as u on g.userid = u.id order by time desc LIMIT 100');
while($row = mysqli_fetch_assoc($qry)){
echo $row['time'].' '.$row['nickname'].' ('.$row['ip'].'): '.$row['message'].'<br>'."\n";
}
echo '<a href="'.$_SERVER['PHP_SELF'].'">Zum Hauptmenu</a>';
@ -71,8 +71,8 @@ function checkLoginData($userid, $password){
function loginUser($user,$pass){
if(checkLoginPassword($user,$pass)){
$test = 'SELECT * from user where nickname = \''.$user.'\'';
$qry = mysql_query($test);
$result = mysql_fetch_assoc($qry);
$qry = db_query($test);
$result = mysqli_fetch_assoc($qry);
$usergroups = getUserGroups($user);
if(isUserInGroup($usergroups, ADMIN)) {

@ -101,7 +101,7 @@ function searchfirstAttack($action) {
}
function searchsecondAttack($action, $attackname) {
$qry = mysql_query('Select name,id from attacken where name like \'%'.$attackname.'%\'');
$qry = db_query('Select name,id from attacken where name like \'%'.$attackname.'%\'');
?>
<form action="" method="POST">
<input name="choose" value="attacken" type="hidden"></input> <input
@ -114,7 +114,7 @@ function searchsecondAttack($action, $attackname) {
<tr>
<td><select name="attackid">
<?php
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
echo '<option value="'.$row['id'].'">'.$row['name'].'</option>\n';
}
?>
@ -134,12 +134,12 @@ function searchsecondAttack($action, $attackname) {
function createOrEditAttack($action, $attackid) {
if($action == 'edit'){
$row = mysql_fetch_assoc(mysql_query('Select * from attacken where id ='.$attackid));
$row = mysqli_fetch_assoc(db_query('Select * from attacken where id ='.$attackid));
}
//Alle attacken auslesen
$att_qry = mysql_query('SELECT id,name FROM attacken WHERE info not like \'%NPC%\' ORDER BY name');
$att_qry = db_query('SELECT id,name FROM attacken WHERE info not like \'%NPC%\' ORDER BY name');
$available_attacks = array();
while($attacks = mysql_fetch_assoc($att_qry)) {
while($attacks = mysqli_fetch_assoc($att_qry)) {
$available_attacks[] = array($attacks['id'], $attacks['name']);
}
$used_attacks = explode(',', $row['req_atk']);
@ -217,8 +217,8 @@ function createOrEditAttack($action, $attackid) {
<td>Type:</td>
<td><select name="type">
<?php
$qry = mysql_query('Select name FROM attackentyp;');
while ($result = mysql_fetch_assoc($qry)) {
$qry = db_query('Select name FROM attackentyp;');
while ($result = mysqli_fetch_assoc($qry)) {
if($row['type'] == $result['name']){
echo '<option value="'.$result['name'].'" selected="selected">'.$result['name'].'</option>';
} else{
@ -315,14 +315,14 @@ function createOrEditAttack($action, $attackid) {
<?php
// Fuers dropdown
$f_sql = 'SELECT id, item FROM wochen_markt WHERE type = \'Teufels Frucht\' order by item';
$f_qry = mysql_query($f_sql);
$f_qry = db_query($f_sql);
if($row['Frucht'] === NULL || $row['Frucht'] == 0){
echo '<option value="0" selected="selected">-Keine-</option>';
} else {
echo '<option value="0">-Keine-</option>';
}
while($f_row = mysql_fetch_assoc($f_qry)){
while($f_row = mysqli_fetch_assoc($f_qry)){
if($f_row['id'] == $row['Frucht']){
echo '<option value="'.$f_row['id'].'" selected="selected">'.$f_row['item'].'</option>';
} else{
@ -374,7 +374,7 @@ function createAttack($attackname, $Frucht, $starke, $verteidigung, $speed, $hp,
$sql = 'INSERT into attacken set name = \''.$attackname.'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.addslashes($options).'\'';
}
//echo $sql.'<br>';
if(!mysql_query($sql)){
if(!db_query($sql)){
echo "Fehler beim Erstellen der Attacke: &Uuml;berpr&uuml;fe deine Eingabe und melde erst DANACH dieses Statement einem Entwickler => $sql";
return;
}
@ -392,8 +392,8 @@ function deleteAttack($attackid, $depth) {
if($depth == 4){
$sql = 'Delete from attacken where id = '.$attackid;
// echo 'Debugnachricht: '.$sql.'<br>';
mysql_query($sql);
mysql_query('Delete from lernen where at_id = '.$attackid);
db_query($sql);
db_query('Delete from lernen where at_id = '.$attackid);
logaction('Attacke mit id = '.$attackid.' wurde geloescht!');
} else{
@ -416,7 +416,7 @@ sicher??
}
function editAttack($attackname, $attackid, $Frucht, $starke, $verteidigung, $speed, $hp, $mp, $rassen, $level, $geld, $options, $type, $info, $req_atk, $req_lvl, $runden, $maxlvl) {
$row = mysql_fetch_assoc(mysql_query('Select * from attacken where id ='.$attackid));
$row = mysqli_fetch_assoc(db_query('Select * from attacken where id ='.$attackid));
$req_atk = implode(',', $req_atk);
json_decode($options, true);
@ -435,10 +435,10 @@ function editAttack($attackname, $attackid, $Frucht, $starke, $verteidigung, $sp
$sql = 'UPDATE attacken set name = \''.htmlspecialchars(urldecode($attackname)).'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = NULL, runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.$options.'\' where id = '.$attackid;
}
if($row['name'] != $attackname){
mysql_query('Update lernen set name = \''.$attackname.'\' WHERE at_id ='.$attackid);
db_query('Update lernen set name = \''.$attackname.'\' WHERE at_id ='.$attackid);
}
//echo 'Debugnachricht: '.$sql.'<br>';
if(!mysql_query($sql)){
if(!db_query($sql)){
echo "Fehler beim Editieren der Attacke: &Uuml;berpr&uuml;fe deine Eingabe und melde erst DANACH dieses Statement einem Entwickler => $sql";
return;
}
@ -508,7 +508,7 @@ function displayAttackenTypenOverview($page) {
echo "\t".'<tr><td colspan="'.$colspan.'"><hr></td></tr>'."\n";
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
echo "\t".'<tr>'."\n";
for($i=0;$i<count($d_array);$i++){
echo "\t\t".'<td>'.$row[$d_array[$i]].'</td>'."\n";
@ -524,7 +524,7 @@ function displayAttackenTypenOverview($page) {
echo "\t".'</tr>'."\n";
}
$total = mysql_num_rows(db_query('SELECT '.join($d_array,',').' FROM attackentyp'));
$total = mysqli_stmt_num_rows(db_query('SELECT '.join($d_array,',').' FROM attackentyp'));
$url = '<a href="'.$_SERVER['PHP_SELF'].'?choose=npc&page=###PAGE###">###LABEL###</a>';
echo "\t".'<tr><td colspan="'.$colspan.'"><hr></td></tr>'."\n";
echo "\t".'<tr><td colspan="'.$colspan.'">'.displayPagelinksNew(20, $total, $page, $url).'</td></tr>'."\n";
@ -544,7 +544,7 @@ function displayAttackenTypenInfo($action, $task, $attid) {
if($task == TASK_EDIT) {
$sql = 'SELECT * FROM attackentyp WHERE id = '.$attid.';';
$qry = db_query($sql);
$row = mysql_fetch_assoc($qry);
$row = mysqli_fetch_assoc($qry);
}
$colspan = 2;
@ -584,7 +584,7 @@ function editAttackentyp($attid, $data) {
$u = db_query($sql);
$log = 0;
if(mysql_affected_rows() == 0 || $u === FALSE) {
if(db_affected_rows() == 0 || $u === FALSE) {
echo "\t\t\t".'<tr><td colspan="2" style="color:red">Fehler aufgetreten!</td></tr>';
} else{
echo "\t\t\t".'<tr><td colspan="2">Änderungen wurden übernommen!</td></tr>';
@ -614,7 +614,7 @@ function createAttackentyp($data) {
$sql .= '\''.$data['kategorie'].'\'';
}
$sql .= ');';
$identifier = mysql_query($sql);
$identifier = db_query($sql);
if($identifier == FALSE){
echo "\t".'<tr><td colspan="2" style="text-align:center">Es gab Probleme beim erstellen des Attacktyps!</td></tr>'."\n";
} else {
@ -628,7 +628,7 @@ function deleteAttackentyp($attid) {
$colspan = 1;
$sql = 'DELETE FROM attackentyp WHERE id = '.$attid.';';
$qry = db_query($sql);
if($qry === FALSE || mysql_affected_rows() <= 0){
if($qry === FALSE || db_affected_rows() <= 0){
echo "\t".'<tr><td colspan="'.$colspan.'" style="text-align:center;color:red">Der Attackentyp '.$row['name'].' konnte nicht gelöscht werden!</td></tr>'."\n";;
} else {
echo "\t".'<tr><td colspan="'.$colspan.'" style="text-align:center">Der Attackentyp '.$row['name'].' wurde gelöscht!</td></tr>'."\n";;
@ -641,7 +641,7 @@ function displayDeleteAttackentyp($attid) {
$sql = 'SELECT * FROM attackentyp WHERE id = '.$attid;
$qry = db_query($sql);
$row = mysql_fetch_assoc($qry);
$row = mysqli_fetch_assoc($qry);
echo "\t".'<tr><td colspan="'.$colspan.'"><h1 style="text-align:center">Attackentyp löschen</h1></td></tr>'."\n";
echo "\t".'<tr><td colspan="'.$colspan.'" style="text-align:center">Soll der Attackentyp '.$row['name'].' wirklich gelöscht werden?</td></tr>'."\n";

@ -38,10 +38,10 @@ function zeigeBilder($begin, $bildurl, $sure, $view, $letter, $date_from, $date_
echo '<tr><form action="'.$_SERVER['PHP_SELF'].'" method="GET"><input type="hidden" name="choose" value="bilder" /><input type="hidden" name="view" value="ByDate" /><td>Von:<input name="date_from"></td><td>Bis: <input name="date_until"></td><td><input type="submit" name="aktualisieren"></td></form></tr>';
$test = 'SELECT name, nickname, bild FROM chars inner join user on chars.besitzer = user.id where bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\' and bild_edit is not null and bild_edit between '.$date_from.' and '.$date_until.' group by besitzer, bild order by nickname';
// echo $test.'<br>';
$qry = mysql_query($test);
$qry = db_query($test);
$actual = '';
$i = 0;
while($result = mysql_fetch_assoc($qry)){
while($result = mysqli_fetch_assoc($qry)){
if($actual == '' || $result['nickname'] != $actual){
// Fuelle die Leeren Felder aus
for(;$i<8;$i++){
@ -59,12 +59,12 @@ function zeigeBilder($begin, $bildurl, $sure, $view, $letter, $date_from, $date_
} else if($view == 'Random'){
$colspan = ' colspan=5';
$sql = 'SELECT name, nickname, bild FROM chars inner join user on chars.besitzer = user.id where besitzer > 2 and bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\' group by bild order by rand() limit 20';
$qry = mysql_query($sql);
$qry = db_query($sql);
echo '<tr><th'.$colspan.'>Avatar Zufall</th></tr>';
for($i=0;$i<4;$i++){
echo '<tr>';
for($t=0;$t<5;$t++){
$tmp = mysql_fetch_assoc($qry);
$tmp = mysqli_fetch_assoc($qry);
if($tmp){
echo '<td><a href="gm_seite.php?choose=bilder&view=SinglePic&bildurl='.urlencode($tmp['bild']).'">'.$tmp['name'].'<br><img src="'.$tmp['bild'].'" width="75" height="75"></a></td>';
} else {
@ -94,28 +94,28 @@ function zeigeBilder($begin, $bildurl, $sure, $view, $letter, $date_from, $date_
echo '</tr></table></td></tr>';
if($letter == 'Numeric'){
$auser = mysql_query('SELECT distinct(user.nickname) FROM chars inner join user on chars.besitzer = user.id where SUBSTRING(nickname,1,1) < \'a\' and bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\' group by user.id order by nickname ASC LIMIT '.($begin*10).', 10');
$total = mysql_fetch_assoc(mysql_query('SELECT count(distinct(user.id)) as anzahl FROM chars inner join user on chars.besitzer = user.id where SUBSTRING(nickname,1,1) < \'a\' and bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\''));
$auser = db_query('SELECT distinct(user.nickname) FROM chars inner join user on chars.besitzer = user.id where SUBSTRING(nickname,1,1) < \'a\' and bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\' group by user.id order by nickname ASC LIMIT '.($begin*10).', 10');
$total = mysqli_fetch_assoc(db_query('SELECT count(distinct(user.id)) as anzahl FROM chars inner join user on chars.besitzer = user.id where SUBSTRING(nickname,1,1) < \'a\' and bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\''));
} else if($letter == null){
$auser = mysql_query('SELECT * FROM chars inner join user on chars.besitzer = user.id where bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\' group by user.id order by nickname ASC LIMIT '.($begin*10).', 10');
$total = mysql_fetch_assoc(mysql_query('SELECT count(distinct(user.id)) as anzahl FROM chars inner join user on chars.besitzer = user.id where bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\''));
$auser = db_query('SELECT * FROM chars inner join user on chars.besitzer = user.id where bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\' group by user.id order by nickname ASC LIMIT '.($begin*10).', 10');
$total = mysqli_fetch_assoc(db_query('SELECT count(distinct(user.id)) as anzahl FROM chars inner join user on chars.besitzer = user.id where bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\''));
} else{
$auser = mysql_query('SELECT * FROM chars inner join user on chars.besitzer = user.id where nickname like \''.$letter.'%\' and bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\' group by user.id order by nickname ASC LIMIT '.($begin*10).', 10');
$total = mysql_fetch_assoc(mysql_query('SELECT count(distinct(user.id)) as anzahl FROM chars inner join user on chars.besitzer = user.id where nickname like \''.$letter.'%\' and bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\''));
$auser = db_query('SELECT * FROM chars inner join user on chars.besitzer = user.id where nickname like \''.$letter.'%\' and bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\' group by user.id order by nickname ASC LIMIT '.($begin*10).', 10');
$total = mysqli_fetch_assoc(db_query('SELECT count(distinct(user.id)) as anzahl FROM chars inner join user on chars.besitzer = user.id where nickname like \''.$letter.'%\' and bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\''));
}
$total = $total['anzahl'];
$users = array();
while($row = mysql_fetch_assoc($auser)){
while($row = mysqli_fetch_assoc($auser)){
// echo 'User: '.$row['id'].'<br>';
$users[] = $row['id'];
}
echo '<td'.$colspan.'><table>'.displayPagelinksNew(10, $total, $begin, '<a href="'.$_SERVER['PHP_SELF'].'?choose=bilder&view=ByUser&letter='.$letter.'&begin=###PAGE###">###LABEL###</a>').'</td>';
$test = 'SELECT name, nickname, bild FROM chars inner join user on chars.besitzer = user.id where besitzer IN ('.join(',', $users).') and bild != \'design/bilder/avatare/noavart.gif\' and bild != \'\' group by besitzer, bild order by nickname';
$qry = mysql_query($test);
$qry = db_query($test);
$actual = '';
$i = 0;
while($result = mysql_fetch_assoc($qry)){
while($result = mysqli_fetch_assoc($qry)){
if($actual == '' || $result['nickname'] != $actual){
// Fuelle die Leeren Felder aus
for(;$i<8;$i++){
@ -134,14 +134,14 @@ function zeigeBilder($begin, $bildurl, $sure, $view, $letter, $date_from, $date_
if($bildurl !== NULL && $sure == 'yes'){
echo '<tr><td>Bild wurde zur&uuml;ckgesetzt</td>';
echo '<td><a href="javascript:history.go(-2);">Zur&uuml;ck</a></td></tr>';
mysql_query('Update chars SET bild=\'\' where bild = \''.urldecode($bildurl).'\' ');
db_query('Update chars SET bild=\'\' where bild = \''.urldecode($bildurl).'\' ');
} else if($bildurl !== NULL){
$colspan = ' colspan=2';
$qry = mysql_query('SELECT name, nickname, bild FROM chars inner join user on chars.besitzer = user.id where bild=\''.urldecode($bildurl).'\'');
$qry = db_query('SELECT name, nickname, bild FROM chars inner join user on chars.besitzer = user.id where bild=\''.urldecode($bildurl).'\'');
echo '<tr><td'.$colspan.' align="center">Wollen sie dieses Bild wirklich l&ouml;schen?</td></tr>';
echo '<tr><td'.$colspan.' align="center"><img src="'.$bildurl.'" width="75" height="75"></td></tr>';
echo '<tr><td>Betroffener User</td><td>Betroffener Char</td></tr>';
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
echo '<tr><td>'.$row['nickname'].'</td><td>'.$row['name'].'</td></tr>';
}
echo '<tr><td><a href="gm_seite.php?choose=bilder&view=SinglePic&bildurl='.urlencode($bildurl).'&sure=yes">ja</a></td><td><a href="javascript:history.back();">nein</a></td></tr>';

@ -12,7 +12,7 @@
defineIfNotDefined("CLAN_CREATION_FEE", 20000);
function displayClanItems() {
$raume_qry = mysql_query('SELECT * FROM clan_item order by tp');
$raume_qry = db_query('SELECT * FROM clan_item order by tp');
?>
<table>
<tr>
@ -36,7 +36,7 @@ function displayClanItems() {
<td colspan=12><hr></td>
</tr>
<?php
while($res = mysql_fetch_assoc($raume_qry)){
while($res = mysqli_fetch_assoc($raume_qry)){
echo '<tr><td>'.$res['name'].'</td><td>'.$res['staerke'].'</td><td>'.$res['verteidigung'].'</td><td>'.$res['glueck'].'</td><td>'.$res['ausdauer'].'</td><td>'.$res['geschwindigkeit'].'</td><td>'.$res['preis'].'</td><td>'.$res['miete'].'</td><td>'.$res['nutzung'].'</td><td>'.$res['tp'].'</td><td>'.$res['req_level'].'</td><td><a href="'.$_SERVER['PHP_SELF'].'?choose=clan&action=editrooms&raumid='.$res['id'].'">edit</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=clan&action=deleterooms&raumid='.$res['id'].'">delete</a></td></tr>';
}
?>
@ -91,19 +91,19 @@ function displayEditOrCreateClanRoom($action, $raumid, $raumname, $staerke, $ver
if($action == 'editrooms'){
logaction('Der Raum '.$raumname.' wurde editiert!');
$sql ='Update clan_item set name = \''.$raumname.'\', staerke = '.$staerke.', verteidigung = '.$verteidigung.', ausdauer = '.$ausdauer.', geschwindigkeit = '.$geschwindigkeit.', glueck = '.$glueck.', preis = '.$kaufpreis.', miete = '.$miete.', nutzung = '.$nutz.', tp = '.$tp.', info = \''.$info.'\', req_level = '.$level.' where id = '.$raumid.'';
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res)
echo $sql . '<br>';
} else if($action == 'createrooms'){
logaction('Der Raum '.$raumname.' wurde erstellt!');
$sql = 'INSERT INTO clan_item(name, staerke, verteidigung, ausdauer, geschwindigkeit, glueck, preis, miete, nutzung, tp, info, req_level) values(\''.$raumname.'\', '.$staerke.', '.$verteidigung.', '.$ausdauer.', '.$geschwindigkeit.', '.$glueck.', '.$kaufpreis.', '.$miete.', '.$nutz.', '.$tp.', \''.$info.'\', '.$level.')';
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res)
echo $sql . '<br>';
}
}
if($action == 'editrooms'){
$raum = mysql_fetch_assoc(mysql_query('SELECT * FROM clan_item WHERE id = '.$raumid));
$raum = mysqli_fetch_assoc(db_query('SELECT * FROM clan_item WHERE id = '.$raumid));
$aLabel = 'editieren';
} else{
$aLabel = 'erstellen';
@ -200,8 +200,8 @@ function displayDeleteClanRoom($raumname, $raumid) {
<table>
<?php
if($raumname !== NULL){
mysql_query('DELETE FROM clan_item WHERE id = '.$raumid);
mysql_query('DELETE FROM clan_ware where item_id ='.$raumid);
db_query('DELETE FROM clan_item WHERE id = '.$raumid);
db_query('DELETE FROM clan_ware where item_id ='.$raumid);
?>
<tr>
<td align="center" colspan="2">Der Raum "<?php echo $raumname; ?>"
@ -209,7 +209,7 @@ if($raumname !== NULL){
</tr>
<?php
} else{
$res = mysql_fetch_assoc(mysql_query('SELECT * FROM clan_item WHERE id = '.$raumid));
$res = mysqli_fetch_assoc(db_query('SELECT * FROM clan_item WHERE id = '.$raumid));
?>
<tr>
<td align="center" colspan="2">Den Raum "<?php echo $res['name']; ?>"

@ -188,9 +188,9 @@ function displayNews($action, $username, $newsid, $header, $value){
$header = addslashes($header);
$value = urldecode($value);
$value = encodeNoHTMLWithBB($value);
mysql_query('INSERT INTO ff11_news(name, betreff, text, zeit, datum)' .
db_query('INSERT INTO ff11_news(name, betreff, text, zeit, datum)' .
' values(\''.$username.'\',\''.$header.'\',\''.$value.'\',CURRENT_TIME, CURRENT_DATE)');
if(mysql_affected_rows() > 0){
if(db_affected_rows() > 0){
logaction('News '.$header.' wurde erstellt!');
echo 'news erfolgreich erstellt!<br>';
} else {
@ -203,8 +203,8 @@ function displayNews($action, $username, $newsid, $header, $value){
$value = encodeNoHTMLWithBB($value);
$sql = 'UPDATE ff11_news set betreff = \''.$header.'\', text = \''.$value.'\' where id ='.$newsid;
echo $sql.'<br>';
mysql_query($sql);
if(mysql_affected_rows() > 0){
db_query($sql);
if(db_affected_rows() > 0){
logaction('News '.$header.' wurde editiert!');
echo 'news erfolgreich editiert!<br>';
} else {
@ -217,7 +217,7 @@ function displayNews($action, $username, $newsid, $header, $value){
$buttonval = 'erstellen';
} else{
$topic = 'Newseintrag editieren';
$row = mysql_fetch_assoc(mysql_query('Select * from ff11_news where id = '.$newsid));
$row = mysqli_fetch_assoc(db_query('Select * from ff11_news where id = '.$newsid));
$header = debbcode($row['betreff']);
$value = debbcode($row['text']);
$buttonval = 'editieren';
@ -265,14 +265,14 @@ function displayNews($action, $username, $newsid, $header, $value){
</form>
<?php
} else if($action == 'edit'){
$qry = mysql_query('Select * from ff11_news order by id desc');
$qry = db_query('Select * from ff11_news order by id desc');
?>
<table>
<tr>
<th>News bearbeiten (Auswahl)</th>
</tr>
<?php
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
?>
<tr>
<td>
@ -335,8 +335,8 @@ function displayPolls($action,$openumfrage,$closeumfrage,$thema,$optionen,$text,
<select name="openumfrage">
<option value="-1">---Bitte Ausw&auml;hlen---</option>
<?php
$qry = mysql_query('SELECT * from poll WHERE TIMESTAMPDIFF(Minute, close, now()) <= 0 || close is null');
while($result = mysql_fetch_assoc($qry)){
$qry = db_query('SELECT * from poll WHERE TIMESTAMPDIFF(Minute, close, now()) <= 0 || close is null');
while($result = mysqli_fetch_assoc($qry)){
echo '<option value="'.$result['pollid'].'">'.$result['thema'].'</option>';
}
?>
@ -351,8 +351,8 @@ function displayPolls($action,$openumfrage,$closeumfrage,$thema,$optionen,$text,
<select name="closeumfrage">
<option value="-1">---Bitte Ausw&auml;hlen---</option>
<?php
$qry = mysql_query('SELECT * from poll WHERE TIMESTAMPDIFF(Minute, close, now()) > 0');
while($result = mysql_fetch_assoc($qry)){
$qry = db_query('SELECT * from poll WHERE TIMESTAMPDIFF(Minute, close, now()) > 0');
while($result = mysqli_fetch_assoc($qry)){
echo '<option value="'.$result['pollid'].'">'.$result['thema'].'</option>';
}
?>
@ -385,9 +385,9 @@ function displayPolls($action,$openumfrage,$closeumfrage,$thema,$optionen,$text,
$pollid = $closeumfrage;
}
if(is_numeric($pollid) && $pollid >= 0){
$result = mysql_fetch_assoc(mysql_query('SELECT * FROM poll WHERE pollid='.$pollid));
$qry = mysql_query('SELECT * FROM poll_options WHERE pollid='.$pollid);
while($opts = mysql_fetch_assoc($qry)){
$result = mysqli_fetch_assoc(db_query('SELECT * FROM poll WHERE pollid='.$pollid));
$qry = db_query('SELECT * FROM poll_options WHERE pollid='.$pollid);
while($opts = mysqli_fetch_assoc($qry)){
$options[$opts['polloptionid']] = $opts['text'];
}
?>
@ -470,20 +470,20 @@ function displayPolls($action,$openumfrage,$closeumfrage,$thema,$optionen,$text,
</form>
<?php
} else if($action == 'save'){
mysql_query('INSERT INTO poll(ersteller, thema, open, close, text) values('.$_SESSION['user'].',\''.$thema.'\',now(),NULL,\''.$text.'\')');
$pollid = mysql_fetch_assoc(mysql_query('SELECT pollid FROM poll WHERE text=\''.$text.'\''));
db_query('INSERT INTO poll(ersteller, thema, open, close, text) values('.$_SESSION['user'].',\''.$thema.'\',now(),NULL,\''.$text.'\')');
$pollid = mysqli_fetch_assoc(db_query('SELECT pollid FROM poll WHERE text=\''.$text.'\''));
for($i=0;$i<5;$i++){
if($optionen[$i] != null){
mysql_query('INSERT INTO poll_options(pollid, polloptionid, text) values('.$pollid['pollid'].','.$i.',\''.$optionen[$i].'\')');
db_query('INSERT INTO poll_options(pollid, polloptionid, text) values('.$pollid['pollid'].','.$i.',\''.$optionen[$i].'\')');
}
}
displayPolls('display',NULL, NULL,NULL,NULL,NULL,$pollid['pollid']);
} else if($action == 'update'){
mysql_query('UPDATE poll set thema =\''.$thema.'\', text =\''.$text.'\' WHERE pollid ='.$pollid);
db_query('UPDATE poll set thema =\''.$thema.'\', text =\''.$text.'\' WHERE pollid ='.$pollid);
for($i=0;$i<5;$i++){
if($optionen[$i] != null){
$sql = 'UPDATE poll_options SET text =\''.$optionen[$i].'\' WHERE pollid='.$pollid.' AND polloptionid ='.$i;
mysql_query($sql);
db_query($sql);
echo $sql.'<br>';
}
}

@ -37,9 +37,9 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
. ' union'
. ' SELECT i.id, i.item AS name, \'wochen_markt\' as tablename FROM wochen_markt i';
}
$qry = mysql_query($sql.' LIMIT '.($page*20).', 20');
$qry = db_query($sql.' LIMIT '.($page*20).', 20');
// echo $sql.' LIMIT '.($page*30).', 30';
$anzahlSeiten = ceil(mysql_num_rows(mysql_query($sql))/20);
$anzahlSeiten = ceil(mysqli_stmt_num_rows(db_query($sql))/20);
$colspan = 3;
echo "\t\t\t".'<tr><td colspan="'.$colspan.'"><h1 style="text-align:center">Bearbeiten</h1></td></tr>'."\n";;
$o_array = array('-Alle-', 'Markt Items', 'Schatzsuche Items', 'Auktionsitems');
@ -57,7 +57,7 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
echo "\t\t\t".'<tr><td colspan="'.$colspan.'"><hr></td></tr>'."\n";
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
echo "\t\t\t".'<tr><td>'.$row['name'].'</td><td width="10"><a href="'.$_SERVER['PHP_SELF'].'?choose=items&action=edit&task=change&itemid='.$row['id'].'&itemtable='.$row['tablename'].'&searchstring='.$searchstring.'&s_itemtable='.$s_itemtable.'&page='.$page.'">Edit</a></td>';
echo '<td width="10"><a href="'.$_SERVER['PHP_SELF'].'?choose=items&action=edit&task=delete&itemid='.$row['id'].'&itemtable='.$row['tablename'].'&searchstring='.$searchstring.'&s_itemtable='.$s_itemtable.'&page='.$page.'">Delete</a></td></tr>'."\n";
}
@ -87,8 +87,8 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
}
if(!$error){
$sql = 'SELECT '.join(',', $d_array).' FROM '.$itemtable.' where id = '.$itemid;
$qry = mysql_query($sql);
$row = mysql_fetch_assoc($qry);
$qry = db_query($sql);
$row = mysqli_fetch_assoc($qry);
echo "\t\t".'<tr><td>'.$desc_array[0].'</td><td style="text-align:center">'.$row[$d_array[0]].'</td></tr>'."\n";
for($i = 1;$i<count($d_array)-1;$i++){
echo "\t\t".'<tr><td>'.$desc_array[$i].'</td><td style="text-align:center"><input name="data['.$d_array[$i].']" value="'.debbcode($row[$d_array[$i]]).'"></input></td></tr>'."\n";
@ -120,7 +120,7 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
if(!$error){
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
echo "\t\t\t".'<tr><td colspan="'.$colspan.'" style="text-align:center">Soll Item "'.$row['name'].'" wirklich gelöscht werden?</td></tr>'."\n";
echo "\t\t\t".'<tr><td style="text-align:center"><a href="'.$_SERVER['PHP_SELF'].'?choose=items&action=edit&task=dodelete&itemid='.$itemid.'&itemtable='.$itemtable.'&s_itemtable='.$s_itemtable.'&searchstring='.$searchstring.'&page='.$page.'">ja</a>, <a href="'.$_SERVER['PHP_SELF'].'?choose=items&action=edit&s_itemtable='.$s_itemtable.'&searchstring='.$searchstring.'&page='.$page.'">nein</a>, <a href="'.$_SERVER['PHP_SELF'].'?choose=items&action=edit&task=delete&itemid='.$itemid.'&itemtable='.$itemtable.'&s_itemtable='.$s_itemtable.'&searchstring='.$searchstring.'&page='.$page.'">vielleicht</a></td></tr>'."\n";
}
@ -139,7 +139,7 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
if(!$error){
$sql = 'UPDATE '.$itemtable.' SET ';
$row = mysql_fetch_assoc(mysql_query('Select '.$d_array[0].' from '.$itemtable.' WHERE id = '.$itemid));
$row = mysqli_fetch_assoc(db_query('Select '.$d_array[0].' from '.$itemtable.' WHERE id = '.$itemid));
$sql .= $d_array[0].' = \''.encodeNoHTMLWithBB($data[$d_array[0]]).'\'';
@ -149,21 +149,21 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
$sql .= ' WHERE id=\''.$itemid.'\'';
// echo $sql.'<br>';
$u = mysql_query($sql);
if(mysql_affected_rows() == 0 || $u === FALSE){
$u = db_query($sql);
if(db_affected_rows() == 0 || $u === FALSE){
echo "\t\t\t".'<tr><td colspan="2" style="color:red">Fehler! Änderungen konnten nicht übernommen werden!</td></tr>';
} else{
logaction('Ein Item wurde geändert (@'.$itemtable.', id = '.$itemid.','.encodeNoHTMLWithBB(join($data,',')).')');
echo "\t\t\t".'<tr><td colspan="2">Änderungen wurden übernommen!</td></tr>';
mysql_query('UPDATE chars set frucht = \''.encodeNoHTMLWithBB($data[$d_array[0]]).'\' where frucht = \''.$row[$d_array[0]].'\'');
db_query('UPDATE chars set frucht = \''.encodeNoHTMLWithBB($data[$d_array[0]]).'\' where frucht = \''.$row[$d_array[0]].'\'');
if($itemtable == 'wochen_markt'){
$sql = 'Update sp_item set name = \''.encodeNoHTMLWithBB($data[$d_array[0]]).'\' where name = \''.$row[$d_array[0]].'\'';
echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
} else if($itemtable == 'sp_item'){
$sql = 'Update wochen_markt set item = \''.encodeNoHTMLWithBB($data[$d_array[0]]).'\' where item = \''.$row[$d_array[0]].'\'';
echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
}
}
}
@ -188,11 +188,11 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
$error = true;
}
if(!$error){
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if(mysql_query($d_sql) === FALSE || mysql_affected_rows() == 0){
if(db_query($d_sql) === FALSE || db_affected_rows() == 0){
echo "\t\t\t".'<tr><td colspan="2">Item "'.$row['name'].'" konnte nicht gelöscht werden!</td></tr>';
} else if(mysql_query($d_sql_2) === FALSE){
} else if(db_query($d_sql_2) === FALSE){
logaction('Ein Item wurde gelöscht (@'.$itemtable.', id = '.$itemid.','.$row['name'].')');
echo "\t\t\t".'<tr><td colspan="2">Item "'.$row['name'].'" wurde zwar gelöscht, bei der Warentabelle ist jedoch ein Fehler aufgetreten!</td></tr>';
} else{
@ -225,8 +225,8 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
if(!$error){
// We create an itemtable-wide unique id!!
$row = mysql_fetch_assoc(mysql_query('select max(max_id) + 1 as id from (select max(s.id) as max_id from sp_item s union select max(i.id) as max_id from item i union select max(w.id) as max_id from wochen_markt w) gno'));
// $row = mysql_fetch_assoc(mysql_query('SELECT max(id) +1 as id FROM '.$itemtable));
$row = mysqli_fetch_assoc(db_query('select max(max_id) + 1 as id from (select max(s.id) as max_id from sp_item s union select max(i.id) as max_id from item i union select max(w.id) as max_id from wochen_markt w) gno'));
// $row = mysqli_fetch_assoc(db_query('SELECT max(id) +1 as id FROM '.$itemtable));
$itemid = $row['id'];
$sql = 'INSERT INTO '.$itemtable.' (id, '.join($d_array,', ').') values('.$itemid;
@ -238,8 +238,8 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
$sql .= ')';
// echo $sql.'<br>';
$u = mysql_query($sql);
if(mysql_affected_rows() == 0 || $u === FALSE){
$u = db_query($sql);
if(db_affected_rows() == 0 || $u === FALSE){
echo "\t\t\t".'<tr><td colspan="2" style="color:red">Fehler! Konnte Item nicht erstellen!</td></tr>';
displayItems($action, null, null, $itemtable, $searchstring, $s_itemtable,$page, $data);
} else{
@ -335,8 +335,8 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
$sql = 'SELECT '.join($d_array,',').' FROM '.$itemtable;
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)){
echo "\t\t\t".'<tr>';
for($i=1;$i<count($d_array)-1;$i++){
echo '<td>'.$row[$d_array[$i]].'</td>';

@ -12,7 +12,7 @@
function displayQuestNPC($action, $name, $starke, $speed, $verteidigung, $ausdauer, $hp, $mp, $level, $orte,$id, $anzahl, $confirm, $glueck){
if($action != 'delete' && $action != 'change' && $action != 'create'){
$sql = 'SELECT id , name FROM `quest_monster` order by name asc';
$result = mysql_query($sql);
$result = db_query($sql);
?>
<table>
<tr>
@ -25,7 +25,7 @@ function displayQuestNPC($action, $name, $starke, $speed, $verteidigung, $ausdau
<th align="center" colspan="2">Aktion</th>
</tr>
<?php
while($res = mysql_fetch_assoc($result)){
while($res = mysqli_fetch_assoc($result)){
?>
<tr>
<td><?php echo $res['name']; ?></td>
@ -48,7 +48,7 @@ function displayQuestNPC($action, $name, $starke, $speed, $verteidigung, $ausdau
echo '<a href="'.$_SERVER['PHP_SELF'].'?choose=qnpc&action=delete&id='.$id.'&confirm=yes">L&ouml;schen!!</a><br>';
} else{
$sql = 'DELETE FROM `quest_monster` where id = '.$id;
$result = mysql_query($sql);
$result = db_query($sql);
logaction('Das Monster mit der ID '.$id.' wurde geloescht!!');
echo 'Das Monster mit der ID '.$id.' wurde gel&ouml;scht<br>';
}
@ -61,32 +61,32 @@ function displayQuestNPC($action, $name, $starke, $speed, $verteidigung, $ausdau
if($name != null){
$sql = 'Update `quest_monster` set name = \''.$name.'\', starke = '.$starke.', speed = '.$speed.', verteidigung = '.$verteidigung.', ausdauer = '.$ausdauer.', hp = '.$hp.', mp = '.$mp.', anzahl = \''.$anzahl.'\', `level` = '.$level.', glueck = '.$glueck.' where id = '.$id;
mysql_query('Delete from quest_monster_orte where monsterid = '.$id);
db_query('Delete from quest_monster_orte where monsterid = '.$id);
for($i=0;$i<count($orte);$i++){
mysql_query('Insert into quest_monster_orte(ortid, monsterid) values('.$orte[$i].', '.$id.')');
db_query('Insert into quest_monster_orte(ortid, monsterid) values('.$orte[$i].', '.$id.')');
}
logaction('Das Monster mit dem Namen '.$name.' wurde angepasst!!');
$query = mysql_query($sql);
$query = db_query($sql);
}
// Erstmal die Orte aufzaehlen, in der das Monster zu finden ist
$sql = 'Select ortid from quest_monster_orte where monsterid = '.$id;
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)){
$monster_orte[$row['ortid']] = $row;
}
// Jetzt die Orte auslesen die zu Bereisen sind
$sql = 'Select * from quest_ort order by stadt';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)){
$orte_array[] = $row;
}
$sql = 'SELECT * FROM `quest_monster` where id = '.$id;
$result = mysql_query($sql);
$res = mysql_fetch_assoc($result);
$result = db_query($sql);
$res = mysqli_fetch_assoc($result);
?>
<form action="" method="POST">
<input name="choose" value="qnpc" type="hidden"></input>
@ -173,11 +173,11 @@ function displayQuestNPC($action, $name, $starke, $speed, $verteidigung, $ausdau
} else if($action == 'create'){
if($name != null){
$sql = 'Insert into `quest_monster`(name, starke, speed, verteidigung, ausdauer, hp, mp, anzahl, `level`) values(\''.$name.'\', '.$starke.', '.$speed.', '.$verteidigung.', '.$ausdauer.', '.$hp.', '.$mp.', \''.$anzahl.'\', '.$level.')';
$query = mysql_query($sql);
$id = mysql_fetch_assoc(mysql_query('Select id from quest_monster where name = \''.$name.'\''));
$query = db_query($sql);
$id = mysqli_fetch_assoc(db_query('Select id from quest_monster where name = \''.$name.'\''));
$monsterid = $id['id'];
for($i=0;$i<count($orte);$i++){
mysql_query('Insert into quest_monster_orte(ortid, monsterid) values('.$orte[$i].', '.$monsterid.')');
db_query('Insert into quest_monster_orte(ortid, monsterid) values('.$orte[$i].', '.$monsterid.')');
}
logaction('Das Monster mit dem Namen '.$name.' wurde erstellt!!');
echo "Monster erstellt<br>";
@ -189,8 +189,8 @@ function displayQuestNPC($action, $name, $starke, $speed, $verteidigung, $ausdau
}
// Jetzt die Orte auslesen die zu Bereisen sind
$sql = 'Select * from quest_ort order by stadt';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)){
$orte_array[] = $row;
}

@ -34,7 +34,7 @@ function getDropItemsAsOptions(){
$qry = db_query($query);
// Damit waeren alle noetigen Datenbankaufrufe erledigt!
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
$result[$index++] = '<option value=\''.$row['id'].','.$row['tablename'].'\'>'.$row['name'].'</option>';
}
@ -59,14 +59,14 @@ function istrinstr($source, $insert, $search) {
function getNPCUser() {
$qry = db_query('SELECT * FROM user WHERE nickname = "'.NPC_USER_NAME.'";');
return mysql_fetch_assoc($qry);
return mysqli_fetch_assoc($qry);
}
function getNPCAttacks() {
$qry = db_query('SELECT name,id FROM attacken a WHERE info like "%NPC%";');
$set = array();
while ($result = mysql_fetch_assoc($qry)) {
while ($result = mysqli_fetch_assoc($qry)) {
$set[$result['id']] = $result['name'];
}
@ -79,7 +79,7 @@ function learnNewAttacks($charid, $att_ids) {
$qry = db_query($sql);
$learned_atts = array();
while($result = mysql_fetch_assoc($qry)) {
while($result = mysqli_fetch_assoc($qry)) {
$learned_atts[$result['at_id']] = $result['id'];
}
@ -88,7 +88,7 @@ function learnNewAttacks($charid, $att_ids) {
$qry = db_query($sql);
$att_names = array();
while($result = mysql_fetch_assoc($qry)) {
while($result = mysqli_fetch_assoc($qry)) {
$att_names[$result['id']] = $result['name'];
}
@ -110,7 +110,7 @@ function getNPCAttackSet($charid, $att_ids) {
$qry = db_query($sql);
$learned_atts = array();
while($result = mysql_fetch_assoc($qry)) {
while($result = mysqli_fetch_assoc($qry)) {
$learned_atts[$result['at_id']] = $result['id'];
}
@ -166,7 +166,7 @@ function displayNPCInfo($action, $task, $charid) {
//$sql = 'SELECT * FROM chars c inner join kampf_list kl on c.id = kl.charakter WHERE c.id ='.$charid;
//echo $sql."<br>";
$qry = db_query($sql);
$row = mysql_fetch_assoc($qry);
$row = mysqli_fetch_assoc($qry);
// Fetch the char array by getChar method (for backwards compat) with no caching enabled!
$char_data = getChar($charid, false);
foreach( $char_data as $key => $value ) {
@ -276,7 +276,7 @@ function editNPC($charid, $data, $att_ids) {
$u = db_query($sql);
$log = 0;
if(mysql_affected_rows() == 0 || $u === FALSE) {
if(db_affected_rows() == 0 || $u === FALSE) {
echo "\t\t\t".'<tr><td colspan="2" style="color:red">Stats wurden nicht geändert oder es gab Fehler!</td></tr>';
} else{
echo "\t\t\t".'<tr><td colspan="2">Änderungen wurden übernommen!</td></tr>';
@ -316,7 +316,7 @@ function createNPC($data, $att_ids) {
if($success) {
//Char ID holen
$qry = db_query('SELECT id FROM chars c WHERE name = "'.$data['name'].'";');
$result = mysql_fetch_assoc($qry);
$result = mysqli_fetch_assoc($qry);
$char_id = $result['id'];
//zur Kampfliste hinzufügen :)
@ -370,7 +370,7 @@ function deleteNPC($charid) {
$colspan = 1;
$sql = 'DELETE FROM chars WHERE id = '.$charid.';';
$qry = db_query($sql);
if($qry === FALSE || mysql_affected_rows() <= 0){
if($qry === FALSE || db_affected_rows() <= 0){
echo "\t".'<tr><td colspan="'.$colspan.'" style="text-align:center;color:red">Der NPC '.$row['name'].' konnte nicht gelöscht werden!</td></tr>'."\n";;
} else {
echo "\t".'<tr><td colspan="'.$colspan.'" style="text-align:center">Der NPC '.$row['name'].' wurde gelöscht!</td></tr>'."\n";;
@ -401,7 +401,7 @@ function displayNPCOverview($page) {
echo "\t".'<tr><td colspan="'.$colspan.'"><hr></td></tr>'."\n";
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
echo "\t".'<tr>'."\n";
for($i=1;$i<count($d_array);$i++){
echo "\t\t".'<td>'.$row[$d_array[$i]].'</td>'."\n";
@ -417,7 +417,7 @@ function displayNPCOverview($page) {
echo "\t".'</tr>'."\n";
}
$total = mysql_num_rows(db_query('SELECT '.join($d_array,',').' from chars where rasse IN ('.implode(',', $include_race_ids).')'));
$total = mysqli_stmt_num_rows(db_query('SELECT '.join($d_array,',').' from chars where rasse IN ('.implode(',', $include_race_ids).')'));
$url = '<a href="'.$_SERVER['PHP_SELF'].'?choose=npc&page=###PAGE###">###LABEL###</a>';
echo "\t".'<tr><td colspan="'.$colspan.'"><hr></td></tr>'."\n";
echo "\t".'<tr><td colspan="'.$colspan.'">'.displayPagelinksNew(20, $total, $page, $url).'</td></tr>'."\n";

@ -240,7 +240,7 @@ function displayRassen($request) {
<th align="center" colspan="2">Aktion</th>
</tr>
<?php
$num = mysql_num_rows(db_query('SELECT * FROM rassen_type'));
$num = mysqli_stmt_num_rows(db_query('SELECT * FROM rassen_type'));
if($num == 0) {
echo '<tr><th colspan="4"><a href="?choose=rassen&setup=1">setup rassen database</a></th></tr>';
} else {

@ -10,19 +10,19 @@
function getItemsMap() {
$items_map = array();
$qry = db_query('SELECT * from sp_item WHERE type != \'Teufels Frucht\'');
while( $row = mysql_fetch_assoc($qry) ) {
while( $row = mysqli_fetch_assoc($qry) ) {
$row['table_name'] = 'sp_item';
$items_map['sp_item'][$row['id']] = $row;
}
$qry = db_query('SELECT * from item');
while( $row = mysql_fetch_assoc($qry)) {
while( $row = mysqli_fetch_assoc($qry)) {
$row['table_name'] = 'item';
$items_map['item'][$row['id']] = $row;
}
$qry = db_query('SELECT * from wochen_markt');
while( $row = mysql_fetch_assoc($qry) ) {
while( $row = mysqli_fetch_assoc($qry) ) {
$row['name'] = $row['item'];
$row['table_name'] = 'wochen_markt';
$items_map['wochen_markt'][$row['id']] = $row;
@ -43,12 +43,12 @@ function get_set_definitions() {
$qry = db_query('SELECT * from sp_sets');
$sets = array();
while( $row = mysql_fetch_assoc($qry) ) {
while( $row = mysqli_fetch_assoc($qry) ) {
$set = array();
$set['item'] = $items_map[$row['table_name']][$row['item_id']];
$dep_items = array();
$qry2 = db_query('SELECT * from sp_set_ingredient WHERE set_id = '.$row['set_id']);
while( $row2 = mysql_fetch_assoc($qry2) ) {
while( $row2 = mysqli_fetch_assoc($qry2) ) {
$dep_items[] = $items_map[$row2['table_name']][$row2['item_id']];
}
$set['deps'] = $dep_items;
@ -141,11 +141,11 @@ function itemEquals($lhs, $rhs) {
function createRezeptEntry($set) {
$qry = db_query('Select max(set_id) FROM sp_sets');
$new_id = mysql_fetch_row($qry)[0];
$new_id = mysqli_fetch_row($qry)[0];
do {
$new_id++;
db_query('INSERT sp_sets(set_id, table_name, item_id) values('.$new_id.',\''.$set['item']['table_name'].'\','.$set['item']['id'].')');
} while(mysql_affected_rows() == 0);
} while(db_affected_rows() == 0);
return $new_id;
}

@ -11,7 +11,7 @@
<?php
function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ, $preis, $frei, $anzahl){
if($action == ''){
$shop_qry = mysql_query('SELECT * FROM shop order by preis');
$shop_qry = db_query('SELECT * FROM shop order by preis');
?>
<table border="1">
<tr>
@ -25,7 +25,7 @@ function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ
<tr><td>Name</td><td>ID</td><td>Art</td>
<td>Preis</td><td>Freischalten</td><td>Anzahl<td>bearbeiten</td></tr>
<?php
while($res = mysql_fetch_assoc($shop_qry)){
while($res = mysqli_fetch_assoc($shop_qry)){
echo '<tr><td>'.$res['item'].'</td><td>'.$res['id'].'</td><td>'.$res['datensatz'].'</td>
<td>'.$res['preis'].'</td><td>'.$res['preis_req'].'</td><td>'.$res['mal'].'
</td><td><a href="'.$_SERVER['PHP_SELF'].'?choose=shop&action=edit&s_id='.$res['id'].'">edit</a>|<a href="'.$_SERVER['PHP_SELF'].'?choose=shop&action=delete&s_id='.$res['id'].'">delete</a></td></tr>';
@ -53,7 +53,7 @@ function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ
logaction('Das Angebot für '.$s3_name.' wurde editiert!');
}
mysql_query($sql);
db_query($sql);
echo $sql;
} else if($action == 'erstellen'){
@ -67,12 +67,12 @@ function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ
$sql = 'INSERT INTO shop(item, datensatz, preis, preis_req, mal, com) values(\''.$s3_name.'\', \''.$s_typ.'\', '.$preis.', '.$frei.', '.$anzahl.', \''.$info.'\')';
}
mysql_query($sql);
db_query($sql);
echo $sql;
}
}
if($action == 'edit'){
$angebot = mysql_fetch_assoc(mysql_query('SELECT * FROM shop WHERE id = '.$s_id));
$angebot = mysqli_fetch_assoc(db_query('SELECT * FROM shop WHERE id = '.$s_id));
$aLabel = 'editieren';
} else{
$aLabel = 'erstellen';
@ -106,12 +106,12 @@ function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ
<td>Bei SS Items</td>
<td height="25" width="200" valign="top">
<?php
$item = mysql_query('SELECT * FROM sp_item where type !=\'Teufels Frucht\' ORDER BY name ');
$item = db_query('SELECT * FROM sp_item where type !=\'Teufels Frucht\' ORDER BY name ');
?>
<select id="input" name="s_name">
<option value="">SS Item wählen</option>
<?php
while ($row2 = mysql_fetch_array($item)) {
while ($row2 = mysqli_fetch_array($item)) {
echo "<option value='$row2[name]'>$row2[name]";
}
?>
@ -122,12 +122,12 @@ function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ
<td>Bei Markt Items</td>
<td height="25" width="200" valign="top">
<?php
$item = mysql_query('SELECT * FROM item ORDER BY s_type ');
$item = db_query('SELECT * FROM item ORDER BY s_type ');
?>
<select id="input" name="s2_name">
<option value="">Martk Item wählen</option>
<?php
while ($row2 = mysql_fetch_array($item)) {
while ($row2 = mysqli_fetch_array($item)) {
echo "<option value='$row2[name]'>$row2[name]";
}
?>
@ -138,12 +138,12 @@ function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ
<td>Teufelsfrüchte</td>
<td height="25" width="200" valign="top">
<?php
$item = mysql_query('SELECT * FROM wochen_markt ORDER BY item ');
$item = db_query('SELECT * FROM wochen_markt ORDER BY item ');
?>
<select id="input" name="s3_name">
<option value="">Teufelsfrucht wählen</option>
<?php
while ($row2 = mysql_fetch_array($item)) {
while ($row2 = mysqli_fetch_array($item)) {
echo "<option value='$row2[item]'>$row2[item]";
}
?>
@ -185,7 +185,7 @@ function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ
<?php
if($s_name !== NULL){
$sql = 'DELETE FROM shop WHERE id='.$s_id.' ';
mysql_query($sql);
db_query($sql);
echo $sql;
?>
<tr>
@ -195,7 +195,7 @@ function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ
</tr>
<?php
} else{
$res = mysql_fetch_assoc(mysql_query('SELECT * FROM shop WHERE id = '.$s_id));
$res = mysqli_fetch_assoc(db_query('SELECT * FROM shop WHERE id = '.$s_id));
?>
<tr>
<td align="center" colspan="2">

@ -12,44 +12,44 @@ include_once(ROOT_PATH.'/include/clan_fights.inc.php');
function doTheClanfightTest($acceptTestCase, $amount) {
mysql_query('UPDATE user SET clan = null'); // clean all clans
db_query('UPDATE user SET clan = null'); // clean all clans
$ids = getClanFightCapableClanIds();
$row = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM user WHERE 0 < (SELECT COUNT(*) FROM chars WHERE besitzer = user.id)'));
$row = mysqli_fetch_row(db_query('SELECT COUNT(*) FROM user WHERE 0 < (SELECT COUNT(*) FROM chars WHERE besitzer = user.id)'));
if(count($ids) < $row[0] / MIN_MEMBERS) {
//echo 'We may optimize the user('.$row[0].')/clan('.count($ids).') ratio<br>';
mysql_query('UPDATE user SET clan = null'); // clean all clans
mysql_query('UPDATE clan SET leader = null, co_leader = null');
db_query('UPDATE user SET clan = null'); // clean all clans
db_query('UPDATE clan SET leader = null, co_leader = null');
$sql = 'SELECT id FROM clan ORDER BY ID ASC';
$qry = mysql_query($sql);
while( $row = mysql_fetch_assoc($qry)) {
$qry = db_query($sql);
while( $row = mysqli_fetch_assoc($qry)) {
$sql = 'UPDATE user SET clan = ' .$row['id'] . ' WHERE clan is null AND 0 < (SELECT COUNT(*) FROM chars WHERE besitzer = user.id) LIMIT 5';
//echo $sql . '<br>';
mysql_query($sql);
db_query($sql);
if(mysql_affected_rows() == 0) {
if(db_affected_rows() == 0) {
break;
}
}
$qry = mysql_query('SELECT clan, min(id) as id FROM user WHERE clan is not null GROUP BY clan');
while($row = mysql_fetch_assoc($qry)) {
$qry = db_query('SELECT clan, min(id) as id FROM user WHERE clan is not null GROUP BY clan');
while($row = mysqli_fetch_assoc($qry)) {
$sql = 'UPDATE clan SET leader = '.$row['id'].' WHERE id = '.$row['clan'];
//echo $sql . '<br>';
mysql_query($sql);
db_query($sql);
}
}
mysql_query('DELETE FROM clan_challenge_requests');
mysql_query('DELETE FROM clan_challenges');
mysql_query('DELETE FROM events');
mysql_query('DELETE FROM clan_locked');
db_query('DELETE FROM clan_challenge_requests');
db_query('DELETE FROM clan_challenges');
db_query('DELETE FROM events');
db_query('DELETE FROM clan_locked');

@ -18,16 +18,16 @@ function getOtherUserGroups($user) {
if(is_numeric($user)) {
$test = 'SELECT gruppen_id, gruppen_name FROM user_gruppe WHERE gruppen_id not in
(SELECT gruppen_id FROM user_gruppe_zuordnung WHERE user_id = \''.$user.'\')';
$qry = mysql_query($test);
$qry = db_query($test);
} else if (validateString($user) != null) {
$test = 'SELECT gruppen_id, gruppen_name FROM user_gruppe WHERE gruppen_id not in
(SELECT ugz.gruppen_id FROM user u INNER JOIN user_gruppe_zuordnung ugz ON
u.id=ugz.user_id WHERE nickname = \''.$user.'\')';
$qry = mysql_query($test);
$qry = db_query($test);
}
$i = 0;
while ($result = mysql_fetch_assoc($qry)) {
while ($result = mysqli_fetch_assoc($qry)) {
$groups[$i] = array("gruppen_id" => $result['gruppen_id'], "gruppen_name" => $result['gruppen_name']);
$i++;
}
@ -115,7 +115,7 @@ function displayUserGroups($action, $name, $ugname, $delete, $add) {
$sqlqry = 'SELECT u.nickname FROM user_gruppe_zuordnung ugz
INNER JOIN user_gruppe ug ON ug.gruppen_id=ugz.gruppen_id
INNER JOIN user u ON ugz.user_id=u.id WHERE ug.gruppen_name = \''.$ugname.'\' ORDER BY u.nickname;';
$usergroups_qry = mysql_query($sqlqry);
$usergroups_qry = db_query($sqlqry);
?>
<table width="80%">
<tr>
@ -127,7 +127,7 @@ function displayUserGroups($action, $name, $ugname, $delete, $add) {
<?php
echo '<tr>';
$x = 0;
while($row = mysql_fetch_assoc($usergroups_qry)){
while($row = mysqli_fetch_assoc($usergroups_qry)){
echo '<td align="center" width = "25%">'.$row['nickname'].'</td>';
$x++;
if($x % 4 == 0) {
@ -174,8 +174,8 @@ function displayUserGroups($action, $name, $ugname, $delete, $add) {
<th>Usergruppe</th>
<th>Beschreibung</th>
<?php
$usergroups_qry = mysql_query('SELECT gruppen_name, gruppen_beschreibung FROM user_gruppe ug;');
while($row = mysql_fetch_assoc($usergroups_qry)){
$usergroups_qry = db_query('SELECT gruppen_name, gruppen_beschreibung FROM user_gruppe ug;');
while($row = mysqli_fetch_assoc($usergroups_qry)){
echo '<tr><td align="center"><a href="'
.$_SERVER['PHP_SELF'].'?choose=usergroups&action=show&ugname='.$row['gruppen_name'].'">'
.$row['gruppen_name'].'</a></td><td>'.$row['gruppen_beschreibung'].'</td></tr>';
@ -225,7 +225,7 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
</form>
<?php
} else if($action == 'access'){
$minmax = mysql_fetch_assoc(mysql_query('SELECT DATE(min(occured)) as min, DATE(max(occured)) as max FROM multiuser'));
$minmax = mysqli_fetch_assoc(db_query('SELECT DATE(min(occured)) as min, DATE(max(occured)) as max FROM multiuser'));
$low = $from===null?$minmax['min']:$from;
$high = $until===null?$minmax['max']:$until;
?>
@ -254,8 +254,8 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
<th>Anzahl</th>
<th>Action</th>
<?php
$cheater_qry = mysql_query('Select u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, count(occured) as anzahl from multiuser left join user as u1 on multiuser.user1 = u1.id left join user as u2 on multiuser.user2 = u2.id where occured >= \''.$low.' 00:00:00\' and occured <= \''.$high.' 23:59:59\' group by u1i, u2i order by anzahl');
while($row = mysql_fetch_assoc($cheater_qry)){
$cheater_qry = db_query('Select u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, count(occured) as anzahl from multiuser left join user as u1 on multiuser.user1 = u1.id left join user as u2 on multiuser.user2 = u2.id where occured >= \''.$low.' 00:00:00\' and occured <= \''.$high.' 23:59:59\' group by u1i, u2i order by anzahl');
while($row = mysqli_fetch_assoc($cheater_qry)){
echo '<tr><td>'.$row['u1n'].'</td><td>'.$row['u2n'].'</td><td>'.$row['anzahl'].'</td><td><a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=show&from='.$low.'&until='.$high.'&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Nachweis</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=vwarn&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Verwarnen</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=ban&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Bannen</a></td></tr>';
}
?>
@ -281,7 +281,7 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
} else if($action == 'trades'){
// Hier ist wichtig, zu hohe Trades und Trades in den Clans
$minmax = mysql_fetch_assoc(mysql_query('SELECT DATE(min(deadline)) as min, DATE(max(deadline)) as max FROM auktion_transaktionen'));
$minmax = mysqli_fetch_assoc(db_query('SELECT DATE(min(deadline)) as min, DATE(max(deadline)) as max FROM auktion_transaktionen'));
$low = $from===null?$minmax['min']:$from;
$high = $until===null?$minmax['max']:$until;
?>
@ -316,8 +316,8 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
<th>Action</th>
<?php
$sql = 'SELECT at.transaktionsid, u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, at.anzahl, betrag, deadline, cheatingverdacht, it.name as i_name, si.name as s_name, wm.item as w_name, itemid, tablename FROM auktion_transaktionen at left join sp_item si on tablename = \'sp_ware\' and itemid = si.id left join item as it on tablename = \'ware\' and itemid = it.id left join wochen_markt as wm on tablename = \'wochen_ware\' and itemid = wm.id left join user as u1 on at.anbieter = u1.id left join user as u2 on at.bieter = u2.id where cheatingverdacht = 1 and deadline >= \''.$low.' 00:00:00\' and deadline <= \''.$high.' 23:59:59\'';
$cheater_qry = mysql_query($sql);
while($row = mysql_fetch_assoc($cheater_qry)){
$cheater_qry = db_query($sql);
while($row = mysqli_fetch_assoc($cheater_qry)){
$name = $row['i_name']!=null?$row['i_name']:($row['w_name']!=null?$row['w_name']:$row['s_name']);
$cheatv = $row['cheatingverdacht']==0?'OK':'WARNUNG';
echo '<tr><td align="center">'.$row['u1n'].'</td><td align="center">'.$row['u2n'].'</td><td align="center">'.$name.'</td><td align="center">'.$row['betrag'].'</td><td align="center">'.$row['anzahl'].'</td><td align="center">'.$row['deadline'].'</td><td align="center">'.$cheatv.'</td><td><a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=show&from='.$low.'&until='.$high.'&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Nachweis</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=undo&tradeid='.$row['transaktionsid'].'">R&uuml;ckg&auml;ngig</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=markok&tradeid='.$row['transaktionsid'].'">OK</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=vwarn&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Verwarnen</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=ban&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Bannen</a></td></tr>';
@ -344,7 +344,7 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
<?php
} else if($action == 'show'){
// Zeigt die Verbindungen zwischen 2 Usern auf
$minmax = mysql_fetch_assoc(mysql_query('SELECT DATE(min(occured)) as min, DATE(max(occured)) as max FROM multiuser'));
$minmax = mysqli_fetch_assoc(db_query('SELECT DATE(min(occured)) as min, DATE(max(occured)) as max FROM multiuser'));
$low = $from===null?$minmax['min']:$from;
$high = $until===null?$minmax['max']:$until;
@ -376,8 +376,8 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
<th>Action</th>
<?php
$sql = 'Select u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, occured, type from multiuser left join user as u1 on multiuser.user1 = u1.id left join user as u2 on multiuser.user2 = u2.id where user1 = '.$user1.' and user2 = '.$user2.' and occured >= \''.$$low.' 0:00:00\' and occured <= \''.$high.' 23:59:59\' order by occured desc';
$cheater_qry = mysql_query($sql);
while($row = mysql_fetch_assoc($cheater_qry)){
$cheater_qry = db_query($sql);
while($row = mysqli_fetch_assoc($cheater_qry)){
echo '<tr><td align="center">'.$row['u1n'].'</td><td align="center">'.$row['u2n'].'</td><td align="center">'.$row['occured'].'</td><td align="center">'.$row['type'].'</td><td align="center"><a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=vwarn&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Verwarnen</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=ban&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Bannen</a></td></tr>';
}
?>
@ -403,8 +403,8 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
<?php
$sql = 'SELECT u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, at.anzahl, betrag, deadline, cheatingverdacht, it.name as i_name, si.name as s_name, wm.item as w_name, itemid, tablename FROM auktion_transaktionen at left join sp_item si on tablename = \'sp_ware\' and itemid = si.id left join item as it on tablename = \'ware\' and itemid = it.id left join wochen_markt as wm on tablename = \'wochen_ware\' and itemid = wm.id left join user as u1 on at.anbieter = u1.id left join user as u2 on at.bieter = u2.id where bieter IN ('.$user1.','.$user2.') and anbieter IN('.$user1.','.$user2.') and deadline >= \''.$low.' 00:00:00\' and deadline <= \''.$high.' 23:59:59\'';
// echo $sql.'<br>';
$cheater_qry = mysql_query($sql);
while($row = mysql_fetch_assoc($cheater_qry)){
$cheater_qry = db_query($sql);
while($row = mysqli_fetch_assoc($cheater_qry)){
$name = $row['i_name']!=null?$row['i_name']:($row['w_name']!=null?$row['w_name']:$row['s_name']);
$cheatv = $row['cheatingverdacht']==0?'OK':'WARNUNG';
echo '<tr><td align="center">'.$row['u1n'].'</td><td align="center">'.$row['u2n'].'</td><td align="center">'.$name.'</td><td align="center">'.$row['betrag'].'</td><td align="center">'.$row['anzahl'].'</td><td align="center">'.$row['deadline'].'</td><td align="center">'.$cheatv.'</td><td></td></tr>';
@ -435,17 +435,17 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
} else if($action == 'vwarn'){
// Spricht eine Verwarnung zwischen 2 Usern aus
if($verify == 1){
$qry = mysql_query('select id, nickname from user where id in ('.$user1.', '.$user2.')');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('select id, nickname from user where id in ('.$user1.', '.$user2.')');
while($row = mysqli_fetch_assoc($qry)){
$users[] = $row['nickname'];
}
displayErrorMessage('Verwarnung ausgesprochen', 'Die User '.join(' und ',$users).' sind nun verwarnt!', '<a href="'.$_SERVER['PHP_SELF'].'?choose=cheat">weiter</a>');
mysql_query('INSERT INTO nachricht(betreff, von, datum, text, besitzer) values(\'Verwarnung\', \'AG-Team\', now(), \'Es kam zwischen den Accounts '.join(' und ',$users).' zu &Uuml;berschneidungen, wir bitten euch dies zu unterlassen, da wir uns sonst gezwungen sehen diese Aktivit&auml;ten zu bestrafen!\', '.$user1.')');
mysql_query('INSERT INTO nachricht(betreff, von, datum, text, besitzer) values(\'Verwarnung\', \'AG-Team\', now(), \'Es kam zwischen den Accounts '.join(' und ',$users).' zu &Uuml;berschneidungen, wir bitten euch dies zu unterlassen, da wir uns sonst gezwungen sehen diese Aktivit&auml;ten zu bestrafen!\', '.$user2.')');
db_query('INSERT INTO nachricht(betreff, von, datum, text, besitzer) values(\'Verwarnung\', \'AG-Team\', now(), \'Es kam zwischen den Accounts '.join(' und ',$users).' zu &Uuml;berschneidungen, wir bitten euch dies zu unterlassen, da wir uns sonst gezwungen sehen diese Aktivit&auml;ten zu bestrafen!\', '.$user1.')');
db_query('INSERT INTO nachricht(betreff, von, datum, text, besitzer) values(\'Verwarnung\', \'AG-Team\', now(), \'Es kam zwischen den Accounts '.join(' und ',$users).' zu &Uuml;berschneidungen, wir bitten euch dies zu unterlassen, da wir uns sonst gezwungen sehen diese Aktivit&auml;ten zu bestrafen!\', '.$user2.')');
logaction('Die User '.join(' und ',$users).' wurden verwarnt!');
} else{
$qry = mysql_query('select id, nickname from user where id in ('.$user1.', '.$user2.')');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('select id, nickname from user where id in ('.$user1.', '.$user2.')');
while($row = mysqli_fetch_assoc($qry)){
$users[] = $row['nickname'];
}
displayErrorMessage('Verwarnen', 'Sollen die User '.join(' und ',$users).' wirklich verwarnt werden?', '<a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=vwarn&user1='.$user1.'&user2='.$user2.'&verify=1">weiter</a> | '.displayHistoryBackLink());
@ -453,18 +453,18 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
} else if($action == 'ban'){
// Bannt zwei Accounts
if($verify == 1){
$qry = mysql_query('select id, nickname from user where id in ('.$user1.', '.$user2.')');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('select id, nickname from user where id in ('.$user1.', '.$user2.')');
while($row = mysqli_fetch_assoc($qry)){
$users[] = $row['nickname'];
}
displayErrorMessage('Bann vollzogen!', 'Die User '.join(' und ',$users).' sind nun verwarnt!', '<a href="'.$_SERVER['PHP_SELF'].'?choose=cheat">weiter</a>');
mysql_query('INSERT INTO nachricht(betreff, von, datum, text, besitzer) values(\'Bann\', \'AG-Team\', now(), \'Es kam zwischen den Accounts '.join(' und ',$users).' zu &Uuml;berschneidungen. Deswegen sahen wir uns gezwungen diese Aktivit&auml;ten zu bestrafen!\', '.$user1.')');
mysql_query('INSERT INTO nachricht(betreff, von, datum, text, besitzer) values(\'Bann\', \'AG-Team\', now(), \'Es kam zwischen den Accounts '.join(' und ',$users).' zu &Uuml;berschneidungen. Deswegen sahen wir uns gezwungen diese Aktivit&auml;ten zu bestrafen!\', '.$user2.')');
mysql_query('Update user set bann = \'ja\' where id IN('.$user1.', '.$user2.')');
db_query('INSERT INTO nachricht(betreff, von, datum, text, besitzer) values(\'Bann\', \'AG-Team\', now(), \'Es kam zwischen den Accounts '.join(' und ',$users).' zu &Uuml;berschneidungen. Deswegen sahen wir uns gezwungen diese Aktivit&auml;ten zu bestrafen!\', '.$user1.')');
db_query('INSERT INTO nachricht(betreff, von, datum, text, besitzer) values(\'Bann\', \'AG-Team\', now(), \'Es kam zwischen den Accounts '.join(' und ',$users).' zu &Uuml;berschneidungen. Deswegen sahen wir uns gezwungen diese Aktivit&auml;ten zu bestrafen!\', '.$user2.')');
db_query('Update user set bann = \'ja\' where id IN('.$user1.', '.$user2.')');
logaction('Die User '.join(' und ',$users).' wurden gebannt!');
} else{
$qry = mysql_query('select id, nickname from user where id in ('.$user1.', '.$user2.')');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('select id, nickname from user where id in ('.$user1.', '.$user2.')');
while($row = mysqli_fetch_assoc($qry)){
$users[] = $row['nickname'];
}
displayErrorMessage('Bannen', 'Sollen die User '.join(' und ',$users).' wirklich gebannt werden?', '<a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=ban&user1='.$user1.'&user2='.$user2.'&verify=1">weiter</a> | '.displayHistoryBackLink());
@ -474,12 +474,12 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
displayErrorMessage(NULL, 'not yet implemented', displayHistoryBackLink());
} else if($action == 'markok'){
if($verify == 1){
$trade = mysql_fetch_assoc(mysql_query('SELECT u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, at.anzahl, betrag, deadline, cheatingverdacht, it.name as i_name, si.name as s_name, wm.item as w_name, itemid, tablename FROM auktion_transaktionen at left join sp_item si on tablename = \'sp_ware\' and itemid = si.id left join item as it on tablename = \'ware\' and itemid = it.id left join wochen_markt as wm on tablename = \'wochen_ware\' and itemid = wm.id left join user as u1 on at.anbieter = u1.id left join user as u2 on at.bieter = u2.id where transaktionsid = '.$tradeid));
$trade = mysqli_fetch_assoc(db_query('SELECT u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, at.anzahl, betrag, deadline, cheatingverdacht, it.name as i_name, si.name as s_name, wm.item as w_name, itemid, tablename FROM auktion_transaktionen at left join sp_item si on tablename = \'sp_ware\' and itemid = si.id left join item as it on tablename = \'ware\' and itemid = it.id left join wochen_markt as wm on tablename = \'wochen_ware\' and itemid = wm.id left join user as u1 on at.anbieter = u1.id left join user as u2 on at.bieter = u2.id where transaktionsid = '.$tradeid));
displayErrorMessage('Trade validiert!', 'Der Handel zwischen '.$trade['u1n'].' und '.$trade['u2n'].' ist nun als \'Ok\' markiert!', '<a href="'.$_SERVER['PHP_SELF'].'?choose=cheat">weiter</a>');
logaction('Der Handel zwischen '.$trade['u1n'].' und '.$trade['u2n'].' wurde als \'Ok\' markiert (Tradeid = '.$tradeid.')!');
mysql_query('Update auktion_transaktionen set cheatingverdacht = 0 where transaktionsid = '.$tradeid);
db_query('Update auktion_transaktionen set cheatingverdacht = 0 where transaktionsid = '.$tradeid);
} else{
$trade = mysql_fetch_assoc(mysql_query('SELECT u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, at.anzahl, betrag, deadline, cheatingverdacht, it.name as i_name, si.name as s_name, wm.item as w_name, itemid, tablename FROM auktion_transaktionen at left join sp_item si on tablename = \'sp_ware\' and itemid = si.id left join item as it on tablename = \'ware\' and itemid = it.id left join wochen_markt as wm on tablename = \'wochen_ware\' and itemid = wm.id left join user as u1 on at.anbieter = u1.id left join user as u2 on at.bieter = u2.id where transaktionsid = '.$tradeid));
$trade = mysqli_fetch_assoc(db_query('SELECT u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, at.anzahl, betrag, deadline, cheatingverdacht, it.name as i_name, si.name as s_name, wm.item as w_name, itemid, tablename FROM auktion_transaktionen at left join sp_item si on tablename = \'sp_ware\' and itemid = si.id left join item as it on tablename = \'ware\' and itemid = it.id left join wochen_markt as wm on tablename = \'wochen_ware\' and itemid = wm.id left join user as u1 on at.anbieter = u1.id left join user as u2 on at.bieter = u2.id where transaktionsid = '.$tradeid));
displayErrorMessage('Trade validieren!', 'Sollen der Handel zwischen '.$trade['u1n'].' und '.$trade['u2n'].' als \'Ok\' markiert werden?', '<a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=markok&tradeid='.$tradeid.'&verify=1">weiter</a> | '.displayHistoryBackLink());
}
}
@ -523,7 +523,7 @@ function displayBannOptions($action, $username,$opfer,$gamebann,$shoutbann,$fore
</form>
<?php
} else if(is_numeric($anonid)){
mysql_query('UPDATE anon_chatter set muted = 1 where anon_id = '.$anonid);
db_query('UPDATE anon_chatter set muted = 1 where anon_id = '.$anonid);
?>
<table>
<tr>
@ -539,7 +539,7 @@ function displayBannOptions($action, $username,$opfer,$gamebann,$shoutbann,$fore
<?php
} else if($action == "search"){
// Auslagern ;D
$qry = mysql_query('Select nickname, id from user where nickname like \''.$username.'%\'');
$qry = db_query('Select nickname, id from user where nickname like \''.$username.'%\'');
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<input type="hidden" name="choose" value="bann"></input> <input
@ -552,7 +552,7 @@ function displayBannOptions($action, $username,$opfer,$gamebann,$shoutbann,$fore
<td>Username</td>
<td><select name="opfer">
<?php
while($result = mysql_fetch_assoc($qry)){
while($result = mysqli_fetch_assoc($qry)){
echo '<option value="'.$result['id'].'">'.$result['nickname'].'</option>';
}
?>

@ -19,10 +19,10 @@ include_once('../path.inc.php'); // get the path ;)
include_once(ROOT_PATH.'/include/config/db.inc.php');
function getChatMessages(){
$result = mysql_query('SELECT *, Minute(zeit) as m, Hour(zeit) as h, DAY(zeit) as d , MONTH(zeit) as mon FROM ag_chat ORDER BY ID desc');
$result = db_query('SELECT *, Minute(zeit) as m, Hour(zeit) as h, DAY(zeit) as d , MONTH(zeit) as mon FROM ag_chat ORDER BY ID desc');
$resultstring = '';
while ($row = mysql_fetch_array($result)) {
while ($row = mysqli_fetch_array($result)) {
$h = $row['h'];
if($h < 10){ $h = "0".$h;}
$m = $row['m'];

@ -13,9 +13,9 @@ include_once(ROOT_PATH.'/include/parse.inc.php');
$page = validateUnsignedInteger($_GET['page'], null);
$online_h = mysql_fetch_array(mysql_query('SELECT * FROM online WHERE id='.($page+1)));
$online_h = mysqli_fetch_array(db_query('SELECT * FROM online WHERE id='.($page+1)));
$row = mysql_fetch_assoc(mysql_query('Select max(id) as maximum from online'));
$row = mysqli_fetch_assoc(db_query('Select max(id) as maximum from online'));
$maxpages = $row['maximum'];
$url = '<a href="index.php?as=h_turnier&page=###PAGE###">###LABEL###</a>';

@ -12,7 +12,7 @@ include_once(ROOT_PATH.'/include/designfunctions.inc.php');
$page = validateUnsignedInteger($_GET['page'], null);
$row = mysql_fetch_assoc(mysql_query('Select max(runde) as maximum from highscore'));
$row = mysqli_fetch_assoc(db_query('Select max(runde) as maximum from highscore'));
$maxpages = $row['maximum'];
$url = '<a href="index.php?as=halloffame&page=###PAGE###">###LABEL###</a>';
@ -25,12 +25,12 @@ if(!is_numeric($page) || $page < 1){
// Determine the importance of the Highscores (the less occurece, the more important)
$qry = mysql_query('Select count(*) as anzahl, art from highscore where runde = '.($maxpages-$page).' group by art order by anzahl,art asc');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('Select count(*) as anzahl, art from highscore where runde = '.($maxpages-$page).' group by art order by anzahl,art asc');
while($row = mysqli_fetch_assoc($qry)){
$events[] = $row;
}
$qry = mysql_query('Select * from highscore where runde = '.($maxpages-$page).' order by art, datum');
$qry = db_query('Select * from highscore where runde = '.($maxpages-$page).' order by art, datum');
echo '<table cellpadding="0" cellspacing="0" width="100%" height="69">'."\n";
@ -39,7 +39,7 @@ echo ' <th class="content" colspan="3">Halle der Helden aus Runde '.($maxpages -
echo '</tr>'."\n";
// Now generate the strings
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
if($old != $row['art']){
$eventhighscore[$row['art']] .= '<tr>'."\n";
$eventhighscore[$row['art']] .= ' <th class="content" height="39" colspan="3">'.$row['art'].'</th>'."\n";

@ -28,8 +28,8 @@
$mptemp = explode(",", $my_charz['mp']);
$mpleft[$char_zahl] = $mptemp['0'] / $mptemp['1'] * 100;
$exptemp = explode(",", $my_charz['exp']);
$room = mysql_query('SELECT ci.name FROM clan_item ci inner join clan_ware cw on ci.id = cw.item_id WHERE cw.id='.$my_charz['clan_train']);
$clanroom=mysql_fetch_assoc($room);
$room = db_query('SELECT ci.name FROM clan_item ci inner join clan_ware cw on ci.id = cw.item_id WHERE cw.id='.$my_charz['clan_train']);
$clanroom=mysqli_fetch_assoc($room);
if($clanroom['name']=="")
$clanroom['name']="kein";
@ -45,7 +45,7 @@
if($my_charz['kampf_item'] != NULL && $my_charz['kampf_item'] != ',,,,'){
// echo 'Problematic Entry = '.$chara_1['kampf_item'].'<br>';
$char1_buffs = mysql_fetch_assoc(mysql_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN (' . $my_charz['kampf_item'] . ')'));
$char1_buffs = mysqli_fetch_assoc(db_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN (' . $my_charz['kampf_item'] . ')'));
}
$c_starke = $char1_buffs['starke']==0?$my_charz['starke']:($my_charz['starke']).' (+'.$char1_buffs['starke'].')';
$c_verteidigung = $char1_buffs['verteidigung']==0?$my_charz['verteidigung']:($my_charz['verteidigung']).' (+'.$char1_buffs['verteidigung'].')';

@ -11,18 +11,18 @@ include_once(ROOT_PATH.'//include/designfunctions.inc.php');
include_once (ROOT_PATH . '/include/clan.inc.php');
include_once (ROOT_PATH . '/include/clan_chat.inc.php');
$itemsx1 = mysql_num_rows(mysql_query("SELECT id FROM sp_ware WHERE item='1' AND user='$user_ida[id]'"));
$itemsz1 = mysql_fetch_array(mysql_query("SELECT id FROM sp_ware WHERE item='1' AND user='$user_ida[id]' LIMIT 1"));
$itemsx1 = mysqli_stmt_num_rows(db_query("SELECT id FROM sp_ware WHERE item='1' AND user='$user_ida[id]'"));
$itemsz1 = mysqli_fetch_array(db_query("SELECT id FROM sp_ware WHERE item='1' AND user='$user_ida[id]' LIMIT 1"));
$itemsx2 = mysql_num_rows(mysql_query("SELECT id FROM sp_ware WHERE item='2' AND user='$user_ida[id]'"));
$itemsz2 = mysql_fetch_array(mysql_query("SELECT id FROM sp_ware WHERE item='2' AND user='$user_ida[id]' LIMIT 1"));
$itemsx2 = mysqli_stmt_num_rows(db_query("SELECT id FROM sp_ware WHERE item='2' AND user='$user_ida[id]'"));
$itemsz2 = mysqli_fetch_array(db_query("SELECT id FROM sp_ware WHERE item='2' AND user='$user_ida[id]' LIMIT 1"));
$anmeldungen = mysql_num_rows(mysql_Query("SELECT id FROM user"));
$db_info = mysql_num_rows(mysql_Query("SELECT id FROM sp_ware WHERE user='$user_ida[id]' AND item='11'"));
$anmeldungen = mysqli_stmt_num_rows(db_query("SELECT id FROM user"));
$db_info = mysqli_stmt_num_rows(db_query("SELECT id FROM sp_ware WHERE user='$user_ida[id]' AND item='11'"));
$user_info_test = mysql_Fetch_array(mysql_Query("SELECT geld FROM user WHERE nickname='$name' LIMIT 1"));
$user_info_test = mysqli_fetch_array(db_query("SELECT geld FROM user WHERE nickname='$name' LIMIT 1"));
//$nnn_nn = mysql_num_rows(mysql_query("SELECT id FROM nachricht WHERE besitzer='$user_ida[id]' AND ag='neu'"));
//$nnn_nn = mysqli_stmt_num_rows(db_query("SELECT id FROM nachricht WHERE besitzer='$user_ida[id]' AND ag='neu'"));
//echo $nnn_nn;
$zeit = date("H:i:s");
$date = date("d.m.y");
@ -89,7 +89,7 @@ if ($name AND $passwort) {
// $clan_009 .= "<a href=index.php?as=clan/c_kampf&id=fights>Clan K&auml;mpfe Anzeige</a><br>";
// Ist user der leader?
// $chiefs = mysql_fetch_assoc(mysql_query('Select co_leader, leader from clan where id = '.$user_ida['clan']));
// $chiefs = mysqli_fetch_assoc(db_query('Select co_leader, leader from clan where id = '.$user_ida['clan']));
// if($chiefs['co_leader'] == $user_ida['id'] || $chiefs['leader'] == $user_ida['id']){
// $clan_009 .= '<a href=index.php?as=clan/c_kampf>Clan K&auml;mpfe</a><br>';
// }
@ -105,7 +105,7 @@ if ($name AND $passwort) {
<a href=index.php?as=halloffame>Halle der Helden</a><br>
<a href=index.php?as=last_fight>Letzten 20 K&auml;mpfe</a><br>";
$auktionensumme = mysql_fetch_assoc(mysql_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = ' . $user_ida['id'] . ' GROUP BY bieter'));
$auktionensumme = mysqli_fetch_assoc(db_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = ' . $user_ida['id'] . ' GROUP BY bieter'));
$auktionensumme = $auktionensumme['summe'];
if ($auktionensumme == 0) {
@ -138,7 +138,7 @@ if ($name AND $passwort) {
<a href=index.php?as=pw>Passwort Vergessen?</a><br>
";
}
$active = mysql_fetch_assoc(mysql_query('select count(*) as anzahl from user where online_zeit between TIMESTAMPADD(DAY, -7, now()) and now()'));
$active = mysqli_fetch_assoc(db_query('select count(*) as anzahl from user where online_zeit between TIMESTAMPADD(DAY, -7, now()) and now()'));
$o_datum = preg_split('# #',$online_rekord_1_0['datum']);
$info_019 = "

@ -11,12 +11,12 @@ include_once(ROOT_PATH.'/include/random.inc.php');
function createAbholcode($charid){
$code = mt_random_wrapper(0, 44*$charid);
$code = md5($code.time());
mysql_query('DELETE from char_abholcodes where charid = '.$charid);
mysql_query('INSERT INTO char_abholcodes(charid, code) values('.$charid.', \''.$code.'\')');
db_query('DELETE from char_abholcodes where charid = '.$charid);
db_query('INSERT INTO char_abholcodes(charid, code) values('.$charid.', \''.$code.'\')');
}
function checkAbholcode($charid, $code){
$code_row = mysql_fetch_assoc(mysql_query('Select * from char_abholcodes where charid = '.$charid));
$code_row = mysqli_fetch_assoc(db_query('Select * from char_abholcodes where charid = '.$charid));
if($code_row){
return $code == $code_row['code'];
}

@ -23,7 +23,7 @@ function calculateArenaData($owner_id, $char_1, $char_2, $factor){
$arena['loge'] = 1000000;
$arena['zustand'] = 1;
} else {
$arena = mysql_fetch_assoc(mysql_query('SELECT * FROM arena WHERE besitzer = '.$owner_id));
$arena = mysqli_fetch_assoc(db_query('SELECT * FROM arena WHERE besitzer = '.$owner_id));
}
$wert_char1 = max(0.75,min(1.25,$char_1['siege']/($char_1['niederlagen'] + 0.01))) * getPowerLevelWithBuffs($char_1['id']);
@ -58,13 +58,13 @@ function calculateRenovierungsKosten($arena){
function getArena($user_id) {
$sql_select = 'SELECT * FROM arena where besitzer = \''.$user_id.'\'';
$qry = mysql_query($sql_select);
if(mysql_num_rows($qry) == 0) {
$qry = db_query($sql_select);
if(mysqli_stmt_num_rows($qry) == 0) {
$sql = 'INSERT arena(besitzer, exp) values (\''.$user_id.'\', \'0,'.calculateRequiredExpArena(1).'\')';
mysql_query($sql);
$qry = mysql_query($sql_select);
db_query($sql);
$qry = db_query($sql_select);
}
$arena = mysql_fetch_assoc($qry);
$arena = mysqli_fetch_assoc($qry);
return $arena;
}

@ -15,7 +15,7 @@ function getAttack($attack_id, $buffer = TRUE) {
}
if(!isset($GLOBALS['attack_buffered'][$attack_id])) {
$GLOBALS['attack_buffered'][$attack_id] = mysql_fetch_assoc(mysql_query('SELECT * FROM attacken WHERE id = ' . $attack_id));
$GLOBALS['attack_buffered'][$attack_id] = mysqli_fetch_assoc(db_query('SELECT * FROM attacken WHERE id = ' . $attack_id));
}
return $GLOBALS['attack_buffered'][$attack_id];
}

@ -30,7 +30,7 @@ function createAttackSet($char_id, $type) {
}
$qry = 'INSERT INTO attackenset VALUES '.$values.';';
return mysql_query($qry);
return db_query($qry);
}
function deleteAttackSet($char_id, $type) {
@ -39,7 +39,7 @@ function deleteAttackSet($char_id, $type) {
}
$qry = 'DELETE FROM attackenset WHERE char_id = '.$char_id.' AND type = '.$type.';';
return mysql_query($qry);
return db_query($qry);
}
function getAttackSet($char_id, $type) {
@ -49,7 +49,7 @@ function getAttackSet($char_id, $type) {
$qry = db_query('SELECT attack_id, round FROM attackenset WHERE char_id = '.$char_id.' AND type = '.$type);
$set = array();
while ($result = mysql_fetch_assoc($qry)) {
while ($result = mysqli_fetch_assoc($qry)) {
$set[$result['round']] = $result['attack_id'];
}
return $set;
@ -64,7 +64,7 @@ function updateAttackSet($char_id, $type, $newSet) {
for ($i = 1; $i < KAMPF_RUNDEN + 1; $i++) {
if($oldset[$i] != $newSet[$i]) {
$qry = 'UPDATE attackenset SET attack_id = '.$newSet[$i].' WHERE char_id = '.$char_id.' AND type = '.$type.' AND round = '.$i.';';
mysql_query($qry);
db_query($qry);
}
}
return true;
@ -75,9 +75,9 @@ function getAttackNames($attackSet) {
return array();
}
$qry = mysql_query('SELECT l.id,a.name FROM attacken a INNER JOIN lernen l ON a.id=l.at_id WHERE l.id in ('.implode(',', $attackSet).');');
$qry = db_query('SELECT l.id,a.name FROM attacken a INNER JOIN lernen l ON a.id=l.at_id WHERE l.id in ('.implode(',', $attackSet).');');
while ($result = mysql_fetch_assoc($qry)) {
while ($result = mysqli_fetch_assoc($qry)) {
$set[$result['id']] = $result['name'];
}
@ -89,8 +89,8 @@ function getAttackTypes($attackSet) {
return array();
}
$qry = mysql_query('SELECT l.id,a.type,a.options FROM attacken a INNER JOIN lernen l ON a.id=l.at_id WHERE l.id in ('.implode(',', $attackSet).');');
while ($result = mysql_fetch_assoc($qry)) {
$qry = db_query('SELECT l.id,a.type,a.options FROM attacken a INNER JOIN lernen l ON a.id=l.at_id WHERE l.id in ('.implode(',', $attackSet).');');
while ($result = mysqli_fetch_assoc($qry)) {
if($result['type'] == 'generic') {
$options = json_decode($result['options'], true);
$set[$result['id']] = $options['type'];
@ -116,9 +116,9 @@ function validateAttackSet($attackSet) {
}
//Alle Attackentypen auslesen
$qry = mysql_query('SELECT name, anzahl, kategorie FROM attackentyp;');
$qry = db_query('SELECT name, anzahl, kategorie FROM attackentyp;');
$types = array();
while ($row = mysql_fetch_assoc($qry)) {
while ($row = mysqli_fetch_assoc($qry)) {
$types[$row['name']] = array('anzahl' => $row['anzahl'], 'kategorie' => $row['kategorie']);
}

@ -27,11 +27,11 @@ include_once(ROOT_PATH.'/include/semaphore.inc.php');
// Returns Mindestgebot
// @Return Integer
function aktuellesMindestgebot($auktionsid){
$qry = mysql_query('SELECT aktuellesgebot, startgebot FROM auktion WHERE auktionsid = '.$auktionsid);
if(mysql_num_rows($qry) != 1){ // Auktion nicht vorhanden??
$qry = db_query('SELECT aktuellesgebot, startgebot FROM auktion WHERE auktionsid = '.$auktionsid);
if(mysqli_stmt_num_rows($qry) != 1){ // Auktion nicht vorhanden??
return -1;
}
$result = mysql_fetch_assoc($qry); // Hole dir den einen Datensatz
$result = mysqli_fetch_assoc($qry); // Hole dir den einen Datensatz
// Aktuelles Gebot vorhanden??
if($result['aktuellesgebot']!=NULL){
$minBetrag = $result['aktuellesgebot']*1.02; // Mindestens 2% mehr muss geboten werden
@ -49,9 +49,9 @@ function aktuellesMindestgebot($auktionsid){
*/
function getUserAvailableMoney($userid) {
//Nun muss noch geprueft werden ob der User genug Geld hat und auch mit allen Geboten gesamt nicht in den Minusbereich kommt
$user_a = mysql_fetch_assoc(mysql_query('SELECT nickname, geld FROM user WHERE id = '.$userid));
$user_a = mysqli_fetch_assoc(db_query('SELECT nickname, geld FROM user WHERE id = '.$userid));
$usermoney = $user_a['geld'];
$auktionensumme = mysql_fetch_assoc(mysql_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$userid));
$auktionensumme = mysqli_fetch_assoc(db_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$userid));
$auktionensumme = $auktionensumme['summe'];
return $usermoney - $auktionensumme;
@ -99,9 +99,9 @@ function biete($userid, $auktionsid, $gebot){
//Nun muss noch geprueft werden ob der User genug Geld hat und auch mit allen Geboten gesamt nicht in den Minusbereich kommt
$user_a = mysql_fetch_assoc(mysql_query('SELECT nickname, geld FROM user WHERE id = '.$userid));
$user_a = mysqli_fetch_assoc(db_query('SELECT nickname, geld FROM user WHERE id = '.$userid));
$usermoney = $user_a['geld'];
$auktionensumme = mysql_fetch_assoc(mysql_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$userid.' AND auktionsid != '.$auktionsid.' GROUP BY bieter'));
$auktionensumme = mysqli_fetch_assoc(db_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$userid.' AND auktionsid != '.$auktionsid.' GROUP BY bieter'));
$auktionensumme = $auktionensumme['summe'];
if($usermoney < $auktionensumme + $gebot){
@ -110,18 +110,18 @@ function biete($userid, $auktionsid, $gebot){
//Wenn 10 minuten vor Deadline-ende geboten wird wird die deadline um 10 Minuten verschoben
if($zeitdifferenz < 10){
mysql_query('UPDATE auktion SET bieter='.$userid.', aktuellesgebot='.$gebot.', deadline=TIMESTAMPADD(Minute,10,TIMESTAMPADD(Second,-second(now()),now())) WHERE auktionsid='.$auktionsid);
db_query('UPDATE auktion SET bieter='.$userid.', aktuellesgebot='.$gebot.', deadline=TIMESTAMPADD(Minute,10,TIMESTAMPADD(Second,-second(now()),now())) WHERE auktionsid='.$auktionsid);
// Speichern der neuen deadline in die deadlinevariable
$res_deadline = mysql_fetch_assoc(mysql_query('SELECT deadline FROM auktion WHERE auktionsid = '.$auktionsid));
$res_deadline = mysqli_fetch_assoc(db_query('SELECT deadline FROM auktion WHERE auktionsid = '.$auktionsid));
$deadline = $res_deadline['deadline'];
} else{
// Ansonsten nur die Grundwerte
mysql_query('UPDATE auktion SET bieter='.$userid.', aktuellesgebot='.$gebot.' WHERE auktionsid='.$auktionsid);
db_query('UPDATE auktion SET bieter='.$userid.', aktuellesgebot='.$gebot.' WHERE auktionsid='.$auktionsid);
}
// Nun noch den aktuellen bieter eine Nachricht senden
sendMessage('Auktionsmarkt', $bieter, '&Uuml;berboten worden', 'Sie sind von '.$user_a['nickname'].' &uuml;berboten worden, er bietet '.$gebot.' f&uuml;r das Item '.debbcode($itemname).'. Deadline: '.$deadline.' Link: [url='.$GLOBALS['server_url_long'].ROOT_URL.'/index.php?as=auktion&action=1&auktionsid='.$auktionsid.']Auktion[/url]');
// mysql_query($new_query);
// db_query($new_query);
// echo '<br><br>'.$new_query.'<br><br>';
return ''; // Leerer String, also kein Fehler!
}
@ -139,9 +139,9 @@ function getItemOptions($userid,$preselected){
union
SELECT i.id, i.item AS name, count(i.id) AS anzahl, \'wochen_ware\' as tablename FROM wochen_ware w INNER JOIN wochen_markt i ON(i.id=w.item) WHERE w.user = '.$userid.' GROUP BY (i.id)';
$qry = mysql_query($query);
$qry = db_query($query);
// Damit waeren alle noetigen Datenbankaufrufe erledigt!
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
if($row['id'] == $preselected){
$result[$index++] = '<option value=\''.$row['id'].','.$row['tablename'].'\' selected>'.$row['name'].' | Anzahl:'.$row['anzahl'].'</option>';
}
@ -189,23 +189,23 @@ function insertItem($userid,$id_db_mix, $anzahl, $startgebot){
// Nun die Anzahl vergleichen
$test = 'SELECT count(i.id) AS anzahl FROM '.$db[0].' as w INNER JOIN '.$db[1].' as i ON(i.id=w.'.$db[2].') where w.user= '.$userid.' AND i.id = '.$id;
$result = mysql_fetch_assoc(mysql_query($test));
$result = mysqli_fetch_assoc(db_query($test));
// echo $test;
if($result['anzahl'] < $anzahl){
return 'Nicht genug Items (Vorhanden:'.$result['anzahl'].', Eingetragen:'.$anzahl.')';
}
$test = 'SELECT '.$db[3].' AS name FROM '.$db[1].' WHERE id ='.$id;
$itemname = mysql_fetch_assoc(mysql_query($test));
$itemname = mysqli_fetch_assoc(db_query($test));
// echo $test;
// Nun werden dem User die Items abgezogen und in die auktionstabelle eingefuegt.
$qry = mysql_query('DELETE FROM '.$db[0].' WHERE '.$db[2].'='.$id.' AND user='.$userid.' LIMIT '.$anzahl);
$anzahl2 = mysql_affected_rows();
$qry = db_query('DELETE FROM '.$db[0].' WHERE '.$db[2].'='.$id.' AND user='.$userid.' LIMIT '.$anzahl);
$anzahl2 = db_affected_rows();
if($anzahl2 == 0){
return 'Cheater!!';
} else if($anzahl != $anzahl2){
mysql_query('INSERT INTO auktion (itemid, itemname, tablename, anbieter, anzahl, deadline, startgebot, startdate) VALUES('.$id.',\''.$itemname['name'].'\',\''.$db[0].'\','.$userid.','.$anzahl2.',TIMESTAMPADD(Day,3,TIMESTAMPADD(Second,-second(now()),now())),'.$startgebot.',now())');
db_query('INSERT INTO auktion (itemid, itemname, tablename, anbieter, anzahl, deadline, startgebot, startdate) VALUES('.$id.',\''.$itemname['name'].'\',\''.$db[0].'\','.$userid.','.$anzahl2.',TIMESTAMPADD(Day,3,TIMESTAMPADD(Second,-second(now()),now())),'.$startgebot.',now())');
} else{
mysql_query('INSERT INTO auktion (itemid, itemname, tablename, anbieter, anzahl, deadline, startgebot, startdate) VALUES('.$id.',\''.$itemname['name'].'\',\''.$db[0].'\','.$userid.','.$anzahl.',TIMESTAMPADD(Day,3,TIMESTAMPADD(Second,-second(now()),now())),'.$startgebot.',now())');
db_query('INSERT INTO auktion (itemid, itemname, tablename, anbieter, anzahl, deadline, startgebot, startdate) VALUES('.$id.',\''.$itemname['name'].'\',\''.$db[0].'\','.$userid.','.$anzahl.',TIMESTAMPADD(Day,3,TIMESTAMPADD(Second,-second(now()),now())),'.$startgebot.',now())');
}
return '';
}
@ -214,8 +214,8 @@ function insertItem($userid,$id_db_mix, $anzahl, $startgebot){
// Diese Funktion erstellt die Auktionstabelle und die Transaktionentabelle
function createTables(){
// Erstellen der Auktionstabelle
mysql_query('DROP TABLE auktion');
mysql_query('
db_query('DROP TABLE auktion');
db_query('
CREATE TABLE `auktion` (
`auktionsid` int(10) unsigned NOT NULL auto_increment,
`anbieter` int(10) unsigned NOT NULL,
@ -233,8 +233,8 @@ function createTables(){
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=0 ;
');
mysql_query('DROP TABLE auktion_transaktionen');
mysql_query('
db_query('DROP TABLE auktion_transaktionen');
db_query('
CREATE TABLE `auktion_transaktionen` (
`transaktionsid` int(10) unsigned NOT NULL auto_increment,
`anbieter` int(10) unsigned NOT NULL,
@ -267,11 +267,11 @@ function getAuktionTotalCount($kategorie,$itemnamepart,$maxPrice){
$stringDelimiter = ' AND itemname LIKE \'%'.$itemnamepart.'%\' ';
}
$test = 'SELECT count(auktionsid) as anzahl FROM auktion WHERE 1 '.$kategorieDelimitier.$stringDelimiter.$priceDelimiter.' AND TIMESTAMPDIFF(Minute,now(),deadline) >= 0';
$qry = mysql_query($test);
if(mysql_num_rows($qry) == 0){
$qry = db_query($test);
if(mysqli_stmt_num_rows($qry) == 0){
return 0;
}
$result = mysql_fetch_assoc($qry);
$result = mysqli_fetch_assoc($qry);
return $result['anzahl'];
}
@ -294,9 +294,9 @@ function getAuktionEntries($kategorie,$itemnamepart,$entriesPerSite,$pageNumber,
}
$index = 0;
$test = 'SELECT a.auktionsid, u.nickname AS anbietername, u2.nickname AS bietername, a.deadline, a.aktuellesgebot, a.startgebot, a.anzahl, a.itemname, a.bieter, a.anbieter, a.itemid, a.tablename FROM auktion AS a INNER JOIN user as u ON a.anbieter = u.id LEFT JOIN user as u2 ON a.bieter = u2.id WHERE 1 '.$kategorieDelimitier.$stringDelimiter.$priceDelimiter.' AND TIMESTAMPDIFF(Minute,now(),deadline) >= 0 ORDER BY '.$order.' '.$dir.' '.$interval;
$qry = mysql_query($test);
$qry = db_query($test);
//echo '<br>'.$test.'<br>';
while($result = mysql_fetch_assoc($qry)){
while($result = mysqli_fetch_assoc($qry)){
$returnArray[$index++] = $result;
}
return $returnArray;
@ -304,9 +304,9 @@ function getAuktionEntries($kategorie,$itemnamepart,$entriesPerSite,$pageNumber,
function getEntryInformation($auktionsid){
if(!is_numeric($auktionsid)){return;}
$qry = mysql_query('SELECT u.nickname AS anbietername, u2.nickname AS bietername, a.auktionsid,a.anbieter,a.bieter,a.itemid,a.itemname,a.tablename,a.anzahl,a.startgebot,a.aktuellesgebot,a.deadline,a.startdate,a.cheatingverdacht, TIMESTAMPDIFF(Minute,now(),deadline) AS zeitdifferenz FROM auktion AS a INNER JOIN user as u ON a.anbieter = u.id LEFT JOIN user as u2 ON a.bieter = u2.id WHERE auktionsid = '.$auktionsid);
if(mysql_num_rows($qry) == 0){ return NULL; }
return mysql_fetch_assoc($qry);
$qry = db_query('SELECT u.nickname AS anbietername, u2.nickname AS bietername, a.auktionsid,a.anbieter,a.bieter,a.itemid,a.itemname,a.tablename,a.anzahl,a.startgebot,a.aktuellesgebot,a.deadline,a.startdate,a.cheatingverdacht, TIMESTAMPDIFF(Minute,now(),deadline) AS zeitdifferenz FROM auktion AS a INNER JOIN user as u ON a.anbieter = u.id LEFT JOIN user as u2 ON a.bieter = u2.id WHERE auktionsid = '.$auktionsid);
if(mysqli_stmt_num_rows($qry) == 0){ return NULL; }
return mysqli_fetch_assoc($qry);
}
function getKategorieOptions($preselect){
@ -318,8 +318,8 @@ function getKategorieOptions($preselect){
$total = 0;
$select = false;
$qry = mysql_query('SELECT tablename,count(tablename) as anzahl FROM auktion WHERE TIMESTAMPDIFF(Minute,now(),deadline) >= 0 AND itemname != \'Geheim!\' GROUP BY tablename');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('SELECT tablename,count(tablename) as anzahl FROM auktion WHERE TIMESTAMPDIFF(Minute,now(),deadline) >= 0 AND itemname != \'Geheim!\' GROUP BY tablename');
while($row = mysqli_fetch_assoc($qry)){
if($preselect == $row['tablename']){
$result[$index++] = '<option value=\''.$row['tablename'].'\' selected>'.$converter[$row['tablename']].' | Anzahl:'.$row['anzahl'].'</option>';
$select = true;
@ -349,10 +349,10 @@ function zurueckziehen($userid, $auktionsid, $pay){
return 'Es wurde zwischenzeitlich geboten! Zur&uuml;ckziehen nur mit Geb&uuml;hr m&ouml;glich!';
}
$gebuehr = floor($auktionsdaten['aktuellesgebot'] * 0.1);
mysql_query('UPDATE user SET geld=geld-'.$gebuehr.' WHERE id='.$userid);
db_query('UPDATE user SET geld=geld-'.$gebuehr.' WHERE id='.$userid);
mysql_query('DELETE FROM auktion WHERE auktionsid='.$auktionsid);
$anzahl2 = mysql_affected_rows();
db_query('DELETE FROM auktion WHERE auktionsid='.$auktionsid);
$anzahl2 = db_affected_rows();
if($anzahl2 == 0){
return 'CHEATER!!';
}
@ -361,23 +361,23 @@ function zurueckziehen($userid, $auktionsid, $pay){
if($auktionsdaten['tablename'] == 'ware'){$item_row_name = 'item_id';}
while($anzahl-- > 0){
$sql = 'INSERT INTO '.$auktionsdaten['tablename'].' ('.$item_row_name.', user) VALUES('.$auktionsdaten['itemid'].','.$userid.')';
mysql_query($sql);
db_query($sql);
// echo '<br>'.$sql.'<br>';
}
$sql = 'INSERT INTO nachricht(von, besitzer, betreff, text) VALUES (\'Auktionsmarkt\', '.$auktionsdaten['anbieter'].', \'Item zur&uuml;ckgezogen!\', \' Sie haben das Item '.$auktionsdaten['itemname'].' f&uuml;r eine Geb&uuml;hr von '.$gebuehr.' zur&uuml;ckgezogen!\')';
mysql_query($sql);
db_query($sql);
// echo '<br>'.$sql.'<br>';
if($auktionsdaten['bieter'] != NULL){
$sql = 'INSERT INTO nachricht(von, besitzer, betreff, text) VALUES (\'Auktionsmarkt\', '.$auktionsdaten['bieter'].', \'Item zur&uuml;ckgezogen!\', \' Das Item '.$auktionsdaten['itemname'].' wurde von '.$auktionsdaten['anbietername'].' zur&uuml;ckgezogen!\')';
mysql_query($sql);
db_query($sql);
// echo '<br>'.$sql.'<br>';
}
}
function getAveragePrice($itemid, $tablename, $anzahl){
$sql = 'SELECT avg(betrag) / avg(anzahl) AS average FROM auktion_transaktionen WHERE anbieter != 1 and itemid = '.$itemid.' and tablename = \''.$tablename.'\' and cheatingverdacht = 0 and TIMESTAMPADD(DAY,30,deadline) > CURRENT_TIMESTAMP';
$qry = mysql_query($sql);
$row = mysql_fetch_assoc($qry);
$qry = db_query($sql);
$row = mysqli_fetch_assoc($qry);
return round($row['average']*$anzahl);
}

@ -6,7 +6,7 @@
*
*/
function isSpammer($id){
$result = mysql_fetch_assoc(mysql_query('SELECT TIMESTAMPDIFF(Second,max(bann_until),now()) as anzahl from spammer WHERE userid='.$id.' group by userid'));
$result = mysqli_fetch_assoc(db_query('SELECT TIMESTAMPDIFF(Second,max(bann_until),now()) as anzahl from spammer WHERE userid='.$id.' group by userid'));
if($result['anzahl'] < 0){
return true;
} else{
@ -17,11 +17,11 @@ function isSpammer($id){
function becomeSpammer($id,$nick,$text){
// Es gibt 2 indikatoren ein Spammer zu sein
// Man schreibt min 10 posts innerhalb von 20 Sekunden
$result1 = mysql_num_rows(mysql_query('SELECT * FROM ag_chat WHERE user=\''.$nick.'\' and TIMESTAMPDIFF(Second,zeit,now()) <= 20'));
$result1 = mysqli_stmt_num_rows(db_query('SELECT * FROM ag_chat WHERE user=\''.$nick.'\' and TIMESTAMPDIFF(Second,zeit,now()) <= 20'));
// Man schreibt min 30 Posts innerhalb einer Minute
$result2 = mysql_num_rows(mysql_query('SELECT * FROM ag_chat WHERE user=\''.$nick.'\' and TIMESTAMPDIFF(Second,zeit,now()) <= 60'));
$result2 = mysqli_stmt_num_rows(db_query('SELECT * FROM ag_chat WHERE user=\''.$nick.'\' and TIMESTAMPDIFF(Second,zeit,now()) <= 60'));
// Innerhalb einer halben Minute 4 mal den selben Post!!
$result3 = mysql_num_rows(mysql_query('SELECT * FROM ag_chat WHERE user=\''.$nick.'\' AND TIMESTAMPDIFF(Second,zeit,now()) <= 30 AND nachricht = \''.$text.'\''));
$result3 = mysqli_stmt_num_rows(db_query('SELECT * FROM ag_chat WHERE user=\''.$nick.'\' AND TIMESTAMPDIFF(Second,zeit,now()) <= 30 AND nachricht = \''.$text.'\''));
// Und nun noch ein paar Aergernisse
@ -40,21 +40,21 @@ function becomeSpammer($id,$nick,$text){
}
function setSpamblock($id){
$anzahl = mysql_num_rows(mysql_query('SELECT * FROM spammer WHERE userid='.$id.' AND TIMESTAMPDIFF(Day,bann_until,now()) <=14'));
$anzahl = mysqli_stmt_num_rows(db_query('SELECT * FROM spammer WHERE userid='.$id.' AND TIMESTAMPDIFF(Day,bann_until,now()) <=14'));
$zeit = pow(5,($anzahl+1));
mysql_query('INSERT INTO spammer(userid, bann_until) values('.$id.',TIMESTAMPADD(Minute,'.$zeit.',now()))');
db_query('INSERT INTO spammer(userid, bann_until) values('.$id.',TIMESTAMPADD(Minute,'.$zeit.',now()))');
}
function releaseSpamblock($id){
mysql_query('DELETE from spammer where userid='.$id.' and TIMESTAMPDIFF(Second,bann_until,now()) < 0');
db_query('DELETE from spammer where userid='.$id.' and TIMESTAMPDIFF(Second,bann_until,now()) < 0');
}
function bannAccount($id){
mysql_query('UPDATE user SET bann = \'ja\' WHERE id='.$id);
db_query('UPDATE user SET bann = \'ja\' WHERE id='.$id);
}
function unbannAccount($id){
mysql_query('UPDATE user SET bann = \'nein\' WHERE id='.$id);
db_query('UPDATE user SET bann = \'nein\' WHERE id='.$id);
}
?>

@ -39,32 +39,32 @@ function getStatus($charid, $buffer_enabled = true) {
}
$sql = 'SELECT count(*) as anzahl FROM turnier_kampf t where art != \'gross\' and (win = ' . $charid . ' or lose = ' . $charid . ') and dauer > now()';
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_buffered_statuses'][$charid] = 'Turnier';
return 'Turnier';
}
$sql = 'SELECT count(*) as anzahl from quests where charid = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_buffered_statuses'][$charid] = 'Schatz Suche';
return 'Schatz Suche';
}
$sql = 'SELECT count(*) as anzahl from kampf where db_satz = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_buffered_statuses'][$charid] = 'Kampf';
return 'Kampf';
}
$sql = 'SELECT count(*) as anzahl FROM kampf_list where charakter = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_buffered_statuses'][$charid] = 'Kampf erstellt';
return 'Kampf erstellt';
}
$sql = 'SELECT count(*) as anzahl FROM turnier1 where charakter = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_buffered_statuses'][$charid] = 'Angemeldet';
return 'Angemeldet';
@ -114,7 +114,7 @@ function getChar2($charid) {
if(!is_numeric($charid)){
return null;
} else {
$char = mysql_fetch_assoc(mysql_query('Select * from chars where id = '.$charid));
$char = mysqli_fetch_assoc(db_query('Select * from chars where id = '.$charid));
if(!$char){return null;}
// Speichere in $char['stauts'] den aktuellen Status des Chars (buffer-Strategie ist hierbei die selbe)
$char['status'] = getStatus($char['id'],$buffer_enabled);
@ -171,7 +171,7 @@ function getCharWithBuffs($charid, $buffer_enabled = true){
function getCharBuffs($items) {
if($items != NULL && $items != ',,,,'){
$char_buffs = mysql_fetch_assoc(mysql_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN ('.$items.')'));
$char_buffs = mysqli_fetch_assoc(db_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN ('.$items.')'));
}
return $char_buffs;
}
@ -206,8 +206,8 @@ function getCharsOfUser($userid, $buffer_enabled = true) {
if ($GLOBALS['chars_read_out_user'][$userid] == null || !$buffer_enabled) {
$GLOBALS['chars_read_out_user'][$userid] = array();
$qry = mysql_query('Select id from chars where besitzer = '.$userid.' order by id');
while($char = mysql_fetch_assoc($qry)){
$qry = db_query('Select id from chars where besitzer = '.$userid.' order by id');
while($char = mysqli_fetch_assoc($qry)){
$GLOBALS['chars_read_out_user'][$userid][] = &getChar($char['id'], $buffer_enabled);
}
}
@ -221,8 +221,8 @@ function deleteChar($userid, $charid){
} else if($char['status'] != 'Frei'){
return 'Char ist nicht Frei!';
}
mysql_query('Delete from lernen where besitzer = '.$charid);
mysql_query('Delete from chars where id = '.$charid);
db_query('Delete from lernen where besitzer = '.$charid);
db_query('Delete from chars where id = '.$charid);
return true;
}
@ -263,7 +263,7 @@ function getPowerLevelWithBuffs($charid, $buffer_enabled = true){
return null;
}
if($char['kampf_item'] != NULL && $char['kampf_item'] != ',,,,'){
$char_buffs = mysql_fetch_assoc(mysql_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN (' . $char['kampf_item'] . ')'));
$char_buffs = mysqli_fetch_assoc(db_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN (' . $char['kampf_item'] . ')'));
}
// Uncomment for hp/mp in PL
return $char_buffs['starke']+$char_buffs['verteidigung']+$char_buffs['speed']+$char_buffs['ausdauer']+$char_buffs['glueck']+$char['starke']+$char['verteidigung']+$char['speed']+$char['ausdauer']+$char['glueck'];
@ -274,8 +274,8 @@ function getPowerLevelWithBuffs($charid, $buffer_enabled = true){
*/
function getCharAttacks($charid){
$attacks = array();
$qry = mysql_query("SELECT name, id, at_id FROM lernen WHERE besitzer='$charid' AND aktiv > '0' order by id");
while($row = mysql_fetch_array($qry)) {
$qry = db_query("SELECT name, id, at_id FROM lernen WHERE besitzer='$charid' AND aktiv > '0' order by id");
while($row = mysqli_fetch_array($qry)) {
$attacks[] = array('name'=>$row['name'], 'id'=>$row['id'], 'at_id'=>$row['at_id']);
}
return $attacks;
@ -325,7 +325,7 @@ function getAttacksforChar($charid, $mode = 0) {
// make a union out of both (TODO: maybe an outer join would result into the same result)
$sql = '('.$sql.') union distinct ('.$sql2.') order by level';
$qry = mysql_query($sql);
$qry = db_query($sql);
if($qry === FALSE) // print sql on error
echo '<br>'.$sql.'<br>';
@ -343,7 +343,7 @@ function getAttacksforChar($charid, $mode = 0) {
$attacke = array();
$requires = array();
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
$attacke[$row['id']] = $row;
if($row['unknown'] == 0 && $mode == 1) {

@ -12,11 +12,11 @@ defineIfNotDefined('STATUS_FREI', 'Frei');
//Dadurch kriege ich detailierte infos, sollte ein mysql query mal inkorrekt sein!
function safe_query($query="") {
if(empty($query)) return false;
if(DEBUG == "OFF") $result = mysql_query($query) or die('Query failed!');
if(DEBUG == "OFF") $result = db_query($query) or die('Query failed!');
else {
$result = mysql_query($query) or die('Query failed: '
.'<li>errorno='.mysql_errno()
.'<li>error='.mysql_error()
$result = db_query($query) or die('Query failed: '
.'<li>errorno='.mysqli_errno($GLOBALS['main_db'])
.'<li>error='.mysqli_error($GLOBALS['main_db'])
.'<li>query='.$query);
}
return $result;
@ -30,7 +30,7 @@ function chardaten($char_id,$name,&$char_1,&$hp1,&$mp1,&$exp,&$fehler) {
$hp1 = explode(',', $char_1['hp']);
$mp1 = explode(',', $char_1['mp']);
$exp = explode(',', $char_1['exp']);
$user = mysql_Fetch_array(mysql_query("SELECT id FROM user WHERE nickname='$name' LIMIT 1"));
$user = mysqli_fetch_array(db_query("SELECT id FROM user WHERE nickname='$name' LIMIT 1"));
if($char_1['besitzer'] != $user[0]) {
$fehler= 'Dieser Char geh&ouml;rt nicht dir!';
}

@ -16,9 +16,9 @@ function checkCookies($nickname, $yps) {
if (isset ($nick_name2) && strtolower($nick_name2) != strtolower($nickname)) {
// Ha!!! Da ist doch was faul!!
// sortiere die namen
$m_user_qry = mysql_query('SELECT * FROM user where nickname IN (\'' . $nickname . '\',\'' . $nick_name2 . '\') order by id');
$m_user_qry = db_query('SELECT * FROM user where nickname IN (\'' . $nickname . '\',\'' . $nick_name2 . '\') order by id');
$muser = array ();
while ($row = mysql_fetch_assoc($m_user_qry)) {
while ($row = mysqli_fetch_assoc($m_user_qry)) {
$muser[] = $row;
}
if (count($muser) != 2) {
@ -26,17 +26,17 @@ function checkCookies($nickname, $yps) {
}
// Neue Tabelle
$sql = 'INSERT INTO multiuser(user1, user2, occured, type) values(\'' . $muser[0]['id'] . '\', \'' . $muser[1]['id'] . '\',CURRENT_TIMESTAMP, \'Cookie\')';
mysql_query($sql);
db_query($sql);
}
}
function detectNonCodeEnterers(){
$qry = mysql_query('Select * from bot_images WHERE TIMESTAMPDIFF(MINUTE, created, now()) > 10');
mysql_query('DELETE from bot_images WHERE TIMESTAMPDIFF(MINUTE, created, now()) > 10 ');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('Select * from bot_images WHERE TIMESTAMPDIFF(MINUTE, created, now()) > 10');
db_query('DELETE from bot_images WHERE TIMESTAMPDIFF(MINUTE, created, now()) > 10 ');
while($row = mysqli_fetch_assoc($qry)){
$sql = 'Insert into bot_image_failures(userid, inserted, valid, used) values('.$row['userid'].', \'!NOTHING!\', \''.$row['compressed_phrase'].'\', \''.$row['created'].'\')';
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
}
}

@ -26,7 +26,7 @@ function getClan($clanid, $buffer = TRUE) {
return $GLOBALS['clan_buffered_instances'][$clanid]; // okay, we already buffered the clan :)
}
$clan = mysql_fetch_assoc(mysql_query('SELECT * FROM clan WHERE id = '. $clanid));
$clan = mysqli_fetch_assoc(db_query('SELECT * FROM clan WHERE id = '. $clanid));
// now calculate the member, max_exp fields :D
@ -41,7 +41,7 @@ function getClan($clanid, $buffer = TRUE) {
function getClanMembersCount($clanid) {
if(!is_numeric($clanid)) { return NULL; }
$row = mysql_fetch_assoc(mysql_query('SELECT count(id) as amount FROM user WHERE clan = '. $clanid));
$row = mysqli_fetch_assoc(db_query('SELECT count(id) as amount FROM user WHERE clan = '. $clanid));
return $row['amount'];
}
@ -120,8 +120,8 @@ function revokeInvitation($user, $userid, $clan = NULL){
}
if($clan === NULL) {
$qry = mysql_query('Select * from clan where id = ' . $user['clan']);
$clan = mysql_fetch_assoc($qry);
$qry = db_query('Select * from clan where id = ' . $user['clan']);
$clan = mysqli_fetch_assoc($qry);
}
if($clan['leader'] != $user['id'] && $clan['co_leader'] != $user['id']){
@ -130,8 +130,8 @@ function revokeInvitation($user, $userid, $clan = NULL){
$sql = 'DELETE FROM user_clan_invitations WHERE clanid = '.$clan['id'].' AND userid = '.$userid;
// echo $sql . '<br>';
mysql_query($sql);
if(mysql_affected_rows() > 0){
db_query($sql);
if(db_affected_rows() > 0){
return NULL;
} else{
return 'Einladung konnte nicht zur&uuml;ckgezogen werden!';
@ -151,15 +151,15 @@ function inviteUser(array $user, $userid, array $clan = NULL){
}
if($clan === NULL) {
$qry = mysql_query('Select * from clan where id = ' . $user['clan']);
$clan = mysql_fetch_assoc($qry);
$qry = db_query('Select * from clan where id = ' . $user['clan']);
$clan = mysqli_fetch_assoc($qry);
}
if($clan['leader'] != $user['id'] && $clan['co_leader'] != $user['id']){
return 'Nur der Leader, bzw. der Co-Leader kann neue Member einladen!';
}
$row = mysql_fetch_assoc(mysql_query('SELECT * FROM user where id = \''. $userid.'\''));
$row = mysqli_fetch_assoc(db_query('SELECT * FROM user where id = \''. $userid.'\''));
if(!row) {
return 'Fehler! Nutzer exisitiert nicht!!';
}
@ -169,12 +169,12 @@ function inviteUser(array $user, $userid, array $clan = NULL){
$sql = 'INSERT INTO user_clan_invitations(userid, clanid, valid) values('.$userid.','.$user['clan'].',TIMESTAMPADD(DAY, 5, now()))';
// echo $sql.'<br>';
mysql_query($sql);
if(mysql_affected_rows() <= 0){ // Fehler?
db_query($sql);
if(db_affected_rows() <= 0){ // Fehler?
$sql = 'UPDATE user_clan_invitations SET valid = TIMESTAMPADD(DAY, 5, now()) where userid = '.$userid.' and clanid = '.$user['clan'];
// echo $sql.'<br>';
mysql_query($sql);
if(mysql_affected_rows() <= 0){ // Fehler?
db_query($sql);
if(db_affected_rows() <= 0){ // Fehler?
return 'Fehler! Konnte Nutzer nicht einladen!';
} else{
sendMessage($user['nickname'], $userid, 'Einladung in Clan', 'Die Einladung des Clans '.$clan['clanname'].' wurde aufgefrischt! Klicke auf "Clan beitreten" um die Einladung anzunehmen!');
@ -191,19 +191,19 @@ function fireMember($user, $member){
if($member != $clan['leader'] && $member != $clan['co_leader'] && ($user['id'] == $clan['leader'] || $user['id'] == $clan['co_leader'] || $member == $user['id'])){
$sql = 'Update user set clan = NULL where id = '.$member.' AND clan = '.$user['clan'];
// echo $sql.'<br>';
mysql_query($sql);
if(mysql_affected_rows() > 0){ // Soll nur ausgeführt werden, wenn member wirklich gekickt wurde!!
db_query($sql);
if(db_affected_rows() > 0){ // Soll nur ausgeführt werden, wenn member wirklich gekickt wurde!!
$sql = 'Update chars set clan_train = NULL where besitzer = '.$member;
mysql_query($sql);
db_query($sql);
if($user['id'] != $member) {
sendMessage($user['nickname'], $member, 'Clan rauswurf!', 'Du wurdest von '.$user['nickname'].' aus deinem Clan geworfen. Du wirst dir wohl einen neuen suchen m&uuml;ssen!');
} else if($clan['exp'] == 0 && $clan['level'] == 1 && getClanMembersCount($user['clan']) == 0) {
mysql_query('DELETE FROM clan WHERE id =' .$user['clan']);
db_query('DELETE FROM clan WHERE id =' .$user['clan']);
}
// delete the participation in open clan fights! Thats tricky because the user itself is not stored in the database!!
mysql_query('DELETE FROM clan_challenge_whitelist WHERE clan_id = ' .$clan['id'] . ' AND user_id = ' .$user['id']);
mysql_query('DELETE FROM clan_challenge_participants WHERE clan_challenge_id in (SELECT clan_challenge_id FROM clan_challenge where calculated = FALSE) and char_id IN (Select id FROM chars where besitzer = '.$user['id'].')');
db_query('DELETE FROM clan_challenge_whitelist WHERE clan_id = ' .$clan['id'] . ' AND user_id = ' .$user['id']);
db_query('DELETE FROM clan_challenge_participants WHERE clan_challenge_id in (SELECT clan_challenge_id FROM clan_challenge where calculated = FALSE) and char_id IN (Select id FROM chars where besitzer = '.$user['id'].')');
}
} else{
echo displayErrorMessage(NULL, 'Du kannst den Member nicht feuern!', displayHistoryBackLink());
@ -216,8 +216,8 @@ function fireMember($user, $member){
*
*/
function getAllClans() {
$qry = mysql_query('SELECT id,clanname FROM clan;');
while ($result = mysql_fetch_assoc($qry)) {
$qry = db_query('SELECT id,clanname FROM clan;');
while ($result = mysqli_fetch_assoc($qry)) {
$clans[] = $result;
}
return $clans;
@ -228,7 +228,7 @@ function joinClan($user, $clanid, $check_invitation = true){
isClanLocked($clanid); // we only require the calculation not the result!
$sql = 'SELECT * FROM user_clan_invitations WHERE userid = '.$user['id'].' and clanid = '.$clanid.' and valid > now();';
$clan_user = mysql_fetch_assoc(mysql_query($sql));
$clan_user = mysqli_fetch_assoc(db_query($sql));
if($clan_user || !$check_invitation){
$clan = getClan($clanid);
@ -241,13 +241,13 @@ function joinClan($user, $clanid, $check_invitation = true){
} else{
$sql = 'UPDATE user SET clan = '.$clanid.' WHERE id = '.$user['id'];
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
// unset the leader if the user is moving from one clan to another
mysql_query('UPDATE clan SET leader = NULL WHERE leader = ' .$user['id'] . ' and id != ' .$clanid);
mysql_query('UPDATE clan SET co_leader = NULL WHERE co_leader = ' .$user['id'] . ' and id != ' .$clanid);
mysql_query('DELETE FROM clan_challenge_whitelist WHERE clan_id = ' .$clanid . ' AND user_id = ' .$user['id']);
mysql_query('DELETE FROM clan_challenge_participants where char_id IN (SELECT id from chars where besitzer = '.$user['id'].') and clan_challenge_id IN (SELECT clan_challenge_id from clan_challenges WHERE calculated = 0)');
db_query('UPDATE clan SET leader = NULL WHERE leader = ' .$user['id'] . ' and id != ' .$clanid);
db_query('UPDATE clan SET co_leader = NULL WHERE co_leader = ' .$user['id'] . ' and id != ' .$clanid);
db_query('DELETE FROM clan_challenge_whitelist WHERE clan_id = ' .$clanid . ' AND user_id = ' .$user['id']);
db_query('DELETE FROM clan_challenge_participants where char_id IN (SELECT id from chars where besitzer = '.$user['id'].') and clan_challenge_id IN (SELECT clan_challenge_id from clan_challenges WHERE calculated = 0)');
if($check_invitation) {
displayErrorMessage('Aufgenommen','Du wurdest erfolgreich in den Clan aufgenommen!','<a href="index.php?as=clan/clan_info">weiter</a>');
@ -257,12 +257,12 @@ function joinClan($user, $clanid, $check_invitation = true){
displayErrorMessage(NULL,'Konnte die Einladung des Clans nicht annehmen!',displayHistoryBackLink());
return;
}
mysql_query('DELETE FROM user_clan_invitations WHERE userid = '.$user['id'].' and clanid = '.$clanid);
db_query('DELETE FROM user_clan_invitations WHERE userid = '.$user['id'].' and clanid = '.$clanid);
}
function denyClan($user, $clanid){
mysql_query('DELETE FROM user_clan_invitations WHERE userid = '.$user['id'].' and clanid = '.$clanid);
if(mysql_affected_rows() > 0){
db_query('DELETE FROM user_clan_invitations WHERE userid = '.$user['id'].' and clanid = '.$clanid);
if(db_affected_rows() > 0){
displayErrorMessage('Abgelehnt','Du hast die Einladung erfolgreich abgelehnt!','<a href="index.php?as=clan/add">weiter</a>');
} else{
displayErrorMessage(NULL,'Einladung des Clans konnte nicht abgelehnt werden!',displayHistoryBackLink());
@ -280,15 +280,15 @@ function deleteClan($userid) {
// Okay notify the members :)
$qry = mysql_query('SELECT id FROM user WHERE clan = '.$user['clan']);
while($member = mysql_fetch_assoc($qry)) {
$qry = db_query('SELECT id FROM user WHERE clan = '.$user['clan']);
while($member = mysqli_fetch_assoc($qry)) {
sendMessage($user['nickname'], $member['id'], 'Clan wurde gelöscht!', 'Dein Clan wurde von '.$user['nickname'].' gel&ouml;scht. Du wirst dir wohl einen neuen suchen m&uuml;ssen!');
}
// Check if this clan is level 0 and has 0 exp ...
if($clan['exp'] == 0 && $clan['level'] == 1) {
// really do delete the clan !!
mysql_query('DELETE FROM clan where id = '.$user['clan']);
db_query('DELETE FROM clan where id = '.$user['clan']);
} else {
// cleanup the clan!
$sql1 = 'UPDATE user SET clan = NULL WHERE clan = ' . $clanid;
@ -298,8 +298,8 @@ function deleteClan($userid) {
// echo $sql1 . '<br>';
// echo $sql2 . '<br>';
mysql_query($sql1);
mysql_query($sql2);
db_query($sql1);
db_query($sql2);
}
return NULL;
@ -308,15 +308,15 @@ function deleteClan($userid) {
function conquerClan($clanid, $userid) {
// It is possible to enter a clan that is empty :)
$user = getUser($userid);
$result = mysql_fetch_row(mysql_query('SELECT count(*) FROM user WHERE clan = ' . $clanid));
$result = mysqli_fetch_row(db_query('SELECT count(*) FROM user WHERE clan = ' . $clanid));
if($result[0] != 0) {
return 'Der Clan ('.$clanid.') ist nicht leer!';
}
$sql = 'UPDATE clan SET leader = ' . $userid . ' WHERE leader is NULL AND id = '. $clanid;
mysql_query($sql);
db_query($sql);
$done = mysql_affected_rows() > 0;
$done = db_affected_rows() > 0;
if(!$done) {
return 'Der Clan ist schon &uuml;bernommen worden!';
}
@ -327,8 +327,8 @@ function conquerClan($clanid, $userid) {
}
function setMeAsLeader($user){
mysql_query('UPDATE clan set leader = '.$user['id'].' WHERE id = '.$user['clan'].' and leader IS null AND co_leader IS null');
return mysql_affected_rows() > 0;
db_query('UPDATE clan set leader = '.$user['id'].' WHERE id = '.$user['clan'].' and leader IS null AND co_leader IS null');
return db_affected_rows() > 0;
}
@ -354,8 +354,8 @@ function sendClanNewsletter($user, $text){
}
$errors = FALSE;
$sql = 'SELECT id FROM user WHERE clan='.$user['clan'];
$clans = mysql_query($sql);
while($row = mysql_fetch_assoc($clans)) {
$clans = db_query($sql);
while($row = mysqli_fetch_assoc($clans)) {
$errors |= !sendMessage($user['nickname'], $row['id'], $clan['clanname'].' Nachricht', $text);
}
if($errors) {
@ -378,15 +378,15 @@ function addClanExp($clan_id, $exp) {
$n_exp = 0;
$n_level++;
}
mysql_query('UPDATE clan SET exp = ' .$n_exp. ', level = ' .$n_level . ' WHERE id = ' .$clan_id . ' AND exp = ' .$clan['exp'] . ' AND level = ' .$clan['level']);
if(mysql_affected_rows() == 0) {
db_query('UPDATE clan SET exp = ' .$n_exp. ', level = ' .$n_level . ' WHERE id = ' .$clan_id . ' AND exp = ' .$clan['exp'] . ' AND level = ' .$clan['level']);
if(db_affected_rows() == 0) {
echo 'Fehler beim zuweisen der Clanexp, dadurch sind dem Clan mit der ID ' . $clan['level'] . ' ' .$exp . ' exp fl&omul;ten gegangen!! Neue exp w&auml;ren ' . $n_exp . ' bei level ' .$n_level;
} else {
$money = getMoneyBonusByLevel($n_level);
if($money > 0) {
// nice we can give the clan some money :D
insertClanTickerMessage($clan_id, 'Durch Erreichen von Level ' .$n_level . ' habt ihr ' . displayMoney($money) . ' bekommen!!');
mysql_query('UPDATE clan SET geld = geld + ' . $money . ' WHERE id = ' .$clan_id );
db_query('UPDATE clan SET geld = geld + ' . $money . ' WHERE id = ' .$clan_id );
}
}
}

@ -21,7 +21,7 @@ include_once(ROOT_PATH.'/include/messagefunctions.inc.php');
*/
function createChatRoom(array $clan_ids, $foreign_identifier) {
db_query('INSERT INTO clan_chatrooms(foreign_id) values(\''.$foreign_identifier.'\')');
if(mysql_affected_rows() == 0) {
if(db_affected_rows() == 0) {
return 'Konnte den Clanchatroom nicht erstellen, da er schon exisitert!';
}
$chat_id = getClanChatId($foreign_identifier);
@ -36,7 +36,7 @@ function createChatRoom(array $clan_ids, $foreign_identifier) {
* @param string $foreign_identifier
*/
function getClanChatId($foreign_identifier) {
$row = mysql_fetch_row(db_query('SELECT clan_chat_id FROM clan_chatrooms WHERE foreign_id = \''.$foreign_identifier.'\''));
$row = mysqli_fetch_row(db_query('SELECT clan_chat_id FROM clan_chatrooms WHERE foreign_id = \''.$foreign_identifier.'\''));
return $row[0];
}
@ -48,7 +48,7 @@ function checkAccessRights($user_id, $clan_chat_id) {
if(!$qry) {
return false;
}
return mysql_num_rows($qry);
return mysqli_stmt_num_rows($qry);
}
function sendClanChatMessage($user_id, $clan_chat_id, $message) {
@ -60,9 +60,9 @@ function sendClanChatMessage($user_id, $clan_chat_id, $message) {
if(!qry) {
return 'COULD NOT EXECUTE A QUERY!!!';
}
$row = mysql_fetch_row($qry);
$row = mysqli_fetch_row($qry);
$res = db_query('INSERT INTO clan_chatroom_messages(clan_chat_id, user_id, message, msg_id) values('.$clan_chat_id.', '.$user_id.', \''.$message.'\', '. $row[0] .')');
if(mysql_affected_rows() > 0) {
if(db_affected_rows() > 0) {
break;
}
}
@ -82,12 +82,12 @@ function getClanChatMessages($requester, $clan_chat_id, $count, $asc, $msg_id =
if(is_numeric($msg_id)) {
$sql .= ' AND msg_id > ' .$msg_id;
} else {
$max_id_row = mysql_fetch_row(mysql_query('Select max(msg_id) from clan_chatroom_messages WHERE clan_chat_id = ' . $clan_chat_id));
$max_id_row = mysqli_fetch_row(db_query('Select max(msg_id) from clan_chatroom_messages WHERE clan_chat_id = ' . $clan_chat_id));
$sql .= ' AND msg_id > ' . ($max_id_row[0] - $count);
}
$sql .= ' ORDER BY msg_id ASC LIMIT ' .$count;
$qry = db_query($sql);
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
$result['max_id'] = max($result['max_id'], $row['msg_id']);
$message = stripslashes(encodeNoHTMLWithBB(stripslashes($row['message'])));
$result['chat_rows'][] = formatTimestampShortYear($row['zeit']) . ' ' . generateUserNameByID($row['user_id']) . ': ' . $message;

@ -111,9 +111,9 @@ function challengeClan(array $user, $clanid, $anzahl = 5, $type = DAVY_BACK_FIGH
// check if both clans have already been challengeing each other since 24h?
$sql = 'SELECT count(*) as anzahl FROM clan_challenge_requests WHERE clan_requester IN ('.$user['clan'].', '.$clanid.') AND clan_challenged IN ('.$user['clan'].', '.$clanid.') AND challenged_time > TIMESTAMPADD(hour, -'.CLANFIGHTS_RECHALLENGE_DELAY.', now())';
$qry = mysql_query($sql);
$qry = db_query($sql);
$row = mysql_fetch_assoc($qry);
$row = mysqli_fetch_assoc($qry);
if($row['anzahl'] > 0) {
semaphoreDown($ressource_clan1); // free the previously reserved semaphore!
semaphoreDown($ressource_clan2); // free the previously reserved semaphore!
@ -123,7 +123,7 @@ function challengeClan(array $user, $clanid, $anzahl = 5, $type = DAVY_BACK_FIGH
// it should not be possible to challenge a clan that already has an open match that is not yet calculated! ( not completely possible in sql)
$sql = 'select count(k.anzahl) as anzahl from (SELECT count(*) as anzahl FROM clan_challenges c inner join clan_challenge_clans ccc on c.clan_challenge_id = ccc.clan_challenge_id where (calculated = 1 or enddate > now()) and clan_id IN ('.$user['clan'].', '.$clanid.') group by c.clan_challenge_id) k where k.anzahl = 0';
//echo $sql .'<br>';
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if($row['anzahl'] > 0) {
semaphoreDown($ressource_clan1); // free the previously reserved semaphore!
semaphoreDown($ressource_clan2); // free the previously reserved semaphore!
@ -133,7 +133,7 @@ function challengeClan(array $user, $clanid, $anzahl = 5, $type = DAVY_BACK_FIGH
// now calculate how many open fights we currently had or have!
$sql = 'select count(*) as anzahl from (SELECT count(*) as anz FROM clan_challenges c inner join clan_challenge_clans ccc on c.clan_challenge_id = ccc.clan_challenge_id where calculated = 0 or TIMESTAMPADD(day, -1, now()) < enddate and clan_id IN ('.$user['clan'].', '.$clanid.') group by clan_id) k where k.anz >= ' . CLANFIGHTS_MAX_FIGHTS_PER_24H;
//echo $sql .'<br>';
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if($row['anzahl'] > 0) {
semaphoreDown($ressource_clan1); // free the previously reserved semaphore!
@ -143,9 +143,9 @@ function challengeClan(array $user, $clanid, $anzahl = 5, $type = DAVY_BACK_FIGH
// Fordere heraus!
mysql_query('INSERT INTO clan_challenge_requests(clan_requester, clan_challenged, type, challenged_time, clan_challenge_creator, anzahl_chars, active) VALUES('.$user['clan'].', '.$clanid.','.$type.' , TIMESTAMPADD(HOUR, CURRENT_TIMESTAMP, 4), '.$user['id'].', '.$anzahl.', true)');
db_query('INSERT INTO clan_challenge_requests(clan_requester, clan_challenged, type, challenged_time, clan_challenge_creator, anzahl_chars, active) VALUES('.$user['clan'].', '.$clanid.','.$type.' , TIMESTAMPADD(HOUR, CURRENT_TIMESTAMP, 4), '.$user['id'].', '.$anzahl.', true)');
if(mysql_affected_rows() > 0) {
if(db_affected_rows() > 0) {
if(is_numeric($oclan['leader'])) {
sendMessage($user['nickname'], $oclan['leader'], 'Clan-Fight Herausforderung', 'Der Clan '.$clan['clanname'].' hat euch zu einem Clan-Fight herausgefordert! Über "Mein Clan" könnt ihr die Herausforderung annehmen!');
}
@ -180,7 +180,7 @@ function acceptChallengeRequest($challenged_clan, array $user) {
}
$sql = 'SELECT * FROM clan_challenge_requests WHERE clan_challenged = ' .$user['clan'] . ' AND clan_requester = ' .$challenged_clan . ' AND active = TRUE AND challenged_time > TIMESTAMPADD(day, -1, now())';
$clan_challenge = mysql_fetch_assoc(mysql_query($sql));
$clan_challenge = mysqli_fetch_assoc(db_query($sql));
if(!$clan_challenge) {
return 'Konnte die Herausforderung nicht annehmen, da diese Herausforderung nicht exisitiert!';
@ -194,14 +194,14 @@ function acceptChallengeRequest($challenged_clan, array $user) {
if(isClanLocked($clan_challenge['clan_challenged']) || isClanLocked($clan_challenge['clan_requester'])) {
// okay we cannot accept the challenge so make it inactive!
mysql_query('UPDATE clan_challenge_requests SET active = FALSE WHERE clan_challenge_id = ' .$clan_challenge_id);
db_query('UPDATE clan_challenge_requests SET active = FALSE WHERE clan_challenge_id = ' .$clan_challenge_id);
return 'Einer der Clans erfüllt die Anforderungen an Clanfights nichtmehr (wahrscheinlich zu wenig Members)!';
}
// now calculate how many open fights we currently had or have! // FIXME: Good idea to pach this in a semaphore?
$sql = 'select count(*) as anzahl from (SELECT count(*) as anz FROM clan_challenges c inner join clan_challenge_clans ccc on c.clan_challenge_id = ccc.clan_challenge_id where calculated = 0 or TIMESTAMPADD(day, -1, now()) < enddate and clan_id IN ('.$clan_challenge['clan_challenged'].', '.$clan_challenge['clan_requester'].') group by clan_id) k where k.anz >= ' . CLANFIGHTS_MAX_FIGHTS_PER_24H;
// echo $sql . '<br>';
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if($row['anzahl'] > 0) {
return 'Einer der beiden Clans hat das Limit von ' . CLANFIGHTS_MAX_FIGHTS_PER_24H . ' offenen und abgeschlossenen Clanfights innerhalb von 24 erreicht. Daher kann die Herausforderung nicht angenommen werden!';
@ -209,11 +209,11 @@ function acceptChallengeRequest($challenged_clan, array $user) {
$oclan = getClan($clan_challenge['clan_requester']);
mysql_query('UPDATE clan_challenge_requests SET active = false WHERE clan_challenged = ' .$user['clan'] . ' AND clan_requester = ' .$challenged_clan . ' AND active = TRUE AND challenged_time > TIMESTAMPADD(day, -1, now())');
db_query('UPDATE clan_challenge_requests SET active = false WHERE clan_challenged = ' .$user['clan'] . ' AND clan_requester = ' .$challenged_clan . ' AND active = TRUE AND challenged_time > TIMESTAMPADD(day, -1, now())');
if(mysql_affected_rows() > 0) {
if(db_affected_rows() > 0) {
// okay and for failsaveness just deactivate old requests
mysql_query('UPDATE clan_challenge_requests SET active = false WHERE clan_challenged = ' .$user['clan'] . ' AND clan_requester = ' .$challenged_clan. ' AND active = TRUE');
db_query('UPDATE clan_challenge_requests SET active = false WHERE clan_challenged = ' .$user['clan'] . ' AND clan_requester = ' .$challenged_clan. ' AND active = TRUE');
if(is_numeric($oclan['leader'])) {
sendMessage($user['nickname'], $oclan['leader'], 'Clan-Fight', 'Der Clan '.$clan['clanname'].' hat eure Herausforderungen zu einem Clan-Fight angenommen! Über "Mein Clan" könnt ihr nun Chars anmelden!');
@ -231,17 +231,17 @@ function acceptChallengeRequest($challenged_clan, array $user) {
$id = -1;
// get id
while(!$finished) {
$row = mysql_fetch_row(mysql_query('select IFNULL(max(clan_challenge_id),0) + 1 from clan_challenges'));
mysql_query('INSERT INTO clan_challenges(clan_challenge_id, type, anzahl_chars) values('.$row[0].', '.$clan_challenge['type'].', '.$clan_challenge['anzahl_chars'].')');
$finished = mysql_affected_rows() > 0;
$row = mysqli_fetch_row(db_query('select IFNULL(max(clan_challenge_id),0) + 1 from clan_challenges'));
db_query('INSERT INTO clan_challenges(clan_challenge_id, type, anzahl_chars) values('.$row[0].', '.$clan_challenge['type'].', '.$clan_challenge['anzahl_chars'].')');
$finished = db_affected_rows() > 0;
$id = $row[0];
}
// insert the participants :)
$sql = 'INSERT INTO clan_challenge_clans(clan_challenge_id, id, clan_id, clan_coordinator, elo) values('.$id.', 0, '.$clan['id'].', '.$user['id'].', ' .$clan['elo'].')';
mysql_query($sql);
db_query($sql);
$sql = 'INSERT INTO clan_challenge_clans(clan_challenge_id, id, clan_id, clan_coordinator, elo) values('.$id.', 1, '.$oclan['id'].', ' .$clan_challenge['clan_challenge_creator'].', ' .$clan['elo'].')';
mysql_query($sql);
db_query($sql);
// we have everything we need for this challenge to be opened :)
@ -266,7 +266,7 @@ function cancelChallengeRequest($challenged_clan, array $user) {
$sql = 'SELECT * FROM clan_challenge_requests WHERE clan_challenged = ' .$challenged_clan . ' AND clan_requester = ' .$user['clan'] . ' AND active = TRUE AND challenged_time > TIMESTAMPADD(day, -1, now())';
// echo $sql .'<br>';
$clan_challenge = mysql_fetch_assoc(mysql_query($sql));
$clan_challenge = mysqli_fetch_assoc(db_query($sql));
if(!$clan_challenge) {
return 'Konnte die Herausforderung nicht zur&uuml;ckziehen, da diese Herausforderung nicht exisitiert!';
@ -280,7 +280,7 @@ function cancelChallengeRequest($challenged_clan, array $user) {
}
// okay seems to be okay
mysql_query('UPDATE clan_challenge_requests SET active = false WHERE clan_challenged = ' .$challenged_clan . ' AND clan_requester = ' .$user['clan'] . ' AND active = TRUE');
db_query('UPDATE clan_challenge_requests SET active = false WHERE clan_challenged = ' .$challenged_clan . ' AND clan_requester = ' .$user['clan'] . ' AND active = TRUE');
if(is_numeric($oclan['leader'])) {
sendMessage($user['nickname'], $oclan['leader'], 'Clan-Fight', 'Der Clan '.$clan['clanname'].' hat die Herausforderungen zu einem Clan-Fight zurückgezogen! Über "Mein Clan" kann eine neue Herausforderungen erstellt werden!');
@ -311,7 +311,7 @@ function denyChallengeRequest($challenge_requester, array $user) {
$sql = 'SELECT * FROM clan_challenge_requests WHERE clan_challenged = ' .$user['clan'] . ' AND clan_requester = ' .$challenge_requester . ' AND active = TRUE AND challenged_time > TIMESTAMPADD(day, -1, now())';
// echo $sql . '<br>';
$clan_challenge = mysql_fetch_assoc(mysql_query($sql));
$clan_challenge = mysqli_fetch_assoc(db_query($sql));
if(!$clan_challenge) {
return 'Konnte die Herausforderung nicht ablehnen, da diese Herausforderung nicht exisitiert!';
@ -325,7 +325,7 @@ function denyChallengeRequest($challenge_requester, array $user) {
}
// okay seems to be okay
mysql_query('UPDATE clan_challenge_requests SET active = false WHERE clan_challenged = ' .$user['clan'] . ' AND clan_requester = ' .$challenge_requester. ' AND active = TRUE');
db_query('UPDATE clan_challenge_requests SET active = false WHERE clan_challenged = ' .$user['clan'] . ' AND clan_requester = ' .$challenge_requester. ' AND active = TRUE');
if(is_numeric($oclan['leader'])) {
sendMessage($user['nickname'], $oclan['leader'], 'Clan-Fight', 'Der Clan '.$clan['clanname'].' hat eure Herausforderungen zu einem Clan-Fight abgelehnt! Über "Mein Clan" könnt neue Herausforderungen erstellen!');
@ -353,8 +353,8 @@ function getChallenge($challenge_id, $buffer = TRUE) {
return $GLOBALS['clan_challenge_buffered_instances'][$challenge_id]; // okay, we already buffered the clan :)
}
$qry = mysql_query('SELECT * from clan_challenges WHERE clan_challenge_id = ' .$challenge_id);
$GLOBALS['clan_challenge_buffered_instances'][$challenge_id] = mysql_fetch_assoc($qry);
$qry = db_query('SELECT * from clan_challenges WHERE clan_challenge_id = ' .$challenge_id);
$GLOBALS['clan_challenge_buffered_instances'][$challenge_id] = mysqli_fetch_assoc($qry);
return $GLOBALS['clan_challenge_buffered_instances'][$challenge_id]; // okay, we already buffered the clan :)
}
@ -371,8 +371,8 @@ function getOpenChallengeRequests($clanid) {
$sql = 'SELECT * from clan_challenge_requests WHERE challenged_time > TIMESTAMPADD(day, -1, now()) and active = TRUE AND (clan_requester = '.$clanid.' OR clan_challenged = '.$clanid.')';
// echo $sql . '<br>';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)) {
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)) {
$array[] = $row;
}
return $array;
@ -384,7 +384,7 @@ function getOpenChallengeRequestCount($clanid) {
}
$sql = 'SELECT count(*) from clan_challenge_requests where challenged_time > TIMESTAMPADD(day, -1, now()) and active = TRUE AND (clan_requester = '.$clanid.' OR clan_challenged = '.$clanid.')';
// echo $sql . '<br>';
$row = mysql_fetch_row(mysql_query($sql));
$row = mysqli_fetch_row(db_query($sql));
return $row[0];
}
@ -397,8 +397,8 @@ function getOpenChallengeIDs($clanid) {
}
$sql = 'SELECT cc.clan_challenge_id FROM clan_challenges AS cc inner join clan_challenge_clans AS ccp ON cc.clan_challenge_id = ccp.clan_challenge_id WHERE clan_id = ' . $clanid . ' AND calculated = FALSE';
$qry = mysql_query($sql);
while($row = mysql_fetch_row($qry)) {
$qry = db_query($sql);
while($row = mysqli_fetch_row($qry)) {
$array[] = $row[0];
}
// return the ids
@ -413,8 +413,8 @@ function getActiveChallengeIDs($clanid) {
}
$sql = 'SELECT cc.clan_challenge_id FROM clan_challenges AS cc inner join clan_challenge_clans AS ccp ON cc.clan_challenge_id = ccp.clan_challenge_id WHERE clan_id = ' . $clanid . ' AND calculated = TRUE AND enddate > now() ORDER BY cc.date DESC ' . $addition;
$qry = mysql_query($sql);
while($row = mysql_fetch_row($qry)) {
$qry = db_query($sql);
while($row = mysqli_fetch_row($qry)) {
$array[] = $row[0];
}
// return the ids
@ -431,8 +431,8 @@ function getAwatingChallengeIDs() {
$array = array();
$sql = 'SELECT distinct(cc.clan_challenge_id) FROM clan_challenges AS cc inner join clan_challenge_clans AS ccp ON cc.clan_challenge_id = ccp.clan_challenge_id WHERE elo_change is null AND calculated = TRUE AND enddate < now()';
// echo $sql . '<br>';
$qry = mysql_query($sql);
while($row = mysql_fetch_row($qry)) {
$qry = db_query($sql);
while($row = mysqli_fetch_row($qry)) {
$array[] = $row[0];
}
// return the ids
@ -447,8 +447,8 @@ function getHistoricalChallengeIDs($clanid, $limit = NULL) {
$addition = ' LIMIT ' .$limit;
}
$sql = 'SELECT cc.clan_challenge_id FROM clan_challenges AS cc inner join clan_challenge_clans AS ccp ON cc.clan_challenge_id = ccp.clan_challenge_id WHERE clan_id = ' . $clanid . ' AND calculated = TRUE AND enddate < now() ORDER BY cc.date DESC ' . $addition;
$qry = mysql_query($sql);
while($row = mysql_fetch_row($qry)) {
$qry = db_query($sql);
while($row = mysqli_fetch_row($qry)) {
$array[] = $row[0];
}
// return the ids
@ -458,8 +458,8 @@ function getHistoricalChallengeIDs($clanid, $limit = NULL) {
function getParticipatingClanIDs($clan_challenge_id) {
$array = array();
$sql = 'SELECT clan_id FROM clan_challenge_clans AS ccp WHERE clan_challenge_id = ' . $clan_challenge_id . ' ORDER BY id';
$qry = mysql_query($sql);
while($row = mysql_fetch_row($qry)) {
$qry = db_query($sql);
while($row = mysqli_fetch_row($qry)) {
$array[] = $row[0];
}
// return the ids
@ -468,24 +468,24 @@ function getParticipatingClanIDs($clan_challenge_id) {
function getParticipatingClanData($clan_challenge_id, $clan_id) {
$sql = 'SELECT * FROM clan_challenge_clans AS ccp WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_id;
$qry = mysql_query($sql);
$qry = db_query($sql);
if(!$qry) {
echo $sql .'<br>';
}
return mysql_fetch_assoc($qry);
return mysqli_fetch_assoc($qry);
}
function isCharBusyWithClanfighting($char_id) {
$sql = 'SELECT count(*) as anzahl FROM clan_challenge_participants ccp INNER JOIN clan_challenges cc on ccp.clan_challenge_id = cc.clan_challenge_id WHERE cc.calculated = FALSE AND char_id = ' .$char_id;
$row = mysql_fetch_row(mysql_query($sql));
$row = mysqli_fetch_row(db_query($sql));
return $row[0] > 0;
}
function getParticipatingCharIDs($clan_challenge_id, $clan_id) {
$array = array();
$sql = 'SELECT char_id, slot FROM clan_challenge_participants WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_id;
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)) {
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)) {
$array[$row['slot']] = $row['char_id'];
}
// return the ids
@ -494,7 +494,7 @@ function getParticipatingCharIDs($clan_challenge_id, $clan_id) {
function getParticipatingChar($clan_challenge_id, $clan_id, $char_id) {
$qry = db_query('SELECT * FROM clan_challenge_participants WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_id . ' AND char_id = ' . $char_id);
$row = mysql_fetch_assoc($qry);
$row = mysqli_fetch_assoc($qry);
return $row;
}
@ -504,7 +504,7 @@ function getClanLockedTime($clan_id) {
return 0;
}
$sql = 'SELECT TIMESTAMPDIFF(SECOND, NOW(), locked_until) FROM clan_locked WHERE clanid = ' . $clan_id;
$row = mysql_fetch_row(mysql_query($sql));
$row = mysqli_fetch_row(db_query($sql));
if($row)
return $row[0];
return 0;
@ -518,7 +518,7 @@ function isClanLocked($clanid) {
// we really want to know if we are locked at the moment. So readout everything at once ;), right join so we always have a row :D
$sql = 'SELECT *, locked_until > now() as `lock`, (Select count(id) from user where clan = c2.id) as members FROM clan_locked right join clan c2 on c2.id = clan_locked.clanid where c2.id = ' . $clanid;
// echo $sql.'<br>';
$lock = mysql_fetch_assoc(mysql_query($sql));
$lock = mysqli_fetch_assoc(db_query($sql));
if($lock['lock'] == 0) { // don't matter if it is 0 or NULL
// we do not have data in the clan locked table so we are not locked :D
@ -529,7 +529,7 @@ function isClanLocked($clanid) {
if($lock['members'] >= MIN_MEMBERS) {
if($lock['lock'] === 0) { // If data is available in 'clan_locked' remove it
$sql = 'DELETE FROM clan_locked WHERE clanid = ' .$clanid .' AND locked_until < now()';
mysql_query($sql);
db_query($sql);
}
// key so every thing seems to be fine :)
@ -538,23 +538,23 @@ function isClanLocked($clanid) {
// INSERT
$sql = 'INSERT INTO clan_locked(clanid, locked_until) values('.$clanid.', TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP))';
// echo $sql.'<br>';
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res)
echo $sql . '<br>';
mysql_query('UPDATE clan_challenge_requests SET active = FALSE WHERE (clan_challenged = '.$clanid.' OR clan_requester = '.$clanid);
mysql_query('DELETE FROM clan_challenges WHERE calculated = FALSE AND clan_challenge_id IN (SELECT clan_challenge_id from clan_challenge_clans WHERE clan_id = '.$clanid.')');
db_query('UPDATE clan_challenge_requests SET active = FALSE WHERE (clan_challenged = '.$clanid.' OR clan_requester = '.$clanid);
db_query('DELETE FROM clan_challenges WHERE calculated = FALSE AND clan_challenge_id IN (SELECT clan_challenge_id from clan_challenge_clans WHERE clan_id = '.$clanid.')');
} else if($lock['members'] < MIN_MEMBERS){ // we have to update the actual row
// UPDATE
$sql = 'UPDATE clan_locked set locked_until = TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP) WHERE clanid = ' .$clanid;
// echo $sql.'<br>';
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res)
echo $sql . '<br>';
}
} else if($lock['members'] < MIN_MEMBERS) {
$sql = 'UPDATE clan_locked set locked_until = TIMESTAMPADD(HOUR, 24, CURRENT_TIMESTAMP) WHERE clanid = ' .$clanid;
// echo $sql.'<br>';
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res)
echo $sql . '<br>';
}
@ -598,7 +598,7 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) {
if($forced && ($char['status'] == 'Kampf' || $char['status'] == 'Schatz Suche' || $char['status'] == 'Clanfight')) { // foreign assignment may also possible if the status is in "fetching" state
// okay now check if the fetch-time is reached!!
if($char['status'] == 'Schatz Suche') {
$row = mysql_fetch_row(db_query('SELECT Timestampdiff(Second,now(),dauer) as dauer from quests where charid = '.$charid));
$row = mysqli_fetch_row(db_query('SELECT Timestampdiff(Second,now(),dauer) as dauer from quests where charid = '.$charid));
} else if($char['status'] == 'Clanfight') {
if(isCharBusyWithClanfighting($charid)) {
$row[0] = '???'; // we do not know when the fight is starting!
@ -608,7 +608,7 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) {
$row[0] = getEventStatusBlocked($char_id);
}
} else {
$row = mysql_fetch_row(db_query('SELECT dauer - ' . time() . ' FROM kampf WHERE db_satz='.$charid ));
$row = mysqli_fetch_row(db_query('SELECT dauer - ' . time() . ' FROM kampf WHERE db_satz='.$charid ));
}
if(!is_numeric($row[0]) || $row[0] > 0) {
return 'Du kannst den Char \''.$char['name'].'\' nicht an dem Kampf teilnehmen lassen, da er im Moment noch f&uuml;r ' . $row[0] . ' Sekunden mit ' . $char['status']. ' besch&auml;ftigt ist!';
@ -651,8 +651,8 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) {
}
// okay does this user already has a char in the fight??
$qry = mysql_query('SELECT count(*) as anzahl FROM clan_challenge_participants ccp inner join chars c on ccp.char_id = c.id WHERE besitzer = ' .$user['id'] . ' AND clan_challenge_id = ' . $clan_challenge_id);
$row = mysql_fetch_assoc($qry);
$qry = db_query('SELECT count(*) as anzahl FROM clan_challenge_participants ccp inner join chars c on ccp.char_id = c.id WHERE besitzer = ' .$user['id'] . ' AND clan_challenge_id = ' . $clan_challenge_id);
$row = mysqli_fetch_assoc($qry);
if($row['anzahl'] != 0) {
semaphoreDown($ressource);
@ -677,17 +677,17 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) {
return 'Du kannst den Char nicht zuweisen, da die maximale Anzahl der erlaubten Zuweisungen ('.MAX_LEADER_ASSIGNED_CHARS.') schon erreicht ist!';
}
$sql = 'INSERT INTO clan_challenge_participants(clan_challenge_id, clan_id, char_id, slot, forced) values('.$clan_challenge_id.', '.$user['clan'].', '.$charid.', '.$slot.', ' .($forced?'TRUE':'FALSE') .')';
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res) {
echo $sql .'<br>';
}
if(mysql_affected_rows() == 0) {
if(db_affected_rows() == 0) {
if(!$forced) {
// maybe the leader has already assigned the char and we now give the official okay for that!
mysql_query('UPDATE clan_challenge_participants SET forced = FALSE, slot = '.$slot.' WHERE clan_challenge_id = '.$clan_challenge_id.' AND clan_id = '.$user['clan'].' AND char_id = '.$charid);
db_query('UPDATE clan_challenge_participants SET forced = FALSE, slot = '.$slot.' WHERE clan_challenge_id = '.$clan_challenge_id.' AND clan_id = '.$user['clan'].' AND char_id = '.$charid);
}
if(mysql_affected_rows() == 0) {
if(db_affected_rows() == 0) {
semaphoreDown($ressource);
if($forced) {
semaphoreDown($ressource2);
@ -706,8 +706,8 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) {
'WHERE ccp.clan_challenge_id = cc.clan_challenge_id AND clan_id = '.$clan_ids[1].
') = ' . $clan_challenge['anzahl_chars'];
mysql_query($sql);
$rows = mysql_affected_rows();
db_query($sql);
$rows = db_affected_rows();
semaphoreDown($ressource);
if($forced) {
semaphoreDown($ressource2);
@ -753,9 +753,9 @@ function leaveChallenge($clan_challenge_id, array $user, $charid) {
// Okay, the rest we can check with the delete statement much easier!
// basically the check consists of a) is the challenge not yet calculated b) is char active in the challenge?
$sql = 'DELETE FROM clan_challenge_participants WHERE (SELECT calculated FROM clan_challenges AS cc WHERE cc.clan_challenge_id = clan_challenge_participants.clan_challenge_id) = FALSE AND char_id = ' . $charid;
mysql_query($sql);
db_query($sql);
if(mysql_affected_rows() == 0) {
if(db_affected_rows() == 0) {
return 'Der Char kann nicht aus dem Kampf zurückgezogen werden.';
}
@ -803,7 +803,7 @@ function cancelChallenge($clan_challenge_id, array $user) {
// kay, finish him !!!
$sql = 'DELETE FROM clan_challenges WHERE clan_challenge_id = ' .$clan_challenge_id . ' AND calculated = FALSE';
// echo $sql . '<br>';
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res)
return 'Beim zur&uuml;ckziehen des Clan-Fights ist ein technischer Fehler aufgetreten!';
@ -835,7 +835,7 @@ function calculateChallenge($clan_challenge_id) {
$clan_char_ids = getParticipatingCharIDs($clan_challenge_id, $clan_id);
$sql = 'update clan_challenge_clans ccc inner join clan c on c.id = clan_id SET ccc.elo = c.elo WHERE clan_id IN (' . implode(', ', $clan_ids) .')';
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res)
echo 'Could not execute QUERY : ' .$sql .'<br>';
@ -864,7 +864,7 @@ function calculateChallenge($clan_challenge_id) {
}
$sql = 'UPDATE clan_challenges set event_id = '.$event_id.', enddate = \''.date("Y-m-d H:i:s",$result).'\' WHERE clan_challenge_id = ' .$clan_challenge_id;
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res) {
echo $sql.'<br>';
return 'Konnte Datenbank-Anfrage nicht durchf&uuml;hren ... breche Skript ab!';
@ -895,11 +895,11 @@ function calculateDavyBackClanFight($clan_challenge_id, $event_id, array $clan_i
if($winner['id'] == $char_clan_1['id']){
$sql = 'UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[0];
// echo $sql . '<br>';
mysql_query($sql);
db_query($sql);
} else {
$sql = 'UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[1];
// echo $sql . '<br>';
mysql_query($sql);
db_query($sql);
}
}
return $start_time + ($runde-1) * $duration;
@ -930,12 +930,12 @@ function calculateSurvivalClanFight($clan_challenge_id, $event_id, array $clan_i
// the loser is of clan 1
$char_clan_1 = $clan_char_array[$clan_ids[0]][++$counter_clan_1];
$char_clan_2 = $sieger; // the new array contains the adjusted health parameter
mysql_query('UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[0]);
db_query('UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[0]);
} else {
// the loser is of clan 2
$char_clan_2 = $clan_char_array[$clan_ids[1]][++$counter_clan_2];
$char_clan_1 = $sieger; // the new array contains the adjusted health parameter
mysql_query('UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[1]);
db_query('UPDATE clan_challenge_clans SET points = points + 1 WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_ids[1]);
}
}
@ -1015,20 +1015,20 @@ function updateAuthorizedClanfightCoordinators($clan_id, array $user_ids) {
$sql = 'DELETE FROM `clan_challenge_whitelist` WHERE `user_id` IN (' . implode(',', $remove) .') AND `clan_id` = ' . $clan_id;
// echo $sql . '<br>';
mysql_query($sql);
db_query($sql);
foreach($add as $user_id) {
$sql = 'INSERT INTO `clan_challenge_whitelist`(`user_id`, `clan_id`) values('.$user_id.', '.$clan_id.')';
// echo $sql . '<br>';
mysql_query($sql);
db_query($sql);
}
}
function getAuthorizedClanfightCoordinatorIDs($clan_id) {
$sql = 'SELECT user_id as id FROM `clan_challenge_whitelist` WHERE `clan_id` = '.$clan_id;
$qry = mysql_query($sql);
$qry = db_query($sql);
$return = array();
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
$return[] = $row['id'];
}
return $return;
@ -1046,7 +1046,7 @@ function isAuthorizedClanfightCoordinator($clan_id, $user_id, $clan_fight_id = N
if($clan_fight_id !== NULL) {
$sql = 'SELECT COUNT(*) FROM `clan_challenge_clans` WHERE `clan_coordinator` = ' .$user_id. ' AND `clan_id` = '.$clan_id . ' AND `clan_challenge_id` = ' .$clan_fight_id;
// echo $sql . '<br>';
$row = mysql_fetch_row(mysql_query($sql));
$row = mysqli_fetch_row(db_query($sql));
if($row[0] <= 0) {
// okay, maybe its a leader ;)
$clan = getClan($clan_id);
@ -1063,7 +1063,7 @@ function isAuthorizedClanfightCoordinator($clan_id, $user_id, $clan_fight_id = N
} else {
// it is a more general thing ;)
$sql = 'SELECT COUNT(*) FROM `clan_challenge_whitelist` WHERE `user_id` = ' .$user_id. ' AND `clan_id` = '.$clan_id;
$row = mysql_fetch_row(mysql_query($sql));
$row = mysqli_fetch_row(db_query($sql));
if($row[0] <= 0) {
// okay, maybe its a leader ;)
$clan = getClan($clan_id);
@ -1103,7 +1103,7 @@ function calculateClanExperience(array $clan1, array $clan2, $winner) {
*/
function getCountLeaderAssignedChars($clan_id, $clan_fight_id) {
$qry = db_query('SELECT COUNT(*) FROM `clan_challenge_participants` WHERE `clan_challenge_id` = ' .$clan_fight_id . ' AND `clan_id` = '.$clan_id .' AND `forced` = TRUE');
$row = mysql_fetch_row($qry);
$row = mysqli_fetch_row($qry);
return $row[0];
}

@ -34,9 +34,9 @@ include_once (ROOT_PATH . '/include/usergroup.inc.php');
// }
//}
//
//mysql_query('Update referer set anzahl = anzahl + 1 where url = \''.$referer.'\' and datum = CURRENT_DATE');
//if(mysql_affected_rows() == 0){
// mysql_query('Insert into referer(url, anzahl, datum) values(\''.$referer.'\', 1, CURRENT_DATE)');
//db_query('Update referer set anzahl = anzahl + 1 where url = \''.$referer.'\' and datum = CURRENT_DATE');
//if(db_affected_rows() == 0){
// db_query('Insert into referer(url, anzahl, datum) values(\''.$referer.'\', 1, CURRENT_DATE)');
//}
$name = validateName($_COOKIE['name']);
@ -51,14 +51,14 @@ if(!checkCookiePassword($name, $passwort)){
$POLOE = 1;
$user_ida = array();
} else {
$user_ida = mysql_fetch_assoc(mysql_query("SELECT * FROM user WHERE nickname='$name' LIMIT 1"));
mysql_query('UPDATE user SET ip=\'' . $_SERVER['REMOTE_ADDR'] . '\', online_zeit=now() WHERE id='.$user_ida['id']);
$user_ida = mysqli_fetch_assoc(db_query("SELECT * FROM user WHERE nickname='$name' LIMIT 1"));
db_query('UPDATE user SET ip=\'' . $_SERVER['REMOTE_ADDR'] . '\', online_zeit=now() WHERE id='.$user_ida['id']);
if ($online_rekord_1_0['anzahl'] < $online_r) {
mysql_query('UPDATE online SET anzahl='.$online_r.', datum=now() WHERE id=1');
db_query('UPDATE online SET anzahl='.$online_r.', datum=now() WHERE id=1');
}
}
$banned_accs = mysql_num_rows(mysql_query("SELECT id FROM user WHERE ip!='' AND ip='$user_ida[ip]' AND id!='$user_ida[id]' LIMIT 2"));
$banned_accs = mysqli_stmt_num_rows(db_query("SELECT id FROM user WHERE ip!='' AND ip='$user_ida[ip]' AND id!='$user_ida[id]' LIMIT 2"));
if ($user_ida['id'] != null) {
$as = 'profil';

@ -15,8 +15,8 @@ $GLOBALS['definesEditable'] = array();
function initializeDefines() {
$sql = 'SELECT * from defines';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)) {
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)) {
if(!defined($row['key'])) {
define($row['key'], $row['value']);
$GLOBALS['definesEditable'][$row['key']] = $row['editable'];
@ -34,13 +34,13 @@ function defineIfNotDefined($key, $value, $editable = TRUE) {
if(!defined($key)) {
// we seem that we need to insert this key - value pair!
$sql = 'INSERT INTO defines(`key`, `value`, `editable`) values(\''.$key.'\', \''.$value.'\', \''.$editable.'\')';
mysql_query($sql);
db_query($sql);
define($key, $value);
} else if($GLOBALS['definesEditable'][$key] != $editable){
// if the editableness of this value has been changed, adjust the database ;)
$sql = 'UPDATE defines SET editable = ' . ($editable?'1':'0') . ' WHERE `key` = \'' .$key.'\'';
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
}
}
@ -66,7 +66,7 @@ function getDefines($prefix = NULL) {
}
$result = array();
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
$result[] = $row;
}
@ -80,7 +80,7 @@ function setDefine($key, $value) {
// set where editable true
$sql = 'UPDATE defines SET `value` = \''.$value.'\' WHERE `key` = \''.$key.'\' AND editable = TRUE';
$qry = db_query($sql);
if(!$qry || mysql_affected_rows() == 0) {
if(!$qry || db_affected_rows() == 0) {
return 'Konnte den define ' . $key . ' nicht auf ' . $value . ' setzen';
}
return NULL;

@ -43,7 +43,7 @@ function generateUserNameByID($userid, $showClanTags = TRUE){
$groups = getUserGroups($userid);
$sql = 'select nickname, user.id as userid, clan.clanz_pre, clan.clanz_suff from user left join clan on user.clan = clan.id where user.id = '.$userid;
$user_info = mysql_fetch_assoc(mysql_query($sql));
$user_info = mysqli_fetch_assoc(db_query($sql));
if(isUserInGroup($groups, WERBUNG_AN)){
if(isUserInGroup($groups, ADMIN)){
$color = 'style="color:'.GROUP_COLOR_GAMEMASTER.'"';
@ -98,12 +98,12 @@ function generateAttackNameByID($attackid, $withColor = TRUE) {
}
$sql = 'SELECT * from attacken WHERE id = ' .$attackid;
$qry = mysql_query($sql);
$row = mysql_fetch_assoc($qry);
$qry = db_query($sql);
$row = mysqli_fetch_assoc($qry);
$qry = db_query('SELECT farbe FROM `attackentyp` where name = \'' . $row['type'].'\'');
$row_color = mysql_fetch_row($qry);
$row_color = mysqli_fetch_row($qry);
$color = 'style="color:'.$row_color[0].'"';
if($withColor) {
@ -115,8 +115,8 @@ function generateAttackNameByID($attackid, $withColor = TRUE) {
function displayClanLink($clanid, $clanname = NULL){
if($clanname === NULL) {
$qry = mysql_query('SELECT clanname FROM clan WHERE id = ' . $clanid);
$row = mysql_fetch_assoc($qry);
$qry = db_query('SELECT clanname FROM clan WHERE id = ' . $clanid);
$row = mysqli_fetch_assoc($qry);
$clanname = $row['clanname'];
}
return '<a href="index.php?as=clan/clan_info&clan_id='.$clanid.'">'.$clanname.'</a>';
@ -137,7 +137,7 @@ function generateCharLinkByID($charid, $showAvatar = FALSE, $showClanTags = FALS
$suffix = null;
if($showClanTags) {
$qry = db_query('select clan.clanz_pre, clan.clanz_suff from user left join clan on user.clan = clan.id where user.id = '.$userid);
$row = mysql_fetch_assoc($qry);
$row = mysqli_fetch_assoc($qry);
$clan_pre = $row['clanz_pre'];
$clan_su = $row['clanz_suff'];
}

@ -15,8 +15,8 @@ function getSpendebarometer($databasename){
// 7-12 Monate = Gruen
// ++ = Violett
$qry = mysql_query('select sum(betrag)+sum(malus) as saldo from '.$databasename.'.umsatz');
$row = mysql_fetch_assoc($qry);
$qry = db_query('select sum(betrag)+sum(malus) as saldo from '.$databasename.'.umsatz');
$row = mysqli_fetch_assoc($qry);
$monate = $row['saldo'] / $kosten;
$color = 'violet';
@ -43,8 +43,8 @@ function getSpendebarometer($databasename){
function getSpenden($databasename){
$spendeline = '<table width="100%">';
$qry = mysql_query('Select * from '.$databasename.'.umsatz where kommentar like \'%Spende%\' order by datum desc');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('Select * from '.$databasename.'.umsatz where kommentar like \'%Spende%\' order by datum desc');
while($row = mysqli_fetch_assoc($qry)){
$spendeline .= '<tr><th class="content">'. $row['instanz'] . '</th><td class="content" width="50%">'.$row['kommentar'].'</td><td class="content">'.$row['betrag'].' '.$row['waehrung'].'</td><td class="content">'.$row['datum'].'</td></tr>';
}
$spendeline .= '</table>';

@ -109,7 +109,7 @@ function erstelleChar($user, $rassen_id, $newname = '', $picture = '', $lvl = 1,
//echo $sql.'<br>';
$identifier = db_query($sql);
if($identifier == FALSE){
if(mysql_fetch_assoc(mysql_query('Select id from chars where name = \''.$newname.'\''))){
if(mysqli_fetch_assoc(db_query('Select id from chars where name = \''.$newname.'\''))){
displayErrorMessage(NULL,'Name schon vorhanden!!',displayHistoryBackLink());
} else{
displayErrorMessage(NULL,'Erstellen fehlgeschlagen!!',displayHistoryBackLink());
@ -118,11 +118,11 @@ function erstelleChar($user, $rassen_id, $newname = '', $picture = '', $lvl = 1,
}
if($race['name'] != 'NPC') {
$charsw_id = mysql_fetch_assoc(mysql_query('SELECT id FROM chars WHERE name=\''.$newname.'\''));
$charsw_id = mysqli_fetch_assoc(db_query('SELECT id FROM chars WHERE name=\''.$newname.'\''));
mysql_query('INSERT lernen SET at_id=1, aktiv=1, besitzer='.$charsw_id['id'].', name=\'Schlag\', dauer=0');
mysql_query('INSERT lernen SET at_id=2, aktiv=1, besitzer='.$charsw_id['id'].', name=\'Kick\', dauer=0');
mysql_query('INSERT lernen SET at_id=3, aktiv=1, besitzer='.$charsw_id['id'].', name=\'Block\', dauer=0');
db_query('INSERT lernen SET at_id=1, aktiv=1, besitzer='.$charsw_id['id'].', name=\'Schlag\', dauer=0');
db_query('INSERT lernen SET at_id=2, aktiv=1, besitzer='.$charsw_id['id'].', name=\'Kick\', dauer=0');
db_query('INSERT lernen SET at_id=3, aktiv=1, besitzer='.$charsw_id['id'].', name=\'Block\', dauer=0');
}
return true; // Hat geklappt
}

@ -37,9 +37,9 @@ defineIfNotDefined('KEY_ITM_CHAR1', 'ITM_CHAR1');
function createEvent($type) {
while(!$finished) {
$sql = 'SELECT IFNULL(max(event_id),0) + 1 FROM events';
$row = mysql_fetch_row(mysql_query($sql));
mysql_query('INSERT INTO events(event_id, event_type) values('.$row[0].', \''.$type.'\')');
$finished = mysql_affected_rows() > 0;
$row = mysqli_fetch_row(db_query($sql));
db_query('INSERT INTO events(event_id, event_type) values('.$row[0].', \''.$type.'\')');
$finished = db_affected_rows() > 0;
$id = $row[0];
}
@ -62,8 +62,8 @@ function addParticipant($event_id, array $char) {
// echo $sql . '<br>';
mysql_query($sql);
if(mysql_affected_rows() == 0)
db_query($sql);
if(db_affected_rows() == 0)
return NULL;
return $char['id'];
}
@ -90,13 +90,13 @@ function persistFight($event_id, array $combinedArray, $startTimestamp, $endTime
$finished = FALSE;
while(!$finished) {
$sql = 'SELECT IFNULL(max(event_fight_id),0) + 1 FROM event_fights WHERE event_id = ' .$event_id;
$row = mysql_fetch_row(mysql_query($sql));
$row = mysqli_fetch_row(db_query($sql));
$sql = 'INSERT INTO event_fights(event_id, event_fight_id, host, winner, `starting`, visible) values('.$event_id.', \''.$row[0].'\', '. $hostId . ', ' . $winnerId .', \''.date("Y-m-d H:i:s",$startTimestamp).'\', \''.date("Y-m-d H:i:s",$endTimestamp).'\')';
if(mysql_query($sql) === FALSE) {
if(db_query($sql) === FALSE) {
echo $sql . '<br>';
break;
}
$finished = mysql_affected_rows() > 0;
$finished = db_affected_rows() > 0;
$event_fight_id = $row[0];
}
@ -114,7 +114,7 @@ function persistFight($event_id, array $combinedArray, $startTimestamp, $endTime
$sql .= ' values('.$event_id.','.$event_fight_id.','.$round.',' .$chara_1['id'].',\''. $chara_1['hp'].'\', \''. $chara_1['mp'].'\', '. $chara_1['starke'].', '. $chara_1['speed'].', '. $chara_1['verteidigung'].', '. $chara_1['glueck'].', '. $chara_1['ausdauer'].', '. ($roundsArray[$round]['atk_char1']===NULL?'NULL': '\''.$roundsArray[$round]['atk_char1'].'\'' ).', '. ($roundsArray[$round]['dmg_char1']===NULL?'NULL': '\''.$roundsArray[$round]['dmg_char1'].'\'' ).', \''.date("Y-m-d H:i:s",$endTimestamp).'\')';
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res)
echo $sql .'<br>';
// now persist char2
@ -123,7 +123,7 @@ function persistFight($event_id, array $combinedArray, $startTimestamp, $endTime
$sql = 'INSERT INTO event_fight_rounds(event_id, event_fight_id, round, event_char_id, hp, mp, strength, speed, defense, luck, stamina, attack, damage, visible)';
$sql .= ' values('.$event_id.','.$event_fight_id.','.$round.',' .$chara_2['id'].',\''. $chara_2['hp'].'\', \''. $chara_2['mp'].'\', '. $chara_2['starke'].', '. $chara_2['speed'].', '. $chara_2['verteidigung'].', '. $chara_2['glueck'].', '. $chara_2['ausdauer'].', '. ($roundsArray[$round]['atk_char2']===NULL?'NULL': '\''.$roundsArray[$round]['atk_char2'].'\'' ).', '. ($roundsArray[$round]['dmg_char2']===NULL?'NULL': '\''.$roundsArray[$round]['dmg_char2'].'\'' ).', \''.date("Y-m-d H:i:s",$endTimestamp).'\')';
$res = mysql_query($sql);
$res = db_query($sql);
if(!$res)
echo $sql .'<br>';
}
@ -132,10 +132,10 @@ function persistFight($event_id, array $combinedArray, $startTimestamp, $endTime
foreach ($data as $key => $value) {
$sql = 'INSERT INTO event_fight_metadata(event_id, event_fight_id, `key`, `value`) values('.$event_id.','.$event_fight_id.',\''.$key.'\',\''.$value.'\')';
// echo $sql . ' <br>';
mysql_query($sql);
db_query($sql);
}
mysql_query('UPDATE event_chars SET block_begin = \''.date("Y-m-d H:i:s",$startTimestamp).'\', block_end = \''.date("Y-m-d H:i:s",$endTimestamp).'\' WHERE event_id = ' . $event_id);
db_query('UPDATE event_chars SET block_begin = \''.date("Y-m-d H:i:s",$startTimestamp).'\', block_end = \''.date("Y-m-d H:i:s",$endTimestamp).'\' WHERE event_id = ' . $event_id);
}
@ -143,8 +143,8 @@ function persistFight($event_id, array $combinedArray, $startTimestamp, $endTime
function getEventStatus($charid) {
$sql = 'SELECT event_type FROM event_chars ec inner join events e on ec.event_id = e.event_id where (block_end > now() or abgeholt = FALSE) and char_id = ' . $charid;
// echo $sql . '<br>';
$qry = mysql_query($sql);
$row = mysql_fetch_assoc($qry);
$qry = db_query($sql);
$row = mysqli_fetch_assoc($qry);
switch ($row['event_type']) {
case EVENT_TEST:
return 'Test';
@ -166,7 +166,7 @@ function getEventStatus($charid) {
function getOngoingEventCount($charid) {
$sql = 'SELECT count(*) FROM event_chars e WHERE abgeholt = FALSE AND char_id = ' .$charid;
$row = mysql_fetch_row(mysql_query($sql));
$row = mysqli_fetch_row(db_query($sql));
return $row[0];
}
@ -174,24 +174,24 @@ function getOngoingEventCount($charid) {
function getEventStatusBlocked($charid) {
$sql = 'SELECT Timestampdiff(Second,now(),MAX(block_end)) FROM event_chars WHERE abgeholt = FALSE AND char_id = ' . $charid;
// echo $sql . '<br>';
$row = mysql_fetch_row(mysql_query($sql));
$row = mysqli_fetch_row(db_query($sql));
return $row[0];
}
function isEventToFetchAwaiting($charid) {
$sql = 'SELECT count(*) FROM event_chars e WHERE abgeholt = FALSE AND char_id = ' .$charid;
$row = mysql_fetch_row(mysql_query($sql));
$row = mysqli_fetch_row(db_query($sql));
return $row[0] > 0;
}
function getEventIdsToFetch($char_id) {
$sql = 'SELECT event_id FROM event_chars e WHERE block_end < now() and abgeholt = FALSE AND char_id = ' .$char_id . ' ORDER BY event_id ASC';
$qry = mysql_query($sql);
$qry = db_query($sql);
if(!$qry)
echo $sql . '<br>';
$result = array();
while ($row = mysql_fetch_row($qry)) {
while ($row = mysqli_fetch_row($qry)) {
$result[] = $row[0];
}
return $result;
@ -255,19 +255,19 @@ function abholenChar(array $user, $event_id, $char_id) {
// Okay and now we want to learn the attacks :)
$sql = 'SELECT attack, count(attack) as anzahl FROM event_fight_rounds e where event_id = ' . $event_id . ' AND event_char_id = ' . $char_id . ' group by attack';
$qry = mysql_query($sql);
$qry = db_query($sql);
if(!$qry)
echo $sql .'<br>';
$attacken_usage = array();
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
$attacken_usage[] = array('id' => $row['attack'], 'anzahl' => $row['anzahl']);
}
addAttackUsageToChar($char_id, $attacken_usage);
$sql = 'UPDATE event_chars SET abgeholt = TRUE WHERE char_id = ' . $char_id . ' AND event_id = ' . $event_id;
$qry = mysql_query($sql);
$qry = db_query($sql);
if(!$qry)
echo $sql .'<br>';
@ -277,14 +277,14 @@ function abholenChar(array $user, $event_id, $char_id) {
function getEvent($event_id) {
$result = mysql_fetch_assoc(mysql_query('SELECT * FROM events WHERE event_id = ' . $event_id));
$result = mysqli_fetch_assoc(db_query('SELECT * FROM events WHERE event_id = ' . $event_id));
if($result)
return $result;
return NULL;
}
function getEventChar($event_id, $event_char_id) {
$result = mysql_fetch_assoc(mysql_query('SELECT * FROM event_chars WHERE event_id = ' . $event_id . ' AND event_char_id = ' . $event_char_id));
$result = mysqli_fetch_assoc(db_query('SELECT * FROM event_chars WHERE event_id = ' . $event_id . ' AND event_char_id = ' . $event_char_id));
if($result)
return $result;
return NULL;
@ -292,24 +292,24 @@ function getEventChar($event_id, $event_char_id) {
}
function getEventFight($event_id, $event_fight_id) {
$result = mysql_fetch_assoc(mysql_query('SELECT * FROM event_fights WHERE event_id = ' . $event_id. ' AND event_fight_id = ' .$event_fight_id ));
$result = mysqli_fetch_assoc(db_query('SELECT * FROM event_fights WHERE event_id = ' . $event_id. ' AND event_fight_id = ' .$event_fight_id ));
if($result)
return $result;
return NULL;
}
function getEventFightMetaData($event_id, $event_fight_id) {
$qry = mysql_query('SELECT * FROM event_fight_metadata WHERE event_id = ' . $event_id. ' AND event_fight_id = ' .$event_fight_id);
while($row = mysql_fetch_assoc($qry)) {
$qry = db_query('SELECT * FROM event_fight_metadata WHERE event_id = ' . $event_id. ' AND event_fight_id = ' .$event_fight_id);
while($row = mysqli_fetch_assoc($qry)) {
$result[$row['key']]= $row['value'];
}
return $result;
}
function getEventFightIds($event_id) {
$qry = mysql_query('SELECT event_fight_id FROM event_fights WHERE event_id = ' . $event_id . ' ORDER by event_fight_id ASC');
$qry = db_query('SELECT event_fight_id FROM event_fights WHERE event_id = ' . $event_id . ' ORDER by event_fight_id ASC');
$result = array();
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
$result[]= $row['event_fight_id'];
}
return $result;
@ -318,10 +318,10 @@ function getEventFightIds($event_id) {
// this is more tricky XD
function getEventFightIdsByChar($event_id, $event_char_id) {
$sql = 'SELECT event_fight_id FROM event_fight_rounds where event_id = ' . $event_id . ' AND event_char_id = ' . $event_char_id . ' AND `round` = 0 ORDER BY event_fight_id ASC';
$qry = mysql_query($sql);
$qry = db_query($sql);
if(!$qry)
echo $sql . '<br>';
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
$result[]= $row['event_fight_id'];
}
return $result;
@ -330,12 +330,12 @@ function getEventFightIdsByChar($event_id, $event_char_id) {
function getEventFightRoundData($event_id, $event_fight_id, $round) {
$sql = 'SELECT * FROM event_fight_rounds WHERE event_id = ' . $event_id . ' AND event_fight_id = ' . $event_fight_id . ' AND `round` = ' .$round;
$qry = mysql_query($sql);
$qry = db_query($sql);
if(!$qry) {
echo $sql . '<br>';
return;
}
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
$result[$row['event_char_id']] = $row;
}
return $result;

@ -67,15 +67,15 @@ function addAttackUsageToChar($char_id, $attacken){
$sql = 'Update lernen set benutzt = benutzt + '.$attacken[$i]['anzahl'].' where at_id = \''.$attacken[$i]['id'].'\' and besitzer = '.$char_id;
}
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
}
// Sooo und nun gehts darum ob wir neue Attacken lernen können
// Ersma die ganzen Infos laden
$sql = 'SELECT * FROM lernen where besitzer = '.$char_id;
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)){
$lern[$row['at_id']] = $row; // Zum späteren Check ob die Reqs erfüllt sind
$atkid[] = $row['at_id']; // Zum ausschliessen der Attacken
}
@ -94,7 +94,7 @@ function addAttackUsageToChar($char_id, $attacken){
// echo $sql.'<br>';
$qry = mysql_query($sql);
$qry = db_query($sql);
// Das geht leider nicht mit dieser Datenstruktur direkt auszuwählen
$raceid[] = getCharRaceId($char_id);
@ -103,7 +103,7 @@ function addAttackUsageToChar($char_id, $attacken){
}
// So und nun arbeite jede Attacke durch die nur im geringsten Lernbar sein könnte ...
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
// Erstmal checken ob es eine Fruchtattacke ist (durch die SQL-Anweisung werden alle nicht zutreffenden Früchte ausgeblockt)
$learnable = false;
if(!is_null($row['Frucht'])){
@ -138,7 +138,7 @@ function addAttackUsageToChar($char_id, $attacken){
}
if($learnable){
mysql_query('INSERT lernen SET name=\''.$row['name'].'\', at_id=\''.$row['id'].'\', besitzer=\''.$char_id.'\', aktiv=\'1\'');
db_query('INSERT lernen SET name=\''.$row['name'].'\', at_id=\''.$row['id'].'\', besitzer=\''.$char_id.'\', aktiv=\'1\'');
echo '<script language="JavaScript">alert(\''.$char['name'].' hat die Technik '.$row['name'].' gelernt!\');</script>';
}
}
@ -169,12 +169,12 @@ function addExpToChar($char_id, $n_exp){
$sql = 'Update chars set exp = \''.$char_exp[0].','.$char_exp[1].'\' where id = '.$char_id;
}
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
$char = getChar($char_id, false); // We really want the actual char!!
if($char['level'] > 25) {
// remove this char out of the registration of the beginners tournament
mysql_query('Delete from turnier1 where art = \'klein\' and charakter = \''.$char_id.'\'');
db_query('Delete from turnier1 where art = \'klein\' and charakter = \''.$char_id.'\'');
}
}
@ -193,9 +193,9 @@ function addExpToArena($user_id, $n_exp){
}
if($lvls > 0){
echo '<script language="JavaScript">alert(\'Arena ist um '.$lvls.' Level gestiegen!\');</script>';
mysql_query('Update arena set exp=\''.$arena_exp[0].','.$arena_exp[1].'\', level='.$arena['level'].', skill=skill+'.$lvls.' WHERE besitzer='.$user_id);
db_query('Update arena set exp=\''.$arena_exp[0].','.$arena_exp[1].'\', level='.$arena['level'].', skill=skill+'.$lvls.' WHERE besitzer='.$user_id);
} else{
mysql_query('Update arena set exp=\''.$arena_exp[0].','.$arena_exp[1].'\' WHERE besitzer='.$user_id);
db_query('Update arena set exp=\''.$arena_exp[0].','.$arena_exp[1].'\' WHERE besitzer='.$user_id);
}
}

@ -18,15 +18,15 @@ include_once(ROOT_PATH.'/include/config/db.inc.php');
include_once(ROOT_PATH.'/include/parse.inc.php');
function insertFaqEntry($parent, $header, $body){
mysql_query('INSERT INTO `faq_entries` ( `id` , `parent` , `header` , `body` ) VALUES (NULL , \''.$parent.'\', \''.encodeNoHTMLWithBB($header).'\', \''.encodeNoHTMLWithBB($body).'\')');
db_query('INSERT INTO `faq_entries` ( `id` , `parent` , `header` , `body` ) VALUES (NULL , \''.$parent.'\', \''.encodeNoHTMLWithBB($header).'\', \''.encodeNoHTMLWithBB($body).'\')');
}
function getAllFaqEntries(){
$sql = 'Select * from faq_entries order by parent';
$qry = mysql_query($sql);
$qry = db_query($sql);
$returnArray = array();
$tempArray[0] = & $returnArray;
while($result = mysql_fetch_assoc($qry)){
while($result = mysqli_fetch_assoc($qry)){
$tempArray[$result['parent']][$result['id']]['node'] = $result;
$tempArray[$result['id']] = & $tempArray[$result['parent']][$result['id']];
}
@ -84,60 +84,60 @@ function getContext($pre1, $pre2, $app1, $app2){
function getEntry($faqentry){
$sql = 'Select * from faq_entries WHERE id = '.$faqentry;
$qry = mysql_query($sql);
return mysql_fetch_assoc($qry);
$qry = db_query($sql);
return mysqli_fetch_assoc($qry);
}
function updateEntry($faqentry, $parent,$header,$body){
$parentpart = $parent!=null?'parent = '.$parent.',':'';
$sql = 'UPDATE faq_entries SET '.$parentpart.' header = \''.encodeNoHTMLWithBB($header).'\', body = \''.encodeNoHTMLWithBB($body).'\' WHERE id = '.$faqentry;
mysql_query($sql);
db_query($sql);
}
function moveUp($faqentry){
$entry = getEntry($faqentry);
$sql = 'Select * from faq_entries WHERE parent = '.$entry['parent'].' AND id < '.$entry['id'].' order by id desc LIMIT 1';
$qry = mysql_query($sql);
$entry2 = mysql_fetch_assoc($qry);
$qry = db_query($sql);
$entry2 = mysqli_fetch_assoc($qry);
if(!$entry2){ // Er ist schon der höchste
return;
}
$sql2 = 'Select * from faq_entries WHERE parent = '.$faqentry;
$qry2 = mysql_query($sql2);
while($row = mysql_fetch_assoc($qry2)){
$qry2 = db_query($sql2);
while($row = mysqli_fetch_assoc($qry2)){
$ids[] = $row['id'];
}
mysql_query('UPDATE faq_entries SET header = \''.$entry2['header'].'\', body = \''.$entry2['body'].'\' where id = '.$entry['id']);
mysql_query('UPDATE faq_entries SET header = \''.$entry['header'].'\', body = \''.$entry['body'].'\' where id = '.$entry2['id']);
db_query('UPDATE faq_entries SET header = \''.$entry2['header'].'\', body = \''.$entry2['body'].'\' where id = '.$entry['id']);
db_query('UPDATE faq_entries SET header = \''.$entry['header'].'\', body = \''.$entry['body'].'\' where id = '.$entry2['id']);
mysql_query('Update faq_entries SET parent = '.$entry['id'].' where parent = '.$entry2['id']);
mysql_query('Update faq_entries SET parent = '.$entry2['id'].' where id IN ('.join($ids, ',').')');
db_query('Update faq_entries SET parent = '.$entry['id'].' where parent = '.$entry2['id']);
db_query('Update faq_entries SET parent = '.$entry2['id'].' where id IN ('.join($ids, ',').')');
}
function moveDown($faqentry){
$entry = getEntry($faqentry);
$sql = 'Select * from faq_entries WHERE parent = '.$entry['parent'].' AND id > '.$entry['id'].' order by id asc LIMIT 1';
$qry = mysql_query($sql);
$entry2 = mysql_fetch_assoc($qry);
$qry = db_query($sql);
$entry2 = mysqli_fetch_assoc($qry);
if(!$entry2){ // Er ist schon der höchste
return;
}
$sql2 = 'Select * from faq_entries WHERE parent = '.$faqentry;
$qry2 = mysql_query($sql2);
while($row = mysql_fetch_assoc($qry2)){
$qry2 = db_query($sql2);
while($row = mysqli_fetch_assoc($qry2)){
$ids[] = $row['id'];
}
mysql_query('UPDATE faq_entries SET header = \''.$entry2['header'].'\', body = \''.$entry2['body'].'\' where id = '.$entry['id']);
mysql_query('UPDATE faq_entries SET header = \''.$entry['header'].'\', body = \''.$entry['body'].'\' where id = '.$entry2['id']);
db_query('UPDATE faq_entries SET header = \''.$entry2['header'].'\', body = \''.$entry2['body'].'\' where id = '.$entry['id']);
db_query('UPDATE faq_entries SET header = \''.$entry['header'].'\', body = \''.$entry['body'].'\' where id = '.$entry2['id']);
mysql_query('Update faq_entries SET parent = '.$entry['id'].' where parent = '.$entry2['id']);
mysql_query('Update faq_entries SET parent = '.$entry2['id'].' where id IN ('.join($ids, ',').')');
db_query('Update faq_entries SET parent = '.$entry['id'].' where parent = '.$entry2['id']);
db_query('Update faq_entries SET parent = '.$entry2['id'].' where id IN ('.join($ids, ',').')');
}
function getChildren($faqentry){
$sql = 'Select * from faq_entries where parent = '.$faqentry.' order by id asc';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)){
$ret[] = $row;
}
return $ret;

@ -16,9 +16,9 @@ include_once(ROOT_PATH.'/include/char.inc.php');
* @return boolean if the insert was successful
*/
function insertIntoHallOfFame($title, $charid, $userid){
$row = mysql_fetch_assoc(mysql_query('Select max(id) as round from online'));
$row = mysqli_fetch_assoc(db_query('Select max(id) as round from online'));
$char = getChar($charid);
$user = mysql_fetch_assoc(mysql_query('Select * from user where id = '.$userid));
$user = mysqli_fetch_assoc(db_query('Select * from user where id = '.$userid));
if(!$row || is_null($char) || is_null($user)){
return false;
@ -57,12 +57,12 @@ function insertIntoHallOfFameFull($round = '', $title = '', $charid = '', $charn
}
$sql = 'INSERT INTO highscore('.$columns.') values('.$values.')';
// echo $sql.'<br>';
$qry = mysql_query($sql);
return mysql_affected_rows() > 0;
$qry = db_query($sql);
return db_affected_rows() > 0;
}
function getHallOfFameEntryCount($title, $userid) {
$row = mysql_fetch_assoc(mysql_query('Select max(id) as round from online'));
$row = mysqli_fetch_assoc(db_query('Select max(id) as round from online'));
return getHallOfFameEntryCountFull($row['round'],$title, $userid);
}
@ -72,7 +72,7 @@ function getHallOfFameEntryCountFull($round = '', $title = '', $userid = '') {
}
$sql = 'SELECT COUNT(*) FROM highscore WHERE art=\''.$title.'\' AND runde='.$round.' AND userid='.$userid;
// echo $sql .'<br>';
$row = mysql_fetch_row(mysql_query($sql));
$row = mysqli_fetch_row(db_query($sql));
return $row[0];
}

@ -17,23 +17,23 @@ function hasToAuthenticate($user){
}
function hasNotDoneAction($user, $count = 1){
mysql_query('Update user set code = code + '.$count.' WHERE id = '.$user['id']);
db_query('Update user set code = code + '.$count.' WHERE id = '.$user['id']);
}
function hasDoneAction($user, $count = 1){
mysql_query('Update user set code = code - '.$count.' WHERE id = '.$user['id']);
db_query('Update user set code = code - '.$count.' WHERE id = '.$user['id']);
}
function resetUserCounter($user){
$char_count = count(getCharsOfUser($user['id']));
// pro Char werden dem User 6-8 Aktionen zugestanden
mysql_query('Update user set code = '.($char_count*mt_random_wrapper(6,8)).' where id = '.$user['id']);
db_query('Update user set code = '.($char_count*mt_random_wrapper(6,8)).' where id = '.$user['id']);
}
function checkImageCode($id, $compr_phrase, $user){
$sql = 'SELECT *, TIMESTAMPDIFF(MINUTE, created, now()) as delay from bot_images WHERE id = \'' . $id . '\'';
// echo $sql.'<br>';
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
// ID not valid
if($row){
// TIMEOUT!
@ -41,12 +41,12 @@ function checkImageCode($id, $compr_phrase, $user){
if($row['delay'] > 5 || strtolower($row['compressed_phrase']) != strtolower($compr_phrase)){
$sql = 'Insert into bot_image_failures(userid, inserted, valid, used) values('.$user['id'].', \''.$compr_phrase.'\', \''.$row['compressed_phrase'].'\', CURRENT_TIMESTAMP)';
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
$success = false;
} else{
$success = true;
}
mysql_query('DELETE from bot_images WHERE id = \'' . $id . '\'');
db_query('DELETE from bot_images WHERE id = \'' . $id . '\'');
} else{
$success = false;
}
@ -65,8 +65,8 @@ function createImage($id, $user) {
for (; $i < 6; $i++) {
$string .= ' ';
}
mysql_query('DELETE from bot_images WHERE id = \'' . $id . '\'');
mysql_query('INSERT INTO bot_images(id, phrase, compressed_phrase, created, userid) values(\'' . $id . '\', \'' . $string . '\', \'' . $comp_str . '\', now(), '.$user['id'].')');
db_query('DELETE from bot_images WHERE id = \'' . $id . '\'');
db_query('INSERT INTO bot_images(id, phrase, compressed_phrase, created, userid) values(\'' . $id . '\', \'' . $string . '\', \'' . $comp_str . '\', now(), '.$user['id'].')');
// Aufräumen (Code wurde ignoriert)
detectNonCodeEnterers();
@ -81,7 +81,7 @@ function displayImage($id, $user) {
createImage($id,$user);
$sql = 'SELECT * FROM bot_images WHERE id = \'' . $id . '\'';
// echo $sql.'<br>';
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if($row){
$string = $row['phrase'];
$variance = true;

@ -40,9 +40,9 @@ if($k_attacke1_2[$x]) {
}
if($new_tech1 == 1) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1_2[$x]' LIMIT 10"));
$technick1 = mysqli_fetch_array(db_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1_2[$x]' LIMIT 10"));
$prozent_technik1 = (20*$technick1['aktiv'])-20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick1 = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
}
}
@ -80,9 +80,9 @@ if($k_attacke2_2[$x]) {
}
if($new_tech2 == 1) {
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2_2[$x]' LIMIT 10"));
$technick2 = mysqli_fetch_array(db_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2_2[$x]' LIMIT 10"));
$prozent_technik2 = (20*$technick2['aktiv'])-20;
$technick2 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick2[at_id]' LIMIT 10"));
$technick2 = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$technick2[at_id]' LIMIT 10"));
}
}

@ -29,7 +29,7 @@ class Kaempfer{
*/
function __construct($char, $alternative = true, $buffs = true){
if(is_numeric($char)){ // ID, wenn keine Abfrage vorhanden
$char = mysql_fetch_assoc(mysql_query('SELECT * FROM chars WHERE id='.$char));
$char = mysqli_fetch_assoc(db_query('SELECT * FROM chars WHERE id='.$char));
} else if(!is_array($char)){ // Wenn es weder ID noch Array ist
return; // breche ab, dann kann nichts mit angefangen werden
}
@ -43,7 +43,7 @@ class Kaempfer{
$this->charid = $char['id'];
if($buffs == true){ // Ruestungen erlaubt???
$char_buffs = mysql_fetch_assoc(mysql_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN ('.$char['kampf_item'].')'));
$char_buffs = mysqli_fetch_assoc(db_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN ('.$char['kampf_item'].')'));
$this->starke += $char_buffs['starke'];
$k_speed[0] = $char['speed'] + $char_buffs['speed'];
$this->verteidigung += $char_buffs['verteidigung'];
@ -61,8 +61,8 @@ class Monster extends Kaempfer{
function __construct($monster){
if(is_numeric($monster)){
$qry = mysql_query('SELECT * FROM quest_monster WHERE id = '.$monster);
$monster = mysql_fetch_assoc($qry);
$qry = db_query('SELECT * FROM quest_monster WHERE id = '.$monster);
$monster = mysqli_fetch_assoc($qry);
} else if(!is_array($monster)){
// Fehler
return;
@ -75,7 +75,7 @@ class Monster extends Kaempfer{
class Attacke{
function __construct($attacke){
if(is_numeric($attacke)){
$qry = mysql_query('SELECT * FROM attacken WHERE id = '.$attacke);
$qry = db_query('SELECT * FROM attacken WHERE id = '.$attacke);
} else if(!is_array($attacke)){
// Fehler!!
return;
@ -90,7 +90,7 @@ class Attackenauswahl{
private $attacke2;
function __construct($char){
if(is_numeric($char)){ // ID, wenn keine Abfrage vorhanden
$char = mysql_fetch_assoc(mysql_query('Select attacken, attacken2, auswahl1, auswahl2, auswahl3 from chars where id = '.$char));
$char = mysqli_fetch_assoc(db_query('Select attacken, attacken2, auswahl1, auswahl2, auswahl3 from chars where id = '.$char));
} else if(!is_array($char)){ // Wenn es weder ID noch Array ist
return; // breche ab, dann kann nichts mit angefangen werden
}
@ -102,8 +102,8 @@ class Attackenauswahl{
// Zwischenschritt ANFANG
// Nun ein Zwischenschritt weil in den Feldern attacken und attacken2
$qry = mysql_query('Select at_id, id from lernen where id IN ('.$char['attacken'].','.$char['attacken2'].')');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('Select at_id, id from lernen where id IN ('.$char['attacken'].','.$char['attacken2'].')');
while($row = mysqli_fetch_assoc($qry)){
$transition[$row['id']] = $row['at_id'];
}
for($i=0;$i<count($this->attacke1);$i++){
@ -114,8 +114,8 @@ class Attackenauswahl{
// Zwischenschritt ENDE!!!
// Lade die Attacken aus der DB und schreibe sie direkt in den Array
$qry = mysql_query('Select * from attacken where id IN ('.join(',',$this->attacke1).','.join(',',$this->attacke2).')');
while($row = mysql_fetch_assoc($qry)){
$qry = db_query('Select * from attacken where id IN ('.join(',',$this->attacke1).','.join(',',$this->attacke2).')');
while($row = mysqli_fetch_assoc($qry)){
$temp_att[$row['id']] = $row;
}
for($i=0;$i<count($this->attacke1);$i++){

@ -9,7 +9,7 @@
####################KAIOKEN SPIELER 1
if($technick1['type'] == 'frucht') {
$frucht_stats1 = mysql_fetch_array(mysql_query("SELECT starke, ver, speed, ausdauer, glueck FROM wochen_markt WHERE item='$chara_1[frucht]' LIMIT 1"));
$frucht_stats1 = mysqli_fetch_array(db_query("SELECT starke, ver, speed, ausdauer, glueck FROM wochen_markt WHERE item='$chara_1[frucht]' LIMIT 1"));
$k_mp[0] = $k_mp[0] - $technick1['mp'];
$k_hp[0] = $k_hp[0] - $technick1['hp'];
if($k_mp[0] < 0) {
@ -29,7 +29,7 @@ if($technick1['type'] == 'frucht') {
####################KAIOKEN SPIELER 2
if($technick2['type'] == 'frucht') {
$frucht_stats2 = mysql_fetch_array(mysql_query("SELECT starke, ver, speed, ausdauer, glueck FROM wochen_markt WHERE item='$chara_2[frucht]' LIMIT 1"));
$frucht_stats2 = mysqli_fetch_array(db_query("SELECT starke, ver, speed, ausdauer, glueck FROM wochen_markt WHERE item='$chara_2[frucht]' LIMIT 1"));
$k_mp[1] = $k_mp[1] - $technick2['mp'];
$k_hp[1] = $k_hp[1] - $technick2['hp'];
if($k_mp[1] < 0) {

@ -11,7 +11,7 @@
if($runden_gif1) {
if($runden_gif1 > $x) {
$technick1_old = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$attacken_old_id1' LIMIT 1"));
$technick1_old = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$attacken_old_id1' LIMIT 1"));
$k_starke[1] = $k_starke[1] - $technick1_old['starke'];
$k_speed[1] = $k_speed[1] - $technick1_old['speed'];
@ -55,7 +55,7 @@ $aktion_AV1[$x] = 'nein';
if($runden_gif2) {
if($runden_gif2 > $x) {
$technick2_old = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$attacken_old_id2' LIMIT 1"));
$technick2_old = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$attacken_old_id2' LIMIT 1"));
$k_starke[0] = $k_starke[0] - $technick2_old['starke'];
$k_speed[0] = $k_speed[0] - $technick2_old['speed'];

@ -21,7 +21,7 @@ if ($technick1['type'] == 'tausch2') {
$k_ver[0] = round($k_ver[0] * 1.1);
$aktion_AV1[$x] = 'nein';
} else {
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick2[id]' LIMIT 10"));
$technick1 = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$technick2[id]' LIMIT 10"));
$technick1['speed'] = $technick1['speed'] + (($technick1['speed'] / 100) * $prozent_technik1);
$technick1['verteidigung'] = $technick1['verteidigung'] + (($technick1['verteidigung'] / 100) * $prozent_technik1);
$technick1['starke'] = $technick1['starke'] + (($technick1['starke'] / 100) * $prozent_technik1);
@ -55,7 +55,7 @@ if ($technick2['type'] == 'tausch2') {
$k_ver[1] = round($k_ver[1] * 1.1);
$aktion_AV2[$x] = 'nein';
} else {
$technick2 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[id]' LIMIT 10"));
$technick2 = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$technick1[id]' LIMIT 10"));
$technick2['speed'] = $technick2['speed'] + (($technick2['speed'] / 100) * $prozent_technik2);
$technick2['verteidigung'] = $technick2['verteidigung'] + (($technick2['verteidigung'] / 100) * $prozent_technik2);

@ -220,7 +220,7 @@ function displaySchatzSuche($char){
include_once(ROOT_PATH.'/include/schatz.inc.php');
// Erstmal die Schatzsuche-stammdaten laden!
$sql = 'Select * from quests where charid ='.$char['id'].' and dauer < now()';
$quest = mysql_fetch_assoc(mysql_query($sql));
$quest = mysqli_fetch_assoc(db_query($sql));
// echo $sql.'<br>';
if(!$quest){
return 'Schatzsuche noch nicht beendet!!';
@ -240,24 +240,24 @@ function displaySchatzSuche($char){
// Erstmal die Seite starten
echo '<html><head><link rel="stylesheet" type="text/css" href="design/FightStyle.css"></head><body><table width="100%">';
// Einfach mal ne dicke Ueberschrift
$ort = mysql_fetch_assoc(mysql_query('select * from quest_ort where id = '.$quest['ortid']));
$ort = mysqli_fetch_assoc(db_query('select * from quest_ort where id = '.$quest['ortid']));
echo '<tr><th class="top" colspan="3">Schatzsuche in '.$ort['stadt'].'</th></tr>';
// Hole die Ergebnisse die auch in die Datenbank eingetragen werden muessen!
$row = mysql_fetch_assoc(mysql_query('Select sum(exp) as exp, sum(geld) as geld, count(*) as anzahl from quest_fights where charid = '.$char['id']));
$row = mysqli_fetch_assoc(db_query('Select sum(exp) as exp, sum(geld) as geld, count(*) as anzahl from quest_fights where charid = '.$char['id']));
// Ermittle den Endzustand des Chars
$end_qf = mysql_fetch_assoc(mysql_query('select max(fightnr) as mf from quest_fights where charid = '.$char['id']));
$end_qr = mysql_fetch_assoc(mysql_query('select max(roundnr) as mr from quest_rounds where fightnr = '.$end_qf['mf'].' and charid = '.$char['id']));
$last_round = mysql_fetch_assoc(mysql_query('Select * from quest_rounds where roundnr = '.$end_qr['mr'].' and fightnr = '.$end_qf['mf'].' and charid = '.$char['id']));
$last_fight = mysql_fetch_assoc(mysql_query('Select * from quest_fights where fightnr = '.$end_qf['mf'].' and charid = '.$char['id']));
$end_qf = mysqli_fetch_assoc(db_query('select max(fightnr) as mf from quest_fights where charid = '.$char['id']));
$end_qr = mysqli_fetch_assoc(db_query('select max(roundnr) as mr from quest_rounds where fightnr = '.$end_qf['mf'].' and charid = '.$char['id']));
$last_round = mysqli_fetch_assoc(db_query('Select * from quest_rounds where roundnr = '.$end_qr['mr'].' and fightnr = '.$end_qf['mf'].' and charid = '.$char['id']));
$last_fight = mysqli_fetch_assoc(db_query('Select * from quest_fights where fightnr = '.$end_qf['mf'].' and charid = '.$char['id']));
// Ermittle die Reqs des Chars!
$sql = 'SELECT c_attack as a_name, count(*) as anzahl FROM quest_rounds q where roundnr > 0 and charid = '.$char['id'].' group by c_attack';
// echo $sql.'<br>';
$reqs = mysql_query($sql);
$reqs = db_query($sql);
while($row_r = mysql_fetch_assoc($reqs)){
while($row_r = mysqli_fetch_assoc($reqs)){
$c_attacken[] = $row_r;
// print_r($c_attacken);
// echo '<br>';
@ -269,10 +269,10 @@ function displaySchatzSuche($char){
$items = getSchatzItems($row['anzahl']);
for($i=0;$items[$i];$i++){
$res = mysql_query('Update quest_item_stats set anzahl = anzahl + 1 WHERE monster = '.$row['anzahl'].' and id = '.$items[$i]['id']);
if(mysql_affected_rows() == 0){
$res = db_query('Update quest_item_stats set anzahl = anzahl + 1 WHERE monster = '.$row['anzahl'].' and id = '.$items[$i]['id']);
if(db_affected_rows() == 0){
// entry not yet present
mysql_query('INSERT INTO quest_item_stats (monster, id, anzahl) values('.$row['anzahl'].', '.$items[$i]['id'].', 1)');
db_query('INSERT INTO quest_item_stats (monster, id, anzahl) values('.$row['anzahl'].', '.$items[$i]['id'].', 1)');
}
}
} else{
@ -285,9 +285,9 @@ function displaySchatzSuche($char){
}
}
$res = mysql_query('Update quest_stats set anzahl = anzahl + 1 WHERE zeit = '.$std.' AND monster = '.$row['anzahl'].' AND status = '.($final_result=='won'?1:0));
if(mysql_affected_rows() == 0){
mysql_query('INSERT INTO quest_stats (monster, zeit, anzahl, status) values('.$row['anzahl'].', '.$std.', 1, '.($final_result=='won'?1:0).')');
$res = db_query('Update quest_stats set anzahl = anzahl + 1 WHERE zeit = '.$std.' AND monster = '.$row['anzahl'].' AND status = '.($final_result=='won'?1:0));
if(db_affected_rows() == 0){
db_query('INSERT INTO quest_stats (monster, zeit, anzahl, status) values('.$row['anzahl'].', '.$std.', 1, '.($final_result=='won'?1:0).')');
}
// Zeige als erstes die Zusammenfassung an!
@ -296,8 +296,8 @@ function displaySchatzSuche($char){
// Lade nun die Fights runter
$sql = 'Select * from quest_fights where charid = '.$char['id'].' ORDER BY fightnr ASC';
$qry = mysql_query($sql);
while($fight = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($fight = mysqli_fetch_assoc($qry)){
displaySchatzSucheFight($quest, $char, $fight);
}
@ -309,7 +309,7 @@ function displaySchatzSuche($char){
function displaySchatzSucheFight($quest, $char, $fight){
// Lade das Monster aus der Datenbank
$sql = 'select * from quest_monster where id = '.$fight['monsterid'];
$monster = mysql_fetch_assoc(mysql_query($sql));
$monster = mysqli_fetch_assoc(db_query($sql));
if($monster['bild'] == null || $monster['bild'] == ''){
$monster['bild'] = 'design/bilder/avatare/noavart.gif';
@ -319,8 +319,8 @@ function displaySchatzSucheFight($quest, $char, $fight){
echo '<tr><th class="top" colspan="3">'.$char['name'].' Vs '.$monster['name'].'</th></tr>';
$sql = 'Select * from quest_rounds where charid = '.$char['id']. ' and fightnr = '.$fight['fightnr'];
// echo $sql.'<br>';
$qry = mysql_query($sql);
while($round = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($round = mysqli_fetch_assoc($qry)){
displaySchatzSucheFightRound($char, $monster, $fight, $round);
}
displaySummary($char['name'], $monster['name'], $fight['sieger']==$char['id']?$char['name']:$monster['name'], $fight['exp'], 0, $fight['geld'], 0);
@ -363,7 +363,7 @@ function displayEventFight($event_id, $event_fight_id) {
// first readout the required event data
$sql = 'SELECT *, visible <= now() as passed FROM event_fights WHERE event_id = ' . $event_id . ' AND event_fight_id = ' . $event_fight_id . ' AND `starting` <= now()';
//echo $sql . '<br>';
$event_fight_data = mysql_fetch_assoc(mysql_query($sql));
$event_fight_data = mysqli_fetch_assoc(db_query($sql));
if(!$event_fight_data){
displayFightNotAvailable();
echo '</table></body></html>';
@ -372,8 +372,8 @@ function displayEventFight($event_id, $event_fight_id) {
// Okay and now get the data of the chars ;)
$sql = 'SELECT * FROM event_chars e where event_id = '.$event_id.' and event_char_id IN (SELECT event_char_id from event_fight_rounds where event_id = '.$event_id.' and event_fight_id = '.$event_fight_id.' and `round` = 0)';
// echo $sql . '<br>';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)) {
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)) {
if($row['char_bild'] == null || $row['char_bild'] == ''){
$row['char_bild'] = 'design/bilder/avatare/noavart.gif';
}
@ -389,8 +389,8 @@ function displayEventFight($event_id, $event_fight_id) {
echo '<tr><th class="top" colspan="3">'.$char1['char_name'].' Vs '.$char2['char_name'].'</th></tr>';
// now get the round data :D
$sql = 'SELECT * from event_fight_rounds WHERE event_id = ' .$event_id . ' AND event_fight_id = ' .$event_fight_id . ' and visible <= now()';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)) {
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)) {
if($event_fight_data['host'] == $row['event_char_id']) {
$char1_rounds[$row['round']] = $row;
} else {
@ -404,9 +404,9 @@ function displayEventFight($event_id, $event_fight_id) {
// readout the meta-data of this fight :D
$sql = 'SELECT * FROM event_fight_metadata WHERE event_id = ' .$event_id . ' AND event_fight_id = ' .$event_fight_id;
$qry = mysql_query($sql);
$qry = db_query($sql);
$event_fight_metadata = array();
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
$event_fight_metadata[$row['key']] = $row['value'];
}

@ -20,11 +20,11 @@ function convertLearnIDToAttackID (array $learnids, $char_id) {
$sql = 'SELECT id, at_id FROM lernen WHERE id IN ('.implode(',', $learnids).') AND besitzer = ' . $char_id;
// echo $sql .'<br>';
$qry = mysql_query($sql);
$qry = db_query($sql);
if (!$qry) {
return array();
}
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
for($i=0;$i<count($learnids);$i++) {
if($learnids[$i] == $row['id']) {
$result[$i] = $row['at_id'];
@ -111,10 +111,10 @@ function calculateFight(array $char1, array $char2) {
if(count($kombined) > 0) {
$sql = 'SELECT * FROM attacken WHERE id IN(' .implode(',', $kombined) . ')';
// echo $sql .'<br>';
$qry = mysql_query($sql);
$qry = db_query($sql);
$attack_data = array();
while($row = mysql_fetch_assoc($qry)) {
while($row = mysqli_fetch_assoc($qry)) {
$attack_data[$row['id']] = $row;
}
}

@ -32,8 +32,8 @@ function sendMessage($von, $besitzer, $betreff, $text){
$sql = 'INSERT INTO nachricht(von, besitzer, betreff, text) VALUES (\''.$von.'\', '.$besitzer.', \''.$betreff.'\', \''.$text.'\')';
// echo $sql.'<br>';
mysql_query($sql);
return mysql_affected_rows() != 0;
db_query($sql);
return db_affected_rows() != 0;
}
function colorize($text){
@ -63,7 +63,7 @@ function sendChatMessage($user,$text, $usergroups){
$nick = displayUserNameByID($user['id']);
}
if($text != '' && !is_null($text)){
mysql_query('INSERT ag_chat SET nachricht=\''.$text.'\', user=\''.$nick.'\'');
db_query('INSERT ag_chat SET nachricht=\''.$text.'\', user=\''.$nick.'\'');
}
}
@ -71,7 +71,7 @@ function getChatMessages($userid, $messageid = 0, $asc = true, $limit = 25){
if(!is_numeric($messageid)){
$messageid = 0;
}
$row = mysql_fetch_row(db_query('Select max(id), count(id) from ag_chat'));
$row = mysqli_fetch_row(db_query('Select max(id), count(id) from ag_chat'));
$maxid = $row[0];
$count = $row[1];
if($maxid === null) {
@ -89,7 +89,7 @@ function getChatMessages($userid, $messageid = 0, $asc = true, $limit = 25){
$result = db_query('SELECT *, Minute(zeit) as m, Hour(zeit) as h FROM ag_chat WHERE id > '.$minid.' ORDER BY ID ASC LIMIT '.$limit);
while ($row = mysql_fetch_assoc($result)) {
while ($row = mysqli_fetch_assoc($result)) {
$h = $row['h'];
if($h < 10){ $h = '0'.$h;}
$m = $row['m'];
@ -119,8 +119,8 @@ function insertUserTickerMessage($userid, $message, $offset = 0){
}
for($msgid = 0; $msgid < 100000; $msgid += mt_random_wrapper(1,1000)){
$sql = 'INSERT INTO user_ticker(userid, date, msgid, text) values('.$userid.', '.$timestamp.', '.$msgid.', \''.$message.'\')';
mysql_query($sql);
if(mysql_affected_rows() == 1){
db_query($sql);
if(db_affected_rows() == 1){
// echo 'MYSQL success: '.$sql;
return;
}
@ -136,8 +136,8 @@ function insertClanTickerMessage($clanid, $message, $offset = 0){
}
for($msgid = 0; $msgid < 100000; $msgid += mt_random_wrapper(1,1000)){
$sql = 'INSERT INTO clan_ticker(clanid, date, msgid, text) values('.$clanid.', now(), '.$msgid.', \''.$message.'\')';
mysql_query($sql);
if(mysql_affected_rows() == 1){
db_query($sql);
if(db_affected_rows() == 1){
// echo 'MYSQL success: '.$sql;
return;
}

@ -9,12 +9,12 @@
function insertUser($user_name, $password){
$sql = 'SELECT * FROM user WHERE nickname like \''.$user_name.'\'';
$user = mysql_fetch_assoc(mysql_query($sql));
$user = mysqli_fetch_assoc(db_query($sql));
// Insert User into mumble!
$sql = 'Insert into '.$GLOBALS['mumble_db_name'].'.players(server_id, player_id, name, pw) values(1, '.$user['id'].', \''.$user['nickname'].'\', sha(\''.$password.'\'))';
// Should do the trick!
mysql_query($sql);
db_query($sql);
}
?>

@ -7,9 +7,9 @@
*/
// Online-Berechnungen
$online_r = mysql_fetch_assoc(mysql_query('Select count(*) as anzahl from user WHERE online_zeit between TIMESTAMPADD(Minute, -15, now()) and now()'));
$online_r = mysqli_fetch_assoc(db_query('Select count(*) as anzahl from user WHERE online_zeit between TIMESTAMPADD(Minute, -15, now()) and now()'));
$online_r = $online_r['anzahl'];
$online_rekord_1_0 = mysql_fetch_assoc(mysql_query('SELECT * FROM online WHERE id=1'));
$online_rekord_1_0 = mysqli_fetch_assoc(db_query('SELECT * FROM online WHERE id=1'));
?>

@ -18,29 +18,29 @@
include_once "parse.inc.php";
function stimme($pollid, $polloptionid, $userid, $kommentar){
if(mysql_num_rows(mysql_query('SELECT * FROM poll_votes WHERE pollid = '.$pollid.' and userid = '.$userid)) == 0){
if(mysqli_stmt_num_rows(db_query('SELECT * FROM poll_votes WHERE pollid = '.$pollid.' and userid = '.$userid)) == 0){
// NEU einfuegen!
$sql = 'INSERT INTO poll_votes(pollid, polloptionid, userid, comment) values ('.$pollid.','.$polloptionid.','.$userid.',\''.$kommentar.'\')';
mysql_query($sql);
db_query($sql);
//echo $sql.'<br>';
} else{
mysql_query('UPDATE poll_votes SET polloptionid='.$polloptionid.', comment = \''.encodeNoHTMLNoBB($kommentar).'\' WHERE pollid='.$pollid.' and userid = '.$userid);
db_query('UPDATE poll_votes SET polloptionid='.$polloptionid.', comment = \''.encodeNoHTMLNoBB($kommentar).'\' WHERE pollid='.$pollid.' and userid = '.$userid);
}
}
// Liefert den Datensatz der Stimme (Nr und eigener Kommentar)
function getStimme($pollid, $userid){
$qry = mysql_query('SELECT * FROM poll_votes WHERE pollid = '.$pollid.' and userid = '.$userid);
$result = mysql_fetch_assoc($qry);
$qry = db_query('SELECT * FROM poll_votes WHERE pollid = '.$pollid.' and userid = '.$userid);
$result = mysqli_fetch_assoc($qry);
return $result;
}
function getUmfrage($pollid){
$umfrage = array();
$qry = mysql_query('SELECT p.thema, p.pollid, p.text, u.nickname FROM poll as p inner join user as u on p.ersteller = u.id WHERE pollid='.$pollid);
$umfrage['poll'] = mysql_fetch_assoc($qry);
$qry = mysql_query('SELECT * FROM poll_options WHERE pollid ='.$pollid);
while($result = mysql_fetch_assoc($qry)){
$qry = db_query('SELECT p.thema, p.pollid, p.text, u.nickname FROM poll as p inner join user as u on p.ersteller = u.id WHERE pollid='.$pollid);
$umfrage['poll'] = mysqli_fetch_assoc($qry);
$qry = db_query('SELECT * FROM poll_options WHERE pollid ='.$pollid);
while($result = mysqli_fetch_assoc($qry)){
$umfrage['options'][$result['polloptionid']] = $result;
}
return $umfrage;
@ -48,41 +48,41 @@ function getUmfrage($pollid){
function getUmfragen($entries, $page){
$returnArray = array();
$qry = mysql_query('SELECT p.thema, p.pollid, u.nickname FROM poll as p inner join user as u on p.ersteller = u.id LIMIT '.$entries*$page.','.$entries);
$qry = db_query('SELECT p.thema, p.pollid, u.nickname FROM poll as p inner join user as u on p.ersteller = u.id LIMIT '.$entries*$page.','.$entries);
$i=0;
while($result=mysql_fetch_assoc($qry)){
while($result=mysqli_fetch_assoc($qry)){
$returnArray[$i++] = $result;
}
return $returnArray;
}
function getUmfragenCount(){
$temp = mysql_fetch_assoc(mysql_query('SELECT count(*) as anzahl FROM poll'));
$temp = mysqli_fetch_assoc(db_query('SELECT count(*) as anzahl FROM poll'));
return $temp['anzahl'];
}
function getComments($pollid, $entries, $page){
$returnArray = array();
$sql = 'SELECT polloptionid, comment FROM poll_votes where comment != \'\' and pollid= '.$pollid.' LIMIT '.$entries*$page.','.$entries;
$qry = mysql_query($sql);
$qry = db_query($sql);
// echo '<br>'.$sql.'<br>';
for($i=0;($result = mysql_fetch_assoc($qry)) != null && $i<$entries;$i++){
for($i=0;($result = mysqli_fetch_assoc($qry)) != null && $i<$entries;$i++){
$returnArray[$i] = $result;
}
return $returnArray;
}
function getCommentCount($pollid){
$temp = mysql_fetch_assoc(mysql_query('Select count(*) as anzahl from poll_votes where comment != \'\' and pollid= '.$pollid));
$temp = mysqli_fetch_assoc(db_query('Select count(*) as anzahl from poll_votes where comment != \'\' and pollid= '.$pollid));
return $temp['anzahl'];
}
function getPollResult($pollid){
$returnArray = array();
$sql = 'SELECT text, pv.polloptionid, count(pv.polloptionid) as anzahl FROM poll_votes as pv inner join poll_options as po on pv.polloptionid = po.polloptionid and pv.pollid = po.pollid where pv.pollid = '.$pollid.' group by polloptionid';
$qry = mysql_query($sql);
$qry = db_query($sql);
// echo '<br>'.$sql.'<br>';
while($result = mysql_fetch_assoc($qry)){
while($result = mysqli_fetch_assoc($qry)){
$returnArray[$result['polloptionid']] = $result['anzahl'];
}
return $returnArray;
@ -91,8 +91,8 @@ function getPollResult($pollid){
function isOpen($pollid){
$sql = 'SELECT count(*) as anzahl from poll where pollid ='.$pollid.' AND (close is null OR close > now())';
$qry = mysql_query($sql);
$row = mysql_fetch_assoc($qry);
$qry = db_query($sql);
$row = mysqli_fetch_assoc($qry);
if($row['anzahl'] > 0){
return true;
}

@ -25,9 +25,9 @@ function getRassen() {
*/
function getRaces() {
if(count($GLOBALS['char_buffered_races']) == 0) {
$qry = mysql_query('select * from rassen');
$qry = db_query('select * from rassen');
// FIXME: This is a simulated SQL Request!
while($race = mysql_fetch_assoc($qry)) {
while($race = mysqli_fetch_assoc($qry)) {
$GLOBALS['char_buffered_races'][$race['id']] = $race;
}
}
@ -40,8 +40,8 @@ function getRassenTypeMapping() {
function getRaceTypes(){
if(count($GLOBALS['char_buffered_race_types']) == 0) {
$qry = mysql_query('select * from rassen_type');
while($racetype = mysql_fetch_assoc($qry)) {
$qry = db_query('select * from rassen_type');
while($racetype = mysqli_fetch_assoc($qry)) {
$GLOBALS['char_buffered_race_types'][$racetype['id']] = $racetype;
}
}

@ -17,14 +17,14 @@ defineIfNotDefined('ATTACK_SET_SCHATZSUCHE', 2);
function interruptSchatzSuche($charid){
mysql_query('Delete from quest_rounds where charid ='.$charid);
mysql_query('Delete from quest_fights where charid ='.$charid);
mysql_query('Delete from quests where charid ='.$charid);
mysql_query('Update chars set status = \'Frei\' where id = '.$charid);
db_query('Delete from quest_rounds where charid ='.$charid);
db_query('Delete from quest_fights where charid ='.$charid);
db_query('Delete from quests where charid ='.$charid);
db_query('Update chars set status = \'Frei\' where id = '.$charid);
}
function getMonsterCount($ort){
return mysql_fetch_assoc(mysql_query('Select count(*) as arten, sum(anzahl) as anzahl from quest_monster_orte as qma inner join quest_monster as qm on qma.monsterid = qm.id where ortid = '.$ort));
return mysqli_fetch_assoc(db_query('Select count(*) as arten, sum(anzahl) as anzahl from quest_monster_orte as qma inner join quest_monster as qm on qma.monsterid = qm.id where ortid = '.$ort));
}
// Die Monsterauswahl in eine Funktion gekapselt um es spaeter optimieren zu koennen!
@ -37,10 +37,10 @@ function getMonster($char_level, $city_id, $min, $max){
$rechnung = 'ROUND(1/SQRT(PI()*2) * EXP(-1/(('.$top.'-'.$bottom.')*2.5)*POW((level-floor(('.$bottom.'+'.$min_l.')/2)),2))*250) as guete';
$sql = 'select *, '.$rechnung.' from quest_monster as qm inner join quest_monster_orte as qmo on qm.id = qmo.monsterid where ortid = '.$city_id.' and level <= 20 + '.$char_level.' order by rand()';
// echo $sql.'<br>';
$qry = mysql_query($sql); // Lade alle Monster
// while($monster[] = mysql_fetch_assoc($qry)); // Lade alle monster in einen Array
$qry = db_query($sql); // Lade alle Monster
// while($monster[] = mysqli_fetch_assoc($qry)); // Lade alle monster in einen Array
$gesamtguete = 0;
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
if($row['guete'] == 0){
$row['guete'] += 1;
}
@ -89,7 +89,7 @@ function monsterfight_neu($chara_1, $fight_monster, $std, $ort){
if($chara_1['kampf_item'] != NULL && $chara_1['kampf_item'] != ',,,,'){
// echo 'Problematic Entry = '.$chara_1['kampf_item'].'<br>';
$char1_buffs = mysql_fetch_assoc(mysql_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN (' . $chara_1['kampf_item'] . ')'));
$char1_buffs = mysqli_fetch_assoc(db_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN (' . $chara_1['kampf_item'] . ')'));
}
// Retrieve the attack set for the treasure hunt!
@ -130,10 +130,10 @@ function monsterfight_neu($chara_1, $fight_monster, $std, $ort){
$in_hp_max.', '.
$in_mp_max.')';
// echo 'Debug-Message: '.$sql.'<br>';
mysql_query($sql);
db_query($sql);
$Dead1 = 0;
// while ($chara_2 = mysql_fetch_assoc($fight_monster)) { // Schleife in monsterfight.inc.php rein!!!
// while ($chara_2 = mysqli_fetch_assoc($fight_monster)) { // Schleife in monsterfight.inc.php rein!!!
for($i=0;$i<count($fight_monster) && $Dead1 == 0;$i++){
$sql = 'Insert into quest_fights(charid, fightnr, monsterid)' .
' values(' .
@ -141,7 +141,7 @@ function monsterfight_neu($chara_1, $fight_monster, $std, $ort){
$i.', ' .
$fight_monster[$i]['id'].')';
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
// Werte uebernehmen
$k_starke[0] = $in_starke;
$k_speed[0] = $in_speed;
@ -186,7 +186,7 @@ function monsterfight_neu($chara_1, $fight_monster, $std, $ort){
$k_starke[1].','.$k_speed[1].','.$k_ver[1].','.$k_hp[1].','.$k_mp[1].','.$k_ausdauer[1].','.$k_glueck[1].
')';
// echo 'Debug Message: '.$sql.'<br>';
mysql_query($sql);
db_query($sql);
$statChange_Char1 = array();
$statChange_Char2 = array();
@ -207,9 +207,9 @@ function monsterfight_neu($chara_1, $fight_monster, $std, $ort){
$GLOBALS['kampf']['aussetzen'] = &$aussetzten_runde;
while ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > 0 AND $x < 10) {
$technick1 = mysql_fetch_assoc(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$technick1 = mysqli_fetch_assoc(db_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20 * $technick1['aktiv']) - 20;
$technick1 = mysql_fetch_assoc(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick1 = mysqli_fetch_assoc(db_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
include (ROOT_PATH . '/include/kampf/andere_technik.php');
@ -274,7 +274,7 @@ function monsterfight_neu($chara_1, $fight_monster, $std, $ort){
$k_starke[1].','.$k_speed[1].','.$k_ver[1].','.$k_hp[1].','.$k_mp[1].','.$k_ausdauer[1].','.$k_glueck[1].
')';
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
}
###########################EXP VERTEILUNG
@ -300,9 +300,9 @@ function monsterfight_neu($chara_1, $fight_monster, $std, $ort){
$geld = 0;
}
// With money on SS
// mysql_query('Update quest_fights set exp = '.$exp.', geld = '.$geld.', sieger = '.$sieger.' where charid = '.$chara_1['id'].' and fightnr = '.$i);
// db_query('Update quest_fights set exp = '.$exp.', geld = '.$geld.', sieger = '.$sieger.' where charid = '.$chara_1['id'].' and fightnr = '.$i);
// No money
mysql_query('Update quest_fights set exp = '.$exp.', geld = 0, sieger = '.$sieger.' where charid = '.$chara_1['id'].' and fightnr = '.$i);
db_query('Update quest_fights set exp = '.$exp.', geld = 0, sieger = '.$sieger.' where charid = '.$chara_1['id'].' and fightnr = '.$i);
}
}
// Just wait (so users can not determinate the success of the SS by calculation time)
@ -319,8 +319,8 @@ function getSchatzItems($monster_count){
$items = array();
$sql = 'SELECT * FROM sp_item where FLOOR(RAND()*wert/'.$divisor.') = 0';
// echo $sql.' ('.$monster_count.')<br>';
$qry = mysql_query($sql);
while($items[] = mysql_fetch_assoc($qry));
$qry = db_query($sql);
while($items[] = mysqli_fetch_assoc($qry));
return $items;
}
@ -345,9 +345,9 @@ function submitCharChanges($charid, $items, $exp, $geld, $ort, $hp, $mp, $attack
$mp[0] = $mp[1];
}
// Erstmal aufräumen
mysql_query('Delete from quests where charid = '.$charid);
mysql_query('Delete from quest_fights where charid = '.$charid);
mysql_query('Delete from quest_rounds where charid = '.$charid);
db_query('Delete from quests where charid = '.$charid);
db_query('Delete from quest_fights where charid = '.$charid);
db_query('Delete from quest_rounds where charid = '.$charid);
// Das leveln :)
// Erfahrung
@ -358,29 +358,29 @@ function submitCharChanges($charid, $items, $exp, $geld, $ort, $hp, $mp, $attack
// Schaden und den neuen Ort eintragen (und den Status nicht vergessen :)
$sql = 'Update chars set hp=\''.$hp[0].','.$hp[1].'\', mp=\''.$mp[0].','.$mp[1].'\', ort = '.$ort.', status = \'Frei\' where id = '.$charid;
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
// // Kohle gibts ja nichmehr :)
// $sql = 'Update user set geld = geld + '.$geld.' where id = '.$char['besitzer'];
//// echo $sql.'<br>';
// mysql_query($sql);
// db_query($sql);
// Nun gehts zum auffinden der Items :)
for($i=0;$items[$i];$i++){
// Ermittle ob es eine Teufelsfrucht ist!
$sql = 'Select name, type from sp_item where id = '.$items[$i]['id'];
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if($row['type'] == 'Teufels Frucht'){
$sql = 'Select id from wochen_markt where item = \''.$row['name'].'\'';
$row2 = mysql_fetch_assoc(mysql_query($sql));
$row2 = mysqli_fetch_assoc(db_query($sql));
$sql = 'INSERT INTO wochen_ware(item, user) values('.$row2['id'].','.$char['besitzer'].')';
mysql_query($sql);
db_query($sql);
} else{
$sql = 'Insert into sp_ware(item, user) values('.$items[$i]['id'].','.$char['besitzer'].')';
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
}
}
}

@ -13,7 +13,7 @@ function renderSchnellleiste($user){
$Schnell_my_chars = getCharsOfUser($user['id']);
$char_zahl = 0;
while($my_charz = mysql_fetch_assoc($Schnell_my_chars)) {
while($my_charz = mysqli_fetch_assoc($Schnell_my_chars)) {
$POWERLEVEL5 = $my_charz['starke']+$my_charz['verteidigung']+$my_charz['speed']+$my_charz['ausdauer']+$my_charz['glueck'];

@ -41,12 +41,12 @@ function semaphoreUP($resource){
// echo 'DEBUG: kritischer Bereich betreten<br>';
}
// Loesche alte Ressourcen
mysql_query('DELETE FROM semaphore WHERE TIMESTAMPDIFF(MINUTE, zeit, now()) > 5 and ressource = \''.$resource.'\'');
db_query('DELETE FROM semaphore WHERE TIMESTAMPDIFF(MINUTE, zeit, now()) > 5 and ressource = \''.$resource.'\'');
$sql = 'INSERT INTO semaphore(ressource) values(\''.$resource.'\')';
mysql_query($sql);
if(mysql_affected_rows() > 0){
// echo 'DEBUG: Semaphore fuer '.$ressource.' belegt!('.mysql_affected_rows().')<br>';
db_query($sql);
if(db_affected_rows() > 0){
// echo 'DEBUG: Semaphore fuer '.$ressource.' belegt!('.db_affected_rows().')<br>';
$GLOBALS['semaphorecount']++;
return true;
}
@ -61,8 +61,8 @@ function semaphoreUP($resource){
// @Returns TRUE if ok, FALSE on Semaphore error, NULL on MYQL Error
function semaphoreDown($resource){
$sql = 'DELETE FROM semaphore where ressource = \''.$resource.'\'';
mysql_query($sql);
if(mysql_affected_rows() == 0){
db_query($sql);
if(db_affected_rows() == 0){
// echo 'DEBUG: Semaphore '.$ressource.' war schon freigegeben<br>';
return false;
}
@ -81,7 +81,7 @@ function semaphoreDown($resource){
* returns true, wenn Semaphore belegt ist, false wenn nicht
*/
function isSemaphoreUP($ressource){
return mysql_fetch_assoc(mysql_query('Select * from semaphore where WHERE TIMESTAMPDIFF(MINUTE, zeit, now()) > 5 and ressource = \''.$ressource.'\'')) != false;
return mysqli_fetch_assoc(db_query('Select * from semaphore where WHERE TIMESTAMPDIFF(MINUTE, zeit, now()) > 5 and ressource = \''.$ressource.'\'')) != false;
}
function installSemaphoreDatabase(){
@ -94,8 +94,8 @@ function installSemaphoreDatabase(){
')' .
'ENGINE = MYISAM ' .
'COMMENT = \'Die Tabelle, die hoffentlich alle Zugriffsprobleme loesen wird\'';
mysql_query($sql1);
mysql_query($sql2);
db_query($sql1);
db_query($sql2);
}
?>

@ -7,10 +7,14 @@
*/
function db_query($sql) {
$qry = mysql_query($sql);
$qry = mysqli_query($GLOBALS['main_db'], $sql);
if(!$qry) {
echo $sql . '<br>';
}
return $qry;
}
function db_affected_rows() {
return mysqli_affected_rows($GLOBALS['main_db']);
}

@ -79,7 +79,7 @@ function getAllTaskIds() {
if(!$qry)
return array();
$result = array();
while($row = mysql_fetch_row($qry)) {
while($row = mysqli_fetch_row($qry)) {
$result[] = $row[0];
}
return $result;
@ -96,7 +96,7 @@ function getPassedTaskIds($timestamp = NULL) {
if(!$qry)
return array();
$result = array();
while($row = mysql_fetch_row($qry)) {
while($row = mysqli_fetch_row($qry)) {
$result[] = $row[0];
}
return $result;
@ -110,7 +110,7 @@ function getTask($task_id) {
$qry = db_query('SELECT * FROM tasking WHERE task_id = ' . $task_id);
if(!$qry)
return null;
return mysql_fetch_assoc($qry);
return mysqli_fetch_assoc($qry);
}
/**

@ -19,7 +19,7 @@ function getUser($userid, $buffer_enabled = true) {
}
// Wenn Char nicht im Puffer ist, oder nicht gepuffert werden soll
if ($GLOBALS['user_buffered_instances'][$userid] == null || !$buffer_enabled) {
$user = mysql_fetch_assoc(db_query('SELECT *, (online_zeit between TIMESTAMPADD(Minute, -15, now()) and now()) as online FROM user WHERE id = '.$userid));
$user = mysqli_fetch_assoc(db_query('SELECT *, (online_zeit between TIMESTAMPADD(Minute, -15, now()) and now()) as online FROM user WHERE id = '.$userid));
$GLOBALS['user_buffered_instances'][$userid] = $user;
}
return $GLOBALS['user_buffered_instances'][$userid];
@ -42,12 +42,12 @@ function getOwnerOfChar($charid, $buffer_enabled = true) {
return null;
}
$user = mysql_fetch_assoc(mysql_query('SELECT u.id FROM user u INNER JOIN chars ch ON ch.besitzer=u.id WHERE ch.id = '.$charid));
$user = mysqli_fetch_assoc(db_query('SELECT u.id FROM user u INNER JOIN chars ch ON ch.besitzer=u.id WHERE ch.id = '.$charid));
return getUser($user['id']);
}
function addMoneyToUser($userid, $amount) {
mysql_query('update user set geld = geld + ' . $amount . ' WHERE id = ' .$userid);
db_query('update user set geld = geld + ' . $amount . ' WHERE id = ' .$userid);
}
/**
@ -56,7 +56,7 @@ function addMoneyToUser($userid, $amount) {
*/
function getRelevantMoney($userid) {
$user = getUser($userid);
$auktionensumme = mysql_fetch_assoc(mysql_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = ' . $user['id'] . ' GROUP BY bieter'));
$auktionensumme = mysqli_fetch_assoc(db_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = ' . $user['id'] . ' GROUP BY bieter'));
$auktionensumme = $auktionensumme['summe'];
if ($auktionensumme == 0) {
@ -69,7 +69,7 @@ function getRelevantMoney($userid) {
function checkSessionPasswort($userid, $password){
$sql = 'SELECT passwort from user where id = \''.$userid.'\'';
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if($row['passwort'] != null){
// echo $password.' == '.$row['passwort'];
return $password == $row['passwort'];
@ -81,7 +81,7 @@ function checkSessionPasswort($userid, $password){
function checkCookiePassword($username, $password){
$sql = 'SELECT passwort from user where nickname = \''.$username.'\'';
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if($row['passwort'] != null){
return $password == $row['passwort'];
} else{
@ -95,7 +95,7 @@ function checkLoginPassword($username, $password){
$sql = 'SELECT SHA1(AES_ENCRYPT(\''.$password.'\',\''.$GLOBALS['PW_AES_KEY'].'\')) as encrypt_password, passwort from user where nickname = \''.$username.'\'';
// echo $sql.'<br>';
$row = mysql_fetch_assoc(mysql_query($sql));
$row = mysqli_fetch_assoc(db_query($sql));
if($row){
if($row['passwort'] == $pw) {
return true; // already bcrypt based!
@ -120,7 +120,7 @@ function setPassword($username, $password){
$pw = encryptPassword($password);
$sql = 'UPDATE user set passwort = \''.$pw.'\' where nickname = \''.$username.'\'';
// echo $sql.'<br>';
mysql_query($sql);
db_query($sql);
}
function encryptPassword($password){
@ -130,7 +130,7 @@ function encryptPassword($password){
function getUserMetaData($userid) {
$sql = 'SELECT * FROM user_meta_data WHERE user_id = ' . $userid;
$qry = mysql_query($sql);
$qry = db_query($sql);
$result = array();
if(!$qry)
@ -139,7 +139,7 @@ function getUserMetaData($userid) {
return $result;
}
while ($row = mysql_fetch_assoc($qry)) {
while ($row = mysqli_fetch_assoc($qry)) {
$result[$row['key']] = $row['value'];
}
return $result;
@ -147,15 +147,15 @@ function getUserMetaData($userid) {
function setUserMetaDataEntry($userid, $key, $value) {
$sql = 'UPDATE user_meta_data SET `value` = \''.$value.'\' WHERE user_id = \''.$userid.'\' and `key` = \''.$key.'\'';
$qry = mysql_query($sql);
$qry = db_query($sql);
if(!qry)
return;
if(mysql_affected_rows() > 0)
if(db_affected_rows() > 0)
return;
$sql = 'INSERT INTO user_meta_data(user_id, `key`, `value`) values (\''.$userid.'\',\''.$key.'\',\''.$value.'\')';
$qry = mysql_query($sql);
$qry = db_query($sql);
}

@ -41,7 +41,7 @@ function getUserGroups($user) {
$i = 0;
if($qry) {
while ($result = mysql_fetch_assoc($qry)) {
while ($result = mysqli_fetch_assoc($qry)) {
$groups[] = array("gruppen_id" => $result['gruppen_id'], "gruppen_name" => $result['gruppen_name']);
}
}

@ -21,7 +21,7 @@ include_once(ROOT_PATH.'/include/messagefunctions.inc.php');
// Fuer den Transit von register_globals auf normal
$name = $user_ida['nickname'];
$passwort = $user_ida['passwort'];
$nnn_nn = mysql_num_rows(mysql_query("SELECT id FROM nachricht WHERE besitzer='$user_ida[id]' AND ag='neu'"));
$nnn_nn = mysqli_stmt_num_rows(db_query("SELECT id FROM nachricht WHERE besitzer='$user_ida[id]' AND ag='neu'"));
$as = $_REQUEST['as'];
$agb = $_REQUEST['agb'];
@ -332,7 +332,7 @@ if($as != "irc" AND $as != "login" AND $as != "anmeldung" AND $as != "info/logs"
if($user_ida['agb'] == "nein" && $as != "info/agb") {
if($agb == 'ok'){
mysql_query("UPDATE user SET agb='ja' WHERE id='$user_ida[id]' LIMIT 1");
db_query("UPDATE user SET agb='ja' WHERE id='$user_ida[id]' LIMIT 1");
}
echo '<form action=index.php method="get"><input type="hidden" name="as" value="'.$as.'"><input name="agb" value="ok" type="hidden">Die Regeln haben sich ver&auml;ndert. Bist du mit den neuen Regeln einverstanden? <a href="index.php?as=info/agb" target="_blank">Hier Klicken um die neuen Regeln zu lesen</a><br><input type="submit" value="Einverstanden"></form>';
exit;

@ -28,7 +28,7 @@ $charm = $_GET['charm'];
function isNickChanged($user){
$row = mysql_fetch_assoc(mysql_query('Select count(*) as anzahl from user_rename where userid = '.$user['id']));
$row = mysqli_fetch_assoc(db_query('Select count(*) as anzahl from user_rename where userid = '.$user['id']));
return $row['anzahl'] != 0;
}
@ -108,9 +108,9 @@ function display1($char_id){
function display2($user_id, $userage, $user_ida){
if($userage != NULL){
$user_a = mysql_fetch_assoc(mysql_query('SELECT * FROM user WHERE nickname=\''.$userage.'\''));
$user_a = mysqli_fetch_assoc(db_query('SELECT * FROM user WHERE nickname=\''.$userage.'\''));
} else{
$user_a = mysql_fetch_assoc(mysql_query('SELECT * FROM user WHERE id='.$user_id));
$user_a = mysqli_fetch_assoc(db_query('SELECT * FROM user WHERE id='.$user_id));
}
if(!is_numeric($user_id)) {
$user_id = $user_a['id'];
@ -134,18 +134,18 @@ function display2($user_id, $userage, $user_ida){
if($user_a['clan'] == NULL){
echo 'Keiner';
} else{
$clan = mysql_fetch_assoc(mysql_query('SELECT * FROM clan WHERE id = '.$user_a['clan']));
$clan = mysqli_fetch_assoc(db_query('SELECT * FROM clan WHERE id = '.$user_a['clan']));
echo displayClanLink ($clan['id'], $clan['clanname']) ;
}
// Now could it be that the user is in an other clan and we may invite him ;), check if current user is a leader!
$qry = mysql_query('Select id from clan where leader = ' . $user_ida['id'] . ' or co_leader = ' . $user_ida['id']);
$clan = mysql_fetch_assoc($qry);
$qry = db_query('Select id from clan where leader = ' . $user_ida['id'] . ' or co_leader = ' . $user_ida['id']);
$clan = mysqli_fetch_assoc($qry);
// is there data available and if yes does the other user have the same clan?
if($clan && $clan['id'] !== $user_a['clan']) {
// check if we already invited him. Then renew invitation ->
$qry = mysql_query('Select count(*) as anzahl from user_clan_invitations where clanid = '.$clan['id'].' AND userid = ' . $user_id);
$row = mysql_fetch_assoc($qry);
$qry = db_query('Select count(*) as anzahl from user_clan_invitations where clanid = '.$clan['id'].' AND userid = ' . $user_id);
$row = mysqli_fetch_assoc($qry);
if ($row['anzahl'] > 0) {
$action = 'Einladung erneuern';
@ -165,8 +165,8 @@ function display2($user_id, $userage, $user_ida){
<?php
if(isNickChanged($user_a)){
$nick_history = array();
$nick_qry = mysql_query('Select * from user_rename where userid = '.$user_a['id'].' ORDER BY datum asc');
while($row = mysql_fetch_assoc($nick_qry)){
$nick_qry = db_query('Select * from user_rename where userid = '.$user_a['id'].' ORDER BY datum asc');
while($row = mysqli_fetch_assoc($nick_qry)){
$nick_history[] = $row['datum'].': Von "'.$row['pre_name'].'" zu "'.$row['post_name'].'"';
}
?>
@ -212,7 +212,7 @@ function display3($tablename, $itemid){
return;
}
$item_a = mysql_fetch_assoc(mysql_query('SELECT * FROM '.$tabletogo.' WHERE id='.$itemid));
$item_a = mysqli_fetch_assoc(db_query('SELECT * FROM '.$tabletogo.' WHERE id='.$itemid));
?>
<table cellpadding="0" cellspacing="0" width="100%" height="51">
<tr>

@ -15,11 +15,11 @@ include_once(ROOT_PATH.'/include/parse.inc.php');
// TODO: Muss noch angepasst werden!
function showAttDetails($at_id) {
$at_info = mysql_Fetch_array(mysql_query("SELECT * FROM attacken WHERE id='".$at_id."' LIMIT 1"));
$at_info = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='".$at_id."' LIMIT 1"));
$req_atk = explode(",", $at_info['req_atk']);
$req_lvl = explode(",", $at_info['req_lvl']);
$req_attack = mysql_fetch_array(mysql_query("SELECT f.name AS f_name, b.name AS b_name, c.name AS c_name, d.name AS d_name, e.name AS e_name FROM attacken a LEFT JOIN attacken b ON(b.id='".$req_atk[0]."') LEFT JOIN attacken c ON(c.id='".$req_atk[1]."') LEFT JOIN attacken d ON(d.id='".$req_atk[2]."') LEFT JOIN attacken e ON(e.id='".$req_atk[3]."') LEFT JOIN attacken f ON(f.id='".$req_atk[4]."') WHERE a.id='".$at_id."'"));
$req_attack = mysqli_fetch_array(db_query("SELECT f.name AS f_name, b.name AS b_name, c.name AS c_name, d.name AS d_name, e.name AS e_name FROM attacken a LEFT JOIN attacken b ON(b.id='".$req_atk[0]."') LEFT JOIN attacken c ON(c.id='".$req_atk[1]."') LEFT JOIN attacken d ON(d.id='".$req_atk[2]."') LEFT JOIN attacken e ON(e.id='".$req_atk[3]."') LEFT JOIN attacken f ON(f.id='".$req_atk[4]."') WHERE a.id='".$at_id."'"));
?>
<div align="center">
<input type="button" value="Zur&uuml;ck" onClick="history.back()">
@ -204,7 +204,7 @@ function showAtks($linkz,$tf='',$rassen='',$order='',$type='',$pagenum='',$fruch
$sql .= ' '.$order.' LIMIT '.($pagenum * 20).', 20 ';
$attacken = db_query($sql);
while ($row = mysql_fetch_array($attacken)) {
while ($row = mysqli_fetch_array($attacken)) {
?>
<tr>
<td align="center" valign="top" bgcolor="#333333"><font
@ -229,7 +229,7 @@ function showAtks($linkz,$tf='',$rassen='',$order='',$type='',$pagenum='',$fruch
}
$row = mysql_fetch_row(db_query(getAttackenSQLStatement($tf, $rassen, $type, $search, 'count(attacken.id)')));
$row = mysqli_fetch_row(db_query(getAttackenSQLStatement($tf, $rassen, $type, $search, 'count(attacken.id)')));
$total = $row[0];
$pages = ceil($total / 20);
@ -348,7 +348,7 @@ function atksHeaderRasse($type,$link,$fruchttyp) {
$condition = getFruchtCondition($fruchttyp);
$tf_query = db_query('SELECT * FROM wochen_markt WHERE '.$condition.' 1 ORDER BY item ASC');
$first = true;
while ($tf_array= mysql_fetch_assoc($tf_query)) {
while ($tf_array= mysqli_fetch_assoc($tf_query)) {
if($first) {
$first = false;
} else {
@ -451,11 +451,11 @@ if (!empty($type) AND empty($fruchttyp)) {
$link = "pagenum=$pagenum&order_art=$order_art&last_klick1=$last_klick1";
if ($p) {
if ($_GET['search']) {
$anzahl_atks = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE name LIKE '%".trim($search)."%'"));
$anzahl_atks = mysqli_stmt_num_rows(db_query("SELECT id FROM attacken WHERE name LIKE '%".trim($search)."%'"));
if ($anzahl_atks == 1) {
$at_z = mysql_fetch_array(mysql_query("SELECT id FROM attacken WHERE name='".trim($search)."' LIMIT 1"));
$at_z = mysqli_fetch_array(db_query("SELECT id FROM attacken WHERE name='".trim($search)."' LIMIT 1"));
if (empty($at_z)) {
$at_z = mysql_fetch_array(mysql_query("SELECT id FROM attacken WHERE name LIKE '%".trim($search)."%' LIMIT 1"));
$at_z = mysqli_fetch_array(db_query("SELECT id FROM attacken WHERE name LIKE '%".trim($search)."%' LIMIT 1"));
}
showAttDetails($at_z['id']);
} else {

@ -8,7 +8,7 @@
include_once(ROOT_PATH.'/include/config.inc.php');
if($item_id) {
$item_info = mysql_Fetch_array(mysql_query("SELECT * FROM item WHERE id='$item_id' LIMIT 1"));
$item_info = mysqli_fetch_array(db_query("SELECT * FROM item WHERE id='$item_id' LIMIT 1"));
?>
@ -117,8 +117,8 @@ exit;
if($pagenum == "" or $pagenum == 1) { $pagenum = 0; }
if($pagenum != "" and $pagenum != 1) { $pagenum = ($pagenum - 1) * 10; }
$item = mysql_query("SELECT name, id FROM item LIMIT $pagenum, 10");
while($row = mysql_Fetch_array($item)) {
$item = db_query("SELECT name, id FROM item LIMIT $pagenum, 10");
while($row = mysqli_fetch_array($item)) {
?>
<tr>
<td width="158" height="25">
@ -130,7 +130,7 @@ while($row = mysql_Fetch_array($item)) {
}
$Total = mysql_num_rows(mysql_query("SELECT id FROM item"));
$Total = mysqli_stmt_num_rows(db_query("SELECT id FROM item"));
$pages = ceil($Total/10);
$z = 1;

@ -25,7 +25,7 @@ if ($char_id == null) {
if ($attack_id != null) {
$test = 'INSERT INTO lernen(name, at_id,besitzer,aktiv) VALUES'.
'((SELECT name FROM attacken WHERE id ='.$attack_id.'), '.$attack_id.', '.$char_id.', 1);';
$qry = mysql_query($test);
$qry = db_query($test);
}
$attacks_learned = getAttacksforChar($char_id, 0);
$attacks_unlearned = getAttacksforChar($char_id, 1);

@ -49,7 +49,7 @@ function getTradeItems($userid){
$result = NULL;
$index = 0;
$arenalvl = mysql_fetch_array(mysql_query("SELECT level FROM arena WHERE besitzer = ".$userid.";"));
$arenalvl = mysqli_fetch_array(db_query("SELECT level FROM arena WHERE besitzer = ".$userid.";"));
// Die etwas abgewandelten SQL-Querys aus dem auktion_functions.php
$query = 'SELECT i.id, i.name, count(i.id) AS anzahl, tausch_anzahl, tausch_lvl, \'ware\' as tablename FROM ware w INNER JOIN item i ON(i.id=w.item_id) WHERE w.user = '.$userid.' AND s_type = \'Trank\' AND tausch_lvl <= '.$arenalvl['level'].' GROUP BY i.id
union
@ -57,9 +57,9 @@ function getTradeItems($userid){
union
SELECT i.id, i.item AS name, count(i.id) AS anzahl, tausch_anzahl, tausch_lvl, \'wochen_ware\' as tablename FROM wochen_ware w INNER JOIN wochen_markt i ON(i.id=w.item) WHERE w.user = '.$userid.' AND tausch_lvl <= '.$arenalvl['level'].' GROUP BY (i.id)';
$qry = mysql_query($query);
$qry = db_query($query);
// Damit waeren alle noetigen Datenbankaufrufe erledigt!
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
$result[$index++] = '<option value=\''.$row['id'].','.$row['tablename'].'\'>'.$row['name'].' | Anzahl:'.$row['anzahl'].' (max: '.$row['tausch_anzahl'].')</option>';
}
return $result;
@ -69,20 +69,20 @@ function getTradeConditions($table, $item_id) {
$row = null;
switch ($table) {
case 'ware':
$row = mysql_fetch_array(mysql_query("SELECT tausch_lvl, tausch_anzahl, name FROM item WHERE id = $item_id;"));
$row = mysqli_fetch_array(db_query("SELECT tausch_lvl, tausch_anzahl, name FROM item WHERE id = $item_id;"));
break;
case 'wochen_ware':
$row = mysql_fetch_array(mysql_query("SELECT tausch_lvl, tausch_anzahl, item FROM wochen_markt WHERE id = $item_id;"));
$row = mysqli_fetch_array(db_query("SELECT tausch_lvl, tausch_anzahl, item FROM wochen_markt WHERE id = $item_id;"));
break;
case 'sp_ware':
$row = mysql_fetch_array(mysql_query("SELECT tausch_lvl, tausch_anzahl, name FROM sp_item WHERE id = $item_id;"));
$row = mysqli_fetch_array(db_query("SELECT tausch_lvl, tausch_anzahl, name FROM sp_item WHERE id = $item_id;"));
break;
}
return $row;
}
function getUserTransaction($user_id) {
$row = mysql_fetch_array(mysql_query('SELECT zeit, NOW() as zeit2 FROM transaktionen WHERE verkaeufer = '.$user_id.' ORDER BY zeit DESC LIMIT 1;'));
$row = mysqli_fetch_array(db_query('SELECT zeit, NOW() as zeit2 FROM transaktionen WHERE verkaeufer = '.$user_id.' ORDER BY zeit DESC LIMIT 1;'));
$day_old = $row['zeit'];
if($day_old != null) {
$day_old = substr($day_old, 8, 2);
@ -105,14 +105,14 @@ function getUserTransaction($user_id) {
function setUserTransaction($user_id, $trade_user_id, $item, $anzahl=1, $betrag=0) {
$qry = 'INSERT INTO transaktionen(kaeufer, verkaeufer, item, anzahl, betrag, zeit) VALUES ('.$trade_user_id.','.$user_id.',\''.$item.'\','.$anzahl.','.$betrag.',NOW())';
mysql_query($qry);
db_query($qry);
}
$user = $user_ida;
if ($charm == 1) {
$item_info1 = mysql_fetch_array(mysql_query("SELECT item_id, id, user FROM ware WHERE id='$item_id1' LIMIT 1"));
$item_info3 = mysql_fetch_array(mysql_query("SELECT preis, anzahl, hp, mp, starke, verteidigung, speed, s_type, type FROM item WHERE id='$item_info1[item_id]' LIMIT 1"));
$item_info1 = mysqli_fetch_array(db_query("SELECT item_id, id, user FROM ware WHERE id='$item_id1' LIMIT 1"));
$item_info3 = mysqli_fetch_array(db_query("SELECT preis, anzahl, hp, mp, starke, verteidigung, speed, s_type, type FROM item WHERE id='$item_info1[item_id]' LIMIT 1"));
$char_id1 = getChar($char_id2);
if ($item_info1['user'] != $user['id']) {
@ -158,8 +158,8 @@ if ($charm == 1) {
$new_mp = $mp1[1];
}
mysql_Query("UPDATE chars SET starke='$new_starke', verteidigung='$new_ver', speed='$new_speed', hp='$new_hp,$new_hp2', mp='$new_mp,$new_mp2' WHERE id='$char_id2' LIMIT 1");
mysql_query("DELETE FROM ware WHERE id='$item_info1[id]' LIMIT 1");
db_query("UPDATE chars SET starke='$new_starke', verteidigung='$new_ver', speed='$new_speed', hp='$new_hp,$new_hp2', mp='$new_mp,$new_mp2' WHERE id='$char_id2' LIMIT 1");
db_query("DELETE FROM ware WHERE id='$item_info1[id]' LIMIT 1");
displayErrorMessage(NULL,'Trank erfolgreich Benutzt', '<a href="index.php?as=item">weiter...</a>');
exit;
@ -171,8 +171,8 @@ if ($charm == 2) {
exit;
}
$item_info = mysql_fetch_array(mysql_query("SELECT item_id, id, user, ru_mal FROM ware WHERE id='$item_id' LIMIT 1"));
$item_info2 = mysql_fetch_array(mysql_query("SELECT preis, anzahl FROM item WHERE id='$item_info[item_id]' LIMIT 1"));
$item_info = mysqli_fetch_array(db_query("SELECT item_id, id, user, ru_mal FROM ware WHERE id='$item_id' LIMIT 1"));
$item_info2 = mysqli_fetch_array(db_query("SELECT preis, anzahl FROM item WHERE id='$item_info[item_id]' LIMIT 1"));
if ($item_info['user'] != $user_ida['id']) {
displayErrorMessage(NULL,'Dieses Item geh&ouml;rt nicht dir', displayHistoryBackLink());
@ -187,9 +187,9 @@ if ($charm == 2) {
$sql = "UPDATE user SET geld='$new_geld' WHERE id='$user[id]'";
// echo $sql.'<br>';
mysql_query($sql);
mysql_query("UPDATE item SET anzahl='$new_zahl' WHERE id='$item_info[item_id]'");
mysql_Query("DELETE FROM ware WHERE id='$item_info[id]'");
db_query($sql);
db_query("UPDATE item SET anzahl='$new_zahl' WHERE id='$item_info[item_id]'");
db_query("DELETE FROM ware WHERE id='$item_info[id]'");
displayErrorMessage(NULL,'Item erfolgreich verkauft', '<a href="index.php?as=item">weiter...</a>');
exit;
}
@ -200,7 +200,7 @@ if($charm == 3) {
displayErrorMessage(NULL,'Kein Namen für den User angegeben!', displayHistoryBackLink());
exit;
} else {
$row = mysql_fetch_array(mysql_query("SELECT id FROM user WHERE nickname='$tausch_user' LIMIT 1"));
$row = mysqli_fetch_array(db_query("SELECT id FROM user WHERE nickname='$tausch_user' LIMIT 1"));
$tausch_user_id = $row['id'];
if($tausch_user_id == null) {
displayErrorMessage(NULL,'Unbekannter User!', displayHistoryBackLink());
@ -215,16 +215,16 @@ if($charm == 3) {
$tausch_item = explode(",", $tausch_item);
if($tausch_geld != null xor $tausch_item[0] >= 0) {
if($tausch_geld != null) {
$row = mysql_fetch_array(mysql_query("SELECT level FROM arena WHERE besitzer = ".$user['id'].";"));
$row = mysqli_fetch_array(db_query("SELECT level FROM arena WHERE besitzer = ".$user['id'].";"));
$arenalvl = $row['level'];
$tausch_geld = round($tausch_geld);
if($tausch_geld <= ($arenalvl * 10000) && $tausch_geld > 0) {
if($tausch_geld <= getRelevantMoney($user['id'])) {
$qry = 'UPDATE user SET geld = geld - '.$tausch_geld.' WHERE id = '.$user['id'].';';
mysql_query($qry);
db_query($qry);
$qry = 'UPDATE user SET geld = geld + '.$tausch_geld.' WHERE id = '.$tausch_user_id.';';
mysql_query($qry);
db_query($qry);
sendMessage($user['nickname'], $tausch_user_id, 'Geschenk', 'Der Spieler '.$user['nickname'].' hat dir '.$tausch_geld.' geschenkt!');
setUserTransaction($user['id'], $tausch_user_id, 'Geld', 0, $tausch_geld);
@ -247,10 +247,10 @@ if($charm == 3) {
if($tausch_anzahl <= $row['tausch_anzahl'] && $tausch_anzahl > 0) {
if($tausch_item[1] == 'ware') {
$qry = 'UPDATE ware SET user = '.$tausch_user_id.' WHERE item_id = '.$tausch_item[0].' AND user = '.$user['id'].' LIMIT '.$tausch_anzahl.';';
mysql_query($qry);
db_query($qry);
} else {
$qry = 'UPDATE '.$tausch_item[1].' SET user = '.$tausch_user_id.' WHERE item = '.$tausch_item[0].' AND user = '.$user['id'].' LIMIT '.$tausch_anzahl.';';
mysql_query($qry);
db_query($qry);
}
sendMessage($user['nickname'], $tausch_user_id, 'Geschenk', 'Der Spieler '.$user['nickname'].' hat dir das Item '.$row['name'].$row['item'].' geschenkt!');
setUserTransaction($user['id'], $tausch_user_id, $row['item'].$row['name'], $tausch_anzahl);
@ -278,7 +278,7 @@ if($charm == 3) {
}
if ($charm == 6) {
$item_info = mysql_fetch_array(mysql_query("SELECT w.user, i.item, i.starke, i.ver, i.speed, i.ausdauer, i.hp, i.mp, i.glueck FROM wochen_ware w LEFT JOIN wochen_markt i ON(i.id=w.item) WHERE w.id='$sp_item' LIMIT 1"));
$item_info = mysqli_fetch_array(db_query("SELECT w.user, i.item, i.starke, i.ver, i.speed, i.ausdauer, i.hp, i.mp, i.glueck FROM wochen_ware w LEFT JOIN wochen_markt i ON(i.id=w.item) WHERE w.id='$sp_item' LIMIT 1"));
$char_id1 = getChar($char_id2);
if ($item_info['user'] != $user['id']) {
@ -318,8 +318,8 @@ if ($charm == 6) {
$new_ausdauer = $item_info['ausdauer'] + $char_id1['ausdauer'];
$new_glueck = $item_info['glueck'] + $char_id1['glueck'];
mysql_Query("UPDATE chars SET frucht='$item_info[item]', ausdauer='$new_ausdauer', glueck='$new_glueck', starke='$new_starke', verteidigung='$new_ver', speed='$new_speed', hp='$hp1[0],$new_hp2', mp='$mp1[0],$new_mp2' WHERE id='$char_id2' LIMIT 1");
mysql_query("DELETE FROM wochen_ware WHERE id='$sp_item' LIMIT 1");
db_query("UPDATE chars SET frucht='$item_info[item]', ausdauer='$new_ausdauer', glueck='$new_glueck', starke='$new_starke', verteidigung='$new_ver', speed='$new_speed', hp='$hp1[0],$new_hp2', mp='$mp1[0],$new_mp2' WHERE id='$char_id2' LIMIT 1");
db_query("DELETE FROM wochen_ware WHERE id='$sp_item' LIMIT 1");
displayErrorMessage(NULL,$item_info['item'].' erfolgreich benutzt', '<a href="index.php?as=item">weiter...</a>');
exit;
@ -328,8 +328,8 @@ if ($charm == 6) {
$chars = getCharsOfUser($user_ida['id']);
$sql = "SELECT item_id, count(item_id) as anzahl, user, id, ru_mal FROM ware WHERE user='$user[id]' group by item_id";
//echo $sql;
$item2 = mysql_query($sql);
$item1 = mysql_query("SELECT item_id, id, ru_mal FROM ware WHERE user='$user[id]' group by item_id");
$item2 = db_query($sql);
$item1 = db_query("SELECT item_id, id, ru_mal FROM ware WHERE user='$user[id]' group by item_id");
?>
<div align="center">
@ -356,8 +356,8 @@ $item1 = mysql_query("SELECT item_id, id, ru_mal FROM ware WHERE user='$user[id]
?>
</select> <br> <br> <select id="input" name="item_id1">
<?php
while ($row = mysql_fetch_array($item2)) {
$item_name = mysql_fetch_assoc(mysql_query('SELECT hp, mp, name, type, s_type, id FROM item WHERE id='.$row['item_id']));
while ($row = mysqli_fetch_array($item2)) {
$item_name = mysqli_fetch_assoc(db_query('SELECT hp, mp, name, type, s_type, id FROM item WHERE id='.$row['item_id']));
if ($item_name['s_type'] == "Trank") {
echo '<option value="'.$row['id'].'">'.$item_name['name'].' ('.$row['anzahl'].' mal)';
}
@ -379,8 +379,8 @@ $item1 = mysql_query("SELECT item_id, id, ru_mal FROM ware WHERE user='$user[id]
$sp_items = array(1,2,11,404,415);
$sql = 'SELECT si.name, si.id, count(sw.item) as anzahl FROM sp_item si LEFT JOIN (Select item from sp_ware where user = '.$user_ida['id'].') sw ON sw.item = si.id WHERE si.id IN ('.join(',',$sp_items).') GROUP by si.id';
// echo $sql.'<br>';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$qry = db_query($sql);
while($row = mysqli_fetch_assoc($qry)){
// 7 DBs, 1 Potara und 1 Bohne gibts derzeit
if($row['id'] == 11 && $row['anzahl'] >= 7){
echo '<a href="index.php?as=dragonballs">'.$row['name'].' einsetzen ('.$row['anzahl'].')</a><br>';
@ -412,7 +412,7 @@ $item1 = mysql_query("SELECT item_id, id, ru_mal FROM ware WHERE user='$user[id]
<option value="">Charakter ausw&auml;hlen</option>
<?php
// Speziell!!
#$char4 = mysql_query('SELECT id, name FROM chars WHERE besitzer='.$user_ida['id'].' AND type=\'Onepiece\' AND frucht is NULL');
#$char4 = db_query('SELECT id, name FROM chars WHERE besitzer='.$user_ida['id'].' AND type=\'Onepiece\' AND frucht is NULL');
$all_chars = getCharsOfUser($user_ida['id']);
foreach($all_chars as $row4) {
if($row4['type'] == 'Onepiece' && $row4['frucht'] == NULL) {
@ -422,8 +422,8 @@ $item1 = mysql_query("SELECT item_id, id, ru_mal FROM ware WHERE user='$user[id]
?>
</select> <br> <br> <select id="input" name="sp_item">
<?php
$sp_item = mysql_query("SELECT w.id, i.item FROM wochen_ware w LEFT JOIN wochen_markt i ON(w.item=i.id) WHERE w.user='$user_ida[id]'");
while ($row3 = mysql_fetch_array($sp_item)) {
$sp_item = db_query("SELECT w.id, i.item FROM wochen_ware w LEFT JOIN wochen_markt i ON(w.item=i.id) WHERE w.user='$user_ida[id]'");
while ($row3 = mysqli_fetch_array($sp_item)) {
echo "<option value='$row3[id]'>$row3[item]";
}
?>
@ -445,8 +445,8 @@ $item1 = mysql_query("SELECT item_id, id, ru_mal FROM ware WHERE user='$user[id]
name="charm" value="2"> <select id="input" name=item_id>
<option value="0">Verkaufen!</option>
<?php
while ($row = mysql_fetch_assoc($item1)) {
$item_name = mysql_fetch_assoc(mysql_query('SELECT * FROM item WHERE id='.$row['item_id']));
while ($row = mysqli_fetch_assoc($item1)) {
$item_name = mysqli_fetch_assoc(db_query('SELECT * FROM item WHERE id='.$row['item_id']));
if($item_name['s_type'] != 'Trank'){
echo '<option value="'.$row['id'].'">'.$item_name['name'].' (Typ: '.$item_name['s_type'].', Level: '.$item_name['level'].')</option>';
} else{

@ -22,11 +22,11 @@ if (!$chara_1['id'] OR !$chara_2['id']) {
}
################## Kaempfer 1
$char1_quis_item = explode(",", $chara_1['kampf_item']);
$char1_item_helm = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[0]' LIMIT 1"));
$char1_item_rustung = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[1]' LIMIT 1"));
$char1_item_schild = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[2]' LIMIT 1"));
$char1_item_schwert = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[3]' LIMIT 1"));
$char1_item_schuhe = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[4]' LIMIT 1"));
$char1_item_helm = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[0]' LIMIT 1"));
$char1_item_rustung = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[1]' LIMIT 1"));
$char1_item_schild = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[2]' LIMIT 1"));
$char1_item_schwert = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[3]' LIMIT 1"));
$char1_item_schuhe = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[4]' LIMIT 1"));
$k_hp1 = explode(",", $chara_1['hp']);
$k_mp1 = explode(",", $chara_1['mp']);
@ -56,11 +56,11 @@ $k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1['aufgeben'];
################## Kaempfer 2
$char2_quis_item = explode(",", $chara_2['kampf_item']);
$char2_item_helm = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[0]' LIMIT 1"));
$char2_item_rustung = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[1]' LIMIT 1"));
$char2_item_schild = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[2]' LIMIT 1"));
$char2_item_schwert = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[3]' LIMIT 1"));
$char2_item_schuhe = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[4]' LIMIT 1"));
$char2_item_helm = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[0]' LIMIT 1"));
$char2_item_rustung = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[1]' LIMIT 1"));
$char2_item_schild = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[2]' LIMIT 1"));
$char2_item_schwert = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[3]' LIMIT 1"));
$char2_item_schuhe = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[4]' LIMIT 1"));
$k_hp2 = explode(",", $chara_2['hp']);
$k_mp2 = explode(",", $chara_2['mp']);
@ -101,9 +101,9 @@ $runden_gif_technik2 = "";
if ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$sql = "INSERT kampf SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]', glueck1='$k_glueck[0]', glueck2='$k_glueck[1]'";
mysql_query($sql);
db_query($sql);
// echo $sql . '<br>';
if (mysql_affected_rows() == 0) {
if (db_affected_rows() == 0) {
echo '"' . $sql . '" konnte nicht ausgef&uuml;rt werden!<br>';
}
} else {
@ -131,13 +131,13 @@ $GLOBALS['kampf']['aussetzen'] = &$aussetzten_runde;
while ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$technick1 = mysqli_fetch_array(db_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20 * $technick1['aktiv']) - 20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick1 = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$technick2 = mysqli_fetch_array(db_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20 * $technick2['aktiv']) - 20;
$technick2 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick2[at_id]' LIMIT 10"));
$technick2 = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$technick2[at_id]' LIMIT 10"));
///////////////////Hier laedt er den RELOAD der technik wenn die zusammen setzung nicht stimmen sollte
include (ROOT_PATH . '/include/kampf/andere_technik.php'); /////////////////// Wenn man ne andere technik sich aussuchen will...
@ -217,9 +217,9 @@ while ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
#####################################KAMPF SYSTEM
include (ROOT_PATH . '/include/kampf/kampf_rechnung.php');
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM kampf WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
$db_query = mysqli_fetch_array(db_query("SELECT * FROM kampf WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
mysql_query("UPDATE kampf SET hp1='$db_query[hp1],$k_hp7[0]', hp2='$db_query[hp2],$k_hp7[1]', mp1='$db_query[mp1],$k_mp7[0]', mp2='$db_query[mp2],$k_mp7[1]', schaden1='$db_query[schaden1],$schaden_1', schaden2='$db_query[schaden2],$schaden_2', attacke1='$db_query[attacke1],$technick1[name]', attacke2='$db_query[attacke2],$technick2[name]', starke1='$db_query[starke1],$k_starke[0]', starke2='$db_query[starke2],$k_starke[1]', ver1='$db_query[ver1],$k_ver[0]', ver2='$db_query[ver2],$k_ver[1]', speed1='$db_query[speed1],$k_speed[0]', speed2='$db_query[speed2],$k_speed[1]', ausdauer1='$db_query[ausdauer1],$k_ausdauer[0]', ausdauer2='$db_query[ausdauer2],$k_ausdauer[1]', glueck1='$db_query[glueck1],$k_glueck[0]', glueck2='$db_query[glueck2],$k_glueck[1]' WHERE id='$db_query[id]'");
db_query("UPDATE kampf SET hp1='$db_query[hp1],$k_hp7[0]', hp2='$db_query[hp2],$k_hp7[1]', mp1='$db_query[mp1],$k_mp7[0]', mp2='$db_query[mp2],$k_mp7[1]', schaden1='$db_query[schaden1],$schaden_1', schaden2='$db_query[schaden2],$schaden_2', attacke1='$db_query[attacke1],$technick1[name]', attacke2='$db_query[attacke2],$technick2[name]', starke1='$db_query[starke1],$k_starke[0]', starke2='$db_query[starke2],$k_starke[1]', ver1='$db_query[ver1],$k_ver[0]', ver2='$db_query[ver2],$k_ver[1]', speed1='$db_query[speed1],$k_speed[0]', speed2='$db_query[speed2],$k_speed[1]', ausdauer1='$db_query[ausdauer1],$k_ausdauer[0]', ausdauer2='$db_query[ausdauer2],$k_ausdauer[1]', glueck1='$db_query[glueck1],$k_glueck[0]', glueck2='$db_query[glueck2],$k_glueck[1]' WHERE id='$db_query[id]'");
$x++;
}
@ -323,8 +323,8 @@ if ($sieger == $chara_1['name']) {
}
// Umsatzsteuer (auf alles, dafür is ja der Freibetrag höher) :)
mysql_query('Update arena set einnahmen = einnahmen + '.$k_geld[0].' WHERE besitzer = '.$chara_1['besitzer']);
mysql_query('Update arena set einnahmen = einnahmen + '.$k_geld[1].' WHERE besitzer = '.$chara_2['besitzer']);
db_query('Update arena set einnahmen = einnahmen + '.$k_geld[0].' WHERE besitzer = '.$chara_1['besitzer']);
db_query('Update arena set einnahmen = einnahmen + '.$k_geld[1].' WHERE besitzer = '.$chara_2['besitzer']);
/*
// Das ist der Teil, der an das Heim-Team geht und versteuert werden muss! 10%
@ -336,25 +336,25 @@ $dauer_Z = time() + ($kampf_info['zeit_rec']);
$arena_exp_new = round(50 * ($chara_1['level'] + $chara_2['level']) * ($exp001 / 3));
mysql_query("UPDATE kampf SET preis='$nw_preis', art='$kampf_info[art]', art2='$kampf_info[rasse]', exp1='$k_exp[0]', arena_name = '$arena_data[id]', win='$sieger', lose='$verlierer', exp2='$k_exp[1]', geld1='$k_geld[0]', geld2='$k_geld[1]', loge='$arena[loge]' , sitz='$arena[sitz]', steh='$arena[steh]', db_satz='$chara_1[id]', dauer='$dauer_Z', arena_exp=$arena_exp_new, loge = $arena_data[loge], sitz = $arena_data[sitz], steh = $arena_data[steh] , arena_geld = $arena_geld WHERE id='$db_query[id]'");
db_query("UPDATE kampf SET preis='$nw_preis', art='$kampf_info[art]', art2='$kampf_info[rasse]', exp1='$k_exp[0]', arena_name = '$arena_data[id]', win='$sieger', lose='$verlierer', exp2='$k_exp[1]', geld1='$k_geld[0]', geld2='$k_geld[1]', loge='$arena[loge]' , sitz='$arena[sitz]', steh='$arena[steh]', db_satz='$chara_1[id]', dauer='$dauer_Z', arena_exp=$arena_exp_new, loge = $arena_data[loge], sitz = $arena_data[sitz], steh = $arena_data[steh] , arena_geld = $arena_geld WHERE id='$db_query[id]'");
$db_query2 = mysql_fetch_array(mysql_query("SELECT * FROM kampf WHERE char1='$chara_1[id]' order by id DESC LIMIT 1"));
$db_query2 = mysqli_fetch_array(db_query("SELECT * FROM kampf WHERE char1='$chara_1[id]' order by id DESC LIMIT 1"));
mysql_query("UPDATE chars SET status='Kampf' WHERE id='$chara_1[id]'");
db_query("UPDATE chars SET status='Kampf' WHERE id='$chara_1[id]'");
/////wenn npcs kaempfen
if ($kampf_info['rasse'] != "NPC") {
$sql = "INSERT kampf SET preis='$nw_preis', art='$kampf_info[art]', art2='$kampf_info[rasse]', hp1='$db_query2[hp1]', hp2='$db_query2[hp2]', mp1='$db_query2[mp1]', mp2='$db_query2[mp2]', attacke1='$db_query2[attacke1]', attacke2='$db_query2[attacke2]', schaden1='$db_query2[schaden1]', schaden2='$db_query2[schaden2]', char1='$db_query2[char1]', char2='$db_query2[char2]', starke1='$db_query2[starke1]', starke2='$db_query2[starke2]', ver1='$db_query2[ver1]', ver2='$db_query2[ver2]', speed1='$db_query2[speed1]',speed2='$db_query2[speed2]', ausdauer1='$db_query2[ausdauer1]', ausdauer2='$db_query2[ausdauer2]', glueck1='$db_query2[glueck1]', glueck2='$db_query2[glueck2]', exp1='$db_query2[exp1]', exp2='$db_query2[exp2]', geld1='$db_query2[geld1]', geld2='$db_query2[geld2]', loge='$db_query2[loge]', sitz=$db_query2[sitz], steh=$db_query2[steh], win='$db_query2[win]', lose='$db_query2[lose]', dauer='$dauer_Z', db_satz ='$chara_2[id]', arena_name='$db_query2[arena_name]', arena_exp=$arena_exp_new, arena_geld='$db_query2[arena_geld]'";
mysql_query($sql);
db_query($sql);
// echo $sql . '<br>';
if (mysql_affected_rows() == 0) {
if (db_affected_rows() == 0) {
echo '"' . $sql . '" konnte nicht ausgef&uuml;rt werden!<br>';
}
mysql_query("UPDATE chars SET status='Kampf' WHERE id='$chara_2[id]'");
mysql_query("DELETE FROM kampf_list WHERE id='$kampf_info[id]'");
db_query("UPDATE chars SET status='Kampf' WHERE id='$chara_2[id]'");
db_query("DELETE FROM kampf_list WHERE id='$kampf_info[id]'");
mysql_query("INSERT top_kampf SET preis='$nw_preis', art='$kampf_info[art]', art2='$kampf_info[rasse]', hp1='$db_query2[hp1]', hp2='$db_query2[hp2]', mp1='$db_query2[mp1]', mp2='$db_query2[mp2]', attacke1='$db_query2[attacke1]', attacke2='$db_query2[attacke2]', schaden1='$db_query2[schaden1]', schaden2='$db_query2[schaden2]', char1='$db_query2[char1]', char2='$db_query2[char2]', starke1='$db_query2[starke1]', starke2='$db_query2[starke2]', ver1='$db_query2[ver1]', ver2='$db_query2[ver2]', speed1='$db_query2[speed1]',speed2='$db_query2[speed2]', ausdauer1='$db_query2[ausdauer1]', ausdauer2='$db_query2[ausdauer2]', glueck1='$db_query2[glueck1]', glueck2='$db_query2[glueck2]', exp1='$db_query2[exp1]', exp2='$db_query2[exp2]', geld1='$db_query2[geld1]', geld2='$db_query2[geld2]', loge='$db_query2[loge]', sitz=$db_query2[sitz], steh=$db_query2[steh], win='$db_query2[win]', lose='$db_query2[lose]', arena_name='$db_query2[arena_name]', arena_exp='$db_query2[arena_exp]', dauer='$dauer_Z', db_satz ='$chara_2[id]'");
db_query("INSERT top_kampf SET preis='$nw_preis', art='$kampf_info[art]', art2='$kampf_info[rasse]', hp1='$db_query2[hp1]', hp2='$db_query2[hp2]', mp1='$db_query2[mp1]', mp2='$db_query2[mp2]', attacke1='$db_query2[attacke1]', attacke2='$db_query2[attacke2]', schaden1='$db_query2[schaden1]', schaden2='$db_query2[schaden2]', char1='$db_query2[char1]', char2='$db_query2[char2]', starke1='$db_query2[starke1]', starke2='$db_query2[starke2]', ver1='$db_query2[ver1]', ver2='$db_query2[ver2]', speed1='$db_query2[speed1]',speed2='$db_query2[speed2]', ausdauer1='$db_query2[ausdauer1]', ausdauer2='$db_query2[ausdauer2]', glueck1='$db_query2[glueck1]', glueck2='$db_query2[glueck2]', exp1='$db_query2[exp1]', exp2='$db_query2[exp2]', geld1='$db_query2[geld1]', geld2='$db_query2[geld2]', loge='$db_query2[loge]', sitz=$db_query2[sitz], steh=$db_query2[steh], win='$db_query2[win]', lose='$db_query2[lose]', arena_name='$db_query2[arena_name]', arena_exp='$db_query2[arena_exp]', dauer='$dauer_Z', db_satz ='$chara_2[id]'");
}
?>

@ -31,10 +31,10 @@ if (!isUserOwnerOf($user['id'], $char_id)) {
exit;
}
$kampf1 = mysql_Fetch_array(mysql_query("SELECT * FROM kampf WHERE db_satz='$char_id' order by id DESC LIMIT 1"));
$kampf1 = mysqli_fetch_array(db_query("SELECT * FROM kampf WHERE db_satz='$char_id' order by id DESC LIMIT 1"));
$char_1 = getChar($kampf1['char1']);
$char_2 = getChar($kampf1['char2']);
$arena = mysql_Fetch_array(mysql_query("SELECT * FROM arena WHERE id='$kampf1[arena_name]' LIMIT 1"));
$arena = mysqli_fetch_array(db_query("SELECT * FROM arena WHERE id='$kampf1[arena_name]' LIMIT 1"));
$ressource = 'Kampf:' . $kampf1['id'];
if (!semaphoreUP($ressource)) {
@ -54,8 +54,8 @@ if (!checkAbholcode($char_id, $code)) {
exit;
}
mysql_query('DELETE FROM kampf WHERE db_satz='.$char_id);
if (mysql_affected_rows() == 0) {
db_query('DELETE FROM kampf WHERE db_satz='.$char_id);
if (db_affected_rows() == 0) {
displayErrorMessage(NULL, 'Der Kampf wurde schon abgeholt!', displayHistoryBackLink());
semaphoreDown($ressource);
exit;
@ -132,7 +132,7 @@ if ($kampf1['id']) {
if ($new_mp > $a_mp1[1]) {
$new_mp = $a_mp1[1];
}
mysql_query("UPDATE chars SET status='Frei', mp='$new_mp,$a_mp1[1]', hp='$new_hp,$a_hp1[1]' WHERE id='$char_id' LIMIT 1");
db_query("UPDATE chars SET status='Frei', mp='$new_mp,$a_mp1[1]', hp='$new_hp,$a_hp1[1]' WHERE id='$char_id' LIMIT 1");
} else {
$new_exp = $kampf1['exp2'];
$new_geld = $user['geld'] + $kampf1['geld2'];
@ -153,7 +153,7 @@ if ($kampf1['id']) {
$new_mp = $a_mp2[1];
}
mysql_query("UPDATE chars SET status='Frei', mp='$new_mp,$a_mp2[1]', hp='$new_hp,$a_hp2[1]' WHERE id='$char_id' LIMIT 1");
db_query("UPDATE chars SET status='Frei', mp='$new_mp,$a_mp2[1]', hp='$new_hp,$a_hp2[1]' WHERE id='$char_id' LIMIT 1");
}
@ -164,9 +164,9 @@ if ($kampf1['id']) {
////////NPC item verteilung
if ($kampf1['art2'] == "NPC") {
$item = mysql_fetch_array(mysql_query('SELECT item, mal, datensatz, wieviel, feld FROM npc_item WHERE charakter='.$kampf1['char2'].';'));
$item = mysqli_fetch_array(db_query('SELECT item, mal, datensatz, wieviel, feld FROM npc_item WHERE charakter='.$kampf1['char2'].';'));
$schon_bekommen = mysql_fetch_assoc(mysql_query("SELECT Count(*) as anzahl FROM npc_ware WHERE charakter='$kampf1[char2]' AND user='$user_ida[id]'"));
$schon_bekommen = mysqli_fetch_assoc(db_query("SELECT Count(*) as anzahl FROM npc_ware WHERE charakter='$kampf1[char2]' AND user='$user_ida[id]'"));
if ($schon_bekommen['anzahl'] >= $item['mal']) {
/////item schon bekommen
@ -184,12 +184,12 @@ if ($kampf1['id']) {
$chars = getCharsOfUser($user_ida['id']);
foreach ($chars as $tmp_char) {
$values = explode(',', $tmp_char[$item['feld']]);
mysql_query('UPDATE '.$item['datensatz'].' SET '.$item['feld'].'=\''.$values[0].','.($values[1]+$item['wieviel']).'\' WHERE besitzer='.$user_ida['id'].' AND id='.$tmp_char['id']);
db_query('UPDATE '.$item['datensatz'].' SET '.$item['feld'].'=\''.$values[0].','.($values[1]+$item['wieviel']).'\' WHERE besitzer='.$user_ida['id'].' AND id='.$tmp_char['id']);
}
} else {
mysql_query("UPDATE $item[datensatz] SET $item[feld]=$item[feld]+'$item[wieviel]' WHERE besitzer='$user_ida[id]' LIMIT 10");
db_query("UPDATE $item[datensatz] SET $item[feld]=$item[feld]+'$item[wieviel]' WHERE besitzer='$user_ida[id]' LIMIT 10");
}
mysql_query("INSERT npc_ware SET user='$user_ida[id]', charakter='$kampf1[char2]'");
db_query("INSERT npc_ware SET user='$user_ida[id]', charakter='$kampf1[char2]'");
} else {
$satz = "item";
$new_item = "sp_item";
@ -201,7 +201,7 @@ if ($kampf1['id']) {
} else {
$ut = 0;
while ($ut < $item['wieviel']) {
mysql_query("INSERT $item[datensatz] SET $satz='$item[item]', user='$user_ida[id]'");
db_query("INSERT $item[datensatz] SET $satz='$item[item]', user='$user_ida[id]'");
if (!$ut) {
$itemname = $item['item'];
@ -211,13 +211,13 @@ if ($kampf1['id']) {
$ut++;
}
mysql_query("INSERT npc_ware SET user='$user_ida[id]', charakter='$kampf1[char2]'");
db_query("INSERT npc_ware SET user='$user_ida[id]', charakter='$kampf1[char2]'");
}
}
}
///ENDE
mysql_query("UPDATE chars SET siege='$new_siege' WHERE id='$char_id'");
db_query("UPDATE chars SET siege='$new_siege' WHERE id='$char_id'");
} else {
###################################################CHARAKTER LOSE
@ -238,7 +238,7 @@ if ($kampf1['id']) {
//-->
</script>";
$new_preis = 0;
mysql_query("UPDATE chars SET status='Tod' WHERE id='$char_id'");
db_query("UPDATE chars SET status='Tod' WHERE id='$char_id'");
} else {
@ -248,7 +248,7 @@ if ($kampf1['id']) {
}
mysql_query("UPDATE chars SET niederlagen='$new_niederlagen', liga_niederlagen='$new_liga_niederlagen', preis='$new_preis', dead_list='$new_dead_list' WHERE id='$char_id'");
db_query("UPDATE chars SET niederlagen='$new_niederlagen', liga_niederlagen='$new_liga_niederlagen', preis='$new_preis', dead_list='$new_dead_list' WHERE id='$char_id'");
}
@ -258,26 +258,26 @@ if ($kampf1['id']) {
// Leveln der Arena :) (Um Rundungsfehler zu vermeiden diese umstaendliche Rechnung)
addExpToArena($char_2['besitzer'], $kampf1['arena_exp']-round($kampf1['arena_exp']*0.25));
// Umsatz wird schon vorher ermittelt :)
// mysql_query('UPDATE arena SET einnahmen = einnahmen + '.$kampf1['arena_geld'].' WHERE besitzer='.$char_2['besitzer']);
// db_query('UPDATE arena SET einnahmen = einnahmen + '.$kampf1['arena_geld'].' WHERE besitzer='.$char_2['besitzer']);
// include_once (ROOT_PATH . '/include/arena_exp.php');
} else{
addExpToArena($char_1['besitzer'], round($kampf1['arena_exp']*0.25));
}
$row = mysql_fetch_assoc(mysql_query('Select mietlasten FROM arena WHERE besitzer='.$user['id']));
$row = mysqli_fetch_assoc(db_query('Select mietlasten FROM arena WHERE besitzer='.$user['id']));
if($row['mietlasten'] > 2){
// Steuerschulden
$tilgung = ceil($new_geld_offset * 0.75);
$restgeld = $new_geld_offset - $tilgung;
mysql_query('UPDATE user SET geld=geld+'.$restgeld.' WHERE id= '.$user['id']);
db_query('UPDATE user SET geld=geld+'.$restgeld.' WHERE id= '.$user['id']);
echo '<script type="text/javascript">alert("Da du 3 Tage hintereinander nicht deine Umsatzsteuerverbindlichkeit beglichen hast wird ab jetzt automatisch von jedem Kampf ein Teil zur Tilgung verwendet. Daher fliessen '.$tilgung.' zum Gl&auml;biger");</script>';
mysql_query('UPDATE arena SET steuerlasten = steuerlasten - '.$tilgung. ' WHERE besitzer ='.$user['id']);
db_query('UPDATE arena SET steuerlasten = steuerlasten - '.$tilgung. ' WHERE besitzer ='.$user['id']);
} else{
mysql_query('UPDATE user SET geld=' . $new_geld . ' WHERE id=' . $user['id'] . ' LIMIT 1');
db_query('UPDATE user SET geld=' . $new_geld . ' WHERE id=' . $user['id'] . ' LIMIT 1');
}
// mysql_query("DELETE FROM kampf_nachricht WHERE charakter='$char_id'");
// db_query("DELETE FROM kampf_nachricht WHERE charakter='$char_id'");
// include_once (ROOT_PATH . '/include/exp.php');
@ -309,10 +309,10 @@ if ($kampf1['id']) {
addAttackUsageToChar($char_id, $l_attacken);
if ($itemname) {
$item_names = mysql_query("SELECT name FROM $new_item WHERE id IN(" . $itemname . ")");
$item_names = db_query("SELECT name FROM $new_item WHERE id IN(" . $itemname . ")");
$x2 = 0;
while ($new_row = @ mysql_fetch_array($item_names)) {
while ($new_row = @ mysqli_fetch_array($item_names)) {
print " <script language='JavaScript'>
<!--
alert('$new_row[name] $item[wieviel]x erhalten');

@ -20,11 +20,11 @@ if (!$chara_1['id'] OR !$chara_2['id']) {
}
################## Kaempfer 1
$char1_quis_item = explode(",", $chara_1['kampf_item']);
$char1_item_helm = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[0]' LIMIT 1"));
$char1_item_rustung = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[1]' LIMIT 1"));
$char1_item_schild = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[2]' LIMIT 1"));
$char1_item_schwert = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[3]' LIMIT 1"));
$char1_item_schuhe = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[4]' LIMIT 1"));
$char1_item_helm = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[0]' LIMIT 1"));
$char1_item_rustung = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[1]' LIMIT 1"));
$char1_item_schild = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[2]' LIMIT 1"));
$char1_item_schwert = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[3]' LIMIT 1"));
$char1_item_schuhe = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[4]' LIMIT 1"));
$k_hp1 = explode(",", $chara_1['hp']);
$k_mp1 = explode(",", $chara_1['mp']);
@ -54,11 +54,11 @@ $k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1['aufgeben'];
################## Kaempfer 2
$char2_quis_item = explode(",", $chara_2['kampf_item']);
$char2_item_helm = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[0]' LIMIT 1"));
$char2_item_rustung = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[1]' LIMIT 1"));
$char2_item_schild = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[2]' LIMIT 1"));
$char2_item_schwert = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[3]' LIMIT 1"));
$char2_item_schuhe = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[4]' LIMIT 1"));
$char2_item_helm = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[0]' LIMIT 1"));
$char2_item_rustung = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[1]' LIMIT 1"));
$char2_item_schild = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[2]' LIMIT 1"));
$char2_item_schwert = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[3]' LIMIT 1"));
$char2_item_schuhe = mysqli_fetch_array(db_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[4]' LIMIT 1"));
$k_hp2 = explode(",", $chara_2['hp']);
$k_mp2 = explode(",", $chara_2['mp']);
@ -117,9 +117,9 @@ $GLOBALS['kampf']['aussetzen'] = &$aussetzten_runde;
if ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$sql = "INSERT clan_fights SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]', clanfight_id='$clanfight_id', runde='$runde', kampf='$kampf'";
mysql_query($sql);
db_query($sql);
// echo $sql . '<br>';
if (mysql_affected_rows() == 0) {
if (db_affected_rows() == 0) {
echo '"' . $sql . '" konnte nicht ausgef&uuml;rt werden!<br>';
}
} else {
@ -129,13 +129,13 @@ if ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
while ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$technick1 = mysqli_fetch_array(db_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20 * $technick1['aktiv']) - 20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick1 = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$technick2 = mysqli_fetch_array(db_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20 * $technick2['aktiv']) - 20;
$technick2 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick2[at_id]' LIMIT 10"));
$technick2 = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$technick2[at_id]' LIMIT 10"));
///////////////////Hier laedt er den RELOAD der technik wenn die zusammen setzung nicht stimmen sollte
include (ROOT_PATH . '//include/kampf/andere_technik.php'); /////////////////// Wenn man ne andere technik sich aussuchen will...
@ -192,9 +192,9 @@ while ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
#####################################KAMPF SYSTEM
include (ROOT_PATH . '//include/kampf/kampf_rechnung.php');
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM clan_fights WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') order by id DESC LIMIT 1"));
$db_query = mysqli_fetch_array(db_query("SELECT * FROM clan_fights WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') order by id DESC LIMIT 1"));
mysql_query("UPDATE clan_fights SET hp1='$db_query[hp1],$k_hp7[0]', hp2='$db_query[hp2],$k_hp7[1]', mp1='$db_query[mp1],$k_mp7[0]', mp2='$db_query[mp2],$k_mp7[1]', schaden1='$db_query[schaden1],$schaden_1', schaden2='$db_query[schaden2],$schaden_2', attacke1='$db_query[attacke1],$technick1[name]', attacke2='$db_query[attacke2],$technick2[name]', starke1='$db_query[starke1],$k_starke[0]', starke2='$db_query[starke2],$k_starke[1]', ver1='$db_query[ver1],$k_ver[0]', ver2='$db_query[ver2],$k_ver[1]', speed1='$db_query[speed1],$k_speed[0]', speed2='$db_query[speed2],$k_speed[1]', ausdauer1='$db_query[ausdauer1],$k_ausdauer[0]', ausdauer2='$db_query[ausdauer2],$k_ausdauer[1]' WHERE id='$db_query[id]'");
db_query("UPDATE clan_fights SET hp1='$db_query[hp1],$k_hp7[0]', hp2='$db_query[hp2],$k_hp7[1]', mp1='$db_query[mp1],$k_mp7[0]', mp2='$db_query[mp2],$k_mp7[1]', schaden1='$db_query[schaden1],$schaden_1', schaden2='$db_query[schaden2],$schaden_2', attacke1='$db_query[attacke1],$technick1[name]', attacke2='$db_query[attacke2],$technick2[name]', starke1='$db_query[starke1],$k_starke[0]', starke2='$db_query[starke2],$k_starke[1]', ver1='$db_query[ver1],$k_ver[0]', ver2='$db_query[ver2],$k_ver[1]', speed1='$db_query[speed1],$k_speed[0]', speed2='$db_query[speed2],$k_speed[1]', ausdauer1='$db_query[ausdauer1],$k_ausdauer[0]', ausdauer2='$db_query[ausdauer2],$k_ausdauer[1]' WHERE id='$db_query[id]'");
$x++;
}
@ -217,6 +217,6 @@ if ($k_hp[0] < $k_aufgabe[0] OR $k_hp[0] < $k_hp[1]) {
$verlierer = $chara_1['id'];
}
mysql_query("UPDATE clan_fights SET win='$sieger', lose='$verlierer' WHERE id='$db_query[id]'");
db_query("UPDATE clan_fights SET win='$sieger', lose='$verlierer' WHERE id='$db_query[id]'");
?>

@ -75,12 +75,12 @@ function starteFight($chara_1, $chara_2, $kampf_info){
function erstelleEinenFight($charid, &$user, $kampf_name, $kampf_pw, $kampf_zeit, $lvl){
// Ermittle ob der User eine Funktionierende Arena besitzt!
$qry = mysql_query('Select * from arena where besitzer = '.$user['id']);
if(mysql_num_rows($qry) == 0){
mysql_query('INSERT arena(besitzer, exp) values (\''.$user_ida['id'].'\', \'0,'.calculateRequiredExpArena(1).'\')');
$arena = mysql_query('Select * from arena where besitzer = '.$user['id']);
$qry = db_query('Select * from arena where besitzer = '.$user['id']);
if(mysqli_stmt_num_rows($qry) == 0){
db_query('INSERT arena(besitzer, exp) values (\''.$user_ida['id'].'\', \'0,'.calculateRequiredExpArena(1).'\')');
$arena = db_query('Select * from arena where besitzer = '.$user['id']);
}
$arena = mysql_fetch_assoc($qry);
$arena = mysqli_fetch_assoc($qry);
if($arena['mietlasten'] > 6){
displayErrorMessage('Kampf erstellen nicht M&ouml;glich!', 'Ihre Arena ist geschlossen', displayHistoryBackLink());
return;
@ -112,7 +112,7 @@ function erstelleEinenFight($charid, &$user, $kampf_name, $kampf_pw, $kampf_zeit
}
$w_zeit = time() + 43200;
mysql_query('UPDATE chars SET status=\'Kampf Erstellt\' WHERE id='.$charid);
db_query('UPDATE chars SET status=\'Kampf Erstellt\' WHERE id='.$charid);
if($lvl != 0){
$sql = 'INSERT INTO kampf_list(lvlmin, lvlmax, kampfname, charakter, passwort, besitzer, zeit, zeit_rec, ip) values ('.($char_a['level']-$lvl).', '.($char_a['level']+$lvl).', \''.$kampf_name.'\', '.$charid.', \''.$kampf_pw.'\', \''.$user['nickname'].'\', '.$w_zeit.', '.$kampf_zeit.', \''.$_SERVER['REMOTE_ADDR'].'\')';
} else{
@ -120,9 +120,9 @@ function erstelleEinenFight($charid, &$user, $kampf_name, $kampf_pw, $kampf_zeit
}
// echo $sql.'<br';
mysql_query($sql);
db_query($sql);
if($kampf_pw != '' && !is_null($kampf_pw)){
mysql_query('UPDATE user SET pw_fight=pw_fight-1 WHERE id='.$user['id']);
db_query('UPDATE user SET pw_fight=pw_fight-1 WHERE id='.$user['id']);
$user['pw_fight']--;
}
@ -167,10 +167,10 @@ function nehmeKampfAn($user, $charid, $kampf_id, $kampf_pw){
}
$sql = 'SELECT * FROM kampf_list where id = '.$kampf_id.' AND ('.$char_a['level'].' between lvlmin and lvlmax OR lvlmax = 0) AND ip != \''.$_SERVER['REMOTE_ADDR'].'\' AND (passwort = \'\' OR passwort = \''.$kampf_pw.'\')';
// echo $sql.'<br>';
$fight_row = mysql_fetch_assoc(mysql_query($sql));
$fight_row = mysqli_fetch_assoc(db_query($sql));
if(!$fight_row){
$fight_row = mysql_fetch_assoc(mysql_query('SELECT * FROM kampf_list where id = '.$kampf_id));
$fight_row = mysqli_fetch_assoc(db_query('SELECT * FROM kampf_list where id = '.$kampf_id));
if(!$fight_row){
displayErrorMessage(NULL,'Kampf existiert nicht mehr!', displayHistoryBackLink());
} else if($_SERVER['REMOTE_ADDR'] == $fight_row['ip']){
@ -242,13 +242,13 @@ function nehmeAutofightAn($user, $charid, $kampf_name, $kampf_zeit, $lvl){
// Nur mal die ID-Liste ausgeben
// echo $sql.'<br>';
$qry = mysql_query($sql);
$qry = db_query($sql);
$fight_row = NULL;
while($row = mysql_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
$ressource = 'Kampf:'.$row['id'];
// Wichtig, die Semaphore!!
if(semaphoreUP($ressource)){ // TRUE, diese Anfrage darf bearbeitet werden
$fight_row = mysql_fetch_assoc(mysql_query('SELECT * FROM kampf_list where id = '.$row['id']));
$fight_row = mysqli_fetch_assoc(db_query('SELECT * FROM kampf_list where id = '.$row['id']));
if($fight_row){
break;
}
@ -445,11 +445,11 @@ function displayAutoFights($user, $portal, $pagenum){
function displayKampfErstellen($user, $portal, $pagenum){
$meta_data = getUserMetaData($user['id']);
// Ermittle ob der User eine Funktionierende Arena besitzt!
$qry = mysql_query('Select * from arena where besitzer = '.$user['id']);
$arena = mysql_fetch_assoc($qry);
if(mysql_num_rows($qry) == 0){
mysql_query('INSERT arena(besitzer, exp) values (\''.$user_ida['id'].'\', \'0,'.calculateRequiredExpArena(1).'\')');
$arena = mysql_fetch_assoc(mysql_query('Select * from arena where besitzer = '.$user['id']));
$qry = db_query('Select * from arena where besitzer = '.$user['id']);
$arena = mysqli_fetch_assoc($qry);
if(mysqli_stmt_num_rows($qry) == 0){
db_query('INSERT arena(besitzer, exp) values (\''.$user_ida['id'].'\', \'0,'.calculateRequiredExpArena(1).'\')');
$arena = mysqli_fetch_assoc(db_query('Select * from arena where besitzer = '.$user['id']));
}
if($arena['mietlasten'] > 7){
displayErrorMessage('Kampf erstellen nicht M&ouml;glich!', 'Ihre Arena ist geschlossen', displayHistoryBackLink());
@ -565,23 +565,23 @@ function display($user, $portal, $pagenum){
<?php
if($portal == 'NPC') {
$kampf_l = mysql_query('SELECT n.mal, k.rasse, k.id, k.passwort, k.kampfname, k.lvlmin, k.lvlmax, k.zeit_rec, k.besitzer, k.charakter ,a.name as a_name, a.level as a_level, a.luxus, a.loge, a.steh, a.sitz FROM kampf_list k LEFT JOIN chars c ON(c.id=k.charakter) LEFT JOIN npc_item n ON(n.charakter=c.id) inner join arena a ON a.besitzer = c.besitzer WHERE k.rasse=\'NPC\' ORDER BY c.level');
$total = mysql_fetch_row(mysql_query('SELECT count(*) FROM kampf_list WHERE rasse=\'NPC\''));
$kampf_l = db_query('SELECT n.mal, k.rasse, k.id, k.passwort, k.kampfname, k.lvlmin, k.lvlmax, k.zeit_rec, k.besitzer, k.charakter ,a.name as a_name, a.level as a_level, a.luxus, a.loge, a.steh, a.sitz FROM kampf_list k LEFT JOIN chars c ON(c.id=k.charakter) LEFT JOIN npc_item n ON(n.charakter=c.id) inner join arena a ON a.besitzer = c.besitzer WHERE k.rasse=\'NPC\' ORDER BY c.level');
$total = mysqli_fetch_row(db_query('SELECT count(*) FROM kampf_list WHERE rasse=\'NPC\''));
$total = $total[0];
$entriesPerPage = $total;
} else if($portal == 'LVL'){
$entriesPerPage = 10;
$kampf_l = mysql_query('SELECT k.id, k.passwort, k.kampfname, k.lvlmin, k.lvlmax, k.zeit_rec, k.besitzer, k.charakter, a.name as a_name, a.level as a_level, a.luxus, a.loge, a.steh, a.sitz FROM kampf_list k LEFT JOIN chars c ON(c.id=k.charakter) inner join arena a ON a.besitzer = c.besitzer WHERE k.rasse=\'ALL\' and k.lvlmax != 0 or passwort != \'\' ORDER BY k.id ASC LIMIT '.$pagenum*$entriesPerPage.','.$entriesPerPage);
$total = mysql_fetch_row(mysql_query('SELECT count(*) FROM kampf_list WHERE rasse=\'ALL\' and lvlmax != 0 or passwort != \'\''));
$kampf_l = db_query('SELECT k.id, k.passwort, k.kampfname, k.lvlmin, k.lvlmax, k.zeit_rec, k.besitzer, k.charakter, a.name as a_name, a.level as a_level, a.luxus, a.loge, a.steh, a.sitz FROM kampf_list k LEFT JOIN chars c ON(c.id=k.charakter) inner join arena a ON a.besitzer = c.besitzer WHERE k.rasse=\'ALL\' and k.lvlmax != 0 or passwort != \'\' ORDER BY k.id ASC LIMIT '.$pagenum*$entriesPerPage.','.$entriesPerPage);
$total = mysqli_fetch_row(db_query('SELECT count(*) FROM kampf_list WHERE rasse=\'ALL\' and lvlmax != 0 or passwort != \'\''));
$total = $total[0];
} else{
$entriesPerPage = 10;
$kampf_l = mysql_query('SELECT k.id, k.passwort, k.kampfname, k.lvlmin, k.lvlmax, k.zeit_rec, k.besitzer, k.charakter, a.name as a_name, a.level as a_level, a.luxus, a.loge, a.steh, a.sitz FROM kampf_list k LEFT JOIN chars c ON(c.id=k.charakter) inner join arena a ON a.besitzer = c.besitzer WHERE k.rasse=\'ALL\' and k.lvlmax = 0 and passwort = \'\' ORDER BY k.id ASC LIMIT '.$pagenum*$entriesPerPage.','.$entriesPerPage);
$total = mysql_fetch_row(mysql_query('SELECT count(*) FROM kampf_list WHERE rasse=\'ALL\' and lvlmax = 0 and passwort = \'\''));
$kampf_l = db_query('SELECT k.id, k.passwort, k.kampfname, k.lvlmin, k.lvlmax, k.zeit_rec, k.besitzer, k.charakter, a.name as a_name, a.level as a_level, a.luxus, a.loge, a.steh, a.sitz FROM kampf_list k LEFT JOIN chars c ON(c.id=k.charakter) inner join arena a ON a.besitzer = c.besitzer WHERE k.rasse=\'ALL\' and k.lvlmax = 0 and passwort = \'\' ORDER BY k.id ASC LIMIT '.$pagenum*$entriesPerPage.','.$entriesPerPage);
$total = mysqli_fetch_row(db_query('SELECT count(*) FROM kampf_list WHERE rasse=\'ALL\' and lvlmax = 0 and passwort = \'\''));
$total = $total[0];
}
while($row = mysql_fetch_array($kampf_l)) {
while($row = mysqli_fetch_array($kampf_l)) {
$char = getChar($row['charakter']);
if($row['passwort']){
$pw_exe = 'pass1';
@ -629,7 +629,7 @@ function display($user, $portal, $pagenum){
<td id="content" align="center">
<?php
if($row['rasse'] == 'NPC') {
$anzahl_min = mysql_fetch_row(mysql_query('SELECT count(id) FROM npc_ware WHERE charakter=\''.$row['charakter'].'\' AND user='.$user['id'].' LIMIT 50'));
$anzahl_min = mysqli_fetch_row(db_query('SELECT count(id) FROM npc_ware WHERE charakter=\''.$row['charakter'].'\' AND user='.$user['id'].' LIMIT 50'));
$anzahl_min = $anzahl_min[0];
echo 'geschafft ('.$anzahl_min.'/'.$row['mal'].')<br>';
} else {
@ -717,7 +717,7 @@ function zieheKampfZurueck($user, $kampf_id){
return;
}
$kampf_a = mysql_fetch_assoc(mysql_query('SELECT * FROM kampf_list where id = '.$kampf_id));
$kampf_a = mysqli_fetch_assoc(db_query('SELECT * FROM kampf_list where id = '.$kampf_id));
if(!$kampf_a){
displayErrorMessage(NULL,'Kampf ist nicht mehr vorhanden! ('.$kampf_a['charakter'].')', displayHistoryBackLink());
return;
@ -746,10 +746,10 @@ function zieheKampfZurueck($user, $kampf_id){
return;
}
mysql_query('DELETE FROM kampf_list WHERE id = '.$kampf_id);
mysql_query('UPDATE chars SET status = \'Frei\' WHERE id ='.$char_id);
db_query('DELETE FROM kampf_list WHERE id = '.$kampf_id);
db_query('UPDATE chars SET status = \'Frei\' WHERE id ='.$char_id);
if($kampf_a['kampf_pw'] !== '' || $kampf_a['kampf_pw'] !== NULL){
mysql_query('UPDATE user SET pw_fight = pw_fight + 1 WHERE id ='.$user['id']);
db_query('UPDATE user SET pw_fight = pw_fight + 1 WHERE id ='.$user['id']);
}
semaphoreDown($ressource2);
semaphoreDown($ressource1);

@ -31,7 +31,7 @@ test += id;
<?php
$ne = time();
$last_fight = mysql_query("SELECT char1, char2, id FROM top_kampf WHERE dauer < '$ne' ORDER BY id DESC LIMIT 20");
$last_fight = db_query("SELECT char1, char2, id FROM top_kampf WHERE dauer < '$ne' ORDER BY id DESC LIMIT 20");
?>
<tr>
<td width="761" height="8" colspan="3">
@ -41,7 +41,7 @@ $last_fight = mysql_query("SELECT char1, char2, id FROM top_kampf WHERE dauer <
</tr>
<?php
while ($row = mysql_fetch_array($last_fight)) {
while ($row = mysqli_fetch_array($last_fight)) {
$char1 = getChar($row['char1']);
$char2 = getChar($row['char2']);
?>

@ -24,17 +24,17 @@ $kampf_id = validateUnsignedInteger($_GET['kampf_id'], null);
if(!$spleoic) { $spleoic = "top_kampf";
} else {
echo "<p align=center>$back<br>&nbsp;<br>";
$kampf1 = mysql_Fetch_array(mysql_query("SELECT * FROM $spleoic WHERE id='$kampf_id' LIMIT 1"));
$kampf1 = mysqli_fetch_array(db_query("SELECT * FROM $spleoic WHERE id='$kampf_id' LIMIT 1"));
if(($kampf_id * 300) + $kampf1['dauer'] > time()) {
echo "Fehler Sie k&ouml;nnen diesen Kampf nicht anschauen bevor er vorbei ist";
exit;
}
}
$kampf1 = mysql_Fetch_array(mysql_query("SELECT * FROM $spleoic WHERE id='$kampf_id' LIMIT 1"));
$kampf1 = mysqli_fetch_array(db_query("SELECT * FROM $spleoic WHERE id='$kampf_id' LIMIT 1"));
$char_1 = getChar($kampf1['char1']);
$char_2 = getChar($kampf1['char2']);
$arena = mysql_Fetch_array(mysql_query("SELECT name, besitzer FROM arena WHERE id='$kampf1[arena_name]' LIMIT 1"));
$arena = mysqli_fetch_array(db_query("SELECT name, besitzer FROM arena WHERE id='$kampf1[arena_name]' LIMIT 1"));
if($kampf1['dauer'] > time()) {
displayErrorMessage(NULL,'Der Kampf ist noch nicht vorbei!', displayHistoryBackLink());

@ -24,9 +24,9 @@ $art = validateString($_GET['art']);
if(!$spleoic) { $spleoic = "top_kampf";
} else {
echo "<p align=center>$back<br>&nbsp;<br>";
$kampf2 = mysql_Fetch_array(mysql_query("SELECT id FROM $spleoic ORDER BY id ASC LIMIT 1"));
$kampf1 = mysql_Fetch_array(mysql_query("SELECT * FROM $spleoic WHERE id='$kampf_id' LIMIT 1"));
$turnier_uids = mysql_fetch_array(mysql_query("SELECT id FROM $spleoic WHERE art='$art' ORDER BY id ASC"));
$kampf2 = mysqli_fetch_array(db_query("SELECT id FROM $spleoic ORDER BY id ASC LIMIT 1"));
$kampf1 = mysqli_fetch_array(db_query("SELECT * FROM $spleoic WHERE id='$kampf_id' LIMIT 1"));
$turnier_uids = mysqli_fetch_array(db_query("SELECT id FROM $spleoic WHERE art='$art' ORDER BY id ASC"));
@ -36,14 +36,14 @@ exit;
}
}
$kampf1 = mysql_Fetch_array(mysql_query("SELECT * FROM turnier_kampf WHERE id='$kampf_id' LIMIT 1"));
$kampf1 = mysqli_fetch_array(db_query("SELECT * FROM turnier_kampf WHERE id='$kampf_id' LIMIT 1"));
$char1 = getChar($kampf1['char1']);
$char2 = getChar($kampf1['char2']);
$char_1 = $char1;
$char_2 = $char2;
$arena = mysql_Fetch_array(mysql_query("SELECT name, besitzer FROM arena WHERE id='$kampf1[arena_name]' LIMIT 1"));
$arena = mysqli_fetch_array(db_query("SELECT name, besitzer FROM arena WHERE id='$kampf1[arena_name]' LIMIT 1"));
$starke1 = explode(",", $kampf1['starke1']);

@ -26,14 +26,14 @@ $kampf_id = validateUnsignedInteger($_GET['kampf_id'], null);
if(!$spleoic) { $spleoic = "top_kampf";
} else {
echo '<p align=center><a href="javascript:window.close();">Schlie&szlig;en</a><br>&nbsp;<br>';
$kampf1 = mysql_Fetch_array(mysql_query("SELECT * FROM $spleoic WHERE id='$kampf_id' LIMIT 1"));
$kampf1 = mysqli_fetch_array(db_query("SELECT * FROM $spleoic WHERE id='$kampf_id' LIMIT 1"));
/*if(($kampf_id * 300) + $kampf1[dauer] > time()) {
echo "Fehler Sie k&ouml;nnen diesen Kampf nicht anschauen bevor er vorbei ist";
exit;
}*/
}
$kampf1 = mysql_Fetch_array(mysql_query("SELECT * FROM $spleoic WHERE id='$kampf_id' LIMIT 1"));
$kampf1 = mysqli_fetch_array(db_query("SELECT * FROM $spleoic WHERE id='$kampf_id' LIMIT 1"));
$char_1 = getChar2($kampf1['char1']);
$char_2 = getChar2($kampf1['char2']);

@ -33,12 +33,12 @@ if (!$char_id) {
exit;
}
$user = mysql_fetch_array(mysql_query("SELECT id, geld FROM user WHERE nickname='$name'"));
$user = mysqli_fetch_array(db_query("SELECT id, geld FROM user WHERE nickname='$name'"));
$char = getChar($char_id);
if ($speed < 0 || $staerke < 0 || $verteidigung < 0 || $glueck < 0 || $ausdauer < 0 || $hp < 0 || $mp < 0) {
mysql_query("INSERT INTO cheater values('$user_ida[id]','Versuchte negative Werte in Levelup einzutragen!',now())");
db_query("INSERT INTO cheater values('$user_ida[id]','Versuchte negative Werte in Levelup einzutragen!',now())");
displayErrorMessage(NULL,'Nicht cheaten....', displayHistoryBackLink());
exit;
}
@ -66,7 +66,7 @@ if ($charm) {
$new_mp = $char_mp[1] + $mp * 5;
$new_lern = $char['lernpunkte'] - $speed - $staerke - $verteidigung - $glueck - $ausdauer - $hp - $mp;
mysql_query("UPDATE chars SET lernpunkte='$new_lern', starke='$new_st', verteidigung='$new_ver', speed='$new_speed', ausdauer='$new_ausdauer',
db_query("UPDATE chars SET lernpunkte='$new_lern', starke='$new_st', verteidigung='$new_ver', speed='$new_speed', ausdauer='$new_ausdauer',
glueck='$new_glueck', hp='$char_hp[0],$new_hp', mp='$char_mp[0],$new_mp' WHERE id='$char_id'");
$fehler_m = "

@ -13,10 +13,10 @@ include_once(ROOT_PATH.'/include/parse.inc.php');
// GET-Section
// Leer
$chara = mysql_query("SELECT name, liga_siege, liga_niederlagen, bild, id, liga_punkte FROM chars order by liga_punkte DESC LIMIT 50");
$chara = db_query("SELECT name, liga_siege, liga_niederlagen, bild, id, liga_punkte FROM chars order by liga_punkte DESC LIMIT 50");
$x=1;
while($row = mysql_Fetch_array($chara)) {
while($row = mysqli_fetch_array($chara)) {
$PIC = "<img border=0 src=".$row['bild']." width=".$pic_g31." height=".$pic_g31.">";

@ -37,7 +37,7 @@ $search = $_GET['search'];
if ($search) {
// TODO: Sollte irgndwie anders gelöst werden
$kampf_id2 = mysql_fetch_array(mysql_query("SELECT k.id FROM chars c LEFT JOIN liga_kampf k ON(k.char1=c.id OR k.char2=c.id) WHERE c.name='$kampf_name' LIMIT 1"));
$kampf_id2 = mysqli_fetch_array(db_query("SELECT k.id FROM chars c LEFT JOIN liga_kampf k ON(k.char1=c.id OR k.char2=c.id) WHERE c.name='$kampf_name' LIMIT 1"));
?>
<SCRIPT language="JavaScript">
window.open(<?php echo '"liga_kampf_anzeige.php?kampf_id=' .$kampf_id2['id']. '"'; ?>,"","status=no,hotkeys=no,Height=600,Width=820,scrollbars=yes");
@ -51,7 +51,7 @@ if ($kampf_id) {
echo "<p align=center>$back<br>&nbsp;<br>";
$kampf1 = mysql_Fetch_array(mysql_query("SELECT * FROM liga_kampf WHERE id='$kampf_id' LIMIT 1"));
$kampf1 = mysqli_fetch_array(db_query("SELECT * FROM liga_kampf WHERE id='$kampf_id' LIMIT 1"));
$char_1 = getChar($kampf1['char1']);
$char_2 = getChar($kampf1['char2']);
@ -88,7 +88,7 @@ if ($kampf_id) {
exit;
} else {
$kampf_search = mysql_query("SELECT c1.name AS c1_name, c2.name AS c2_name, k.id FROM liga_kampf k
$kampf_search = db_query("SELECT c1.name AS c1_name, c2.name AS c2_name, k.id FROM liga_kampf k
LEFT JOIN chars c1 ON(c1.id=k.char1) LEFT JOIN chars c2 ON(c2.id=k.char2) LEFT JOIN user u ON(u.id=c1.besitzer OR u.id=c2.besitzer) WHERE u.id='$user_ida[id]'");
?>
@ -101,7 +101,7 @@ if ($kampf_id) {
$kampfs = 1;
while ($row = mysql_fetch_array($kampf_search)) {
while ($row = mysqli_fetch_array($kampf_search)) {
?>
<tr>
<td width="102" height="23">

@ -13,7 +13,7 @@ if (isset($_POST['nick_name']) and isset($_POST['pw_1'])) {
$nick_name = validateName($_POST['nick_name']);
$pw_1 = validateString($_POST['pw_1']);
$ip_con = mysql_fetch_array(mysql_query("SELECT nickname FROM user WHERE ip='$REMOTE_ADDR' AND nickname !='$nick_name' LIMIT 1"));
$ip_con = mysqli_fetch_array(db_query("SELECT nickname FROM user WHERE ip='$REMOTE_ADDR' AND nickname !='$nick_name' LIMIT 1"));
if (checkLoginPassword($nick_name, $pw_1)) {
// MumbleAddon!!

@ -16,7 +16,7 @@ include_once(ROOT_PATH . '/include/user.inc.php');
$nick_name = validateName($_POST['nick_name']);
$pw_1 = validateString($_POST['pw_1']);
$ip_con = mysql_fetch_array(mysql_query("SELECT nickname FROM user WHERE ip='$REMOTE_ADDR' AND nickname !='$nick_name' LIMIT 1"));
$ip_con = mysqli_fetch_array(db_query("SELECT nickname FROM user WHERE ip='$REMOTE_ADDR' AND nickname !='$nick_name' LIMIT 1"));
if (!checkLoginPassword($nick_name, $pw_1)) {
displayErrorMessage(NULL,'Username oder Passwort falsch!', displayHistoryBackLink());

@ -48,7 +48,7 @@ $as = $_GET['as'];
/////////////////////////Item Info
if($info) {
$item = mysql_fetch_array(mysql_query("SELECT * FROM item WHERE id='$info' and preis>0 LIMIT 1"));
$item = mysqli_fetch_array(db_query("SELECT * FROM item WHERE id='$info' and preis>0 LIMIT 1"));
$head = "$item[name] Info";
$text .= "St&auml;rke: $item[starke]<br>";
$text .= "Verteidigung: $item[verteidigung]<br>";
@ -97,7 +97,7 @@ $u=1;
while($u < count($w_item_anzahl)) {
if($w_item_anzahl[$u]) {
$item = mysql_fetch_array(mysql_query("SELECT preis, anzahl, name FROM item WHERE id='$w_item_id[$u]' and preis>0 LIMIT 1"));
$item = mysqli_fetch_array(db_query("SELECT preis, anzahl, name FROM item WHERE id='$w_item_id[$u]' and preis>0 LIMIT 1"));
$item_preis = $item_preis + ($item['preis'] * $w_item_anzahl[$u]);
if($item['anzahl'] < $w_item_anzahl[$u]) {
@ -108,7 +108,7 @@ $item_preis = $item_preis + ($item['preis'] * $w_item_anzahl[$u]);
exit;
}
if($w_item_anzahl[$u] < 0){
mysql_query("INSERT INTO cheater values('$user_ida[id]','Versuchte negative Werte in den Markt einzufuegen!',now())");
db_query("INSERT INTO cheater values('$user_ida[id]','Versuchte negative Werte in den Markt einzufuegen!',now())");
$fehler = "NICHT CHEATEN, VERDAMMT NOCHMAL!!!!!";
$link = $back;
eval("\$fehler1.=\"".gettemplate("gfx/markt_fehler")."\";");
@ -123,11 +123,11 @@ $u++;
$user = mysql_fetch_array(mysql_query("SELECT geld, item_res FROM user WHERE id='$user_ida[id]'"));
$user = mysqli_fetch_array(db_query("SELECT geld, item_res FROM user WHERE id='$user_ida[id]'"));
$item_preis = ($item_preis / 100) * (100 - $user['item_res']);
$auktionensumme = mysql_fetch_assoc(mysql_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$user_ida['id'].' GROUP BY bieter'));
$auktionensumme = mysqli_fetch_assoc(db_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$user_ida['id'].' GROUP BY bieter'));
$auktionensumme = $auktionensumme['summe'];
if($user['geld']<$item_preis+$auktionensumme) {
@ -144,20 +144,20 @@ while($u < count($w_item_anzahl)) {
if($w_item_anzahl[$u]) {
$item = mysql_fetch_array(mysql_query("SELECT anzahl, name, s_type FROM item WHERE id='$w_item_id[$u]' and preis>0 LIMIT 1"));
$item = mysqli_fetch_array(db_query("SELECT anzahl, name, s_type FROM item WHERE id='$w_item_id[$u]' and preis>0 LIMIT 1"));
$t=0;
while($t < $w_item_anzahl[$u]) {
if($item['s_type'] != "Trank") { $ru_malss = 1; }
mysql_query("INSERT ware SET ru_mal='$ru_malss', item_id='$w_item_id[$u]', user='$user_ida[id]'");
db_query("INSERT ware SET ru_mal='$ru_malss', item_id='$w_item_id[$u]', user='$user_ida[id]'");
$t++;
}
mysql_query("UPDATE item SET anzahl=anzahl-'$w_item_anzahl[$u]' WHERE id='$w_item_id[$u]' LIMIT 1");
db_query("UPDATE item SET anzahl=anzahl-'$w_item_anzahl[$u]' WHERE id='$w_item_id[$u]' LIMIT 1");
$fehler .= "Sie haben $item[name] x $w_item_anzahl[$u] gekauft!<br>";
}
$u++;
}
mysql_query("UPDATE user SET geld=geld-'$item_preis' WHERE id='$user_ida[id]' LIMIT 1");
db_query("UPDATE user SET geld=geld-'$item_preis' WHERE id='$user_ida[id]' LIMIT 1");
$fehler .= "<p>f&uuml;r $item_preis &#165;";
$link = "<a href=markt.php>weiter...</a>";
@ -185,9 +185,9 @@ exit;
if(!$oder) { $oder = 'level,preis'; }
if(!$ords) { $ords = "Trank"; }
$item_name = mysql_query("SELECT * FROM item WHERE preis>0 and $filter AND s_type='$ords' order by $oder ASC LIMIT $pagenum, 10");
$user = mysql_Fetch_array(mysql_query("SELECT id, geld, item_res FROM user WHERE id='$user_ida[id]' LIMIT 1"));
$user_item = mysql_query("SELECT name, id FROM item WHERE preis>0");
$item_name = db_query("SELECT * FROM item WHERE preis>0 and $filter AND s_type='$ords' order by $oder ASC LIMIT $pagenum, 10");
$user = mysqli_fetch_array(db_query("SELECT id, geld, item_res FROM user WHERE id='$user_ida[id]' LIMIT 1"));
$user_item = db_query("SELECT name, id FROM item WHERE preis>0");
$GELD = $user['geld'];
@ -201,7 +201,7 @@ exit;
$x=0;
$y=1;
while($row = mysql_fetch_array($item_name))
while($row = mysqli_fetch_array($item_name))
{
@ -233,16 +233,16 @@ exit;
////////////STORE
while($row2 = mysql_fetch_array($user_item)) {
while($row2 = mysqli_fetch_array($user_item)) {
$user_items = mysql_num_rows(mysql_query("SELECT id FROM ware WHERE item_id='$row2[id]' AND user='$user_ida[id]' LIMIT 100"));
$user_items = mysqli_stmt_num_rows(db_query("SELECT id FROM ware WHERE item_id='$row2[id]' AND user='$user_ida[id]' LIMIT 100"));
if($user_items) {
$STORE_ITEMS .= "".$row2['name']." x ".$user_items."<br>";
}
}
$Total = mysql_num_rows(mysql_query("SELECT id FROM item WHERE preis>0 and $filter AND s_type='$ords'"));
$Total = mysqli_stmt_num_rows(db_query("SELECT id FROM item WHERE preis>0 and $filter AND s_type='$ords'"));
$pages = ceil($Total/10);
$z = 1;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save