The Tournament Director Forums

Main => Suggestions => Topic started by: davidator on July 09, 2012, 11:42:54 AM

Title: Status Update by URL
Post by: davidator on July 09, 2012, 11:42:54 AM
Hello
i was testing TD3.1 and very happy to see that my scanner bar code will works perfectly with the new features! TY Corey  :)
I saw something interesting, too!
We can now send Tournament status by URL! Wonderful !....but there is nothing to read the feed updated!

I m not a Dev ! but i tryed to do something in php and it works!!! ;D

I send datas from TD to a specific URL of my site (path of the status.php file in my website)
The php file read vars and and modify XML file (status.xml)
After, with the XML parser, we can read status of tournament! (view_status.html)

attention! it is a very simple php code!And HTML page is minimalist
there is no test to check if the variables are integers, if it exists ....
Code can be well improve

here, my contribution
you can test and enjoy ;)
(i added a little help text file to explain how to use- readme.txt)
Title: Re: Status Update by URL
Post by: Corey Cooper on July 09, 2012, 04:19:52 PM
Very cool.  Thanks for sharing.  I have a to-do item to add an example to be included with the software, but just haven't gotten to it yet.
Title: Re: Status Update by URL
Post by: davidator on July 09, 2012, 04:40:08 PM
with pleasure  ;)
Title: Re: Status Update by URL
Post by: davidator on July 11, 2012, 01:03:37 PM
i added some features :

1. securit the php file
2. Average Added
3. time after day of last upadtes
4. fixed "refresh" button on the view_status.html and i translated in english 

I dont use all fields, but you can add all field you need by editing view.php and view_status.htm

corey, why the playersleft and players are the same value?

numberofplayers=6
n=6
the same?
Title: Re: Status Update by URL
Post by: jodybingo on July 11, 2012, 04:02:49 PM
I'm looking for a bit of help on this. Google wasnt that fruitful for me. I am running my own server (SBS 2003 with IIS 6.0). I think I have set all permissions in every place I could think of. Both directly on the files and the folder and also on the files and folder through IIS both on my FTP sites directory and my Web Sites directory. Every attempt to update returned a Failed from TD3.
What a I missing??
Title: Re: Status Update by URL
Post by: davidator on July 11, 2012, 04:37:54 PM
so sorry, i cant help u about this! i use mutual server and it works! maybe search around the php.ini file
Title: Re: Status Update by URL
Post by: Corey Cooper on July 11, 2012, 05:50:32 PM
corey, why the playersleft and players are the same value?

numberofplayers=6
n=6
the same?

buyins is the number of players who have bought into the tournament
numberofplayers and n are aliases of buyins

playersleft is the number of players still in the tournament (those who have not yet busted out)
players is an alias of playersleft


Since the user manual isn't updated yet, here is the list: http://www.thetournamentdirector.net/forums/index.php?topic=3336.0

Although it doesn't list all of the aliases.
Title: Re: Status Update by URL
Post by: Corey Cooper on July 11, 2012, 06:06:43 PM
I'm looking for a bit of help on this. Google wasnt that fruitful for me. I am running my own server (SBS 2003 with IIS 6.0). I think I have set all permissions in every place I could think of. Both directly on the files and the folder and also on the files and folder through IIS both on my FTP sites directory and my Web Sites directory. Every attempt to update returned a Failed from TD3.
What a I missing??

My suggestion would be to start with the simplest of scripts to make sure PHP is working on IIS.  Put a file named "phpinfo.php" at the root of your web server.  The file contents should simply be:

<?php phpinfo(); ?>

Then using your browser go to http://your-web-server/phpinfo.php.  You should get a PHP page with your system info on it.  If that simple test doesn't work, Google "Configuring IIS 6 and php" to get IIS configured properly.  Once you've gotten PHP working on your web server, put davidator's script in place.  Then try to update using the "Attempt update now" button.  Whether it succeeds or fails, copy the "Destination" value (you should be able to highlight and copy it) and paste it into your browser to see what kind of response the TD got.  This should help you get to the next step.  For example, for mine before I've done any configuring (I'm using IIS7), I see:

Code: [Select]
Warning: Division by zero in C:\inetpub\wwwroot\status.php on line 20

Warning: fopen(status.xml) [function.fopen]: failed to open stream: Permission denied in C:\inetpub\wwwroot\status.php on line 28

Warning: fseek(): supplied argument is not a valid stream resource in C:\inetpub\wwwroot\status.php on line 29

Warning: fputs(): supplied argument is not a valid stream resource in C:\inetpub\wwwroot\status.php on line 30

