PSLS for Tennis League | Peter's Sports League Standings | Forum
Back to the sports standings script page
6:30 pm
Hi Peter,
Thanks a mil for a great piece of work. Thought I'd mention that I've been working to adapt your app for a Tennis league. Hope you don't mind. I'm making it publicly available and you still have the credit in the footer, etc.
http://eliotche.com/2009/08/se.....d-destroy/
It's a work in progress, so I'm sure I'll be making further customizations.
Great stuff! Thanks for sharing. I especially like the user-friendly links you added to the back end.
There's also a PHP squash ladder app that I used many years ago for a tennis club:
http://www.deepblue.uk.net/site/forum/7
I've been wanted to write my own tennis ladder app for quite a while, and more recently, develop the sports league standings script more, but other work has simply gotten in the way.
11:55 am
Hi Peter,
Thanks for the feedback and link.
I'm trying to add a function to addscoreyes.php so that instead of outputing
it outputs
I can get the integer variables, but I'm having problem getting the team names (when I call output the $winner and $loser variables, i only get their integer values).
Any ideas?
Thanks!
2:27 pm
just to follow up, I ended up doing a simple mySQL query to put the TEAMIDs and TEAMNAMEs into an array and then pulling out the Team Names that were required.
I've also completed some Facebook Connect and Feed integration so I'll hopefully release a new version soon.
Thanks again for the great script.
3:06 am
another post :)
I'm working towards showing an icon beside a given team to indicate they are on a "hot" streak. This would be for winning at least 5 games in a row.
I think the general logic of the mySQL query would be to query each teamid individually to see if they have won their last 5 games.
I'm wondering if you think there would be a better, more efficient way? Seems like querying each team individually would increase server load a lot if there are many teams.
Maybe one possibility is to add a mySQL table for streaks, that would add up to 5 or revert to zero if there was a loss?
I think I just answered my own question. Not sure about the mySQL query tho.
thanks!
3:45 pm
in case anyone else needs the info, it was pretty simple:
i added a field in the mySQL sportsdb_teams called teamstreak.
Then i edited addscoreyes.php and deleteyes.php so that when the user updates, it runs teamstreak = teamstreak +1 or teamstreak = teamstreak -1 in the mySQL query.
Then in standings.php, you can do some if statements to say, for example, if teamstreak is equal or larger than 5, show icon (or something similar).
Hope that helps.
I’m glad you were able to get both of those things going.
For getting the team name from the ID, you can also see the get_team_name function in standings_functions.php.
As for the streak code, you would need to check the existing value in “teamstreak”, since in many league formats (like tennis) there is technically no “0? streak, and the reversal of a winning or losing streak is not just plus or minus one more.
4:05 pm
Thanks for the info on the get_team_name function. That makes things much easier.
In terms of teamstreak. It's only meant to count winning streaks. So if the team wins a game, then it's teamstreak +1 (which adds up over time). But if a team losses a game, then teamstreak resets to 0. The teamstreak -1 is only used in deleteyes.php.
I see your point though, about a losing streak. If I was to implement that, it just be a matter of adding another field to the table, say "teamlosestreak" and doing a teamlosestreak +1 when a team loses a game. But then have teamlosesstreak reset to 0 if they were to win a game. This would work with deleteyes.php as well.
11:03 am
Got a demo site setup here: http://serveanddestroy.com if you are curious to see the changes.