Hi,
i have a problem... i'll want show the last 5 matches (see this example -> LINK ) in the standing template. Who can help me?
Thanks!
Hi,
i have a problem... i'll want show the last 5 matches (see this example -> LINK ) in the standing template. Who can help me?
Thanks!
I wrote a bit of code to add a new shortcode that I think will give you want you want. Give me an email address and I'll send a new version of the 'shortcode.php' file. [ Or post a link to the pastebin.com file instead. ] You can tweak the matches template to get the output you want, but right now you'll get this:
November 9, 2012 20:30 Stozice Arena
Union Olimpija Ljubljana – Real Madrid 76 - 89
Hi,
my email is [ redacted, support is offered via the forums and not email ]
Ty very much!
lamontef please post a link to the pastebin.com file instead. ty
I'd like to see this too, along with an easy way to only show future scheduled matches, for example, the matches for the next 2 weeks.
Yes this is a thing that I would like to see .
[signature moderated]
I looked for the code on pastebin.com but I didn't find it. Where is it possible to find it?
Thx
Also interesting ... How can I get the updated file - shortcode.php?
I am trying to download this plugin but it cannot be located in the WP repository. Any ideas?
A mi tambien me interesa!!!
I'm working on some code that I just need to tweak the CSS for, if you're interested in testing it, let me know. I'll post it here sometime today or tomorrow.
interested
interested
interested
I'm committing a test version shortly that will be 3.8.8.1, specifically for the 'Last 5' functionality.
Here's some information that will be part of the new version info )there's also a screen shot of a 'Last 3' setup so you can see what it should look like):
If you test and find that the icons at the end of each line in the standings are moving to a second line it means you don't have enough room on your template for five past results. You can then change to a lesser number in the template, named 'standings-last5.php' in the 'admin/templates' folder. Go to 43:
<th width="100" class="last5"><?php _e( 'Last 5', 'leaguemanager' ) ?></th>
change the 'Last 5' text to 'Last 3' if you're going to use three past results, or whatever you choose. Then go to line 93:
$results = get_latest_results($team->id, 5);
Change the '5' at the end to '3' if you want three past results.
The final version will probably have this as a preference option.
Shortcode to use:
[standings league_id=1 template=last5] or
[standings league_id=1 group=A template=last5 logo=true]
(group and logo are optional)
Nice one boss.
Keep up the good work.
great job, I do not work very well, I get the last 5 but can not see anything. if I can not put a link to my website
If you test and don't mind, please put a link to a page that you've got set up to test so I can see how it looks on your page.
Thanks robsanders - let me know if there's anything that can make it better. I have a few ideas, but am interested in getting more.
Cargov - I'm not sure I understand your message. You can't see anything? Can you post a link so I can see it on your page?
Hi LaMonte, thanks for every thing you are doing a good job with the plugin
i need some help to show matches
what is the code to show matches (prev) and next
i put this code:
[matches league_id=1 limit=10 time=prev order="date DESC"]
[matches league_id=1 limit=10 time=next order="date ASC"]
example now the italian "31 days" matches is not finish in the sunday it's missing one match that they will play today
if i put the code for next match "32 days" this game it's already included there is some thing wrong.
an other question can i have the title "num_match_days" to put before the code in automatic
Yeah, I actually added a new 'time' code called 'prev1' to fix that a few months ago. What I did was if the game was scheduled, but there's no winner (obviously wasn't played), then it will still show up in the list. Otherwise the shortcode is looking for games in the past without checking if they've been played or not...
Try this code and see if it works for you (make a copy of your 'shortcodes.php' file first!)
Open the 'shortcode.php' file in the 'libs' folder. Around line 250-260 you'll see:
if ( $time ) {
if ( $time == 'next' )
$search .= " AND DATEDIFF(NOW(), <code>date</code>) <= 0";
elseif ( $time == 'prev' )
$search .= " AND DATEDIFF(NOW(), <code>date</code>) > 0";
}
Change that with this:
if ( $time ) {
if ( $time == 'next' )
$search .= " AND DATEDIFF(NOW(), <code>date</code>) <= 0";
elseif ( $time == 'prev' )
$search .= " AND DATEDIFF(NOW(), <code>date</code>) > 0";
elseif ( $time == 'prev1' )
$search .= " AND (DATEDIFF(NOW(), <code>date</code>) > 0) AND (<code>winner_id</code> != 0) ";
}
Then, around line 275 (probably 285 or so) find:
$matches = $leaguemanager->getMatches( $search, $limit, $order );
after that line, add these:
foreach ( $matches AS $key => $row ) {
$matchdate[$key] = $row->date;
}
if ($time=='prev1'){ array_multisort( $matchdate, SORT_ASC, $matches ); }
That will come right before:
$i=0;
foreach ( $matches AS $match ){
There are two other things that could make it work better, but try that first and we'll go from there. I haven't touched this code in awhile since it'w working for me.
Sorry, forgot the most important line:
[matches league_id=1 limit=10 time=prev1 order="date DESC"]
See how that works, and let me know.
it gives me an error
'date) > 0) AND (winner_id != 0) ORDER BY date DESC LI' at line 1]
Warning: array_multisort() [function.array-multisort]: Argument #1 is expected to be an array or a sort flag in /home/xxxxxx/public_html/wp-content/plugins/leaguemanager/lib/shortcodes.php on line 277
This:
if ($time=='prev1'){ array_multisort( $matchdate, SORT_ASC, $matches ); }
Yeah, sorry, that's my fault I didn't notice that the code didn't copy over right. Make a copy of your shortcode.php file in the libs folder and put the following in it's place.
Here's the file on pastebin:
See how that works...
It works (of course) but it will add the last game in the schedule that is even unplayed. I have default last 5 games, not 6.
<a class="N last5-bg" href="?match=8"> </a> - not yet played
<a class="L last5-bg" href="?match=6"> </a>
<a class="L last5-bg" href="?match=5"> </a>
<a class="L last5-bg" href="?match=4"> </a>
<a class="W last5-bg" href="?match=3"> </a>
<a class="D last5-bg" href="?match=2"> </a>
That's by design, the first icon is the next game to be played...
Being this is something new, we have the opportunity to make various things optional, such as number of games to show, to show the next game or not, what icons to use, etc. I saw an implementation of a similar feature on a site the other day that had simple green and red bullets. It was very clean but very easily identifiable.
Just some thoughts, I'd encourage anyone to jot down some thoughts as well...
Thanks LaMonte,
Error is gone and with this code is showing:
[matches league_id=1 limit=10 time=prev1 order="date DESC"]
i dont know if it's working, because all the matches are played yet
i will see for the next week, because i will get the same thing in the date of matches (Sunday and Monday)
but pls. can you do some thing for example when i put the code
[matches league_id=1 limit=10 time=prev1 order="date DESC"]
before or on the top must have the number of "$league->match_days" as per title.
thanks a lot
I'm not 100% clear on what you're looking for...
Can you put the code on a page and post a link so I can see it? Or can you take a screen shot and write on it what is or isn't working and what you need.
Dear LaMonte,
on top of match table next or prev matches i want to put a title:
$league->num_match_days
how can i post the screen shot????
wrong icons in a draw and defeat
how I can add a screenshot???
You must log in to post.