]> git.mxchange.org Git - friendica.git/commitdiff
prev/next links in calendar
authorFriendika <info@friendika.com>
Tue, 7 Jun 2011 04:28:11 +0000 (21:28 -0700)
committerFriendika <info@friendika.com>
Tue, 7 Jun 2011 04:28:11 +0000 (21:28 -0700)
mod/events.php

index d280bc1edc4e5b160f7d792d7b51789733adf559..da076313ad15b5bb2bb56e823679c5c391997a97 100644 (file)
@@ -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 .= '<a href="' . $a->get_baseurl() . '/events/' . $prevyear . '/' . $prevmonth . '" class="prevcal">' . t('&lt;&lt; Previous') . '</a> | <a href="' . $a->get_baseurl() . '/events/' . $nextyear . '/' . $nextmonth . '" class="nextcal">' . t('Next &gt;&gt;') . '</a>'; 
                $o .= cal($y,$m,false, ' eventcal');
 
                $dim = get_dim($y,$m);