I've created an official page for my various PHP API examples here:
http://www.briggsoft.com/docs/pmavens/API_Examples.htm
and another one for custom HTML (e.g., banner ads, etc.) here:
http://www.briggsoft.com/docs/pmavens/HTML_Examples.htm
<html>
<body>
<?php
if (isset($_REQUEST["Search"])) // page load via search button
{
include "API.php"; // include file has $pw, $url, Poker_API()
// get player name submitted by form
$player = $_REQUEST["Player"];
if ($player == "")
{
echo "<b>No player name entered. Click the back button.</b><br/>";
exit;
}
// get list of connections
echo "<b>Searching logins ...</b><br/>";
$params = "Password=$pw&Command=ConnectionsList&Fields=Player";
$api = Poker_API($url,$params);
if ($api["Result"] == "Error")
{
echo "Error: " . $api["Error"] . "<br/>";
exit;
}
// loop thru connections list looking for player
$found = false;
$connections = $api["Connections"];
for ($i = 1; $i <= $connections; $i++) {
if (strcasecmp($player,$api["Player" . $i])==0)
{
$found = true;
break;
}
}
if ($found == true) echo $player . " is logged in<br/>"; else
{
echo $player . " is not logged in<br/>";
echo "<br/><b>Click the back button for another search</b><br/>";
exit;
}
// get list of ring games
echo "<br/><b>Searching ring game tables ...</b><br/>";
$params = "Password=$pw&Command=RingGamesList&Fields=Name";
$api = Poker_API($url,$params);
if ($api["Result"] == "Error")
{
echo "Error: " . $api["Error"] . "<br/>";
exit;
}
// loop thru ring games list looking for player
$found = 0;
$rcount = $api["RingGames"];
for ($i = 1; $i <= $rcount; $i++)
{
$r = $api["Name" . $i];
$params = "Password=$pw&Command=RingGamesPlaying&Name=" . urlencode($r);
$api2 = Poker_API($url,$params);
$pcount = $api2["Count"];
// loop thru players list
for ($j = 1; $j <= $pcount; $j++)
{
if (strcasecmp($player,$api2["Player" . $j])==0)
{
$found++;
echo $player . " is seated at " . $r . "<br/>";
break;
}
}
}
if ($found == 0) echo $player . " is not seated at any ring game tables<br/>";
// get list of tournaments
echo "<br/><b>Searching tournament tables ...</b><br/>";
$params = "Password=$pw&Command=TournamentsList&Fields=Name";
$api = Poker_API($url,$params);
if ($api["Result"] == "Error")
{
echo "Error: " . $api["Error"] . "<br/>";
exit;
}
// loop thru tournaments list looking for player
$found = 0;
$tcount = $api["Tournaments"];
for ($i = 1; $i <= $tcount; $i++)
{
$t = $api["Name" . $i];
$params = "Password=$pw&Command=TournamentsPlaying&Name=" . urlencode($t);
$api2 = Poker_API($url,$params);
$pcount = $api2["Count"];
// loop thru players list
for ($j = 1; $j <= $pcount; $j++)
{
if (strcasecmp($player,$api2["Player" . $j])==0)
{
$found++;
echo $player . " is seated at " . $t . " - Table " . $api2["Table" . $j] . "<br/>";
break;
}
}
}
if ($found == 0) echo $player . " is not seated at any tournaments<br/>";
echo "<br/><b>Click the back button for another search</b><br/>";
exit;
}
?>
<!-- display input form on first load -->
<!-- post results back to same page -->
<h3>Search for Player</h3>
<form method="post">
Screen name:<br/>
<input type="text" name="Player" />
<input type="submit" name="Search" value="Search" />
</form>
</body>
</html>
rjones33 wrote:One project I am working on though is a points system for league tournament play where the players receive points based on their finishing postion rather than chips. Any plans to implement something like this in future releases?
rjones33 wrote: I currently store all my user data in a SQL database.
lp69 wrote:I didn't figure out how to have the poker server retrieve the data from the SQL database.
lp69 wrote:How do you do that ? I thought it wasn't possible, I didn't figure out how to have the poker server retrieve the data from the SQL database.
lp69 wrote:OK I see, thanks.
But since the whole process still uses 1 file per account, it is still well under the expected performance of using a database only.
Users browsing this forum: No registered users and 5 guests