Warning: fclose(): supplied argument is not a valid stream resource in C:\inetpub\wwwroot\status.php on line 31

I'll dig into it a little deeper tomorrow and hopefully what I find will be applicable to your situation as well.
Title: Re: Status Update by URL
Post by: mcfrojd on July 13, 2012, 08:35:18 AM
Love this .php example.

Works like a charm when i implement it on our wordpress site http://poker.grantek.se

Now if only the "export to html" for the stats and summary could get a bit html responsive (adapt appearence depending on wich device viewing it) from some one with some html experience it would be great.
Title: Re: Status Update by URL
Post by: davidator on July 13, 2012, 09:41:46 AM
Nice job mcfrojd !
Happy to see it works for u!

For the stats, i use a very nice joomla component for my web site ( to see the compnent in action on my site, http://pokerplayer13.fr , in the navbar: "CLASSEMENT")
with this joomla component, u just export the xml file built by TD and after, i upload it in my joomla admin.
the component is http://www.thepokerleaderboard.com/

Otherwise, why don't you use a wrapper to integrate your  stats pages ? http://wordpress.org/extend/plugins/wp-wrapper/
Title: Re: Status Update by URL
Post by: Corey Cooper on July 13, 2012, 12:11:38 PM
davidator, you inspired me to get off my butt and create the example to support this feature.  So here is the first pass at it.  This will be included in the next version of the software.

Your website needs to be able to support PHP (I can't imagine a hosting service that doesn't).  As davidator demonstrated, there are basically two pages: (1) the "listener" page that the TD sends the data to, and (2) the "viewer" page that one can point their browser at and see live information from the tournament.  I've divided the viewer page out into HTML, CSS, and Javascript files.  This should make it very easy to adapt and extend.

Attached is a ZIP file containing 4 files:

statusListener.php
This is the "listener" page.  Once installed on your site, you'll need to configure the Status Updates feature in the TD to point to this page.

TournamentStatus.html
This is the "viewer" page.  Once installed on your site, point your browser to it to see the current tournament status.

TournamentStatus.css
The stylesheet for the viewer page.

TournamentStatus.js
The Javascript supporting the viewer page.

The listener page will need to be able to write a file locally.  You may have to configure your web site to allow this.  You may need to modify the URLStatus variable in TournamentStatus.js, depending on where you install statusListener.php and TournamentStatus.html.  By default, if the two are installed in the same folder on your web site, it should work out of the box.

The page automatically updates itself, so once you point your browser to it, you don't have to do anything else.  The page will continually refresh.  The page uses the JQuery Javascript library to make the values fade in and out (among other things).  I did this to convey the idea that the page isn't "real-time" and to make it obvious when something on the page changes.  The TournamentStatus.js file has some options at the top you can change yourself.  The Javascript is basically self-contained, so it shouldn't interfere with any other script you may have on your site.

The code isn't written to handle odd situations, like a request to update the page taking a long time or failing entirely.  So you may get strange behavior should something out of the ordinary happen.

The refresh rate by default is 3 seconds.  This means that the page will request an update from the web server, and once that update is received, the page waits 3 seconds before issuing another update request.  If the request from the server takes 3 seconds to arrive, the effective refresh rate will end up being 6 seconds.

On a local server, I set the TD to send updates once per second, and had the page refresh every 2 or 3 seconds and it has a nice effect.  Might make a (potentially big) difference when updating to and viewing from an internet web site.
Title: Re: Status Update by URL
Post by: Corey Cooper on July 13, 2012, 12:16:05 PM
btw, jodybingo, I'm running Windows 7 Professional (so IIS7), and I dropped the files into the wwwroot folder.  I had to modify the permissions on the folder, giving Modify and Write permission to  the local IIS_IUSRS account to make this work.  There's probably a much better and safer method, but I was just trying to make it work.
Title: Re: Status Update by URL
Post by: davidator on July 13, 2012, 12:54:00 PM
woaw!
full optimization of php code!
 
Question: the length of an url is not it limited? (I thought of the GET method)
Title: Re: Status Update by URL
Post by: Corey Cooper on July 13, 2012, 01:27:22 PM
Question: the length of an url is not it limited? (I thought of the GET method)

Probably, but frankly I don't know what the limit is and regardless I doubt the TD's Status Updates feature will reach it.  But this is a good point, and brings up something I forgot to mention: the Status Updates feature has a bug, in that it does not send a "Content-type" header when using the POST method.  I've already fixed this for the next version.  What it means for now is that when using the POST method, languages like PHP may not automatically parse the variables for you.  The data is still available in the $HTTP_RAW_POST_DATA variable, for example, but not in the $_POST array.

The example I previously posted will accept the data from the TD using either the GET or POST method, but until the next version of the TD is released (and this bug fixed), it won't work unless you use the GET method.
Title: Re: Status Update by URL
Post by: davidator on July 13, 2012, 01:35:06 PM
ok

i made a litle video to show how script works!

http://screencast.com/t/d9KvcEYrT

And the script on my cell:

(http://img98.imageshack.us/img98/8995/screenshot201207142018.png)
 
you are a boss corey!
Title: Re: Status Update by URL
Post by: mcfrojd on July 14, 2012, 12:23:13 PM
Otherwise, why don't you use a wrapper to integrate your  stats pages ? http://wordpress.org/extend/plugins/wp-wrapper/

Tried that, problem is when viewing from mobile device, the stats in their table have some problems fitting a mobile screen.
Seeing more and more websites, templates and even joomla components getting full responsiveness, making them fully viewable from any device.
Title: Re: Status Update by URL
Post by: mcfrojd on July 14, 2012, 12:25:57 PM
Is there any way to get the tournamen name/title to be pushed as an status update to?
Easier for website visitors to know what tournamen they see live stats for.
Title: Re: Status Update by URL
Post by: Corey Cooper on July 14, 2012, 01:44:15 PM
Absolutely.  Right now I just made it pass the same variables that are available to formulas.  Tournament title isn't useful to a formula.  But I knew I would be adding other items as requested.  So request away.
Title: Re: Status Update by URL
Post by: mcfrojd on July 14, 2012, 03:10:08 PM
Great job Corey.

Any way to format the date from
Sat Jul 14 2012 21:19:18 GMT+0200 (Västeuropa, sommartid)
to
Jul 14 2012 - 21:19:18

http://poker.grantek.se/

And am i suppose to set the "update frequency" in TD3 to a very small number like 2 or 3 as well as in the TournamentStatus.js to get allmost instant uppdates?
Title: Re: Status Update by URL
Post by: Corey Cooper on July 14, 2012, 09:26:17 PM
Any way to format the date from
Sat Jul 14 2012 21:19:18 GMT+0200 (Västeuropa, sommartid)
to
Jul 14 2012 - 21:19:18

I didn't tackle the date because that's the only built-in date format in Javascript (and it's locale-specific).  To get a date formatted the way you like, you've got to build it yourself.  I'm sure there are other alternatives, too, like using a JQuery plug-in.

For the format you specified, add the following code to the TournamentStatus.js file (you can just paste it at the end of the file):

Code: [Select]
TDStatus.getDateTime = function(inDate)
{
  // Jul 14 2012 - 21:19:18
  var theMon = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];

  return theMon[inDate.getMonth()] + " " + inDate.getDate() + " " + inDate.getFullYear() + " - " + (inDate.getHours() + 1) + ":" + TDStatus.pad(inDate.getMinutes(), 2) + ":" + TDStatus.pad(inDate.getSeconds(), 2);
}

Then change this line:

Code: [Select]
TDStatus.setValue("lastupdated", "" + new Date(parseInt(TDStatus.Vars["time"]) * 1000));
to this:

Code: [Select]
TDStatus.setValue("lastupdated", TDStatus.getDateTime(new Date(parseInt(TDStatus.Vars["time"]) * 1000)));
And am i suppose to set the "update frequency" in TD3 to a very small number like 2 or 3 as well as in the TournamentStatus.js to get allmost instant uppdates?

You can set the update frequency in TD3 as low as 1 second.  Since the TD basically does a "fire and forget" (it doesn't care really what the server says in response), you should be able to safely have it update once per second.

You'll have to experiment with the refresh setting in TournamentStatus.js.  As I said, I didn't really examine how it might behave if your server is slow to respond, or timeouts occur.  Might be fine, might not, I can't say.  Probably will be fine, but again, I just can't really say.  FYI, the refresh rate setting in TournamentStatus.js. is defined in seconds, but you can give it fractions, too.  Set it to .5 to have it update every 1/2 second.
Title: Re: Status Update by URL
Post by: mcfrojd on July 15, 2012, 05:37:52 AM
The date format worked great.

The refresh rate is the one concerning me, it works great but i don't want to get i trouble with my web space provider, thinking maby an very low rate could get flagged as some sort of "attack".
Probably not thou, but I'm satisfied with leaving the rate at 5 sec to start with.

Once again, thanks for a lovely product and the fantastic respons on your users input.
In the middle of the summer you might think someone would like to relax and enjoy life instead of typing code.
Kudos to you Corey.
Title: Re: Status Update by URL
Post by: Corey Cooper on July 15, 2012, 11:21:51 AM
The refresh rate is the one concerning me, it works great but i don't want to get i trouble with my web space provider, thinking maby an very low rate could get flagged as some sort of "attack".
Probably not thou, but I'm satisfied with leaving the rate at 5 sec to start with.

I wouldn't worry about it.  Your hosting service should not only be able to handle it, but I think it's pretty unlikely to set off any alarms.  I went back and looked at TournamentStatus.js a little more closely and I think it should behave just fine no matter what you set the refresh to be.  It might get a little weird if you were to dynamically set it (there's a form built into the page to change the refresh rate, but it's not displayed by default; if you just change the refresh rate in TournamentStatus.js directly, there should be no trouble at all).

Once again, thanks for a lovely product and the fantastic respons on your users input.
In the middle of the summer you might think someone would like to relax and enjoy life instead of typing code.
Kudos to you Corey.

Actually, that is how some of us relax.  Sometimes.  :)
Title: Re: Status Update by URL
Post by: macacan on July 16, 2012, 02:09:19 AM
OK, complete novice hear at this html and all this other stuff.

Just wandering if it is a simple thing that I could do.

I use a simple program to build my site, WYSIWYG, and upload using ftp.

Anybody know if I could get this to run using these or is it to complex.

 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8)
Title: Re: Status Update by URL
Post by: Corey Cooper on July 16, 2012, 12:11:05 PM
It really shouldn't be very hard.  There's no coding, as the pages are already written for you.  Probably the hardest part will be making sure your website is configured to allow the statusListener.php page to write to the folder/directory in which it is installed.  So, setting it up should consist of:

1) Uploading statusListener.php, TournamentStatus.html, TournamentStatus.css, TournamentStatus.js files to your web server
2) Configuring your web server to allow statusListener.php to write the status file
3) Configuring the Status Updates feature in the TD to send status updates to the statusListener.php page on your website
4) Pointing your browser to the TournamentStatus.html page on your website
Title: Re: Status Update by URL
Post by: macacan on July 16, 2012, 12:34:48 PM
It really shouldn't be very hard.  There's no coding, as the pages are already written for you.  Probably the hardest part will be making sure your website is configured to allow the statusListener.php page to write to the folder/directory in which it is installed.  So, setting it up should consist of:

