Fixed items so new races can also have their own items.

main
hecht 7 years ago
parent 7c53f1a403
commit 0a242d546e

@ -64,14 +64,12 @@ function stelledar($char_id,$user_ida,$name) {
$clanfight_attset_name = getAttackNames($clanfight_attset); $clanfight_attset_name = getAttackNames($clanfight_attset);
$normfight_attset_name = getAttackNames($normfight_attset); $normfight_attset_name = getAttackNames($normfight_attset);
//Rüstung laden //Rüstung laden
$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]' AND 0 = (SELECT count(c.id) from chars c WHERE c.besitzer = w.user AND c.id != '$char_1[id]' AND find_in_set(w.id, kampf_item)) 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.rassen_type=".$char_1['rasse_a']['type']." OR i.rassen_type is NULL) AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Schuhe' AND i.level <='$char_1[level]' AND 0 = (SELECT count(c.id) from chars c WHERE c.besitzer = w.user AND c.id != '$char_1[id]' AND find_in_set(w.id, kampf_item)) 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]' AND 0 = (SELECT count(c.id) from chars c WHERE c.besitzer = w.user AND c.id != '$char_1[id]' AND find_in_set(w.id, kampf_item)) 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.rassen_type=".$char_1['rasse_a']['type']." OR i.rassen_type is NULL) AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Schwert' AND i.level <='$char_1[level]' AND 0 = (SELECT count(c.id) from chars c WHERE c.besitzer = w.user AND c.id != '$char_1[id]' AND find_in_set(w.id, kampf_item)) 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]' AND 0 = (SELECT count(c.id) from chars c WHERE c.besitzer = w.user AND c.id != '$char_1[id]' AND find_in_set(w.id, kampf_item)) 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.rassen_type=".$char_1['rasse_a']['type']." OR i.rassen_type is NULL) AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Ruestung' AND i.level <='$char_1[level]' AND 0 = (SELECT count(c.id) from chars c WHERE c.besitzer = w.user AND c.id != '$char_1[id]' AND find_in_set(w.id, kampf_item)) 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]' AND 0 = (SELECT count(c.id) from chars c WHERE c.besitzer = w.user AND c.id != '$char_1[id]' AND find_in_set(w.id, kampf_item)) 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.rassen_type=".$char_1['rasse_a']['type']." OR i.rassen_type is NULL) AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Schild' AND i.level <='$char_1[level]' AND 0 = (SELECT count(c.id) from chars c WHERE c.besitzer = w.user AND c.id != '$char_1[id]' AND find_in_set(w.id, kampf_item)) 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]' AND 0 = (SELECT count(c.id) from chars c WHERE c.besitzer = w.user AND c.id != '$char_1[id]' AND find_in_set(w.id, kampf_item)) 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.rassen_type=".$char_1['rasse_a']['type']." OR i.rassen_type is NULL) AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Helm' AND i.level <='$char_1[level]' AND 0 = (SELECT count(c.id) from chars c WHERE c.besitzer = w.user AND c.id != '$char_1[id]' AND find_in_set(w.id, kampf_item)) group by i.name order by i.level desc");
$checked = explode(',',$char_1['kampf_item']); $checked = explode(',',$char_1['kampf_item']);
$excludeIds = getExcludeIds($user_ida['id'], $char_id); $excludeIds = getExcludeIds($user_ida['id'], $char_id);
?> ?>

