From a3ed44cbe32a55bb6d1a8f8e94b2697e3ba196f1 Mon Sep 17 00:00:00 2001 From: hecht Date: Mon, 5 Aug 2013 18:22:25 +0000 Subject: [PATCH] checkin ... die infos der attacken werden nun nicht mehr nach id gemacht ... sprich neue fruechte koennen nun eingepflegt werden ... die kategorisierung geht nach wochen_markt.kategorie --- ag/info/attacken.php | 84 +++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/ag/info/attacken.php b/ag/info/attacken.php index 0e945d0..eb963c6 100644 --- a/ag/info/attacken.php +++ b/ag/info/attacken.php @@ -182,16 +182,12 @@ function showAtks($linkz,$tf='',$rassen='',$order='',$type='',$pagenum='',$fruch } elseif ($type == 'db') { $attacken = mysql_query("SELECT * FROM attacken WHERE (rassen LIKE '%2,%' OR rassen LIKE '%3,%' OR rassen LIKE '%4,%' OR rassen LIKE '%5,%' OR rassen LIKE '%6,%' OR rassen LIKE '%7,%' OR rassen LIKE '%10,%') AND Frucht is NULL AND rassen!='11,' AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 '); } elseif ($type == 'tf') { - if ($fruchttyp == 'paramecia') { - $attacken = mysql_query("SELECT * FROM attacken WHERE (Frucht=3 OR Frucht=4 OR Frucht=9 OR Frucht=11 OR Frucht=12 OR Frucht=38 OR Frucht=14 OR Frucht=17 OR Frucht=26 OR Frucht=2 OR Frucht=19 OR Frucht=20 OR Frucht=21 OR Frucht=22) AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 '); - } elseif ($fruchttyp == 'zoan') { - $attacken = mysql_query("SELECT * FROM attacken WHERE (Frucht=31 OR Frucht=30 OR Frucht=33 OR Frucht=34 OR Frucht=35 OR Frucht=32 OR Frucht=29 OR Frucht=16) AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 '); - } elseif ($fruchttyp == 'logia') { - $attacken = mysql_query("SELECT * FROM attacken WHERE (Frucht=23 OR Frucht=24 OR Frucht=8 OR Frucht=15 OR Frucht=6) AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 '); - } else { - $attacken = mysql_query("SELECT * FROM attacken WHERE Frucht!=0 AND rassen!='11,' AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 '); - } - } else { + $condition = getFruchtCondition($fruchttyp); + // select attacken.*, wochen_markt.kategorie from attacken inner join wochen_markt on attacken.frucht = wochen_markt.id + $sql = 'SELECT attacken.* FROM attacken inner join wochen_markt on attacken.frucht = wochen_markt.id WHERE ' .$condition.' attacken.info not like \'%npc attacke%\' '.$order.' LIMIT '.($pagenum * 20).', 20 '; + $attacken = mysql_query($sql); + + } else { $attacken = mysql_query("SELECT * FROM attacken WHERE info NOT LIKE '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 '); } } else { @@ -237,15 +233,8 @@ function showAtks($linkz,$tf='',$rassen='',$order='',$type='',$pagenum='',$fruch } elseif ($type == 'db') { $total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE (rassen LIKE '%2,%' OR rassen LIKE '%3,%' OR rassen LIKE '%4,%' OR rassen LIKE '%5,%' OR rassen LIKE '%6,%' OR rassen LIKE '%7,%' OR rassen LIKE '%10,%') AND Frucht is NULL AND rassen!='11,' AND info not like '%npc attacke%' ")); } elseif ($type == 'tf') { - if ($fruchttyp == 'paramecia') { - $total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE (Frucht=3 OR Frucht=4 OR Frucht=9 OR Frucht=11 OR Frucht=12 OR Frucht=38 OR Frucht=14 OR Frucht=17 OR Frucht=26 OR Frucht=2 OR Frucht=19 OR Frucht=20 OR Frucht=21 OR Frucht=22) AND info not like '%npc attacke%' ")); - } elseif ($fruchttyp == 'zoan') { - $total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE (Frucht=31 OR Frucht=30 OR Frucht=33 OR Frucht=34 OR Frucht=35 OR Frucht=32 OR Frucht=29 OR Frucht=16) AND info not like '%npc attacke%' ")); - } elseif ($fruchttyp == 'logia') { - $total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE (Frucht=23 OR Frucht=24 OR Frucht=8 OR Frucht=15 OR Frucht=6) AND info not like '%npc attacke%' ")); - } else { - $total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE Frucht!=0 AND rassen!='11,' AND info not like '%npc attacke%' ")); - } + $condition = getFruchtCondition($fruchttyp); + $total = mysql_num_rows(mysql_query('SELECT attacken.* FROM attacken inner join wochen_markt on attacken.frucht = wochen_markt.id WHERE ' .$condition.' attacken.info not like \'%npc attacke%\'')); } else { $total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE info NOT LIKE '%npc attacke%' ")); } @@ -348,34 +337,44 @@ function atksHeaderRasse($type,$link,$fruchttyp) { - Kaioshin
Parameciafrüchte - Zoanfrüchte - Logiafrüchte - '.$tf_array['item'].''; - } - } elseif ($fruchttyp == 'zoan') { - $tf_query= mysql_query('SELECT * FROM wochen_markt WHERE (id!=25 AND id!=41 AND id!=42) AND (id=29 OR id=31 OR id=34 OR id=35 OR id=30 OR id=33 OR id=16 OR id=32 OR id=401 OR id=403 OR id=405 OR id=407) ORDER BY item ASC'); - while ($tf_array= mysql_fetch_assoc($tf_query)) { - echo ' - '.$tf_array['item'].''; - } - } elseif ($fruchttyp == 'logia') { - $tf_query= mysql_query('SELECT * FROM wochen_markt WHERE (id!=25 AND id!=41 AND id!=42) AND (id=8 OR id=23 OR id=24 OR id=6 OR id=15 OR id=413 OR id=414) ORDER BY item ASC'); - while ($tf_array= mysql_fetch_assoc($tf_query)) { - echo ' - '.$tf_array['item'].''; - } - } + + + +   + + '.$tf_array['item'].''; + } + + ?> + + + +