1) Uploading statusListener.php, TournamentStatus.html, TournamentStatus.css, TournamentStatus.js files to your web server
2) Configuring your web server to allow statusListener.php to write the status file
3) Configuring the Status Updates feature in the TD to send status updates to the statusListener.php page on your website
4) Pointing your browser to the TournamentStatus.html page on your website


Cheers Corey

Will have a try over the next few weeks

 8) 8) 8) 8) 8) 8) 8) 8) 8)
Title: Re: Status Update by URL
Post by: macacan on July 28, 2012, 09:05:01 AM
Anybody know wysiwyg ?.

Not a clue how to do this, all I do at the mo is build my site using the program WYSIWYG (What You See Is What You Get).
So all is very easy, it works a bit like Microsoft publisher, no html to write.

Then I just upload it to my web server.

Is the somewhere in wysiwyg to place the files or would it have to be somwhere on the server.

 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8)
Title: Re: Status Update by URL
Post by: Seitz333 on August 24, 2012, 10:46:26 PM
Wow! I have not checked the forum for a while, glad to see there is some progress with the status updates. I will config my website and server tomorrow and see what happens.

Thanks!

Chuck
Title: Re: Status Update by URL
Post by: Seitz333 on August 25, 2012, 04:37:02 PM
I got it working pretty easy. One of the items I think most people would like to see being updated is the rankings along with total winnings.

