getMInfo($d); $baseId = isset($basearray['id'])? $basearray['id'] : 0; $uinfo = $database->getVillage($baseId); $isOasis = ($basearray['fieldtype'] == 0); $oasis = array('conqured'=>0,'owner'=>0); if ($isOasis) { $q = $database->dblink->query('SELECT conqured, owner FROM `'.TB_PREFIX.'odata` WHERE wref='.(int)$d); if($q) $oasis = $q->fetch_assoc(); } $access = $session->access; $oasislink = ''; $coords = "(".$basearray['x']."|".$basearray['y'].")"; $otext = $isOasis? ($oasis['conqured']? OCCUOASIS : UNOCCUOASIS) : ''; // ---------- 1. FIELD ---------- $fieldMap = array( 1=>'3-3-3-9', 2=>'3-4-5-6', 3=>'4-4-4-6', 4=>'4-5-3-6', 5=>'5-3-4-6', 6=>'1-1-1-15', 7=>'4-4-3-7', 8=>'3-4-4-7', 9=>'4-3-4-7', 10=>'3-5-4-6', 11=>'4-3-5-6', 12=>'5-4-3-6' ); $tt = $isOasis? '' : (isset($fieldMap[$basearray['fieldtype']])? $fieldMap[$basearray['fieldtype']] : ''); $landd = $isOasis? array() : explode('-', $tt); // ---------- 2. OASIS BONUS ---------- $oasisBonus = array( 1=>array(array('r1',LUMBER,25)), 2=>array(array('r1',LUMBER,25)), 3=>array(array('r1',LUMBER,25),array('r4',CROP,25)), 4=>array(array('r2',CLAY,25)), 5=>array(array('r2',CLAY,25)), 6=>array(array('r2',CLAY,25),array('r4',CROP,25)), 7=>array(array('r3',IRON,25)), 8=>array(array('r3',IRON,25)), 9=>array(array('r3',IRON,25),array('r4',CROP,25)), 10=>array(array('r4',CROP,25)), 11=>array(array('r4',CROP,25)), 12=>array(array('r4',CROP,50)) ); $bonusData = $isOasis? (isset($oasisBonus[$basearray['oasistype']])? $oasisBonus[$basearray['oasistype']] : array()) : array(); if ($isOasis) { $parts = array_map(function($b){ return "+".$b[2]."% ".$b[1]; }, $bonusData); $tt = implode(' and ', $parts).' '.PERHOUR; } // ---------- 3. HELPERE ---------- function tribeName($t){ $m = array(1=>TRIBE1,2=>TRIBE2,3=>TRIBE3,4=>TRIBE4,5=>TRIBE5); return isset($m[$t])? $m[$t] : ''; } function renderBonus($bonusData){ foreach($bonusData as $b){ $cls=$b[0]; $res=$b[1]; $pct=$b[2]; echo ' '.$pct.'% '.$res.''; } } function renderReports($database,$generator,$session,$d,$limit,$typeMap=null){ $where = $session->alliance? 'ally = '.(int)$session->alliance : 'uid = '.(int)$session->uid; $sql = 'SELECT ntype,id,topic,time FROM '.TB_PREFIX.'ndata WHERE ('.$limit.') AND '.$where.' AND toWref = '.(int)$d.' ORDER BY time DESC LIMIT 5'; $res = $database->dblink->query($sql); if(!$res ||!$res->num_rows){ echo ''.THERENOINFO.''; return; } while($row=$res->fetch_assoc()){ $type = $row['ntype']; if($typeMap && isset($typeMap[$type])) $type = $typeMap[$type]; if($type>=18 && $type<=22){ $icon = ''.$row['topic'].''; } else { $icon = ''; } $date = $generator->procMtime($row['time']); // Reports here are selected by `ally = session alliance` (shared alliance // reports) whenever the viewer is in an alliance, so they may be owned by // an ally rather than the viewer. berichte.php only renders such a report // when the `aid` param is present (its uid-owner branch fails for allies), // hence the blank page. Append &aid= like Alliance/attacks.tpl does. $link = 'berichte.php?id='.$row['id'].($session->alliance? '&aid='.(int)$session->alliance : ''); echo ''.$icon.' '.$date[0].' '.substr($date[1],0,5).''; } } ?>

