Knowledgebase

php ordered list problem

Posted by Crafty1, 07-23-2008, 01:26 AM
I'm working with phpbbgarage, which is still in beta and has been abandon so it's really hard finding support for it. Anyway the problem i have is that the ordered list is wrong, for dyno runs for example it's fine because obviously the highest figure is the better figure. But for quartermile times it's showing it back to front using this same order, because obviously a lower time is better. What do I look for in the php file to change this order so it's ordering the list back the other way? If someone can give me some tips on what to look for. I think this is the right section of code. Quarter Mile (need to switch order) Dyno Run (order is fine)

Posted by ThatScriptGuy, 07-23-2008, 03:04 AM
Are you wanting to change the quarter mile times to show highest to lowest? The code says to order them lowest to highest, which is what I'd think you would want. Regardless, if you DO want to show quarter mile times highest to lowest, you need to change your code to this:

Posted by Crafty1, 07-23-2008, 03:21 AM
Yeah I want them to show lowest to highest, meaning lowest time is on the top. The script doesn't do this, is it supposed to? It doesnt work anyway. There is a 14 second car at the top, and a 11 second car at the bottom when it should be the other way around. Are you saying the existing code should already be listing it like that? It's not!

Posted by ThatScriptGuy, 07-23-2008, 03:23 AM
It sure looks to me like it should be listing ASC (lowest to highest). If you want to FORCE it to show lowest to highest, this should work:

Posted by Crafty1, 07-23-2008, 03:32 AM
I just tried that code, the same thing. I swaped ASC to DESC and back again aswell before I posted on here and that didn't do anything either. I tried to change DESC to ASC for dyno runs too, and same result nothing changes. I'm totally confused as to why this doesn't work! I wouldn't have to delete any template file to regenerate the page or anything silly would I? I figured it generates it on the fly. A slight update, on the quartermile page itself it lists it fine and the correct order with the lowest at the top as it should be but on the actual garage index page where it lists a summarized table the order is around the wrong way. The problem is the file I am editing is for this front page, so I'm lost. Last edited by Crafty1; 07-23-2008 at 03:35 AM.

Posted by ThatScriptGuy, 07-23-2008, 03:33 AM
If changing ASC to DESC in that certain code isn't doing anything, then it's not the right section of code. Doesn't this hack have a discussion thread @ phpbb.com? If so, you might be better off asking your question there, where people have actually used it. Kevin

Posted by Crafty1, 07-23-2008, 03:36 AM
Ok so changing ASC to DESC is altering the order on the 1/4 mile page itself but not on the index page where it lists the summary. Damn, where the hell is it getting this from then? lol Yeah there is a thread on there about this hack, but there is so many bugs and so many issues nothing ever gets done and the author is MIA!

Posted by Crafty1, 07-23-2008, 03:43 AM
OH SWEET! I did it the ghetto way and did a mass replace on files to count them out. I found the correct file to edit for the MAIN PAGE wasn't class_garage.php as you would expect. That actually edits the sub page for the 1/4 mile list and the class_garage_quartermile.php file edits it on the main page. Whatever, that makes no sense and I feel stupid for not having tried that first! LOL Thanks for your help though, got me steered in the right direction!



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read


Language:

Client Login

Email

Password

Remember Me

Search