I have changed the look/layout to fit my site.

http://www.seitz333.com/livetourney/tournamentstatus.html (http://www.seitz333.com/livetourney/tournamentstatus.html)

Chuck
Title: Re: Status Update by URL
Post by: Corey Cooper on August 26, 2012, 08:08:55 PM
The next step will be to add a lot more data, using a different format (probably JSON).  The current format was easy to implement in a quick fashion, but it's very limited.
Title: Re: Status Update by URL
Post by: NJPL on September 05, 2012, 07:33:59 PM
This topic is exactly what I was looking for. I've managed to output the status to a simple page http://www.northjerseypoker.com/tstatus/view_status.html (http://www.northjerseypoker.com/tstatus/view_status.html)

I also ported it to our mobile site http://www.northjerseypoker.com/frame/live.php (http://www.northjerseypoker.com/frame/live.php)  --- (works with iphones, not sure if the site works with droid)
Title: Re: Status Update by URL
Post by: xtof on October 12, 2012, 05:26:13 AM
hi

is there a file for aspx pls . my site is aspx so php don't work here . :-s

rg
Title: Re: Status Update by URL
Post by: Corey Cooper on October 13, 2012, 09:35:30 PM
Sorry, don't have any ASP version at the moment.  I'll try to put something together at some point but it's not really my area of expertise.
Title: Re: Status Update by URL
Post by: The Meal on November 03, 2012, 01:59:32 PM
The next step will be to add a lot more data, using a different format (probably JSON).  The current format was easy to implement in a quick fashion, but it's very limited.

