The Tournament Director Forums
Main => Templates, Layouts and Sounds => Topic started by: a15995 on October 14, 2015, 09:15:49 AM
-
Has anyone managed to make a script that receives tournament data via GET or POST and displays that information on a webpage?
I'm thinking about making a page that just stores the GET/POST data in a database and displays the data as HTML when no GET/POST is received. I can do that but given the many variables TD has to offer it seems quite complex...
But if someone already has a template (ASP/VB) to do this, I'm very interested.
Thanks,
Søren
-
I do.
You are more than welcome to all of my files!
http://mobile.hitmenpoker.com
-
Hi Mesnik44!
Thanks, that's great!
To which file do you send the data from TD - I seem to get "Failed" when I send to statusListener.php ...?
Thanks,
Søren
-
FYI, the software includes example files in the folder named (oddly enough) examples. That would be where the TD is installed, usually C:\Program Files (x86)\The Tournament Director 3\examples.
The TD should point to statusListener.php or statusListener.asp, depending on what your web site supports (PHP or ASP).
One thing to point out: the statusListener file will attempt to write the status data it receives from the TD to a file in the same folder in which statusListener is. It is common that this is not allowed, due to file system permissions. You can either adjust the permissions on that folder to allow it, or modify statusListener.php (or statusListener.asp) and TournamentStatus.js such that they use a different path where permissions are different (many sites will have a tmp folder to which data can be written).
-
Hi Corey!
I don't know if it is obvious that the example folder would contain a script for the "online" part of TD, but I see now (when I know what it is for) that it contains the same example.
In order to write the text file I had to modify some of the script "statusListener.asp" from this:
try
{
theRef = new ActiveXObject("Scripting.FileSystemObject").CreateTextFile(kFileOutput, true, false);
theRef.Write(theOutput.join("\n"));
}
...to this:
try
{
var objFS = Server.CreateObject("Scripting.FilesystemObject");
theRef = Server.MapPath(kFileOutput);
var objFile = objFS.CreateTextFile(theRef, true, false);
objFile.Write(theOutput.join("\n"));
}
Now it works (the code may not be smooth but anyways) and I have no problem writing the file "tdstatus.txt" in the same folder...
Thanks both of you! :D
/Søren
-
Glad you got it to work.
That actually makes a lot of sense. I think I'll update the example code with your addition. Thanks!
-
Hmm I'm back and I seem to have found a small bug in the "TournamentStatus.js"-file which I believe should be updated in the example.
The code reads this:
$("#ante").css({ display: TDStatus.HideZeroAnte ? "none" : "" });
$("#label_ante").css({ display: TDStatus.HideZeroAnte ? "none" : "" });
$("#space_ante").css({ display: TDStatus.HideZeroAnte ? "none" : "" });
But this only takes into consideration whether you have set HideZeroAnte to true/false - NOT considering if the actual ante is in fact zero.
I think the code should be updated to:
$("#ante").css({ display: !TDStatus.HideZeroAnte ? "" : TDStatus.getChipsString(TDStatus.Vars["ante"]) == 0 ? "none" : "" });
$("#label_ante").css({ display: !TDStatus.HideZeroAnte ? "" : TDStatus.getChipsString(TDStatus.Vars["ante"]) == 0 ? "none" : "" });
$("#space_ante").css({ display: !TDStatus.HideZeroAnte ? "" : TDStatus.getChipsString(TDStatus.Vars["ante"]) == 0 ? "none" : "" });
Anyway, I have done the above and now the ante shows correctly, when there's something to show (HideZeroAnte = true)...
/Søren
-
Yikes! You're absolutely right. That was a big brain fart. :)
Thanks for pointing this out. I'll get it updated.