Page 1 of 1

League Add-On or Export out to a Poker Leauge PHP Script

Posted: Sat Sep 27, 2008 5:04 pm
by hofdiggity
Hello,

Before I mention my wish list, I just want to let you know, I think your software ROCKS. The online community I participate in has REALLY enjoyed the ease of use, the power of the multi-table tournament, and the lite-ness.

Now onto the wish list, which maybe you could just point me into the right direction on third-party php script:
Is there anyway to have a League Add-in? One in which it will grant a predetermined portion of the chips based on rank of a particular multi-table tournament and keep track of the points over a given amount of time.

or

Is there a method of exporting a particular tournament results, then sending them to a php poker league software which can parse the data into an organized view (similar to UltraStats for Call of Duty)?

Once again, thank you for all your hard work. Your product is outstanding without any further additions!

Re: League Add-On or Export out to a Poker Leauge PHP Script

Posted: Sat Sep 27, 2008 5:39 pm
by Kent Briggs
hofdiggity wrote: Is there a method of exporting a particular tournament results, then sending them to a php poker league software which can parse the data into an organized view
Yes, the API command set built into the Pro version has a function (conveniently named "TournamentResults") for retrieving tournament results. Anyone with a working knowledge of PHP should be able to retrieve that and format the output however you wished. I've posted a generic PHP function (Poker_API) for calling the API in this thread:

http://www.briggsoft.com/forums/viewtopic.php?f=8&t=114

I haven't posted any examples of manipulating the tournaments results data but the file it retrieves looks something like this example pasted from the help file:

Results=Ok
Tournament=Tournament #1
Number=39
BuyIn=1500
Entrants=2
Start=2008-07-12 13:41:21
Place2=BoneCrusher (0)
Place1=Aces123 (3000)
Stop=2008-07-12 13:42:04

Tournament=Tournament #1
Number=40
BuyIn=1500
Entrants=3
Start=2008-07-12 17:11:26
Place3=DeathBot (0)
Place2=Aces123 (0)
Place1=BoneCrusher (4500)
Stop=2008-07-12 17:12:08

Re: League Add-On or Export out to a Poker Leauge PHP Script

Posted: Sun Sep 28, 2008 5:42 pm
by hofdiggity
Thank you very much for all your help!

Do you recommend any certain PHP Poker League Scripts out right now?

Re: League Add-On or Export out to a Poker Leauge PHP Script

Posted: Sun Sep 28, 2008 10:09 pm
by Kent Briggs
hofdiggity wrote:Do you recommend any certain PHP Poker League Scripts out right now?
I'm not familiar with any. I imagine you would have to do some custom script development in any case to get the data in the format you need.

Re: League Add-On or Export out to a Poker Leauge PHP Script

Posted: Sun Sep 28, 2008 10:34 pm
by hofdiggity
Well, I am looking into PokerMax Poker League PHP Script. And though I will not be able to have automatic parsing of result data with it, We will track stats manually. So I have a scripting question, that if you have time, maybe you could shoot me a solution. I have attempted to script it myself with no success because I am a very beginner user to php scripting and mysql commands, though I do believe it should be rather simple.

Here is the issue: Currently, the admin can only add one playerid to a specified tournament per submission. I would like to be able to either checkbox or highlight multiple playerids to a specified tournament per submission.

Here is the form:

Code: Select all

<form method="post">
<input name="op" type="hidden" value="AssignPlayer">
<select name="playerid" size="1">
<option value="">Select Player ....</option>
<?PHP 

    $rows = $sql->execute (
      "SELECT * FROM " . $player_table .
      " ORDER BY playerid ASC", SQL_RETURN_ASSOC );

    for ( $i = 0; $i < sizeof ( $rows ); ++$i )
    {
      $row = $rows [ $i ];
      
      ?>
<option value="<?php echo $cgi->htmlEncode ( $row [ "playerid" ] ); ?>">
<?php echo $cgi->htmlEncode ( $row [ "playerid" ] ); ?> - <?php echo $cgi->htmlEncode ( $row [ "name" ] ); ?>
</option>
<?php
    }