What sort of things can we (currently) pass through TDStatus.Vars?  I'm assuming the idea of pulling points from the database and adding current points earned in a live tournament (on a per-player basis) isn't yet available?
Title: Re: Status Update by URL
Post by: Corey Cooper on November 03, 2012, 10:09:35 PM
What sort of things can we (currently) pass through TDStatus.Vars?  I'm assuming the idea of pulling points from the database and adding current points earned in a live tournament (on a per-player basis) isn't yet available?

No, and I'm sorry to say that may not ever be there.  That's really a horse of a different color.  That would mean sending not only the current tournament information and information on all players in the tournament, but also that the software user would have to run Stats beforehand, so the TD is currently aware of every player's accumulated score/points/etc, and pass that information as well ... every time an update is performed.
Title: Re: Status Update by URL
Post by: mikiewendy on November 09, 2012, 12:23:12 PM
I am quite intrigued by this new feature as I have been wanting to better implement my realtime updates to the site.  Is there a way to show basic information on individual players as well?  Basically, looking for elimination statistics like when and the player ID of the person that eliminatated them?

Thanks Corey!  I have been holding out for the latest release waiting for this very feature.

Mike
Title: Re: Status Update by URL
Post by: Corey Cooper on November 09, 2012, 01:10:42 PM
Not yet, and probably not in 3.2 since it 3.2 has taken way longer than expected and I really want to get it out.  But it is definitely on the short list of features I want to get in as soon as possible.
Title: Re: Status Update by URL
Post by: Mesnik44 on December 03, 2012, 02:16:35 PM
Hi Corey,


Is there a way to list who is in the tournament, and who is out?

Also, is there a way to show break, instead of round when a break hits? var theRound = (TDStatus.Vars["isbreak"] == 1) ? "On Break (" + TDStatus.Vars["breaknum"] + ")" : TDStatus.Vars["roundnum"]; does not seem to fire. The break is the same round number previous.

Sorry for the hassle and thanks in advance,
Mesnik44
Title: Re: Status Update by URL
Post by: Corey Cooper on December 03, 2012, 04:18:35 PM
Is there a way to list who is in the tournament, and who is out?

Not yet.

Quote
Also, is there a way to show break, instead of round when a break hits? var theRound = (TDStatus.Vars["isbreak"] == 1) ? "On Break (" + TDStatus.Vars["breaknum"] + ")" : TDStatus.Vars["roundnum"]; does not seem to fire. The break is the same round number previous.

Not sure why this isn't working for you.  I just tested it again and it seems to work fine.  When I try it with the sample tournament I get "Round 6" and then when I move to the next level (the first break in the schedule) it changes to "Round: On Break (1)".  What do you see?
Title: Re: Status Update by URL
Post by: Mesnik44 on December 03, 2012, 06:20:59 PM
This is what I see;

I am using the files that you had supplied. (BTW HUUUUGE THANKS for that!!)

Mesnik44

PS:
I've just tried it now with a pre-built tournament, and using original files, and it is not updating the breaks.

Perhaps you could share your files that you recently tested with?
Title: Re: Status Update by URL
Post by: Corey Cooper on December 04, 2012, 10:52:25 AM
The page/code hasn't changed - I'm using the exact same stuff as I posted earlier in this thread.  I also double-checked the line of code you posted in an earlier response and it is the same.

I have no idea why this isn't working for you.  Are you saying that otherwise the page updates fine and with what appears to be the correct, current information from your running tournament, but that when the tournament moves from a round to a break, the "Round:" value doesn't change?  So, in round 2, it says correctly "Round: 2".  Then in the first break it still says "Round: 2" (incorrectly)?  And after the first break when it moves into round 3 it correctly says "Round: 3"?
Title: Re: Status Update by URL
Post by: Mesnik44 on December 04, 2012, 10:56:20 AM
Hi Corey,

Yes that is exactly what I am saying.

