query('SELECT * FROM assets WHERE AssetType = 9 order by players DESC')->fetchAll(); if ($Keyword !== ""){ if (trim($Keyword) == ""){ die; } $stmt = $pdo->prepare("SELECT * FROM assets WHERE AssetType = 9 AND isSubPlace = 0 AND isPrivate = 0 AND Name LIKE :keyword LIMIT :startRow,:maxRows"); $Keyword = "%$Keyword%"; $stmt->bindParam(':keyword', $Keyword, PDO::PARAM_STR); $stmt->bindParam(":startRow", $StartRows, PDO::PARAM_INT); $stmt->bindParam(":maxRows", $MaxRows, PDO::PARAM_INT); $stmt->execute(); }else{ switch ($SortFilter) { case 0: $stmt = $pdo->prepare("SELECT * FROM assets WHERE AssetType = 9 AND isSubPlace = 0 AND isPrivate = 0 ORDER BY Visits DESC LIMIT :startRow,:maxRows"); $stmt->bindParam(":startRow", $StartRows, PDO::PARAM_INT); $stmt->bindParam(":maxRows", $MaxRows, PDO::PARAM_INT); $stmt->execute(); break; case 1: $stmt = $pdo->prepare("SELECT * FROM assets WHERE AssetType = 9 AND isSubPlace = 0 AND isPrivate = 0 ORDER BY players DESC LIMIT :startRow,:maxRows"); $stmt->bindParam(":startRow", $StartRows, PDO::PARAM_INT); $stmt->bindParam(":maxRows", $MaxRows, PDO::PARAM_INT); $stmt->execute(); break; default: $stmt = $pdo->prepare("SELECT * FROM assets WHERE AssetType = 9 AND isSubPlace = 0 AND isPrivate = 0 ORDER BY players DESC LIMIT :startRow,:maxRows"); $stmt->bindParam(":startRow", $StartRows, PDO::PARAM_INT); $stmt->bindParam(":maxRows", $MaxRows, PDO::PARAM_INT); $stmt->execute(); break; } } foreach($stmt as $game) { if(!$game['isSubPlace']){ $stmt = $pdo->prepare('SELECT * FROM users where UserId = :uid'); $stmt->execute(['uid' => $game['CreatorID']]); $user = $stmt->fetch(PDO::FETCH_ASSOC); echo '
'.htmlspecialchars($game['Name']).'
'.intval($game['players']).' players online - '.$game['ClientYear'].'
played '.intval($game['Visits']).' times
0   |   0
'; } } ?>