Azərbaycan dili Bahasa Indonesia Bosanski Català Čeština Dansk Deutsch Eesti English Español Français Galego Hrvatski Italiano Latviešu Lietuvių Magyar Malti Mакедонски Nederlands Norsk Polski Português Português BR Românã Slovenčina Srpski Suomi Svenska Tiếng Việt Türkçe Ελληνικά Български Русский Українська Հայերեն ქართული ენა 中文
Subpage under development, new version coming soon!

Onderwerp: »[news] XML Data Improvements

2007-02-16 01:26:16
How does sokker differentiate the tie breaker in league position when there's two teams with the same points, GD, and goals scored? Same as with promotion by using last year's position? Ie i can use ranking as the 4th sort if that's the case (points, GD, Goals, Ranking would be the sort).

Yes, last season position.
2007-02-16 09:24:41
no man, wait a minute, you were asking how to have the exact order for each league. You're a programmer and I thought you need just a little input not the whole process...do you want the entire process? here you hare:

ok, let's say we are calculating Division 3 promoting table
1 - donwload xml of each legues 2nd Division
2 - store teamID and rankTotal and leagueid of each team

now it is time to select the best teams from this division, we don't need them because we want calculate just 3rd division promotion, but i'm doing it just to be complete

3 - sort the data you just stored by rankTotal and league like that:

SELECT * FROM `teams` WHERE `league`='league you want' ORDER BY `rankTotal` DESC LIMIT 1 (you need the very 1st or LIMIT 2 if you need the first two)

4 - put the result in the promotion table for 2nd dvision (i'm talking about an SQL table)

Operation 3 and 4 as to be done as many times we need (it dipends on how many leagues we had, 2nd division should be 4 leagues, so four times)

Ok, now we are going to calculate the last 4 of each league of 2nd division

5 - sort the data you stored in point 2 by rankTotal and league like that:

SELECT * FROM `teams` WHERE `league`='league you want' ORDER BY `rankTotal` ASC LIMIT 4

6 - put the result in the table of the worst for 2nd dvision

Operation 5 and 6 as to be done as many times we need (it dipends on how many leagues we had, 2nd division should be 4 leagues, so four times)

Now we have 2 tables we will use the second table (worst of 2nd division) to estabilish who will do the match and who will automatically pass to 3rd division

7 - Order the worst table by rankTotal, the last 25% will not dispute the match with the formula explained above

8 - donwload xml of each legues 3nd Division
9 - store teamID and rankTotal and leagueid of each team

now it is time to select the best teams from this division

10 - sort the data you just stored by rankTotal and league like that:

SELECT * FROM `teams` WHERE `league`='league you want' ORDER BY `rankTotal` DESC LIMIT 1 (you need the very 1st or LIMIT 2 if you need the first two)

11 - put the result in the promotion table for 3nd dvision (i'm still talking about an SQL table)

Operation 3 and 4 as to be done as many times we need (it dipends on how many leagues we had, 2nd division should be 4 leagues, so four times)

Ok, we still need to calculate the worst of this division but we will not doing because we have all the information we need to calculate the promoting table of division3, missing just the last 2 steps:

12 - Order the promotion table of 3rd division by rankTotal, the first 25% will not dispute the match with the formula explained above

Right now, you have two tables, the worst of the second division, the best of the third division, you need just to match them, if you used the ASC / DESC option correctly i will need to take the first from one table with the first of the second one and so on.

I hope that all i wrote is understandable, i'm not so used to write so long in english :P
(gewijzigd)
2007-02-16 09:26:55
I forgot to say that this is the process explained step by step, but not the optimized one, you will need just two tables to store every information.
(gewijzigd)
2007-02-16 16:56:09
I didn't say i needed help doing it, i already said two ways in this thread it could be done (if ranktotal was how the tiebreakers were set). I just said that the way you were saying at first wouldn't work.
2007-02-16 16:58:24
Btw, i think there's a much easier way than that. Just do a select on all the teams, ordered by league and rank total. Then set the rank for each team as 1..8 as you go down the leagues.

Don't need to store the rank if you care about the update sql time, you could just store it in the recordset (depending on what you use) and resort then by league rank and rating, and then do the promotion table like i already do it.
2007-02-16 21:35:11
I was trying to be helpful, but i barely understand your objections (due to our different languages, probably). Nevermind, hope my posts helped somebody :)
2007-03-07 11:05:26
does someone know about a good PHP XML Parser?
2007-03-14 12:06:15
Nevermind, hope my posts helped somebody :)

Surely :)

Thanks
(gewijzigd)
2007-05-09 16:25:54
Up for ken.
2007-05-11 04:06:04
2007-05-11 08:11:09
little question...

xml data shows stadium construction days: 4,4233
when a player has a injury it shows in full days like: 5

why players injurys arent shown in similar way like construction, since http://online.sokker.org/data.php shows it 4,56?
2007-06-23 19:43:19
I was looking at your example code.
How do you parse the xml in $my_load_page? Just a quick pointer will do...
2007-06-24 13:23:18
it depends on which PHP version is installed on the server you're working. PHP5 has specific function to parse XML. PHP4 with PEAR installed has also some specific function. If you want to use these options please refer to php.net Or, as I did, you can find some good class here.
2007-06-24 14:51:31
I was testing locally (using XAMPP and sometimes WAMP), I guess that was php5 and simpleXML.

I give up with it... it gives me a headache :)
2007-06-24 16:20:59
working locally causes sometime connection issues, if you were able to download xml, the tough work is done. If you want i can send you my modified class to parse xml, i'm on holiday now, and coming back home the day after tomorrow, if you're interested in just send me a sk-mail.
2007-07-05 23:33:45
bump for alex jung