WordPress.org

Support

Support » Plugins and Hacks » My Calendar » [Resolved] [Plugin: My Calendar] Bug in my_calendar_permalink_prefix()

[Resolved] [Plugin: My Calendar] Bug in my_calendar_permalink_prefix()

  • I’ve run into a problem with My Calendar screwing up the next and previous URLs if I’m passing other variables on the querystring and month is the first querystring variable – the current code places all the non-my calendar querystring parameters before the ? and lands you on a 404 page.

    I tracked the problem down to the my_calendar_permalink_prefix() function in my-calendar.php – it can be fixed by replacing this block of code:

    if (isset($_GET['month']) && isset($_GET['yr'])) {
    	$new_tail = split("&", $real_link);
    	foreach ($new_tail as $item) {
    		if (!strstr($item, 'month') && !strstr($item, 'yr')) {
    			$link_part .= $item.'&';
    		}
    	}
    	if (!strstr($link_part, '?')) {
    		$new_tail = split("month", $link_part);
    		$link_part = $new_tail[0].'?'.$new_tail[1];
    	}
    } else {
    $link_part = $real_link.'&';
    }

    with this:

    if (isset($_GET['month']) && isset($_GET['yr'])) {
    	$link_part = '';
    	$new_base = split('\?', $real_link);
    	if(count($new_base) > 1){
    		$new_tail = split('&', $new_base[1]);
    		foreach ($new_tail as $item) {
    			if (!strstr($item, 'month') && !strstr($item, 'yr')) {
    				$link_part .= $item.'&';
    			}
    		}
    	}
    	$link_part = $new_base[0] . ($link_part ? '?'.$link_part : '');
    } else {
    	$link_part = $real_link.'&';
    }

    Any chance of this making it into the next version?

    Cheers,
    Geoff

    http://wordpress.org/extend/plugins/my-calendar/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: My Calendar] Bug in my_calendar_permalink_prefix()’ is closed to new replies.
Skip to toolbar