?>
</select> 
&nbsp;&nbsp;<em>and assign to the tournament =></em>&nbsp;&nbsp;
<select name="tournamentid" size="1">
<option value="">Select Tournament ....</option>
<?PHP 

    $rows = $sql->execute (
      "SELECT * FROM " . $tournament_table .
      " ORDER BY id DESC", SQL_RETURN_ASSOC );

    for ( $i = 0; $i < sizeof ( $rows ); ++$i )
    {
      $row = $rows [ $i ];
      
      ?>
<option value="<?php echo $cgi->htmlEncode ( $row [ "tournamentid" ] ); ?>">
<?php echo $cgi->htmlEncode ( $row [ "tournament_name" ] ); ?>
</option>
<?php
    }

?>
</select> &nbsp;&nbsp;<input type="submit" value="Assign Player"  ONCLICK="return confirm('Are you sure you want to add this player to the tournament?');" />
</form>
This is the action:

Code: Select all

<?php

  if ( $cgi->getValue ( "op" ) == "AssignPlayer" )
  {

  $result = mysql_query("SELECT playerid FROM ".$score_table." WHERE playerid = " . $sql->quote ( $cgi->getValue ( "playerid" ) ) . " AND tournamentid = " . $sql->quote ( $cgi->getValue ( "tournamentid" ) ) . "") or die ("$DatabaseError"); 
$chkd_email = mysql_numrows($result);

if ($chkd_email != "") {
print "<p class=\"red\"><strong>The Player has already been assigned to this tournament</strong></p>";
 }
 else {

  mysql_query("INSERT INTO ".$score_table." VALUES (
'',
" . $sql->quote ( $cgi->getValue ( "playerid" ) ) . ",
" . $sql->quote ( $cgi->getValue ( "tournamentid" ) ) . ",
'0',
'$dateadded'
)") or die ("$DatabaseError"); 
    ?>
<br>
<p align="center" class="red">The player <strong><?php echo $_POST['playerid']; ?></strong> has been assigned to the poker tournament.</p>
<?php
  }
  }
?>
Once again, if you can help me out that is EXCELLENT, however, if you are much too busy for such question, I completely understand. I am greatly grateful for your product! We are just about to startup our second season!!!!

Re: League Add-On or Export out to a Poker Leauge PHP Script

Posted: Mon Sep 29, 2008 12:05 am
by Kent Briggs
hofdiggity wrote:Here is the issue: Currently, the admin can only add one playerid to a specified tournament per submission. I would like to be able to either checkbox or highlight multiple playerids to a specified tournament per submission.
In general, you would need to loop through the tournament file and pick out the players on the lines that started with "Place". But specifically after that, I'm afraid I can't help you with someone else's program. Your best bet would be in a support forum for that league software (assuming one exists) or a general purpose PHP programming forum.

Re: League Add-On or Export out to a Poker Leauge PHP Script

Posted: Mon Sep 29, 2008 6:08 am
by hofdiggity
Well thank you for taking the time to read it over.

Thanks for all the help and keep on rockin'!

Re: League Add-On or Export out to a Poker Leauge PHP Script

Posted: Mon Sep 29, 2008 11:36 am
by rjones33
I am about to implement this on my site http://www.pokersharkz.net for league play. I am doing all my programming in ASP.Net, but the logic should still roughly be the same. I would be glad to share when I get finished, if that would be any help to you.

-Ricky

Re: League Add-On or Export out to a Poker Leauge PHP Script

Posted: Fri Oct 03, 2008 6:39 am
by hofdiggity
Well thank you for the help, however, Our community will continue to use poker-leaderboard because it is quite powerful and very easy to use.

Re: League Add-On or Export out to a Poker Leauge PHP Script

Posted: Fri Oct 03, 2008 11:52 am
by rjones33
Yeah that software does look pretty cool, but you still have to enter data in manually. Personally, I would rather spend time on something else and have my league standings generated automatically without having to input names after every tournament from a different website. However I think it is a great solution for people who are not interested in designing their own custom solution. That's just my 2 cents...

-Ricky