# Plugin Problem

**URL:** https://forum.kirupa.com/t/plugin-problem/298757
**Category:** Uncategorized
**Created:** [October 24, 2009, 5:07am UTC](https://forum.kirupa.com/t/plugin-problem/298757 "2009-10-24T05:07:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gpimpin](https://avatars.discourse-cdn.com/v4/letter/g/fbc32d/32.png) [@gpimpin](https://forum.kirupa.com/u/gpimpin)
#### Post date: [October 24, 2009, 5:07am UTC](https://forum.kirupa.com/t/plugin-problem/298757/1 "2009-10-24T05:07:14Z")

</div>

First time post, and of course it is a help question.

I am using a WP plug-in to display previous and next games in a season. (Leaguemanager is the plug-in name - Link [http://wordpress.org/extend/plugins/leaguemanager/](http://wordpress.org/extend/plugins/leaguemanager/) ). The challenge I am having is that the previous game only displays the first game of the season, not the actual previous game…

The following code is pulled from the shortcode.php file in the lib folder of the plugin.  
\*\*  
Here is the code for the next game which works…\*\*

```auto
$next_matches = $leaguemanager->getMatches("( `home_team` = {$team->id} OR
`away_team` = {$team->id} ) AND DATEDIFF(NOW(), `date`) <= 0");
$next_match = $next_matches[0];

```

**Here is the code for the previous game that pulls the first game of the  
season, not the actual previous game.**

```auto
$prev_matches = $leaguemanager->getMatches("( `home_team` = {$team->id} OR
`away_team` = {$team->id} ) AND DATEDIFF(NOW(), `date`) > 0");
$prev_match = $prev_matches[0];

```

It’s probably something really simple, but I have been hacking away at this for about 8 hours and I cannot get it to work. On a side note if you swap the “0” for a “1” in this line **$prev\_match = $prev\_matches[0];** it will show the second game of the season.

Thanks for any help!
