diff --git a/code/web/app/app_achievements/class/AchAchievement_class.php b/code/web/app/app_achievements/class/AchAchievement_class.php index e64a11c35..0902f0c1a 100644 --- a/code/web/app/app_achievements/class/AchAchievement_class.php +++ b/code/web/app/app_achievements/class/AchAchievement_class.php @@ -28,7 +28,7 @@ $this->template = $data['aal_template']; $this->dev = $data['aa_dev']; - $res = $DBc->sqlQuery("SELECT * FROM ach_perk LEFT JOIN (ach_perk_lang) ON (apl_lang='".$_USER->getLang()."' AND apl_perk=ap_id) LEFT JOIN (ach_player_perk) ON (app_perk=ap_id AND app_player='".$_USER->getID()."') WHERE ap_achievement='".$this->id."' AND ap_parent IS NULL"); + $res = $DBc->sqlQuery("SELECT * FROM ach_perk LEFT JOIN (ach_perk_lang) ON (apl_lang='".$_USER->getLang()."' AND apl_perk=ap_id) LEFT JOIN (ach_player_perk) ON (app_perk=ap_id AND app_player='".$_USER->getID()."') WHERE ap_achievement='".$this->id."' ORDER by ap_porder ASC"); $sz = sizeof($res); for($i=0;$i<$sz;$i++) { diff --git a/code/web/app/app_achievements/include/ach_render_ig.php b/code/web/app/app_achievements/include/ach_render_ig.php index d3b5c0b05..8e639cc3b 100644 --- a/code/web/app/app_achievements/include/ach_render_ig.php +++ b/code/web/app/app_achievements/include/ach_render_ig.php @@ -112,7 +112,7 @@ $res = $DBc->sqlQuery("SELECT sum(ap_value) as anz FROM ach_perk,ach_player_perk WHERE ap_id=app_perk AND app_player='".$_USER->getID()."'"); - $html = "".$_USER->getName()." ".$res[0]['anz'].""; + $html = "".$_USER->getName()." ".max(0,$res[0]['anz']).""; return $html; } @@ -182,7 +182,7 @@ $iter = $cat->getDone(); while($iter->hasNext()) { - $curr = $cat->getChildByIdx($iter->getNext()); + $curr = $iter->getNext(); #$sz = sizeof($tmp); #for($i=0;$i<$sz;$i++) { #echo "A"; @@ -194,7 +194,7 @@ $iter = $cat->getOpen(); while($iter->hasNext()) { - $curr = $cat->getChildByIdx($iter->getNext()); + $curr = $iter->getNext(); #$sz = sizeof($tmp); #for($i=0;$i<$sz;$i++) { #echo "B"; @@ -259,7 +259,7 @@ $html = ""; $perk_list = $ach->getOpen(); - $perk = $ach->getChildByIdx($perk_list->getNext()); + $perk = $perk_list->getNext(); if($perk->inDev()) { return $html; @@ -281,7 +281,7 @@ $perk_list = $ach->getDone(); while($perk_list->hasNext()) { - $perk = $ach->getChildByIdx($perk_list->getNext()); + $perk = $perk_list->getNext(); #foreach($perk_list as $elem) { #$perk = $ach->getChild($elem); diff --git a/code/web/app/app_achievements/include/ach_render_web.php b/code/web/app/app_achievements/include/ach_render_web.php index 0bac0107f..459bebffd 100644 --- a/code/web/app/app_achievements/include/ach_render_web.php +++ b/code/web/app/app_achievements/include/ach_render_web.php @@ -120,7 +120,7 @@ $res = $DBc->sqlQuery("SELECT sum(ap_value) as anz FROM ach_perk,ach_player_perk WHERE ap_id=app_perk AND app_player='".$_USER->getID()."'"); - $html = "