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


PHP Globals::getHiddenPlayers方法代码示例

本文整理汇总了PHP中Globals::getHiddenPlayers方法的典型用法代码示例。如果您正苦于以下问题:PHP Globals::getHiddenPlayers方法的具体用法?PHP Globals::getHiddenPlayers怎么用?PHP Globals::getHiddenPlayers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Globals的用法示例。


在下文中一共展示了Globals::getHiddenPlayers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: USING

    $players[$db->getInt('account_id')] = SmrPlayer::getPlayer($db->getInt('account_id'), $player->getGameID())->getLinkedDisplayName(false);
}
$db->query('SELECT mb_messages FROM player_has_alliance_role JOIN alliance_has_roles USING(game_id,alliance_id,role_id) WHERE account_id = ' . $db->escapeNumber($player->getAccountID()) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND alliance_id=' . $db->escapeNumber($alliance->getAllianceID()) . ' LIMIT 1');
$db->nextRecord();
$thread['CanDelete'] = $db->getBoolean('mb_messages');
$db->query('SELECT text, sender_id, time, reply_id
FROM alliance_thread
WHERE game_id=' . $db->escapeNumber($player->getGameID()) . '
AND alliance_id=' . $db->escapeNumber($alliance->getAllianceID()) . '
AND thread_id=' . $db->escapeNumber($thread_id) . '
ORDER BY reply_id LIMIT ' . $var['thread_replies'][$thread_index]);
$thread['CanDelete'] = $db->getNumRows() > 1 && $thread['CanDelete'];
$thread['Replies'] = array();
$container = create_container('alliance_message_delete_processing.php', '', $var);
$container['thread_id'] = $thread_id;
while ($db->nextRecord()) {
    $thread['Replies'][$db->getInt('reply_id')] = array('Sender' => $players[$db->getInt('sender_id')], 'Message' => $db->getField('text'), 'SendTime' => $db->getInt('time'));
    if ($thread['CanDelete']) {
        $container['reply_id'] = $db->getInt('reply_id');
        $thread['Replies'][$db->getInt('reply_id')]['DeleteHref'] = SmrSession::getNewHREF($container);
    }
}
if ($mbWrite || in_array($player->getAccountID(), Globals::getHiddenPlayers())) {
    $container = create_container('alliance_message_add_processing.php', '', $var);
    $container['thread_index'] = $thread_index;
    $thread['CreateThreadReplyFormHref'] = SmrSession::getNewHREF($container);
}
$template->assignByRef('Thread', $thread);
if (isset($var['preview'])) {
    $template->assign('Preview', $var['preview']);
}
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:alliance_message_view.php

示例2: in_array

<?php

$template->assign('PageTopic', 'Examine Planet');
$planet =& $player->getSectorPlanet();
$template->assignByRef('ThisPlanet', $planet);
$planetLand = !$planet->hasOwner() || $planet->getOwner()->sameAlliance($player) || in_array($player->getAccountID(), Globals::getHiddenPlayers());
if (!$planetLand) {
    // Only check treaties if we can't otherwise land.
    $ownerAllianceID = 0;
    if ($planet->hasOwner()) {
        $ownerAllianceID = $planet->getOwner()->getAllianceID();
    }
    $db->query('
		SELECT planet_land
		FROM alliance_treaties
		WHERE (alliance_id_1 = ' . $db->escapeNumber($ownerAllianceID) . ' OR alliance_id_1 = ' . $db->escapeNumber($player->getAllianceID()) . ')
		AND (alliance_id_2 = ' . $db->escapeNumber($ownerAllianceID) . ' OR alliance_id_2 = ' . $db->escapeNumber($player->getAllianceID()) . ')
		AND game_id = ' . $db->escapeNumber($player->getGameID()) . '
		AND planet_land = 1
		AND official = ' . $db->escapeBoolean(true));
    $planetLand = $db->nextRecord();
}
$template->assign('PlanetLand', $planetLand);
开发者ID:smrealms,项目名称:smrv2.0,代码行数:23,代码来源:planet_examine.php


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