Round 1 = Round 1
Round 2 = Round 2
Break 1 = Round 2
Round 3 = Round 3
Title: Re: Status Update by URL
Post by: Corey Cooper on December 04, 2012, 11:25:05 AM
OK, then I'll take a wild guess and say that there's an error occurring but the browser is suppressing it (like they pretty much all do now).  Since you're using Chrome, I would suggest using the developer tools to check for an error.

Set up your tournament to post to the status listener, point your Chrome browser to the status page and start your tournament.  Then press F12 to open Chrome's developer tools.  It should open in the bottom half of the browser window.  Near the top of that section will be a set of tab-like buttons.  The last one should be "Console".  Press it.  Then move your tournament to the first break.  Hopefully (?) you'll see an error appear in the console.
Title: Re: Status Update by URL
Post by: Mesnik44 on December 04, 2012, 11:37:29 AM
Hi Corey,

I did what you said to try, and nothing showed up in the console, just >

I also tried in IE, and no luck there either.
Title: Re: Status Update by URL
Post by: Corey Cooper on December 04, 2012, 11:47:51 AM
Hmm, OK, well the only thing I can think to do is start debugging.  If you want, try the following.

Three lines down from the previously quoted line in TournamentStatus.js, change:

TDStatus.setValue("round", theRound);

to

TDStatus.setValue("round", 'isbreak="' + TDStatus.Vars["isbreak"] + '"; breaknum="' + TDStatus.Vars["breaknum"] + '"');

(please copy/paste to make sure it's updated exactly as above)

In my browser, this changes the "Round:" line to:

Round: isbreak="1"; breaknum="1"
Title: Re: Status Update by URL
Post by: Mesnik44 on December 04, 2012, 11:55:51 AM
I have done what you said;

Round: isbreak="undefined"; breaknum="1" is the response.

http://mobile.hitmenpoker.com is the site, if you wish to see.

In reading the code, it looks like there is no definition for isbreak.

var theChipCount = parseInt(TDStatus.Vars["chipcount"]);
  var thePlayersLeft = parseInt(TDStatus.Vars["playersleft"]);
  var theAvgStack = thePlayersLeft == 0 ? 0 : Math.floor(theChipCount / thePlayersLeft);
  var theRound = (TDStatus.Vars["isbreak"] == 1) ? "On Break (" + TDStatus.Vars["breaknum"] + ")" : TDStatus.Vars["roundnum"];

  var theNewClock = TDStatus.getClockValue(TDStatus.Vars["secondsleft"]) + (TDStatus.Vars["clockpaused"] == 1 ? " (PAUSED)" : "");

  TDStatus.setValue("clock", theNewClock);
  TDStatus.setValue("round", 'isbreak="' + TDStatus.Vars["isbreak"] + '"; breaknum="' + TDStatus.Vars["breaknum"] + '"');
  TDStatus.setValue("blinds", TDStatus.getChipsString(TDStatus.Vars["bigblind"]) + " / " +

TDStatus.getChipsString(TDStatus.Vars["smallblind"]));
  TDStatus.setValue("ante", TDStatus.getChipsString(TDStatus.Vars["ante"]));
  $("#ante").css({ display: TDStatus.HideZeroAnte ? "none" : "" });
  $("#label_ante").css({ display: TDStatus.HideZeroAnte ? "none" : "" });
  $("#space_ante").css({ display: TDStatus.HideZeroAnte ? "none" : "" });
  TDStatus.setValue("players", thePlayersLeft + " / " + TDStatus.Vars["buyins"]);
  TDStatus.setValue("averagestack", TDStatus.getChipsString(theAvgStack));
  TDStatus.setValue("pot", TDStatus.getMoneyString(TDStatus.Vars["pot"]));
  TDStatus.setValue("lastupdated", "" + new Date(parseInt(TDStatus.Vars["time"]) * 1000));

This is the tdstatus.txt from the server;

roundnum=2
breaknum=1
level=2
isround=0
nextisround=1
state=2
statedesc=inprogress
buyins=21
numberofplayers=21
n=21
defaultbuyinfee=0
defaultbuyinrake=0
defaultbuyinchips=0
totalbuyinsamount=0
totalbuyinsrake=0
totalbuyinschips=0
numberofleaguemembers=0
nm=0
pot=0
prizepool=0
pp=0
playersleft=21
players=21
tablesleft=3
tables=3
secondsleft=585
secondselapsed=15
clockpaused=1
clockpausedseconds=164
timeofday=101700
time=1354645020
lastplayermovetime=1354643661
rebuysallowed=0
rebuysover=0
rebuysleft=0
rebuyssecondsleft=0
defaultrebuyfee=0
defaultrebuyrake=0
defaultrebuychips=0
totalrebuys=0
totalnumberofrebuys=0
tnr=0
totalrebuysamount=0
totalrebuysrake=0
totalrebuyschips=0
addonsallowed=0
addonsover=0
addonsleft=0
addonssecondsleft=0
defaultaddonfee=0
defaultaddonrake=0
defaultaddonchips=0
totaladdons=0
totalnumberofaddons=0
tna=0
totaladdonsamount=0
totaladdonsrake=0
totaladdonschips=0
inthemoneyrank=5
mr=5
totalfixedrake=0
fixedrake=0
ante=0
smallblind=200
bigblind=400
limit1=200
limit2=400
gametype=0
gamename=texas hold em
nextante=0
nextsmallblind=300
nextbigblind=600
nextlimit1=300
nextlimit2=600
nextgamename=texas hold em
nextgametype=2
chipcount=0
guaranteedpot=0
preguaranteedpot=0
houseadds=0
housecontribution=0
Title: Re: Status Update by URL
Post by: Corey Cooper on December 04, 2012, 12:14:23 PM
Boom goes the dynamite.  :)

