API and HTML Examples
-
- Posts: 72
- Joined: Sun Sep 13, 2009 7:08 pm
- Location: TX
Re: API and HTML Examples
I got another question for you.. im workin with the leaderboard.. im arraying 100 accounts.. my admin accounts have alot of money.. is there a way to sor by chip rank.. and then sort by title.. so the the admins with the Title admin are put to the bottom.. or possible if Title = Admin then it doesnt show.
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: API and HTML Examples
There's probably several ways to do that. I'd probably just make two passes through the $accounts array, removing the Admins on the first pass, sort those, display those. Then repeat that but remove the non-Admins from the second pass, sort those, display those. Or if you don't want the Admins at all, just strip them out like this:lildamien09 wrote:I got another question for you.. im workin with the leaderboard.. im arraying 100 accounts.. my admin accounts have alot of money.. is there a way to sor by chip rank.. and then sort by title.. so the the admins with the Title admin are put to the bottom.. or possible if Title = Admin then it doesnt show.
Code: Select all
for ($i = 1; $i <= $accounts; $i++)
{
if ($api["Title" . $i] <> "Admin")
{
$player = $api["Player" . $i];
$chips[$player] = $api["Balance" . $i];
}
}
-
- Posts: 72
- Joined: Sun Sep 13, 2009 7:08 pm
- Location: TX
Re: API and HTML Examples
Thats axactly what i was looking for.. i tried a code similar to that but didnt close it in with the ()Kent Briggs wrote:Code: Select all
for ($i = 1; $i <= $accounts; $i++) { if ($api["Title" . $i] <> "Admin") { $player = $api["Player" . $i]; $chips[$player] = $api["Balance" . $i]; } }
Re: API and HTML Examples
I thought that Players could only play ONE table at a time with PM?Kent Briggs wrote:Just added to the API page is this PHP routine that allows anyone to search if a player is logged in and gives a list of the tables where they are currently seated:
[/code]
How can it search through the tables they are seated at, in that case?
Can you play more than one table or tournament after all?
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: API and HTML Examples
Nope, PM is a true multi-table system. Anyone can play multiple ring games and/or tournaments all at the same time in the Pro and Gold versions.social wrote: I thought that Players could only play ONE table at a time with PM?
Re: API and HTML Examples
was working but now get this?
Notice: Undefined offset: 1 in C:\Program Files\EasyPHP-5.3.2i\www\kplpoker\pokerroom\API.php on line 29
Notice: Undefined index: Result in C:\Program Files\EasyPHP-5.3.2i\www\kplpoker\pokerroom\index.php on line 62
Notice: Undefined index: Value in C:\Program Files\EasyPHP-5.3.2i\www\kplpoker\pokerroom\index.php on line 64
only change was update to 2.85
just the standard api.php from site.
cheers paul
Notice: Undefined offset: 1 in C:\Program Files\EasyPHP-5.3.2i\www\kplpoker\pokerroom\API.php on line 29
Notice: Undefined index: Result in C:\Program Files\EasyPHP-5.3.2i\www\kplpoker\pokerroom\index.php on line 62
Notice: Undefined index: Value in C:\Program Files\EasyPHP-5.3.2i\www\kplpoker\pokerroom\index.php on line 64
only change was update to 2.85
just the standard api.php from site.
cheers paul
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: API and HTML Examples
There were no changes in the API recently. There's likely something wrong in your PHP code or setup. Impossible to tell without seeing the source.treeman wrote: Notice: Undefined offset: 1 in C:\Program Files\EasyPHP-5.3.2i\www\kplpoker\pokerroom\API.php on line 29
Notice: Undefined index: Result in C:\Program Files\EasyPHP-5.3.2i\www\kplpoker\pokerroom\index.php on line 62
Notice: Undefined index: Value in C:\Program Files\EasyPHP-5.3.2i\www\kplpoker\pokerroom\index.php on line 64
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: API and HTML Examples
I've posted some PHP code on the API Examples page of how to use Session Keys. See the Automated Logins section:
http://www.briggsoft.com/docs/pmavens/API_Examples.htm
http://www.briggsoft.com/docs/pmavens/API_Examples.htm
Re: API and HTML Examples
I have copied every thing as is and still get the error.
Its connecting to the api and then the server as i do not get the server error.
as above the first error is in the api at 29 which is in
api.php
29 $api[$namevalue[0]] = $namevalue[1];
I am not sure what to do next my feeling is that it is not seeing the datafile properly.
It must be simple i think. The thing is i had it working. i will keep at it as this game software is worth the effort and i feel its something i am not doing.
cheers Paul![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Its connecting to the api and then the server as i do not get the server error.
as above the first error is in the api at 29 which is in
api.php
29 $api[$namevalue[0]] = $namevalue[1];
I am not sure what to do next my feeling is that it is not seeing the datafile properly.
It must be simple i think. The thing is i had it working. i will keep at it as this game software is worth the effort and i feel its something i am not doing.
cheers Paul
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: API and HTML Examples
Create and run a little test program with this code:treeman wrote:I have copied every thing as is and still get the error.
<?php
phpinfo();
?>
Then scroll down in the output and see if there is a "curl" section that shows curl to be enabled: