Author Topic: Exporting Stats to website  (Read 3003 times)

knoepke84

  • Newbie
  • *
  • Posts: 24
    • View Profile
Exporting Stats to website
« on: August 30, 2008, 04:38:41 AM »
Is there anyway when you export stats to put onto a personal website that it could somehow have the same features as in the TD columns....such as being able to sort out individual rankings on points, cashes, final tables, etc. by just clicking the top button of the category like in the program?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Exporting Stats to website
« Reply #1 on: August 30, 2008, 11:19:08 AM »
There's no way from the TD to do that, but as the program allows you to use your own template, the template file could contain code to do this itself.  If I don't think it would be too hard, so if I can get a chance this weekend, I'll look into it.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Exporting Stats to website
« Reply #2 on: September 01, 2008, 01:49:40 PM »
OK, I added sorting to the players export (Players tab) and the tournament export (Game tab).  Turned out to be a little more involved than I thought, but once I got started I couldn't stop.

It's worth noting that sorting in the exported file is different from how it works directly in the TD program itself.  The export uses generic sorting code.  It doesn't know what kind of data is in each column, so it does a rudimentary check for data type and tries to sort accordingly.  It also doesn't do any kind of "fall back".  In the TD program, if you sort by buy-in (for example), the sorting code falls back on the player name when the buy-in value is the same for any two rows.  This sorting code will not do that, and therefore you'll get a non-determinant order for rows that have the same value.  I guess the bottom line is, if you export using one of these templates, it will have the ability to sort by clicking on column headers, but don't expect too much from the sorting code.

Save these files over your existing PlayersExport.html and TournamentExport.html files (in the templates) folder.  These will be the default templates for future versions.

FYI, I tested these in IE 6 and Firefox 3.  Which means it SHOULD work in most browsers, but no promises.

verbalvolley

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Exporting Stats to website
« Reply #3 on: September 02, 2008, 04:04:33 AM »
Hi cory,
thanks for this feature any added widgets to make our personal sites more interactive are gratefully received and i only mention this as a bug not as a criticism, when i sort the points coloumn it gives a strange result, the first pic is from a high points Sort and the second is from a low points sort. All the other coloumns work perfectly.

Also i have the limited HTML knowledge to edit the background colours, table colours in notepad or a editor, but i would personally find it useful and I'm sure others would if we could pick the basics of the page IE colours on the way out of the export, I have no idea of the work involved to achieve this so apologies if this sounds like a "can you just....."

Cheers

Gary


« Last Edit: September 02, 2008, 04:17:34 AM by verbalvolley »

badbeat

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: Exporting Stats to website
« Reply #4 on: September 02, 2008, 05:41:14 AM »
Hi cory,
thanks for this feature any added widgets to make our personal sites more interactive are gratefully received and i only mention this as a bug not as a criticism, when i sort the points coloumn it gives a strange result, the first pic is from a high points Sort and the second is from a low points sort. All the other coloumns work perfectly.


These results are due to them being sorted using the decimal comma. If you remove the decimal comma in TD preferences, the numbers will look like this 1000, instead of this 1,000 and will sort ok.

verbalvolley

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Exporting Stats to website
« Reply #5 on: September 02, 2008, 06:19:38 AM »
Ahh thanks mark thats fixed it, whats the reason behind that then?

badbeat

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: Exporting Stats to website
« Reply #6 on: September 02, 2008, 06:28:38 AM »
I can only think it reads the comma as a decimal point.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Exporting Stats to website
« Reply #7 on: September 02, 2008, 11:43:44 AM »
Actually, it unfortunately stops trying to decipher the number once it reaches a non-numeric character.  But this is overcome with very small change.  See attached.


verbalvolley

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Exporting Stats to website
« Reply #8 on: September 02, 2008, 12:09:01 PM »
I have just got home looked at the post and realised that now i know where the template for the export html is i can just change that file to the colours and format i need and that will be jobs a goodun

thanks for answers and the fix