The isBreak variable was added in 3.2, which no one but me has yet.  :)  It should be using isRound and just reverse the logic.  Sorry, I tend to forget when stuff gets added.

I've updated the status_updates.zip file attached to this topic (http://www.thetournamentdirector.net/forums/index.php?topic=3450.msg16760#msg16760) to fix this.

Mesnik44, based on your screenshots you've likely made some customizations.  You can fix this issue with the following:

Change the "debugging" line changed in my last reply back to:

TDStatus.setValue("round", theRound);

Then change the line you first mentioned:

var theRound = (TDStatus.Vars["isbreak"] == 1) ? "On Break (" + TDStatus.Vars["breaknum"] + ")" : TDStatus.Vars["roundnum"];

to:

var theRound = (TDStatus.Vars["isround"] == 1) ? TDStatus.Vars["roundnum"] : "On Break (" + TDStatus.Vars["breaknum"] + ")";

Sorry for the confusion.
Title: Re: Status Update by URL
Post by: Mesnik44 on December 04, 2012, 12:37:18 PM
You sir, are a God!

I really appreciate the effort you have given to this. I can not even begin to thank you enough! So, here goes, Thank you so much!

Mesnik44

PS:

I helped your post count get to 4k on this...
 :) Cookie?
Title: Re: Status Update by URL
Post by: Corey Cooper on December 04, 2012, 02:26:18 PM
No, I should be thanking you.  You found a bug and helped me fix it.  I appreciate your help.  So thank you.  :)
Title: Re: Status Update by URL
Post by: IBuyCars on February 19, 2013, 09:32:39 AM
I've tried and tried to make this update thing work to no avail

I guess that i must have sonthing wrong in the setup

I have sent the 4 files to my web server, i have tried getting them to work in the Public HTML folder and in their own folder
i have altered the permissions to allow the files to write (i think)

i guess that I am trying to send the info from TD3 (beta version) to the wrong file
What do i need to put in the "Send the status of the tournament to a URL" section? mine says http://www.MYSITE.co.uk/StatusUpdates/TournamentStatus.html

cheers
Title: Re: Status Update by URL
Post by: Corey Cooper on February 19, 2013, 10:14:55 AM
Set the URL (in the Status Updates section of the Preferences tab) to: http://www.MYSITE.co.uk/StatusUpdates/statusListener.php
Then you point your own browser to: http://www.MYSITE.co.uk/StatusUpdates/TournamentStatus.html

Title: Re: Status Update by URL
Post by: IBuyCars on February 19, 2013, 10:59:07 AM
I must be a idiot because i still cannot get the Status updates to work
all the files are on my web server (in the same place)
I have altered the permissions it says 0777 which i guess gives full read/write capabilities to the file/s
I've pointed TD at the location of the listener file (http://www.MYSITE.co.uk/statusListener.php) (Method GET)
I can see that TD is trying to update "Pending" then "Fail"

are there any other options that i should try before i hit my computer with a hammer?

Cheers
Title: Re: Status Update by URL
Post by: IBuyCars on February 19, 2013, 11:21:14 AM
I tried the Status Updates on another of my websites and it worked out of the box

thanks

i guess im doing nothing wrong, and that i need to alter a few settings somewhere

Cheers Corey
Title: Re: Status Update by URL
Post by: IBuyCars on February 19, 2013, 01:47:29 PM
Corey or anyone is there a way to change the currency symbol from $ to £

