X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=calendar.php;h=d9a7d29880b01c3d94be89f22768c4b30a92eed0;hb=f7f243ac52fea086657aca1b589018778d7198d6;hp=6082989fdef3342f00a6d110c3d6818843ec992b;hpb=9852f8e5a8b84cb565343914dae4376336ccf387;p=wfpl.git diff --git a/calendar.php b/calendar.php index 6082989..d9a7d29 100644 --- a/calendar.php +++ b/calendar.php @@ -37,12 +37,6 @@ # The html and CSS is completely customizable without opening a php file. -# ACKNOWLEDGMENTS -# -# Thank you Oscar Merida for figuring out the necessary date() and strftime() -# calls: http://freshmeat.net/projects/simplephpcalendar/ - - require_once('code/wfpl/template.php'); @@ -55,9 +49,16 @@ function calendar_day($kind, &$template) { $template->sub('day'); } -function calendar($year, $month, $events = 0, &$template = 0) { - if($template == 0) { - $template = $GLOBALS['wfpl_template']; +# php4 is broken, in that you cannot set a default value for a parameter that +# is passed by reference. So, this is set up to use the following screwy +# syntax: +# +# calendar('2006', '12', $events, ref($my_template)) +function calendar($year, $month, $events = 0, $template = 0) { + if($template === 0) { + $template = &$GLOBALS['wfpl_template']; + } else { + $template = &$template->ref; } if(strlen($year) == 2) {