示例#1
0
    }
}
if ($beaten) {
    // selects top 30 scores (default)
    $r = User::find_top_scores(50);
    // finds the position based on the points player scored
    $key = array_search($score, $r);
    //	echo $key;
}
// checks if player's score is greater than bottom score from the table
$beaten ? $color = "high" : ($color = "low");
// odmiana sekund i minut
$r = s2m($time);
//print_r($r);
$czas = $r['min'] != 0 ? ileMinut($r['min']) : false;
$czas .= " " . ileSekund($r['sec']);
?>
<div id="endWrap" class="oknoGry">
	<div id="yourResult" class="resultsBlock roundCorners">
		<?php 
if ($beaten && $logged) {
    ?>
		<span id="position" class="<?php 
    echo $color;
    ?>
 miejsce">Miejsce: <?php 
    echo $key + 1;
    ?>
</span>
		<span class="<?php 
    echo $color;
示例#2
0
<script>
$(function(){
    wszechwiedzacy.gra.cv = $("#rezultat");
    var txt = "<span id=\"position\" class=\"high miejsce\">Miejsce: <?php 
echo $key;
?>
</span>";
    txt += "<span class=\"high score\">Punkty: <?php 
echo $score;
?>
</span>";
    txt += "<span class=\"tick\"></span>";
	$("#yourResult").html(txt);
    var h = "<h3 class=\"gra not\">Twój wynik to <?php 
echo $score;
?>
 punktów, czas: <?php 
echo ileSekund($time);
?>
.<br>";
    h += "Sprawdź swoją pozycję w <a id=\"showRank\" href=\"#\">rankingu</a> zwycięzców.<br>";
    h += "Poprawne odpowiedzi: <?php 
echo $_SESSION['odp_poprawne'];
?>
<br>Procent poprawnych odpowiedzi: <?php 
echo $perc;
?>
%</h3>";
    $("#statystyki h3").replaceWith(h);
});
</script>