Author Topic: PHP Template Converter  (Read 4193 times)

benmajor

  • Newbie
  • *
  • Posts: 34
    • View Profile
PHP Template Converter
« on: October 07, 2007, 05:42:39 AM »
Hello all,

This is my first post on the forum, but firstly let me start by thanking the chaps behind TD for their excellent work and application. I have taken a special interest in the Layout Designer, and have read a couple of posts both on this forum, and others asking whether or not it is possible to import HTML Pages as Templates for the Layout. I personally love the idea of this, and was thinking about how it could be made possible.

I know PHP 5, and think that I should be able to code a converter that is able to convert any HTML page into a TD layout file. The question is, is this worth it, and does Corey want me to do this?

Let me know your thoughts, and I figure that this is a small repayment I can make for this great software and contribution to Poker Tournament Managers.

Thanks,
Ben

Bojan1983

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: PHP Template Converter
« Reply #1 on: October 07, 2007, 08:22:59 AM »
Anything that would incourage people to create better lookin templates would be great. I dont have a clue how to create my own layout, so I am stuck with the default, cheap lookin default.

I am looking forward to developing this part of TD...

Proud owner of TD licence :)

gaffa

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: PHP Template Converter
« Reply #2 on: October 07, 2007, 10:19:05 AM »
I agree, this and any help alont this line is a good idea ...

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5429
    • View Profile
Re: PHP Template Converter
« Reply #3 on: October 08, 2007, 11:00:10 AM »
You are welcome to give it a go.  The problem will be outputting a file that is compatible with the object model of the TD.  Not an easy thing to do.  But like I said, you are welcome to give it a go.

One thing to keep in mind: Part of the reason the TD's layout is divided into cells (and rows and columns), is to facilitate the TD only needing to update parts of the screen at any given time.  This is huge - I can't emphasize enough how important this is.  You could conceivably create a single cell with a lot of HTML in it, all your tokens, etc, (as a matter of fact, you could do this with your PHP script), but this will basically result in the entire screen being updated every second, and you'll see the TD grind to halt, even on fast computers.

benmajor

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: PHP Template Converter
« Reply #4 on: October 08, 2007, 04:21:46 PM »
Hi Corey,
Thanks for your thoughts. To be honest, what got my juices running about this project was the fact that I saw in the tdMain.js a variable named "layoutHTML", and this struck me as something which sounded interesting. My question is, what exactly does this variable do, as it's value seems to be defaulted as ""?

I must admit now I am running an old version of TD (v1.3.5). The reason that I am running this one is because of the error with the MS-ITS protocol at load-up, and so I had to role back to this earlier version I had on my computer.

Thanks, and look forward to hearing your thoughts,
Ben

P.S. please feel free to handle this with PMs if you want to avoid filling the thread up with pointless tech stuff Corey.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5429
    • View Profile
Re: PHP Template Converter
« Reply #5 on: October 09, 2007, 10:28:56 AM »
layoutHTML does not do what you might think it does.  It basically holds the "framework" for the Layout tab on the Settings page.  Doesn't actually have anything to do with what is displayed on the Tournament page.

benmajor

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: PHP Template Converter
« Reply #6 on: October 09, 2007, 11:20:00 AM »
Ah right, probably won't be as easy to build this as I first thought, and looking at the different ways in which TD creates templates, it won't be possible to create a cross-version compatible one.

Out of interest, is there are more help reagrding the MS-ITS problem on startup? I tried to follow the comments in the "Help Me" forum, but to no avail.

Thanks,
Ben

benmajor

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: PHP Template Converter
« Reply #7 on: October 09, 2007, 03:22:30 PM »
Well, it seems I managed to make some progress as to getting the recent version of the software to run on my computer. By clicking on refresh from the HTA File, I can open the manager, but for some reason none of the images display. Any help on how I can get them to display would be most gratefully received indeed.

Thanks,
Ben

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5429
    • View Profile
Re: PHP Template Converter
« Reply #8 on: October 09, 2007, 04:27:36 PM »
The symptoms you describe sound exactly like what happens when the ms-its protocol is disabled.  How you got it to run in the first place is a mystery to me, because it should not be able to run with this protocol disabled.

In my testing, when I enabled the ms-its protocol, started the TD, and then disabled the protocol while the TD was running, I see what you described: the software works but the images are not displayed.

The ms-its protocol allows the TD code and its supplemental files (such as images) to be read from the code library.  Once the TD is started, all of the code has been read, but the images are read as needed.  Disabling the protocol should allow the program to continue running, since it has already loaded all of the code, but the images won't be accessible.  Sounds like exactly what you are experiencing.

The only program I've come across that allows you to enable/disable this protocol is the BugOff program posted in the forums here: http://thetournamentdirector.net/forums/index.php?topic=29.msg307#msg307

... which I am sure you've tried already.  Did it not work for you?

benmajor

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: PHP Template Converter
« Reply #9 on: October 09, 2007, 04:39:11 PM »
Hi Corey,

Thanks for your message. I have indeed tried to disable and then disable the MS-ITS protocol using the BugOff program, but to no avail. I also tried to repair IE6 using the methods on Microsoft's website, but again become of it. I did have one thought as to how the problem could be fixed. Would it not be possible to edit the Library to use a full absolute path to the files and images needed by the HTA file, as I assume that they use relative paths, and perhaps this could be part of the problem? Or is it perhaps how the images are transmitted over the MS-ITS Protocol? I have been hunting around for other browsers that support HTA, or indeed a plug-in for FireFox, but haven't been able to find anything at all.

Thanks for your help thus far,
Ben

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5429
    • View Profile
Re: PHP Template Converter
« Reply #10 on: October 10, 2007, 10:21:00 AM »
No other browsers support HTA or the ms-its protocol.  It is a Microsoft only thing.  And the TD would never run in any other browser, sorry.  It is too IE specific.

Paths don't have anything to do with it.  You have to think of the "TD.lib" file as the code library, and it is in a format such that only the ms-its protocol can read it.  Without this protocol enabled, the file simply cannot be deciphered.

What confuses me is how you got the TD started in the first place.  It appears as if the protocol was enabled briefly, and then disabled after the TD started.  I have no idea how this could/would happen.  Makes me think perhaps you've got some anti-virus software installed that is affecting it.  It may be that the protocol is not disabled, but merely blocked by some third-party software (read: anti-virus).  If that's the case, using the BugOff program to enable/disable it wouldn't have any effect, as it would still be blocked by other software.  Any ideas?

benmajor

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: PHP Template Converter
« Reply #11 on: October 10, 2007, 11:02:59 AM »
I too was confused when the program started after selecting the "Refresh" option. It really confused. It seems that I will either have to get a new HDD to run the TD exclusively under its own OS, or format this one (but this isn't really possible). I tried the TD out on my laptop, work's laptop and also the other family computer, and it worked perfectly on all of them - except this one!

I thought that your option sounded viable, and tried running TD with my Firewall and Anti-Virus software disabled, but again images and dialogues were corrupt. I then tried reinstalling and re-installing IE6, but again nothing become of it! I was also going to update from SP2 (I never did this), but this isn't an option either, as I have a 64-bit processor, and there are known problems with this architecture. So it looks like my only option is to head over to the PC Store and get another HDD, install Windows and then run all Poker related activities from there!

Thanks for your help Corey, and if I can find a solution, I will let everyone know. I wonder whether or not it would be worth contacting Microsoft, and asking them whether or not they have any methods for either testing the ms-its protocol, or perhaps more importantly repairing it.

Thanks again,
Ben