The MU forums have moved to WordPress.org

Kieran's Calendar - duplication of year in URL (4 posts)

  1. tkreucher
    Member
    Posted 16 years ago #

    I'm back to haunt the place with more questions about the calendar plugin written by Kieran O'Shea, for which I am using the modified version SteveAtty graciously shared with us a couple of months back. I'm still stuck with the issue I described in this thread with the multiplying years. Once I jump one step beyond the current month using the PREV and NEXT buttons, it starts adding years. For instance, if I click NEXT twice on my Feb 2008 calendar, I end up with an Apr 2008/2008. Clicking previous results in Mar 2008/2008/2008/2008.

    Steve has limited availability right now and I'm wondering if perhaps others have ran into this and resolved it already, or if you can right offhand see an obvious problem. :)

    I believe the problem is in a PHP script and not in the rewrite rules, because when I mouseover the PREV or NEXT links, the URL is tacking on the additional year even before I click on it.

    I've tried this as a potential fix but that's not the problem.

    I am looking at the calendar.php file that comes in Steve's ZIP package and it has been modified slightly for MU. Specifically, I am looking at the functions for previous and next links.

    Here is the original code from Kieran's package:

    [Please use pastebin for long code - Mark]

  2. tkreucher
    Member
    Posted 16 years ago #

    I'll share the solution in case someone else runs into it. This is probably child's play for really experienced PHP programmers, but I'm still learning and I'm sure others are as well.

    I had to add the URL to /calendar/ in the return lines for function next_link and prev_link in the calendar.php file.

    For example:

    "http://MYURL/calendar/' . $next_year . '/jan"

    Hope this might help someone else.

  3. moorezilla
    Member
    Posted 15 years ago #

    Just to let you guys know... Kieran has a new version of this calendar plugin that is just about a release candidate at this point. I tried the beta and it seems to work great with Mu. You can get a copy at

    http://www.kieranoshea.com/category/development/calendar-for-wordpress/

  4. SteveAtty
    Member
    Posted 15 years ago #

    It does seem to work. Now if we can have nice URLS using re-writing (i.e /calendar/2008/08 rater than /calendar/?month=aug&yr=2008 ) it would be perfect!

About this Topic

  • Started 16 years ago by tkreucher
  • Latest reply from SteveAtty