Web Design Discussion > General Web Design Discussion

stat tables in untraveled regions & systems

(1/2) > >>

yakra:
http://tm.teresco.org/user/region.php?units=miles&u=yakra&rg=ESP-CL
                            Overall ESP-CL Region Statistics                           
Active SystemsActive + Preview SystemsDistance Traveled     0.00 of 0.00 miles (%) Rank: 5     0.00 of 0.00 miles (%) Rank: 5Routes Drivenof 111 (%) Rank: 7of 150 (%) Rank: 7Routes Clinchedof 111 (%) Rank: 7of 150 (%) Rank: 7Routes Driven & Clinched should read "0 of 111 (0%) Rank: N/A", etc.
For Distance Traveled, note that my rank here is 5, not 7. There are 6 travelers listed in the table at the bottom of the page.

http://tm.teresco.org/user/system.php?units=miles&u=yakra&sys=espa
  System Statistics for Spain Autopista / Autovia  Distance Traveled     0.00 of 8801.73 miles (0.00%) Rank: 17Routes Traveledof 269 (0%)Routes Clinchedof 269 (0%) Rank: 18Distance Traveled: Per espa-all.csv there are 17 travelers on the espa system, so at 0 miles I would be tied for 18th place.
Routes Driven:
  • 0 of 269 (0%)
  • No rank is shown. (Same for a system I have traveled.)
  • This stat is "Driven" on region.php and "Traveled" on system.php. It should be consistent between the two. (Was it discussed & decided to move from "Driven" to "Traveled" once upon a time?)
Routes Clinched: 0 of 269 (0%) Rank: N/A

yakra:
Note also that region.php incorrectly reports 0 miles total in Active Systems and Active + Preview Systems.

See also:
http://travelmapping.net/user/region.php?units=miles&u=the_spui_ninja&rg=ME
http://travelmapping.net/user/region.php?units=miles&u=oscar&rg=GU

michih:
There are a lot bugs like this......................

yakra:
Possibly related, possibly not:
http://forum.travelmapping.net/index.php?topic=2152
We'll have to keep an eye on the one thing as we fix the other thing...

yakra:
region.php

Why total mileage is listed as 0:
$activeTotalMileage = $row['totalActiveMileage'];
when
$row = tm_fetch_user_row_with_rank($activeClinchedRes, 'activeClinched');
when there is no actual user row to fetch in $activeClinchedRes.
Using a separate query to get total mileage before the main query that gets our results, similar to what's done elsewhere on the site, should clear this up.

Why Distance Traveled Rank is n out of n travelers:
In tm_fetch_user_row_with_rank, the while loop is executed 8 times, once for each traveler. $rank is set to $nextRank for values of 1 to 8 inclusive.

Why Routes Traveled/Clinched Rank is n+1 out of n travelers:
If I query
SELECT traveler, SUM(cr.clinched) AS clinched, ROUND(sum(cr.clinched) / 112 * 100, 2) as clinchedPct FROM routes AS r LEFT JOIN clinchedRoutes AS cr ON cr.route = r.root LEFT JOIN systems ON r.systemName = systems.systemName WHERE (r.region = 'ESP-CT' AND systems.level = 'active') GROUP BY traveler ORDER BY clinched DESC;
I get an extra 9th row in my results where all fields are NULL, allowing for one more iteration of the while loop in tm_fetch_user_row_with_rank.
Changing the first LEFT JOIN to a RIGHT JOIN eliminates this extra row. (Do we want to do this?)
Technically, I am in a 238-way tie for 9th place here, along with everyone else traveling 0 routes. Do we prefer to present this information that way, or as N/A as suggested in the OP?

Navigation

[0] Message Index

[#] Next page

Go to full version