API and HTML Examples

For discussion of the Poker Mavens server module and other administration topics

Re: API and HTML Examples

Postby lildamien09 » Fri Jan 15, 2010 12:20 am

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.
lildamien09
 
Posts: 71
Joined: Sun Sep 13, 2009 7:08 pm
Location: TX

Re: API and HTML Examples

Postby Kent Briggs » Fri Jan 15, 2010 12:46 am

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];
    }
  }
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: API and HTML Examples

Postby lildamien09 » Fri Jan 15, 2010 12:56 am

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 ()
lildamien09
 
Posts: 71
Joined: Sun Sep 13, 2009 7:08 pm
Location: TX

Re: API and HTML Examples

Postby social » Thu Jun 17, 2010 4:11 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]

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?
social
 
Posts: 199
Joined: Fri Nov 20, 2009 12:23 am

Re: API and HTML Examples

Postby Kent Briggs » Thu Jun 17, 2010 4:31 pm

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.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: API and HTML Examples

Postby treeman » Wed Aug 18, 2010 5:00 am

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

Re: API and HTML Examples

Postby Kent Briggs » Wed Aug 18, 2010 9:33 am

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 - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: API and HTML Examples

Postby Kent Briggs » Wed Aug 18, 2010 4:51 pm

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
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: API and HTML Examples

Postby treeman » Sun Aug 22, 2010 5:02 am

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

Re: API and HTML Examples

Postby Kent Briggs » Sun Aug 22, 2010 9:30 am

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 7387 times
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

PreviousNext

Return to Site Administration

Who is online

Users browsing this forum: No registered users and 3 guests

cron