query_first("SELECT tag FROM bb".$n."_city1 WHERE cityid = '1'");
$tag = $temptag['tag'];
$contextOptions = array("http" => array ("header" => "Cookie: X-Mc-Ref=1;expires=1;path=/\r\n"));
$context =stream_context_create($contextOptions);
$url = @file_get_contents ("http://".$cityname.".myminicity.com",false, $context);
$kPos = strpos($url, "&k=") +3;
$k = substr($url, $kPos, 5);
$source = @file_get_contents("http://".$cityname.".myminicity.com/xml");
$file = $cityname.'_myminicity.xml';
file_put_contents($file, file_get_contents('http://'.$cityname.'.'.$extension.'/xml'));
$city = simplexml_load_file($file);
$platz = $city->ranking;
$user = $city->population;
$geld = number_format($city->incomes,0, ",", ".");
$alg = $city->unemployment;
$transe = $city->transport;
$crime = $city->criminality;
$dreck = $city->pollution;
$com = $city->bases[com];
$env = $city->bases{env};
$ind = $city->bases{ind};
$sec = $city->bases{sec};
$tra = $city->bases{tra};
$inhalt ="
 | Hier kannst Du einen - Einwohner stiften |
";
if ($city->unemployment == 0){
if ($city->population >=50){
$algtxt = "Alles OK";
}
else {
$algtxt = "Nicht genügend Einwohner";
}
$inhalt .= "  | $algtxt |
";
}
else {
$inhalt .= "  | Hier kannst Du eine - Fabrik stiften |
";
}
if ($city->transport == 100){
if ($city->population >=100){
$transtxt = "Alles OK";
}
else {
$transtxt = "Nicht genügend Einwohner";
}
$inhalt .= "  | $transtxt |
";
}
else {
$inhalt .= "  | Hier kannst Du eine - Straße stiften |
";
}
if ($city->criminality == 0){
if ($city->population >=300){
$crimetxt = "Alles OK";
}
else {
$crimetxt= "Nicht genügend Einwohner";
}
$inhalt .= " | $crimetxt |
";
}
else {
$inhalt .= " | Hier kannst Du einen - Polizisten stiften |
";
}
if ( $city->pollution == 0 ) {
if ($city->population >=500){
$drecktxt = "Alles OK";
}
else {
$drecktxt = "Nicht genügend Einwohner";
}
$inhalt .= " | $drecktxt |
";
}
else {
$inhalt .= " | Hier kannst Du einen - Baum stiften |
";
}
if ( $city->population >= 1000 ) {
$inhalt .= " | Hier kannst Du einen - Shop eröffnen |
";
}
eval ("\$tpl->output(\"".$tpl->get("citya")."\");");
?>