diff --git a/Templates/dorf3/2.tpl b/Templates/dorf3/2.tpl index 6b2c2237..c8255a44 100644 --- a/Templates/dorf3/2.tpl +++ b/Templates/dorf3/2.tpl @@ -7,10 +7,14 @@ include('menu.tpl'); VillageMerchants getProfileVillages($session->uid); -foreach($varray as $vil){ +$varray = $database->getProfileVillages($session->uid); +$woodSUM = 0; +$claySUM = 0; +$ironSUM = 0; +$cropSUM = 0; +foreach($varray as $vil){ $vid = $vil['wref']; - $vdata = $database->getVillage($vid); + $vdata = $database->getVillage($vid); $totalmerchants = $building->getTypeLevel(17,$vid); $availmerchants = $totalmerchants - $database->totalMerchantUsed($vid); if($vdata['wood'] > $vdata['maxstore']) { $wood = $vdata['maxstore']; } else { $wood = $vdata['wood']; } @@ -28,7 +32,7 @@ foreach($varray as $vil){ '.($totalmerchants>0?'':'').$availmerchants.'/'.$totalmerchants.' '; - $woodSUM += $wood; + $woodSUM += $wood; $claySUM += $clay; $ironSUM += $iron; $cropSUM += $crop; diff --git a/Templates/dorf3/5.tpl b/Templates/dorf3/5.tpl index b01deb66..458a0473 100644 --- a/Templates/dorf3/5.tpl +++ b/Templates/dorf3/5.tpl @@ -18,7 +18,7 @@ getEnforceVillage($vid,1); array_unshift($units,$database->getUnit($vid)); @@ -31,18 +31,27 @@ $uni['u'.$i] += $unit['u'.$i]; $unit_total['u'.$i] += $unit['u'.$i]; } - $uni['u'.$i] += $movement['u'.$i]; - $unit_total['u'.$i] += $movement['u'.$i]; + if (isset($movement['u'.$i])) { + $uni[ 'u' . $i ] += $movement[ 'u' . $i ]; + $unit_total['u'.$i] += $movement['u'.$i]; + } if($uni['u'.$i] !=0){$cl = '';}else{$cl = 'none';} echo ''.$uni['u'.$i].''; } $uni['hero'] = 0; + if (!isset($unit_total['hero'])) { + $unit_total['hero'] = 0; + } foreach($units as $unit) { $uni['hero'] += $unit['hero']; $unit_total['hero'] += $unit['hero']; } - $uni['hero'] += $movement['hero']; - $unit_total['hero'] += $movement['hero']; + + if (isset($movement['hero'])) { + $uni['hero'] += $movement['hero']; + $unit_total['hero'] += $movement['hero']; + } + if($uni['hero'] !=0){$cl = '';}else{$cl = 'none';} echo ''.$uni['hero'].''; echo ''; diff --git a/Templates/dorf3/menu.tpl b/Templates/dorf3/menu.tpl index cbdb3373..65dbf002 100644 --- a/Templates/dorf3/menu.tpl +++ b/Templates/dorf3/menu.tpl @@ -1,7 +1,7 @@
Overview - | Resources - | Warehouse - | CP - | Troops + | Resources + | Warehouse + | CP + | Troops
\ No newline at end of file