From bbc65f98328cd0a4732af5a52bec586a868255ba Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 6 Jun 2011 21:28:11 -0700 Subject: [PATCH] prev/next links in calendar --- mod/events.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mod/events.php b/mod/events.php index d280bc1ed..da076313a 100644 --- a/mod/events.php +++ b/mod/events.php @@ -120,7 +120,23 @@ function events_content(&$a) { if(! $m) $m = intval($thismonth); - + $nextyear = $y; + $nextmonth = $m + 1; + if($nextmonth > 12) { + $nextmonth = 1; + $nextyear ++; + } + + $prevyear = $y; + if($m > 1) + $prevmonth = $m - 1; + else { + $prevmonth = 12; + $prevyear --; + } + + + $o .= '' . t('<< Previous') . ' | ' . t('Next >>') . ''; $o .= cal($y,$m,false, ' eventcal'); $dim = get_dim($y,$m);