Cheers
Title: Re: Status Update by URL
Post by: Corey Cooper on February 19, 2013, 04:16:48 PM
I must be a idiot because i still cannot get the Status updates to work
all the files are on my web server (in the same place)
I have altered the permissions it says 0777 which i guess gives full read/write capabilities to the file/s
I've pointed TD at the location of the listener file (http://www.MYSITE.co.uk/statusListener.php) (Method GET)
I can see that TD is trying to update "Pending" then "Fail"

are there any other options that i should try before i hit my computer with a hammer?

Cheers

I tried the Status Updates on another of my websites and it worked out of the box

thanks

i guess im doing nothing wrong, and that i need to alter a few settings somewhere

Cheers Corey


If the TD is showing a "Failed" status when it attempts to send an update to the URL, I believe it means the site is returning a status code of something other than 200 (which means "OK").  I'd copy/paste the update URL (http://www.MYSITE.co.uk/statusListener.php) as a first step to see what the site is returning.  Could be a bad path/URL.  Or maybe permissions on statusListener.php.  Or permissions on the folder (if it can't write the status to a file).  Or anything, really...

Corey or anyone is there a way to change the currency symbol from $ to £

Cheers


Edit the file TournamentStatus.js.  There are options right at the top of the file.
Title: Re: Status Update by URL
Post by: IBuyCars on February 19, 2013, 05:18:50 PM
Thanks alot I got it working now
Title: Re: Status Update by URL
Post by: IBuyCars on February 21, 2013, 11:22:01 AM
Corey

Is it possible to get the data from any or all of the lines in the "tdstatus.txt" file to display on the "TournamentStatus.html" page?

The info that i would really like to show would be
title=***************
description=********************

I guess its already on your huge to do list

Cheers

ps Testing the live updates tonight at http://www.norwichpokerclub.co.uk/TournamentStatus.html
 
Title: Re: Status Update by URL
Post by: Magic_fubu on February 21, 2013, 11:29:09 AM
I don't know if it is due to no players, but the pot shows as this to me: &pound0.00

It may be that I'm viewing on my kindle fire, but just in case, I wanted to point it out to you.
Title: Re: Status Update by URL
Post by: IBuyCars on February 21, 2013, 11:42:44 AM
Thanks

when i look at it with IE9, Google Chrome on on my Ipad2 I see £0.00

so im sorry to say I think its your problem

Cheers for the comment
Title: Re: Status Update by URL
Post by: Magic_fubu on February 21, 2013, 03:17:46 PM
Not a problem. Glad to hear it's my kindle :)
Title: Re: Status Update by URL
Post by: IBuyCars on February 21, 2013, 03:25:32 PM
Well the status update works great, would be great now to add a bit more info for the viewers,

Ps don't buy a kindle
Title: Re: Status Update by URL
Post by: Corey Cooper on February 21, 2013, 05:19:35 PM
Corey

Is it possible to get the data from any or all of the lines in the "tdstatus.txt" file to display on the "TournamentStatus.html" page?

The info that i would really like to show would be
title=***************
description=********************

I guess its already on your huge to do list

Cheers

ps Testing the live updates tonight at http://www.norwichpokerclub.co.uk/TournamentStatus.html

They're there in the beta of 3.2.  You'd still have to edit TournamentStatus.js and TournamentStatus.html to actually display them, but that info is being sent on the status update.
Title: Re: Status Update by URL
Post by: Corey Cooper on February 21, 2013, 05:23:17 PM
Thanks

when i look at it with IE9, Google Chrome on on my Ipad2 I see £0.00

so im sorry to say I think its your problem

Cheers for the comment

Magic_fubu, your Kindle is probably just being less forgiving than other browsers.  The HTML entity to represent the pound is "&pound;", but IBuyCars's TournamentStatus.js has it set to "&pound" (missing the trailing semicolon).
Title: Re: Status Update by URL
Post by: Magic_fubu on February 21, 2013, 09:06:34 PM
Tis what I figured given he stated it looked good on his end. Just wanted to be absolutely sure it was something with that browser versus something actually being wrong.

As far as kindles go, I love  my kindle! Then again, I'm slightly biased against the iSeries anyhow... To each their own! :)
Title: Re: Status Update by URL
Post by: IBuyCars on February 22, 2013, 02:32:52 AM
Magic_fubu

I have put in the missing ; see how it looks now

rgds
Title: Re: Status Update by URL
Post by: Magic_fubu on February 22, 2013, 11:41:27 AM
Shows up properly now! Just so happens to be I'm on my kindle again! Lol