コード例 #1
0
ファイル: wynik.php プロジェクト: qmmr/wszechwiedzacy
    if ($score != 0 && $score >= $btm) {
        $id = User::insert_new_score($score, $username, $time, $perc, $_SESSION['odp_poprawne'], $_SESSION['hashed_email']);
        User::update_user_stats($username);
    }
}
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;
    ?>
コード例 #2
0
ファイル: amidala.php プロジェクト: buganini/amidala
function matrix_transpose($s)
{
    $m = s2m($s);
    $m = mfix($m);
    for ($i = 0; $i < count($m); ++$i) {
        for ($j = 0; $j < count($m[0]); ++$j) {
            $r[$j][$i] = $m[$i][$j];
        }
    }
    return m2s($r);
}