jump_ace Posted December 14, 2011 Share Posted December 14, 2011 Hey guys, I've kind of taken over a project from a friend. It's a leaderboard for posting splits for drivers. The splits get posted to a leaderboard.xsl (which is working fine). The update.php page is designed to update a leaderboard.xml file, this way anyone can login and update new splits for each weeks race. (more info can be found here if you are curious). I found a small bug in the leaderboard.xsl file. It is meant for displaying the drivers splits, calculating the difference between drivers, what division they are, car they used and includes a 'Controller' column. This is where the bug is. Normally, it will display if that driver uses a gamepad or a steering wheel. If it's a one lap aka 'hotlap' race, the Controller column shows either a 'wheel' or 'controller' as it should. However, if it's a multi-lap race (2+ laps), then the Controller column automatically defaults to the <xsl:otherwise> option of a "?". Here is an example of the Controller column working properly for each driver: Here is what it does when there are two (or more) sets of splits for each driver on the leaderboard: The code makes the post over the character length, you can view the code here. Any assistance/help would be great appreciated as I'll be done with the project then Jerome Link to comment https://forums.phpfreaks.com/topic/253177-small-bug-in-leaderboardxsl/ Share on other sites More sharing options...
Psycho Posted December 14, 2011 Share Posted December 14, 2011 OK, so can you give a little more information. Is the value being saved incorrectly or is it a problem when the values are displayed? Link to comment https://forums.phpfreaks.com/topic/253177-small-bug-in-leaderboardxsl/#findComment-1297948 Share on other sites More sharing options...
requinix Posted December 14, 2011 Share Posted December 14, 2011 A shot in the dark: Wheel Gamepad ? Link to comment https://forums.phpfreaks.com/topic/253177-small-bug-in-leaderboardxsl/#findComment-1297949 Share on other sites More sharing options...
jump_ace Posted December 14, 2011 Author Share Posted December 14, 2011 OK, so can you give a little more information. Is the value being saved incorrectly or is it a problem when the values are displayed? It's being saved properly in the leaderboard.xml file, likely a problem when the values are displayed; gives "?" instead. EDIT: A shot in the dark: <!-- Controller --> <xsl:if test="../descendant::driver/@controller"> <td class="controller" rowspan="{count(lap) + 1}"> <xsl:choose> <xsl:when test="@controller = 1"> <xsl:text>Wheel</xsl:text> </xsl:when> <xsl:when test="@controller = 2"> <xsl:text>Gamepad</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>?</xsl:text> </xsl:otherwise> </xsl:choose> </td> </xsl:if> That worked! Now single lap and multilaps show the controller! YES! Thank you so much Jerome Link to comment https://forums.phpfreaks.com/topic/253177-small-bug-in-leaderboardxsl/#findComment-1297953 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.