Page 5 of 7

Re: API and HTML Examples

PostPosted: Fri Jan 15, 2010 12:20 am
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.

Re: API and HTML Examples

PostPosted: Fri Jan 15, 2010 12:46 am
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];
    }
  }

Re: API and HTML Examples

PostPosted: Fri Jan 15, 2010 12:56 am
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 ()

Re: API and HTML Examples

PostPosted: Thu Jun 17, 2010 4:11 pm
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?

Re: API and HTML Examples

PostPosted: Thu Jun 17, 2010 4:31 pm
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.

Re: API and HTML Examples

PostPosted: Wed Aug 18, 2010 5:00 am
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

Re: API and HTML Examples

PostPosted: Wed Aug 18, 2010 9:33 am
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.

Re: API and HTML Examples

PostPosted: Wed Aug 18, 2010 4:51 pm
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

Re: API and HTML Examples

PostPosted: Sun Aug 22, 2010 5:02 am
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

Re: API and HTML Examples

PostPosted: Sun Aug 22, 2010 9:30 am
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 7126 times