本文整理汇总了PHP中Review::get_steps方法的典型用法代码示例。如果您正苦于以下问题:PHP Review::get_steps方法的具体用法?PHP Review::get_steps怎么用?PHP Review::get_steps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Review
的用法示例。
在下文中一共展示了Review::get_steps方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Review
<?php
// this page should only be accessed via AJAX
// as it contains invalid markup otherwise
require_once 'includes/inc.global.php';
if (empty($_SESSION['game_file'])) {
exit;
}
try {
$Review = new Review($_SESSION['game_file'], $_SESSION['step']);
$table_format = array(array('SPECIAL_CLASS', true, '[[[class]]]'), array(' ', ' *** '), array('Message', 'message'));
$table_meta = array('no_data' => '<p>There is nothing to show yet</p>', 'caption' => 'Game History <span class="info">Newest entries on top</span>', 'class' => 'history', 'alt_class' => '');
if (!isset($history)) {
$logs = $Review->get_steps(true, $_SESSION['step']);
$players = $Review->get_players();
$colors = array();
foreach ($players as $key => $player) {
$colors[$player['color']] = htmlentities($GLOBALS['_PLAYERS'][$key]) . ' [' . $key . ']';
}
foreach ($logs as &$log) {
// wrap the first all uppercase word in a class of the same name
$log['message'] = preg_replace_callback('/^([ -+=]*)([A-Z]+)/', 'make_class', $log['message']);
// add outcome class to attack outcome
if (' - - ' == substr($log['message'], 0, 5)) {
$log['message'] = str_replace('">', ' outcome">', $log['message']);
$log['message'] = str_replace('and was defeated', '<span class="defeat">and was defeated</span>', $log['message']);
}
// test the data or the message and add a class to the message
$class = '';
switch ($log['data'][0]) {
# case 'A' : $class = 'attack'; break;
示例2: get_header
call('ERROR ACCESSING GAME :' . $e->outputMessage());
}
exit;
}
$chat_html = '';
unset($Chat);
$meta['title'] = htmlentities($Review->name, ENT_QUOTES, 'UTF-8', false) . ' - #' . $_SESSION['game_file'];
$meta['show_menu'] = false;
$meta['head_data'] = '
<link rel="stylesheet" type="text/css" media="screen" href="css/game.css" />
<script type="text/javascript">//<![CDATA[
var state = "watching";
var game_file = ' . json_encode($_SESSION['game_file']) . ';
var step = ' . json_encode($Review->step) . ';
var steps = ' . json_encode($Review->get_steps()) . ';
/*]]>*/</script>
<script type="text/javascript" src="scripts/review.js"></script>
';
echo get_header($meta);
?>
<div id="contents">
<ul id="buttons">
<li><a href="index.php<?php
echo $GLOBALS['_?_DEBUG_QUERY'];
?>
">Main Page</a></li>
<li><a href="game.php<?php
echo $GLOBALS['_?_DEBUG_QUERY'];
?>