API and HTML Examples

For discussion of the Poker Mavens server module and other administration topics
Post Reply
lildamien09
Posts: 72
Joined: Sun Sep 13, 2009 7:08 pm
Location: TX

Re: API and HTML Examples

Post by lildamien09 »

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.
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API and HTML Examples

Post by Kent Briggs »

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.
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:

Code: Select all

  for ($i = 1; $i <= $accounts; $i++)
  {
    if ($api["Title" . $i] <> "Admin")
    {
      $player = $api["Player" . $i];
      $chips[$player] = $api["Balance" . $i];
    }
  }
lildamien09
Posts: 72
Joined: Sun Sep 13, 2009 7:08 pm
Location: TX

Re: API and HTML Examples

Post by lildamien09 »

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];
    }
  }
Thats axactly what i was looking for.. i tried a code similar to that but didnt close it in with the ()
social
Posts: 211
Joined: Fri Nov 20, 2009 12:23 am

Re: API and HTML Examples

Post by social »

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]
I thought that Players could only play ONE table at a time with PM?
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?
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API and HTML Examples

Post by Kent Briggs »

social wrote: I thought that Players could only play ONE table at a time with PM?
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.
treeman
Posts: 8
Joined: Sat Apr 24, 2010 5:26 am

Re: API and HTML Examples

Post by treeman »

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
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API and HTML Examples

Post by Kent Briggs »

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
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.
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API and HTML Examples

Post by Kent Briggs »

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
treeman
Posts: 8
Joined: Sat Apr 24, 2010 5:26 am

Re: API and HTML Examples

Post by treeman »

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 :D
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API and HTML Examples

Post by Kent Briggs »

treeman wrote:I have copied every thing as is and still get the error.
Create and run a little test program with this code:

<?php
phpinfo();
?>

Then scroll down in the output and see if there is a "curl" section that shows curl to be enabled:
curl.png
curl.png (2.56 KiB) Viewed 45713 times
Post Reply