getProfileVillages($session->uid); foreach ($varray as $vil) { $vid = $vil['wref']; // CP (culture points) $cp = $database->getVillageField($vid, 'cp'); // ========================================================== // EXP SLOTS (celebration slots) // ========================================================== $exp = 0; for ($i = 1; $i <= 3; $i++) { $slot = $database->getVillageField($vid, 'exp'.$i); if ($slot != 0) { $exp++; } } // ========================================================== // BUILDINGS LEVELS // ========================================================== $lvlTH = $building->getTypeLevel(24, $vid); $lvlRes = $building->getTypeLevel(25, $vid); $lvlPal = $building->getTypeLevel(26, $vid); // slots calculation (păstrat identic) $maxslots = ($lvlRes >= 10 ? floor($lvlRes / 10) : 0) + ($lvlPal >= 10 ? floor(($lvlPal - 5) / 5) : 0); // ========================================================== // CELEBRATION TIMER // ========================================================== $hasCel = $database->getVillageField($vid, 'celebration'); if ($hasCel != 0) { $timer++; } // highlight village $class = ($vid == $village->wid) ? 'hl' : ''; // ========================================================== // TROOPS // ========================================================== $unit = $database->getUnit($vid); $tribe = $session->tribe; $siedler = isset($unit['u'.$tribe*10]) ? $unit['u'.$tribe*10] : 0; $senator = isset($unit['u'.((($tribe - 1) * 10) + 9)]) ? $unit['u'.((($tribe - 1) * 10) + 9)] : 0; // images (avoid recompute) $siedlerImg = ''; $senatorImg = ''; // ========================================================== // OUTPUT ROW // ========================================================== echo ' '; // ========================================================== // GLOBAL SUMS // ========================================================== $gesexp += $exp; $gesdorf += $maxslots; $gescp += $cp; $gessied += $siedler; $gessen += $senator; } ?>
Culture points
Village CP/day Celebrations Troops Slots
'.$vil['name'].' '.$cp.' '; if ($lvlTH > 0) { echo ''; if ($hasCel != 0) { echo ''.$generator->getTimeFormat($hasCel - time()).''; } else { echo '●'; } echo ''; } else { echo ' '; } echo ' '; // display troops (safe loops, same logic) for ($i = 0; $i < $siedler; $i++) { echo $siedlerImg; } for ($s = 0; $s < $senator; $s++) { echo $senatorImg; } echo ' '.$exp.'/'.$maxslots.'
Sum