@ -55,10 +55,10 @@ if ($user_geld < $clan_geld) {
db_query("UPDATE clan SET geld=geld+'$clan_geld' WHERE id='$user_ida[clan]'"); 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 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']); db_query('UPDATE user_clan SET spende = spende + '.$clan_geld.', spende_today = spende_today + '.$clan_geld.' WHERE clanid = '.$user_ida['clan'].' and userid = '.$user_ida['id']);
if(db_affected_rows() == 0){ if(db_affected_rows() == 0){
db_query('INSERT INTO user_clan(spende,clanid,userid) values('.$clan_geld.','.$user_ida['clan'].','.$user_ida['id'].')'); db_query('INSERT INTO user_clan(spende,clanid,userid,spende_today) values('.$clan_geld.','.$user_ida['clan'].','.$user_ida['id'].','.$clan_geld.')');
} }
displayErrorMessage(NULL,'An Clan Erfolgreich Gespendet', '<a href="index.php?as=clan/spende">weiter...</a>'); displayErrorMessage(NULL,'An Clan Erfolgreich Gespendet', '<a href="index.php?as=clan/spende">weiter...</a>');
@ -157,7 +157,7 @@ while($row = mysqli_fetch_assoc($qry)){
//print_r($user_raum); //print_r($user_raum);
$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'); $clans_spend = db_query('SELECT spende, nickname, user.id as userid, spende_today, spende_yesterday 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_num_rows($clans_spend); $member = mysqli_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'; $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';
@ -182,7 +182,7 @@ for($i=0;$i<$raumanzahl;$i++){
} }
//echo 'Unterschuss: '.$clan_untersch.'<br>'; //echo 'Unterschuss: '.$clan_untersch.'<br>';
$cols = 4; $cols = 6;
?> ?>
@ -193,10 +193,12 @@ $cols = 4;
</tr> </tr>
<tr> <tr>
<th>Member</th> <th>Member</th>
<th>Spenden</th> <th>Spenden<br>Total</th>
<th>Spenden<br>Heute</th>
<th>Spenden<br>Gestern</th>
<?php <?php
for($i=0;$i<$raumanzahl;$i++){ for($i=0;$i<$raumanzahl;$i++){
echo '<th>'.$clanraum_a[$i]['name'].'</th>'; echo '<th>'.join('<br>', explode(' ', $clanraum_a[$i]['name'])).'</th>';
} }
?> ?>
<th>Mietgeb&uuml;hren</th> <th>Mietgeb&uuml;hren</th>
@ -212,6 +214,8 @@ while($row = mysqli_fetch_assoc($clans_spend)) {
<tr> <tr>
<th align="center"><?php echo $row['nickname']; ?></th> <th align="center"><?php echo $row['nickname']; ?></th>
<td align="center"><?php echo displayMoney($row['spende']); ?></td> <td align="center"><?php echo displayMoney($row['spende']); ?></td>
<td align="center"><?php echo displayMoney($row['spende_today']); ?></td>
<td align="center"><?php echo displayMoney($row['spende_yesterday']); ?></td>
<?php <?php
$summe += $row['spende']; $summe += $row['spende'];
$costs = 0; $costs = 0;
@ -238,11 +242,13 @@ while($row = mysqli_fetch_assoc($clans_spend)) {
<tr> <tr>
<th><?php echo $member; ?> Member</th> <th><?php echo $member; ?> Member</th>
<th><?php <th><?php
$sql = 'SELECT sum(spende) as summe FROM user_clan WHERE clanid ='.$user_ida['clan']; $sql = 'SELECT sum(spende) as summe, sum(spende_today) as spende_today, sum(spende_yesterday) as spende_yesterday FROM user_clan WHERE clanid ='.$user_ida['clan'];
$qry = db_query($sql); $qry = db_query($sql);
$row_s = mysqli_fetch_assoc($qry); $row_s = mysqli_fetch_assoc($qry);
echo displayMoney($row_s['summe']); echo displayMoney($row_s['summe']);
?></th> ?></th>
<th><?php echo displayMoney($row_s['spende_today']); ?> </th>
<th><?php echo displayMoney($row_s['spende_yesterday']); ?> </th>
<?php <?php
for($i=0;$i<$raumanzahl;$i++){ for($i=0;$i<$raumanzahl;$i++){
if($clanrauminfo[$clanraum_a[$i]['id']]['anzahl'] < $mindestchar){ if($clanrauminfo[$clanraum_a[$i]['id']]['anzahl'] < $mindestchar){

@ -70,19 +70,17 @@ background="gfx/markt/back_xx.jpg" OnLoad="preis();">
</td> </td>
</tr> </tr>
</table> </table>
<table border="0" cellpadding="0" cellspacing="0" <table border="0" cellpadding="0" cellspacing="0" width="376">
width="376">
<tr> <tr>
<td><img src="gfx/markt/line_top_clean.gif" width="376" border="0"></td>
<td>
<map name="FPMap0">
<area href="?as=markt&charm=Dragonball&ords=$ords" shape="rect" coords="14, 2, 79, 18">
<area href="?as=markt&charm=Onepiece&ords=$ords" shape="rect" coords="93, 0, 187, 20">
</map>
<img src="gfx/markt/line_top.gif" width="376"
height="55" usemap="#FPMap0" border="0"></td>
</tr> </tr>
<tr>
<td style="background-color:#e1ecca; font-size: 12px;">&nbsp;&nbsp;&nbsp;$HEADER_DATA</td>
</tr>
<tr>
<td><img src="gfx/markt/line_top_clean2.gif" width="376" border="0"></td>
</tr>
<!-- 1 form des styles! --> <!-- 1 form des styles! -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

@ -72,9 +72,15 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
echo "\t".'<input type="hidden" name="itemtable" value="'.$itemtable.'"></input>'."\n"; echo "\t".'<input type="hidden" name="itemtable" value="'.$itemtable.'"></input>'."\n";
$colspan = 2; $colspan = 2;
echo "\t\t\t".'<tr><td colspan="'.$colspan.'"><h1 style="text-align:center">Editieren</h1></td></tr>'."\n"; echo "\t\t\t".'<tr><td colspan="'.$colspan.'"><h1 style="text-align:center">Editieren</h1></td></tr>'."\n";
$d_array = NULL;
$desc_array = NULL;
$value_type_map = array();
if($itemtable == 'item'){ if($itemtable == 'item'){
$d_array = array('id','name','hp','mp','starke','verteidigung','speed','s_type','preis','anzahl','type','level','tausch_lvl','tausch_anzahl','info'); $d_array = array('id','name','hp','mp','starke','verteidigung','speed','s_type','preis','anzahl','rassen_type','level','tausch_lvl','tausch_anzahl','info');
$desc_array = array('ID', 'Name', 'HP', 'MP', 'Bonus Stärke', 'Bonus Verteidigung', 'Bonus Geschwindigkeit', 'Art (Item, Helm, ..)', 'Preis im Markt', 'Anzahl', 'Rassen (ALL, Onepiece, Dragonball)', 'Level', 'Tauschlevel', 'Tauschanzahl', 'Infotext'); $desc_array = array('ID', 'Name', 'HP', 'MP', 'Bonus Stärke', 'Bonus Verteidigung', 'Bonus Geschwindigkeit', 'Art (Item, Helm, ..)', 'Preis im Markt', 'Anzahl', 'Rassen', 'Level', 'Tauschlevel', 'Tauschanzahl', 'Infotext');
$race_types = getRaceTypes();
$race_types[] = array('id' => NULL, 'name' => 'ALL');
$value_type_map = array('rassen_type' => array( 'index' => 'id', 'name' => 'name', 'data' => $race_types ));
} else if($itemtable == 'sp_item'){ } else if($itemtable == 'sp_item'){
$d_array = array('id','name','preis','wert','type','slot','tausch_lvl','tausch_anzahl','info'); $d_array = array('id','name','preis','wert','type','slot','tausch_lvl','tausch_anzahl','info');
$desc_array = array('ID', 'Name', 'Preis', 'Häufigkeit (je höher desto seltener)', '"Teufels Frucht" oder nicht', 'Slot (immer auf 0 setzen)', 'Tauschlevel', 'Tauschanzahl', 'Infotext'); $desc_array = array('ID', 'Name', 'Preis', 'Häufigkeit (je höher desto seltener)', '"Teufels Frucht" oder nicht', 'Slot (immer auf 0 setzen)', 'Tauschlevel', 'Tauschanzahl', 'Infotext');
@ -91,8 +97,23 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
$row = mysqli_fetch_assoc($qry); $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"; 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++){ for($i = 1;$i<count($d_array)-1;$i++){
if (isset($value_type_map[$d_array[$i]])) {
$entry = $value_type_map[$d_array[$i]];
echo "\t\t".'<tr><td>'.$desc_array[$i].'</td><td style="text-align:center">'."\n";
echo "\t\t\t".'<select name="data['.$d_array[$i].']">'."\n";
foreach ($entry['data'] as $entry_data) {
$selected = '';
if ($row[$d_array[$i]] == $entry_data[$entry['index']] ) {
$selected = 'selected="selected"';
}
echo "\t\t\t\t".'<option value="'.$entry_data[$entry['index']].'" '.$selected.'>'.$entry_data[$entry['name']].'</option>'."\n";
}
echo "\t\t\t".'</select>'."\n";
echo "\t\t".'</td></tr>'."\n";
} else {
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"; 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";
} }
}
// Infotext // Infotext
echo "\t\t\t".'<tr><td>'.$desc_array[$i].'</td><td style="text-align:center"><textarea name="data['.$d_array[$i].']" cols="30" rows="5">'.debbcode($row[$d_array[$i]]).'</textarea></td></tr>'."\n"; echo "\t\t\t".'<tr><td>'.$desc_array[$i].'</td><td style="text-align:center"><textarea name="data['.$d_array[$i].']" cols="30" rows="5">'.debbcode($row[$d_array[$i]]).'</textarea></td></tr>'."\n";
@ -127,7 +148,7 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
} else if($task == 'dochange'){ } else if($task == 'dochange'){
// d_array[0] muss name sein!! // d_array[0] muss name sein!!
if($itemtable == 'item'){ if($itemtable == 'item'){
$d_array = array('name','hp','mp','starke','verteidigung','speed','s_type','preis','anzahl','type','level','tausch_lvl','tausch_anzahl','info'); $d_array = array('name','hp','mp','starke','verteidigung','speed','s_type','preis','anzahl','rassen_type','level','tausch_lvl','tausch_anzahl','info');
} else if($itemtable == 'sp_item'){ } else if($itemtable == 'sp_item'){
$d_array = array('name','preis','wert','type','slot','tausch_lvl','tausch_anzahl','info'); $d_array = array('name','preis','wert','type','slot','tausch_lvl','tausch_anzahl','info');
} else if($itemtable == 'wochen_markt'){ } else if($itemtable == 'wochen_markt'){
@ -144,8 +165,12 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
$sql .= $d_array[0].' = \''.encodeNoHTMLWithBB($data[$d_array[0]]).'\''; $sql .= $d_array[0].' = \''.encodeNoHTMLWithBB($data[$d_array[0]]).'\'';
for($i=1;$i<count($d_array);$i++){ for($i=1;$i<count($d_array);$i++){
if ($data[$d_array[$i]] == "") {
$sql .= ', '. $d_array[$i].' = NULL';
} else {
$sql .= ', '. $d_array[$i].' = \''.encodeNoHTMLWithBB($data[$d_array[$i]]).'\''; $sql .= ', '. $d_array[$i].' = \''.encodeNoHTMLWithBB($data[$d_array[$i]]).'\'';
} }
}
$sql .= ' WHERE id=\''.$itemid.'\''; $sql .= ' WHERE id=\''.$itemid.'\'';
// echo $sql.'<br>'; // echo $sql.'<br>';
@ -213,7 +238,7 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
if($task == 'docreate'){ if($task == 'docreate'){
// Do the insert and open the edit-page :) // Do the insert and open the edit-page :)
if($itemtable == 'item'){ if($itemtable == 'item'){
$d_array = array('name','hp','mp','starke','verteidigung','speed','s_type','preis','anzahl','type','level','info'); $d_array = array('name','hp','mp','starke','verteidigung','speed','s_type','preis','anzahl','rassen_type','level','info');
} else if($itemtable == 'sp_item'){ } else if($itemtable == 'sp_item'){
$d_array = array('name','preis','wert','type','slot','info'); $d_array = array('name','preis','wert','type','slot','info');
} else if($itemtable == 'wochen_markt'){ } else if($itemtable == 'wochen_markt'){
@ -232,8 +257,12 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
$sql = 'INSERT INTO '.$itemtable.' (id, '.join($d_array,', ').') values('.$itemid; $sql = 'INSERT INTO '.$itemtable.' (id, '.join($d_array,', ').') values('.$itemid;
for($i=0;$i<count($d_array);$i++){ for($i=0;$i<count($d_array);$i++){
if ($data[$d_array[$i]] == "") {
$sql .= ', '. $d_array[$i].' = NULL';
} else {
$sql .= ', \''.encodeNoHTMLWithBB($data[$d_array[$i]]).'\''; $sql .= ', \''.encodeNoHTMLWithBB($data[$d_array[$i]]).'\'';
} }
}
$sql .= ')'; $sql .= ')';
@ -251,10 +280,17 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
} }
} else { } else {
$colspan = 2; $colspan = 2;
$d_array = array();
$desc_array = array();
$value_type_map = array();
echo "\t\t\t".'<tr><td colspan="'.$colspan.'"><h1 style="text-align:center">Erstellen</h1></td></tr>'."\n"; echo "\t\t\t".'<tr><td colspan="'.$colspan.'"><h1 style="text-align:center">Erstellen</h1></td></tr>'."\n";
if($itemtable == 'item'){ if($itemtable == 'item'){
$d_array = array('id','name','hp','mp','starke','verteidigung','speed','s_type','preis','anzahl','type','level','info'); $d_array = array('id','name','hp','mp','starke','verteidigung','speed','s_type','preis','anzahl','rassen_type','level','info');
$desc_array = array('ID', 'Name', 'HP', 'MP', 'Bonus Stärke', 'Bonus Verteidigung', 'Bonus Geschwindigkeit', 'Art (Item, Helm, ..)', 'Preis im Markt', 'Anzahl', 'Rassen (ALL, Onepiece, Dragonball)', 'Level', 'Infotext'); $desc_array = array('ID', 'Name', 'HP', 'MP', 'Bonus Stärke', 'Bonus Verteidigung', 'Bonus Geschwindigkeit', 'Art (Item, Helm, ..)', 'Preis im Markt', 'Anzahl', 'Rassen', 'Level', 'Infotext');
$race_types = getRaceTypes();
$race_types[] = array('id' => NULL, 'name' => 'ALL');
$value_type_map = array('rassen_type' => array( 'index' => 'id', 'name' => 'name', 'data' => $race_types ));
} else if($itemtable == 'sp_item'){ } else if($itemtable == 'sp_item'){
$d_array = array('id','name','preis','wert','type','slot','info'); $d_array = array('id','name','preis','wert','type','slot','info');
$desc_array = array('ID', 'Name', 'Preis', 'Häufigkeit (je höher desto seltener)', '"Teufels Frucht" oder nicht', 'Slot (immer auf 0 setzen)', 'Infotext'); $desc_array = array('ID', 'Name', 'Preis', 'Häufigkeit (je höher desto seltener)', '"Teufels Frucht" oder nicht', 'Slot (immer auf 0 setzen)', 'Infotext');
@ -282,8 +318,23 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite
echo "\t".'<input type="hidden" name="task" value="docreate"></input>'."\n"; echo "\t".'<input type="hidden" name="task" value="docreate"></input>'."\n";
echo "\t\t".'<tr><td>'.$desc_array[0].'</td><td style="text-align:center">'.$data[$d_array[0]].'</td></tr>'."\n"; echo "\t\t".'<tr><td>'.$desc_array[0].'</td><td style="text-align:center">'.$data[$d_array[0]].'</td></tr>'."\n";
for($i = 1;$i<count($d_array)-1;$i++){ for($i = 1;$i<count($d_array)-1;$i++){
if (isset($value_type_map[$d_array[$i]])) {
$entry = $value_type_map[$d_array[$i]];
echo "\t\t".'<tr><td>'.$desc_array[$i].'</td><td style="text-align:center">'."\n";
echo "\t\t\t".'<select name="data['.$d_array[$i].']">'."\n";
foreach ($entry['data'] as $entry_data) {
$selected = '';
if ($row[$d_array[$i]] == $entry_data[$entry['index']] ) {
$selected = 'selected="selected"';
}
echo "\t\t\t\t".'<option value="'.$entry_data[$entry['index']].'" '.$selected.'>'.$entry_data[$entry['name']].'</option>'."\n";
}
echo "\t\t\t".'</select>'."\n";
echo "\t\t".'</td></tr>'."\n";
} else {
echo "\t\t".'<tr><td>'.$desc_array[$i].'</td><td style="text-align:center"><input name="data['.$d_array[$i].']" value="'.debbcode($data[$d_array[$i]]).'"></input></td></tr>'."\n"; echo "\t\t".'<tr><td>'.$desc_array[$i].'</td><td style="text-align:center"><input name="data['.$d_array[$i].']" value="'.debbcode($data[$d_array[$i]]).'"></input></td></tr>'."\n";
} }
}
// Infotext // Infotext
echo "\t\t\t".'<tr><td>'.$desc_array[$i].'</td><td style="text-align:center"><textarea name="data['.$d_array[$i].']" cols="30" rows="5">'.debbcode($data[$d_array[$i]]).'</textarea></td></tr>'."\n"; echo "\t\t\t".'<tr><td>'.$desc_array[$i].'</td><td style="text-align:center"><textarea name="data['.$d_array[$i].']" cols="30" rows="5">'.debbcode($data[$d_array[$i]]).'</textarea></td></tr>'."\n";

@ -115,7 +115,7 @@ $user = $user_ida;
if ($charm == 1) { if ($charm == 1) {
$item_info1 = mysqli_fetch_array(db_query("SELECT item_id, id, user FROM ware WHERE id='$item_id1' 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")); $item_info3 = mysqli_fetch_array(db_query("SELECT preis, anzahl, hp, mp, starke, verteidigung, speed, s_type, rassen_type FROM item WHERE id='$item_info1[item_id]' LIMIT 1"));
$char_id1 = getChar($char_id2); $char_id1 = getChar($char_id2);
if ($item_info1['user'] != $user['id']) { if ($item_info1['user'] != $user['id']) {
@ -127,7 +127,7 @@ if ($charm == 1) {
displayErrorMessage(NULL,'Dieser Charakter geh&ouml;rt nicht dir!', displayHistoryBackLink()); displayErrorMessage(NULL,'Dieser Charakter geh&ouml;rt nicht dir!', displayHistoryBackLink());
exit; exit;
} }
if ($item_info3['type'] != $char_id1['type'] AND $item_info3['type'] != 'ALL') { if ($item_info3['rassen_type'] != $char_id1['rasse']['type'] AND $item_info3['rassen_type'] != NULL) {
displayErrorMessage(NULL,'Dein Charakter kann dieses Item nicht benutzen!', displayHistoryBackLink()); displayErrorMessage(NULL,'Dein Charakter kann dieses Item nicht benutzen!', displayHistoryBackLink());
exit; exit;
} }
@ -360,7 +360,7 @@ $item1 = db_query("SELECT item_id, id, ru_mal FROM ware WHERE user='$user[id]' g
</select> <br> <br> <select id="input" name="item_id1"> </select> <br> <br> <select id="input" name="item_id1">
<?php <?php
while ($row = mysqli_fetch_array($item2)) { 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'])); $item_name = mysqli_fetch_assoc(db_query('SELECT hp, mp, name, s_type, id FROM item WHERE id='.$row['item_id']));
if ($item_name['s_type'] == "Trank") { if ($item_name['s_type'] == "Trank") {
echo '<option value="'.$row['id'].'">'.$item_name['name'].' ('.$row['anzahl'].' mal)'; echo '<option value="'.$row['id'].'">'.$item_name['name'].' ('.$row['anzahl'].' mal)';
} }

@ -10,6 +10,7 @@ include_once(ROOT_PATH.'/include/config.inc.php');
include_once(ROOT_PATH.'/include/designfunctions.inc.php'); include_once(ROOT_PATH.'/include/designfunctions.inc.php');
include_once(ROOT_PATH.'/include/parse.inc.php'); include_once(ROOT_PATH.'/include/parse.inc.php');
include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php'); include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php');
include_once(ROOT_PATH.'/include/rassen.inc.php');
include_once(ROOT_PATH.'/gfx/gfx_config.php'); include_once(ROOT_PATH.'/gfx/gfx_config.php');
@ -41,7 +42,16 @@ $item_10 = validateUnsignedInteger($_GET['item_10'], null);
$pagenum = validateUnsignedInteger($_GET['pagenum'], null); $pagenum = validateUnsignedInteger($_GET['pagenum'], null);
$oder = validateStringCritical($_GET['oder']); $oder = validateStringCritical($_GET['oder']);
$ords = validateStringCritical($_GET['ords']); $ords = validateStringCritical($_GET['ords']);
$charm = validateString($_GET['charm']); $charm = validateUnsignedInteger($_GET['charm']);
$race_types = getRaceTypes();
$race_type_map = array( NULL => array('name' => 'ALL'));
foreach ($race_types as $race_type) {
$race_type_map[$race_type['id']] = $race_type;
}
if( strlen($ords) > 10 ) { if( strlen($ords) > 10 ) {
unset($ords); unset($ords);
@ -177,7 +187,7 @@ exit;
$filter = '1'; $filter = '1';
if(isset($charm)) { if(isset($charm)) {
$filter = '(type=\''.$charm.'\' OR type=\'ALL\')'; $filter = '(rassen_type='.$charm.' OR rassen_type IS NULL)';
} }
if($pagenum == "" or $pagenum == 1) if($pagenum == "" or $pagenum == 1)
@ -209,11 +219,8 @@ exit;
$y=1; $y=1;
while($row = mysqli_fetch_array($item_name)) while($row = mysqli_fetch_array($item_name))
{ {
$ITEM = $row['name']; $ITEM = $row['name'];
$TYPE = $row['type']; $TYPE = $race_type_map[$row['rassen_type']]['name'];
$ANZAHL = $row['anzahl']; $ANZAHL = $row['anzahl'];
$row['preis'] = $row['preis'] / 100; $row['preis'] = $row['preis'] / 100;
$row['preis'] = $row['preis'] * (100 - $user['item_res']); $row['preis'] = $row['preis'] * (100 - $user['item_res']);
@ -260,7 +267,12 @@ exit;
$i++; $i++;
} }
$HEADER_DATA = '';
foreach ($race_types as $race_type) {
if (!$race_type['gm_only'] ) {
$HEADER_DATA .= '<a href="?as=markt&charm='.$race_type['id'].'&oder='.$oder.'&ords='.$ords.'">'.$race_type['name'].'</a> ~ ';
}
}

Loading…
Cancel
Save