LaMonte Forthun
Forum Replies Created
-
Forum: Plugins
In reply to: [LeagueManager] Standings UpdateThe solution is to modify the way the ‘sport’ sorts teams. The ‘Sports’ are templates that are designed to be user modifiable. If you want to sort on name, you’d just change the function.
Here’s the function in the ‘baseball.php’ file:
/** * rank Teams * * @param array $teams * @return array of teams */ function rankTeams( $teams ) { foreach ( $teams AS $key => $row ) { $won[$key] = $row->won_matches; $lost[$key] = $row->lost_matches; } array_multisort( $won, SORT_DESC, $lost, SORT_ASC, $teams ); return $teams; }Here’s what I did with ‘basketball.php’:
/** * rank Teams * * @param array $teams * @return array of teams */ function rankTeams( $teams ) { foreach ( $teams AS $key => $row ) { $points[$key] = $row->points['plus']+$row->add_points; $done[$key] = $row->done_matches; $diff[$key] = $row->diff; $GA[$key] = round((($row->points2_plus) > 0 ? (($row->points2_minus) > 0 ? ((($row->points2_plus)/($row->points2_minus))*1000) : 1000) : 0),0); $WinPerc[$key] = round((($row->won_matches) > 0 ? (($row->done_matches) > 0 ? ((($row->won_matches)/($row->done_matches))*100) : 100) : 0)); } array_multisort( $points, SORT_DESC, SORT_NUMERIC, $WinPerc, SORT_DESC, SORT_NUMERIC, $GA, SORT_DESC, SORT_NUMERIC, $teams ); return $teams; }Going in and changing team numbers and such in the database will kill the entire set up as those are the numbers everything else is based off…
Forum: Plugins
In reply to: [LeagueManager] Create different groups into same leagueYou should be able to do what you want to as is…
Let me explain what I think you want to do, you tell me if I’m right or where I’m wrong and we’ll figure things out from there.
1). You create a league, in your example, you call it “Serie Junior”
2). After creating the league you add a season, we’ll call it 2013. If you are playing 24 matches during the season, add 24 to the ‘Number of Match Days’ field.
3). While you see “Leaguemanager >> Serie Junior” in the upper right corner, you’ll see ‘Preferences’ on the top left, you click that and for ‘Mode’, select ‘Championship’ and save.
4). You should see a field called ‘Groups’, if not, click “Serie Junior” at the top right and then ‘Preferences’ again, now you should see ‘Groups’
5). Enter your groups like like Group A;Group B;Group C (semi-colon between, no space between the semi-colon and the text.
6). Click on ‘Serie Junior’ you should now be in ‘Group A’ and can now add teams to Group A. Keep a close eye on what group you are in because when you add teams to ‘Group B’ the system goes back to ‘Group A’, so you have to make sure you’ve selected ‘Group B’ or ‘Group C’ in the group popup menu.
7). After you’ve added teams to a group, you can add matches to the group. Again, be sure you’re in the right group before adding matches. When you add matches, make sure you add the ‘Match Day’.I would suggest following that so you get to the point of being able to test if that’s what you need or now. If not, let me know.
Thanks,
LaMonte
Forum: Plugins
In reply to: [LeagueManager] 11 Or More TeamsAre you using ‘baseball’ as your sport or something else?
Forum: Plugins
In reply to: [LeagueManager] ImportingCan you send it to me please: lamontef (at) yahoo (.) com
Thanks
Forum: Plugins
In reply to: [LeagueManager] home/away tableThe way to add things like home/away to standings is to create a template that adds the column. Go into the template folder, grab the ‘standings-extended.php’ file, copy it, rename it something like ‘standings-HA.php’ and then you can modify that to get what you want.
When you want to call it from the shortcode you’d use
[standings league_id=1 template=HA]
Any chance of adding it to the shortcode? Even if I add something to the shortcode it still has to be added to a template, those are user customizable. If you built a template you wouldn’t need it in the shortcode, it would just be there.
Forum: Plugins
In reply to: [LeagueManager] Inter-Group MatchesActually, I hadn’t found anything either, so some code I wrote a while ago allows for that, with a preference checkbox “Allow Intergroup Play”. What I hadn’t quite finished was overall standings and standings in group/division. I needed it for US Basketball.
When I get back home tomorrow, I’ll put some code together that I have and we’ll see how it works for you.
Forum: Plugins
In reply to: [LeagueManager] 11 Or More TeamsYeah, there’s something going on because that’s not normal and I’ve never seen that in any version of LeagueManager I’ve used.
Just to be clear, what version do you have installed?
I’m going to look at a few things this morning, then I’m completely out of touch for about 36 hours, but will get back on it Sunday afternoon. If I find a solution this morning, I’ll post something.
Forum: Plugins
In reply to: [LeagueManager] Create different groups into same leagueSorry for my delay, I’m out of town and haven’t been able to get on the support site much.
I’m happy to help, but I’m not sure I understand your problem. You need to add three groups in five leagues? Are you looking for an automated solution or something else? Give me a more detailed explanation please and I’ll do what I can for you.
Nice website, looks great.
Thanks…
Forum: Plugins
In reply to: [LeagueManager] [Plugin: LeagueManager] Scores entered not holdingI posted this a couple of months ago about this issue:
**************************
This problem is based on a PHP update (introduced in 5.3.9) that introduced a setting to help prevent hash collision attacks. The setting is “max_input_vars” and is defaulted to be set at 1,000.The problem with updating an entire season, or even a few weeks worth, of matches is there are a lot of variables per game and those variables add up quickly when you’re limited to 1,000.
The best solution would be to re-write the code to work on a few lines at a time instead of grabbing all the code at once and then updating game by game, and I’m looking at it to see if I can do that (keeping in mind that League Manager isn’t my plug in).
In the mean time, there are two solutions:
1). Make sure you have match days defined in the season (how many matches per season), then make sure when you add a match you have a match day assigned to the match. When you go to update matches, filter by match day so you are only working with game 12 or whatever, so that the number of updates and variables used stays under the limit. If you’ve got 36 teams in a league and you’re trying to update 18 games at a time, you might run into the problem anyway and you’ll need to see solution 2. There are a lot of reasons that this is the best option, but the best reason is that it doesn’t involved anything like code changing or server tweaking…
2). This isn’t the ideal solution because it’s bypassing a setting that’s been added to PHP to avoid a vulnerability. The solution is to increase the number of variables that can be set at one time from 1,000 to some number higher. If you have access to your server’s php.ini file and know how to modify files on a server, you can add or modify the max_input_vars setting like this:
max_input_vars = 2,500
You can also change this setting in an .htaccess file in your local word press directory like this (they are different, if you put the above code in an htaccess file you’ll get a server error):
php_value max_input_vars 2500
I’ve tested this and it does work. If you find that the number isn’t high enough, add another 500 or 1,000, but I wouldn’t recommend throwing 10,000 in right away as the purpose of the restriction was to close a PHP vunerability.
If I can figure out how to update the code to work with a group of matches at a time so that the problem goes away, I’ll update the code here.
*****************************Changing the basketball.php file will only help those that are using basketball as their sport, otherwise that file is never called. Personally, I do as that’s what my site is, basketball, but it won’t help anyone with a soccer site, etc.
Deleting the ‘!isset($_POST[‘doaction2′])’ code isn’t a solution or part of the problem. That block is part of an if-then-else that has multiple options.
Thanks for the heads up on the ‘clas’ typos, I haven’t had time to go through all the files for errors like that, so please do let me know of anything you (or anyone else) find…
Forum: Plugins
In reply to: [LeagueManager] 11 Or More TeamsI would have to probably look at your admin area and code to see why you can’t add more than 11 teams as there isn’t any limitation that I know of. I personally use LeagueManager for a number of International basketball leagues and have numerous that have more than 11 teams.
I just looked at your site and notice that all your leagues have odd numbers, so my original thought wasn’t it. It’s only 11, eh? Strange… I’ll get in and have a look, but I’m not sure I can until I get back home on Sunday. I’ll be in touch.
Thanks for using LeagueManager!
Forum: Plugins
In reply to: [LeagueManager] calendar@intellicents, do you have a specific need for the calendar? Did you look at the link @ben52 provided to see if that’s what you need as well?
I can’t and don’t take any credit for the plugin, but hope we can all continue to make it better and better. Any and all ideas are welcome. No promises, other than to consider the idea and go from there!
Forum: Plugins
In reply to: [LeagueManager] PCT CalculationThe baseball ‘sport’ calculates games behind slightly differently, but the results are the same. I would propose that we build a sport file for softball since some of the rules are a bit different… At worse case, since I don’t have access to all my ‘tools’, let me build a softball sport and modify a couple of these things and we’ll go from there when I get back over the weekend.
Forum: Plugins
In reply to: [LeagueManager] calendarThat’s a template that would have to be built, but yes, could be done…
Forum: Plugins
In reply to: [LeagueManager] team widget logoThanks, I’ll check it out a bit later tonight and get it fixed up. I apologize…
Forum: Plugins
In reply to: [LeagueManager] team widget logoWhat error are you getting?