(capital)
';?> <?php echo PLANVILLAGE;?> <?php echo htmlspecialchars($tt);?>
getUnit($d); $unames = array(31=>U31,32=>U32,33=>U33,34=>U34,35=>U35,36=>U36,37=>U37,38=>U38,39=>U39,40=>U40); $has=false; for($i=31;$i<=40;$i++) if($unit['u'.$i]>0){ $has=true; if(!$oasislink) $oasislink = rtrim(HOMEPAGE,'/').'/warsim.php?target=4'; $oasislink.= '&u'.$i.'='.$unit['u'.$i]; echo ''; } if(!$has) echo ''; ?>
:
'.$unames[$i].''.$unit['u'.$i].''.$unames[$i].'
'.NOTROOP.'
getVillage($d); $isOwner = $session->uid == (isset($tmp['owner'])? $tmp['owner'] : 0); $limit = $isOwner? 'ntype > 3 AND ntype < 8' : 'ntype < 8 OR ntype > 17'; renderReports($database,$generator,$session,$d,$limit); ?>
:
getUserArray($oasis['owner'],1);?>
'.$database->getUserAlliance($oasis['owner']).'' : '-';?>
getUserField($oasis['owner'],'username',0);?>
getVillageField($oasis['conqured'],'name');?>
getVillage($d); $isOwner = $session->uid == (isset($tmp['owner'])? $tmp['owner'] : 0); $limit = $isOwner? '(ntype > 3 AND ntype < 8) OR ntype = 20 OR ntype = 21' : 'ntype < 8 OR ntype > 17'; renderReports($database,$generator,$session,$d,$limit); ?>
getUserArray($basearray['owner'],1);?>
'.$database->getUserAlliance($basearray['owner']).'' : '-';?>
getUserField($basearray['owner'],'username',0);?>
uid == $basearray['owner']; $limit = $isOwner? '(ntype > 3 AND ntype < 8) OR ntype = 23' : '(ntype < 8 OR (ntype > 17 AND ntype < 22)) OR ntype = 22'; renderReports($database,$generator,$session,$d,$limit,array(23=>22)); ?>
:
dblink->query('SELECT owner FROM `'.TB_PREFIX.$tbl.'` WHERE wref='.(int)$d); $ownerId = $qr? $qr->fetch_assoc() : array('owner'=>0); $ownerId = $ownerId['owner']; $tUser = $database->dblink->query('SELECT access,id,vac_mode,protect FROM `'.TB_PREFIX.'users` WHERE id='.(int)$ownerId)->fetch_assoc(); $banned = $tUser['access']==0 || ($tUser['access']==MULTIHUNTER && $tUser['id']==5) || (!ADMIN_ALLOW_INCOMING_RAIDS && $tUser['access']==9); ?>
» .
resarray['f39']>0; if($canRaid){ echo '» '.RAID.' '.$otext.''; } else { echo '» '.RAID.' '.$otext.' ('.BUILDRALLY.')'; } if($oasislink) echo '
» Combat Simulator'; } else { $total = count($database->getProfileVillages($session->uid)); $need = ${'cp'.CP}[$total+1]; $have = floor($database->getUserField($session->uid,'cp',0)); $settlers = $village->unitarray['u'.$session->tribe.'0']; if($settlers>=3 && $have>=$need && $village->resarray['f39']>0){ echo '» '.FNEWVILLAGE.''; } elseif($settlers>=3 && $have<$need){ echo '» '.FNEWVILLAGE.' ('.$have.'/'.$need.' '.CULTUREPOINT.')'; } elseif(!$village->resarray['f39']){ echo '» '.FNEWVILLAGE.' ('.BUILDRALLY.')'; } else { echo '» '.FNEWVILLAGE.' ('.$settlers.'/3 '.SETTLERSAVAIL.')'; } } ?>
resarray['f39']>0? '» '.SENDTROOP.'' : '» '.SENDTROOP.' ('.BUILDRALLY.')'; else echo '» '.SENDTROOP.' ('.BEGINPRO.')'; ?>
getTypeLevel(17)? '» '.SENDMERC.'' : '» '.SENDMERC.' ('.BUILDMARKET.')'; ?>