本文整理匯總了PHP中Neuron_Core_Tools::output_partly_xml方法的典型用法代碼示例。如果您正苦於以下問題:PHP Neuron_Core_Tools::output_partly_xml方法的具體用法?PHP Neuron_Core_Tools::output_partly_xml怎麽用?PHP Neuron_Core_Tools::output_partly_xml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Neuron_Core_Tools
的用法示例。
在下文中一共展示了Neuron_Core_Tools::output_partly_xml方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
$output .= '<players>';
$objCache->setCache('ranking.xml', $output);
foreach ($players as $v) {
$objPlayer = Neuron_GameServer::getPlayer($v['plid'], $v);
//$output['content']['players'][] = $objPlayer->getBrowserBasedGamesData ();
$objCache->appendCache('ranking.xml', Neuron_Core_Tools::output_partly_xml($objPlayer->getBrowserBasedGamesData(), 'player'));
$objPlayer->__destruct();
unset($objPlayer);
}
$objCache->appendCache('ranking.xml', ' </players>');
$objCache->appendCache('ranking.xml', '<clans>');
// Clans
$clans = $db->getDataFromQuery($db->customQuery("\n\t\t\t\tSELECT\n\t\t\t\t\tclans.*,\n\t\t\t\t\tSUM(villages.networth) / COUNT(clan_members.plid) AS score\n\t\t\t\tFROM\n\t\t\t\t\tclans\n\t\t\t\tLEFT JOIN\n\t\t\t\t\tclan_members ON clans.c_id = clan_members.c_id AND clan_members.cm_active = 1\n\t\t\t\tLEFT JOIN\n\t\t\t\t\tn_players ON clan_members.plid = n_players.plid \n\t\t\t\tLEFT JOIN\n\t\t\t\t\tvillages ON villages.plid = n_players.plid\n\t\t\t\tGROUP BY clans.c_id\n\t\t\t\tORDER BY\n\t\t\t\t\tclans.c_score DESC\n\t\t\t"));
foreach ($clans as $v) {
$tmp = array('name' => $v['c_name'], 'clan_id' => $v['c_id'], 'score' => floor($v['score']), 'members' => array());
// Load all members
$members = $db->getDataFromQuery($db->customQuery("\n\t\t\t\t\tSELECT\n\t\t\t\t\t\t*\n\t\t\t\t\tFROM\n\t\t\t\t\t\tclan_members\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tclan_members.c_id = " . $v['c_id'] . "\n\t\t\t\t\t\tAND clan_members.cm_active = 1\n\t\t\t\t"));
foreach ($members as $v) {
$tmp['members'][] = array('member_id' => $v['plid']);
}
$objCache->appendCache('ranking.xml', Neuron_Core_Tools::output_partly_xml($tmp, 'clan'));
}
$objCache->appendCache('ranking.xml', '</clans>');
$objCache->appendCache('ranking.xml', '</browsergameshub>');
//echo $sRanking;
$lock->releaseLock('ranking_api', 1);
echo $objCache->getCache('ranking.xml');
} else {
echo 'Try again soon.';
}
}