本文整理汇总了PHP中Game::findGame方法的典型用法代码示例。如果您正苦于以下问题:PHP Game::findGame方法的具体用法?PHP Game::findGame怎么用?PHP Game::findGame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game
的用法示例。
在下文中一共展示了Game::findGame方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: session_start
<?php
session_start();
//echo "sdfsdf";
require 'controller/dbsettings.php';
if (Game::findGame()->type != "geo") {
header('Location: showAnswerOther.php');
}
/*
if (Game::findGame()->type=="pop")
header( 'Location: showAnswerPop.php') ;
if (Game::findGame()->type=="weather")
header( 'Location: showAnswerWeather.php') ;
if (Game::findGame()->type=="age")
header( 'Location: showAnswerAge.php') ;
if (Game::findGame()->type=="user")
header( 'Location: showAnswerAge.php') ;
if (Game::findGame()->type=="time")
header( 'Location: showAnswerTime.php');
*/
$allAnswers = new AllAnswers($_SESSION["questionNumber"]);
?>
<html>
<head>
<link rel="stylesheet" href="style/global.css">
<style type="text/css">
html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
示例2: session_start
<?php
session_start();
//echo "sdfsdf";
require 'controller/dbsettings.php';
if (Game::findGame()->type != "geo" && Game::findGame()->type != "pt" && Game::findGame()->type != "places") {
header('Location: showAnswerOther.php');
}
$theQuestion = Question::loadQuestion();
$theQuestion->alertUsers(-1);
$allAnswers = new AllAnswers($_SESSION["questionNumber"]);
//die ($allAnswers->zoomLevel());
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Answer</title>
<link rel="stylesheet" href="style/global.css">
<link rel="stylesheet" href="style/showAnswer.css">
<link rel="stylesheet" href="style/showAnswerOther.css">
<!--<script src="scripts/getQuestion.js"></script>-->
<script src="scripts/global.js"></script>
<script src="scripts/socketScripts.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDFCvK3FecOiz5zPixoSmGzPsh0Zv75tZs"></script>
<script>
示例3: url
body{
<?php
if ($theQuestion->type == "age") {
?>
background-size: contain;
<?php
} else {
?>
background-size: cover;
<?php
}
?>
background-repeat: no-repeat;
background-position:center center;
background: url('<?php
echo Question::loadImage($allAnswers->correctAns->name, Game::findGame()->type);
?>
');
}
#overlayWrap{
left:400px;
height:140px;
background: rgba(0,0,0,.7);
}
#scoresWrap{
display: block;
position: fixed;
left: 0px;
示例4: session_start
<?php
session_start();
$whitelist = array('message', 'submit', 'name', 'game_id');
require 'controller/dbsettings.php';
if ($submit == "Join") {
//$name=substr($name,0,20);
$_SESSION["game_id"] = $game_id;
// User::createUser($game_id,$name);
if (Game::findGame() == null) {
header('Location: joinQuiz.php?error=Bad Game');
}
if (!User::createUser($game_id, $name)) {
header('Location: joinQuiz.php?error=Bad Username');
}
$game = Game::findGame();
$questionNumber = $game->round;
if ($questionNumber != -1) {
if ($game->type == "geo") {
header('Location: userScreen.php?question=' . $questionNumber);
} else {
$type = ucwords($game->type);
header('Location: userScreen' . $type . '.php?question=' . $questionNumber);
}
}
}
?>
<html>
<head>
<link rel="stylesheet" href="style/global.css">
<link rel="stylesheet" href="style/joinQuiz.css">
示例5: getNumberUsers
public static function getNumberUsers()
{
$game = Game::findGame();
global $conn;
$lastQuestionNumber = $game->round - 1;
if ($lastQuestionNumber > 0) {
$sql = "SELECT COUNT(*) as total FROM `answers` WHERE game_id ='" . $_SESSION["game_id"] . "' AND questionNum='{$lastQuestionNumber}' AND points>=1";
//echo $sql;
$result = $conn->query($sql);
if ($result) {
$row = $result->fetch_assoc();
return $row['total'];
}
} else {
$sql = "SELECT COUNT(*) as total FROM `users` WHERE game_id ='" . $_SESSION["game_id"] . "'";
$result = $conn->query($sql);
if ($result) {
$row = $result->fetch_assoc();
return $row['total'];
}
}
return 999;
}
示例6:
}, 50);
}
</script>
<style>
body{
background-image:url("<?php
echo $theQuestion->getImage();
?>
");
<?php
if (Game::findGame()->type == "age" || Game::findGame()->type == "entertainment" || Game::findGame()->type == "rand") {
?>
background-size : contain;
background-position : top center;
<?php
} else {
?>
background-size : cover;
background-position : center;
<?php
}
?>
}
</style>
</head>
示例7: parseInt
val = parseInt(labels[i].innerHTML);
labels[i].innerHTML = comma(val);
}
}
</script>
<style>
body{
background-color:black;
background-image: url('<?php
echo $theQuestion->loadImage();
?>
');
background-attachment : fixed;
<?php
if (Game::findGame()->type == "age") {
?>
background-size : contain;
background-position : top center;
<?php
} else {
?>
background-size : cover;
background-position : center;
<?php
}
?>
background-repeat: no-repeat;
}
</style>
示例8: addUser
public static function addUser($qID, $loc, $ans, $userID, $correct, $points, $color)
{
$answer = new self();
$answer->user_id = $userID;
$answer->location = $loc;
$answer->ans = $ans;
$answer->qID = $qID;
$answer->color = $color;
if ($ans == -999) {
//meaning they didnt submit
$answer->distanceAway = -999.99;
} else {
if (!is_object($correct)) {
//meaning end of game
$answer->distanceAway = -999.99;
} else {
if (Game::findGame()->type == "geo" || Game::findGame()->type == "pt" || Game::findGame()->type == "places") {
$answer->distanceAway = LatLong::findDistance($correct->location, $loc);
} else {
$answer->distanceAway = abs($ans - $correct->value);
}
}
}
if ($ans > 100000) {
$answer->distanceAway = round($answer->distanceAway, -5);
}
$answer->getUserInfo();
$answer->updateUser();
$answer->roundPoints = $points;
return $answer;
}