LogsHandHistory regarding Tournament

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

LogsHandHistory regarding Tournament

Postby bigboss » Mon Jun 06, 2011 10:17 am

I've read the API example of LogsHandHistory regarding Tournament history that has a dropdown menu but what I want to do is instead output the entire hand history logs. I need to know a example of how to do this.

I've tried to look the array but I cannot output it. I dumped the variable $api and saw the array but I couldn't loop anything.


THANK YOU
bigboss
 
Posts: 13
Joined: Fri May 20, 2011 3:00 am

Re: LogsHandHistory regarding Tournament

Postby Kent Briggs » Mon Jun 06, 2011 11:20 am

bigboss wrote:I've read the API example of LogsHandHistory regarding Tournament history that has a dropdown menu but what I want to do is instead output the entire hand history logs


I assume you are referring to this:

http://www.briggsoft.com/docs/pmavens/API_Examples.htm#hand_history

I'm not sure what you are asking. The example does display the entire log for whatever file you select. Or do you mean you want the list of files but you just don't want them in a dropdown menu? If that's the case, just remove all the <select> and <option> references:

Code: Select all
$params = "Password=" . $pw . "&Command=LogsHandHistory";
$api = Poker_API($url,$params,true);
if ($api["Result"] == "Error") die($api["Error"]);
$count = $api["Files"];
for ($i=1; $i<=$count; $i++)
{
  $hh = $api["Date" . $i] . "  " . $api["Name" . $i];
  echo $hh . "<br />";
}
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3763
Joined: Wed Mar 19, 2008 8:47 pm

Re: LogsHandHistory regarding Tournament

Postby bigboss » Tue Jun 07, 2011 12:19 pm

What I'm trying to do is display (output) every possible option in Logshandhistory to a single variable to be used as $data. That way I'm able to use the preg_match_all function.
bigboss
 
Posts: 13
Joined: Fri May 20, 2011 3:00 am

Re: LogsHandHistory regarding Tournament

Postby Kent Briggs » Tue Jun 07, 2011 1:23 pm

bigboss wrote:What I'm trying to do is display (output) every possible option in Logshandhistory to a single variable to be used as $data. That way I'm able to use the preg_match_all function.


You could loop through the array and concatenate the data into a single string. Or just use the implode() function in PHP to do that for you. Or you could modify the Poker_API() function so that it only returns a single string instead of an array of strings. Something like this (untested):

Code: Select all
function Poker_API($url,$params)
{
  $curl = curl_init($url);
  curl_setopt($curl,CURLOPT_POST,true);
  curl_setopt($curl,CURLOPT_POSTFIELDS,$params);
  curl_setopt($curl,CURLOPT_TIMEOUT,30);
  curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
  $response = trim(curl_exec($curl));
  curl_close($curl);
  return $response;
}
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3763
Joined: Wed Mar 19, 2008 8:47 pm

Re: LogsHandHistory regarding Tournament

Postby bigboss » Tue Jun 07, 2011 2:21 pm

thank you kent, that was what i was looking for , will give this a try and see how it goes.
bigboss
 
Posts: 13
Joined: Fri May 20, 2011 3:00 am

Re: LogsHandHistory regarding Tournament

Postby bigboss » Thu Jun 09, 2011 2:50 pm

kent , we did test your example.

The example only output the data that would have been populated inside the drop down menu

Is it possible to get tested example of having all the current LogsHandhistory logs that are available and soon to be available in the future to a single string and/or variable

Thank you
bigboss
 
Posts: 13
Joined: Fri May 20, 2011 3:00 am

Re: LogsHandHistory regarding Tournament

Postby Kent Briggs » Thu Jun 09, 2011 3:29 pm

bigboss wrote:Is it possible to get tested example of having all the current LogsHandhistory logs that are available and soon to be available in the future to a single string and/or variable


There is one file created every day for each table, assuming at least one hand was played there. The data is just appended to the end until the server clock hits midnight. Obviously the software isn't going to know if anyone will play in the future.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3763
Joined: Wed Mar 19, 2008 8:47 pm


Return to Site Administration

Who is online

Users browsing this forum: No registered users and 4 guests

cron