当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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.';
    }
}
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:31,代码来源:ranking.php


注:本文中的Neuron_Core_Tools::output_partly_xml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。