LogsHandHistory regarding Tournament

For discussion of the Poker Mavens server module and other administration topics
Post Reply
bigboss
Posts: 13
Joined: Fri May 20, 2011 3:00 am

LogsHandHistory regarding Tournament

Post by bigboss »

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

Re: LogsHandHistory regarding Tournament

Post by Kent Briggs »

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/A ... nd_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 />";
} 
bigboss
Posts: 13
Joined: Fri May 20, 2011 3:00 am

Re: LogsHandHistory regarding Tournament

Post by bigboss »

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

Re: LogsHandHistory regarding Tournament

Post by Kent Briggs »

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;
}
bigboss
Posts: 13
Joined: Fri May 20, 2011 3:00 am

Re: LogsHandHistory regarding Tournament

Post by bigboss »

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

Post by bigboss »

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

Re: LogsHandHistory regarding Tournament

Post by Kent Briggs »

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.
Post Reply