[geeklog-cvs] geeklog-1.3/public_html calendar.php,1.33,1.34

dhaun at geeklog.net dhaun at geeklog.net
Fri Jan 23 07:14:00 EST 2004


Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory geeklog_prod:/tmp/cvs-serv2277

Modified Files:
	calendar.php 
Log Message:
Added filtering of parameters


Index: calendar.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/calendar.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** calendar.php	6 Jan 2004 22:38:40 -0000	1.33
--- calendar.php	23 Jan 2004 12:13:58 -0000	1.34
***************
*** 9,13 ****
  // | Geeklog calendar.                                                         |
  // +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2003 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs        - tony at tonybibbs.com                           |
--- 9,13 ----
  // | Geeklog calendar.                                                         |
  // +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2004 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs        - tony at tonybibbs.com                           |
***************
*** 98,106 ****
          }
      }
-     return array($hourcols, $thedata, $max, $alldaydata);
  
  }
  
! function setCalendarLanguage (&$aCalendar) {
      global $LANG30;
  
--- 98,107 ----
          }
      }
  
+     return array($hourcols, $thedata, $max, $alldaydata);
  }
  
! function setCalendarLanguage (&$aCalendar)
! {
      global $LANG30;
  
***************
*** 128,132 ****
  }
  
! function makeDaysHeadline () {
      global $LANG30;
  
--- 129,134 ----
  }
  
! function makeDaysHeadline ()
! {
      global $LANG30;
  
***************
*** 208,212 ****
          $month_options .= '<option value="' . $mval . '" ';
          if ($z == $month) {
!             $month_options .= 'selected="SELECTED"';
          }
          $month_options .= '>' . $mval . '</option>';
--- 210,214 ----
          $month_options .= '<option value="' . $mval . '" ';
          if ($z == $month) {
!             $month_options .= 'selected="selected"';
          }
          $month_options .= '>' . $mval . '</option>';
***************
*** 218,222 ****
          $day_options .= '<option value="' . $z . '" ';
          if ($z == $day) {
!             $day_options .= 'selected="SELECTED"';
          }
          $day_options .= '>' . $z. '</option>';
--- 220,224 ----
          $day_options .= '<option value="' . $z . '" ';
          if ($z == $day) {
!             $day_options .= 'selected="selected"';
          }
          $day_options .= '>' . $z. '</option>';
***************
*** 228,232 ****
          $year_options .= '<option value="' . $z . '" ';
          if ($z == $year) {
!             $year_options .= 'selected="SELECTED"';
          }
          $year_options .= '>' . $z . '</option>';
--- 230,234 ----
          $year_options .= '<option value="' . $z . '" ';
          if ($z == $year) {
!             $year_options .= 'selected="selected"';
          }
          $year_options .= '>' . $z . '</option>';
***************
*** 236,242 ****
      $cur_hour = date('H',time());
      if ($cur_hour >= 12) {
!         $tpl->set_var('pm_selected','selected="SELECTED"');
      } else {
!         $tpl->set_var('am_selected','selected="SELECTED"');
      }
      if ($cur_hour > 12) $cur_hour = $cur_hour-12;
--- 238,244 ----
      $cur_hour = date('H',time());
      if ($cur_hour >= 12) {
!         $tpl->set_var('pm_selected','selected="selected"');
      } else {
!         $tpl->set_var('am_selected','selected="selected"');
      }
      if ($cur_hour > 12) $cur_hour = $cur_hour-12;
***************
*** 250,254 ****
              $hour_options .= '<option value="12" ';
              if ($cur_hour == 12) {
!                 $hour_options .= 'selected="SELECTED"';
              }
              $hour_options .= '>12</option>';
--- 252,256 ----
              $hour_options .= '<option value="12" ';
              if ($cur_hour == 12) {
!                 $hour_options .= 'selected="selected"';
              }
              $hour_options .= '>12</option>';
***************
*** 256,260 ****
          $hour_options .= '<option value="' . $hval . '" ';
          if ($cur_hour == $z) {
!             $hour_options .= 'selected="SELECTED"';
          }
          $hour_options .= '>' . $z . '</option>';
--- 258,262 ----
          $hour_options .= '<option value="' . $hval . '" ';
          if ($cur_hour == $z) {
!             $hour_options .= 'selected="selected"';
          }
          $hour_options .= '>' . $z . '</option>';
***************
*** 270,274 ****
  
      return $tpl;
! } 
  
  /** 
--- 272,276 ----
  
      return $tpl;
! }
  
  /** 
***************
*** 290,295 ****
  $display .= COM_siteHeader('');
  
  // Set mode back to master if user refreshes screen after their session expires
! if (empty($_USER['uid']) AND $mode == 'personal') {
      $mode = '';
  }
--- 292,304 ----
  $display .= COM_siteHeader('');
  
+ $mode = '';
+ if (isset ($HTTP_POST_VARS['mode'])) {
+     $mode = COM_applyFilter ($HTTP_POST_VARS['mode']);
+ } else if (isset ($HTTP_GET_VARS['mode'])) {
+     $mode = COM_applyFilter ($HTTP_GET_VARS['mode']);
+ }
+ 
  // Set mode back to master if user refreshes screen after their session expires
! if (empty ($_USER['uid']) AND $mode == 'personal') {
      $mode = '';
  }
***************
*** 313,321 ****
  }
  
  // Create new calendar object
  $cal = new Calendar();
  
  if ($view == 'week' AND (empty($month) AND empty($day) AND empty($year))) {
!     list($month, $day, $year) = getPriorSunday(date('m', time()), date("j", time()), date('Y', time()));
  } else {
      // Get current month
--- 322,348 ----
  }
  
+ $view = '';
+ if (isset ($HTTP_POST_VARS['view'])) {
+     $view = COM_applyFilter ($HTTP_POST_VARS['view']);
+ } else if (isset ($HTTP_GET_VARS['view'])) {
+     $view = COM_applyFilter ($HTTP_GET_VARS['view']);
+ }
+ 
+ if (isset ($HTTP_POST_VARS['year']) || isset ($HTTP_POST_VARS['month']) ||
+         isset ($HTTP_POST_VARS['day'])) {
+     $year = COM_applyFilter ($HTTP_POST_VARS['year'], true);
+     $month = COM_applyFilter ($HTTP_POST_VARS['month'], true);
+     $day = COM_applyFilter ($HTTP_POST_VARS['day'], true);
+ } else {
+     $year = COM_applyFilter ($HTTP_GET_VARS['year'], true);
+     $month = COM_applyFilter ($HTTP_GET_VARS['month'], true);
+     $day = COM_applyFilter ($HTTP_GET_VARS['day'], true);
+ }
+ 
  // Create new calendar object
  $cal = new Calendar();
  
  if ($view == 'week' AND (empty($month) AND empty($day) AND empty($year))) {
!     list($month, $day, $year) = getPriorSunday(date('m', time()), date('j', time()), date('Y', time()));
  } else {
      // Get current month
***************
*** 332,336 ****
  
      // Get current day
!     $currentday =  date("j", time());
      if (empty($day)) {
          $day = $currentday;
--- 359,363 ----
  
      // Get current day
!     $currentday =  date('j', time());
      if (empty($day)) {
          $day = $currentday;
***************
*** 644,670 ****
  
  $cal_templates->set_var('lang_january', $LANG30[13]);
! if ($month == 1) $cal_templates->set_var('selected_jan','SELECTED');
  $cal_templates->set_var('lang_february', $LANG30[14]);
! if ($month == 2) $cal_templates->set_var('selected_feb','SELECTED');
  $cal_templates->set_var('lang_march', $LANG30[15]);
! if ($month == 3) $cal_templates->set_var('selected_mar','SELECTED');
  $cal_templates->set_var('lang_april', $LANG30[16]);
! if ($month == 4) $cal_templates->set_var('selected_apr','SELECTED');
  $cal_templates->set_var('lang_may', $LANG30[17]);
! if ($month == 5) $cal_templates->set_var('selected_may','SELECTED');
  $cal_templates->set_var('lang_june', $LANG30[18]);
! if ($month == 6) $cal_templates->set_var('selected_jun','SELECTED');
  $cal_templates->set_var('lang_july', $LANG30[19]);
! if ($month == 7) $cal_templates->set_var('selected_jul','SELECTED');
  $cal_templates->set_var('lang_august', $LANG30[20]);
! if ($month == 8) $cal_templates->set_var('selected_aug','SELECTED');
  $cal_templates->set_var('lang_september', $LANG30[21]);
! if ($month == 9) $cal_templates->set_var('selected_sep','SELECTED');
  $cal_templates->set_var('lang_october', $LANG30[22]);
! if ($month == 10) $cal_templates->set_var('selected_oct','SELECTED');
  $cal_templates->set_var('lang_november', $LANG30[23]);
! if ($month == 11) $cal_templates->set_var('selected_nov','SELECTED');
  $cal_templates->set_var('lang_december', $LANG30[24]);
! if ($month == 12) $cal_templates->set_var('selected_dec','SELECTED');
  
  $cal_templates->set_var('lang_day', $LANG30[39]);
--- 671,697 ----
  
  $cal_templates->set_var('lang_january', $LANG30[13]);
! if ($month == 1) $cal_templates->set_var('selected_jan','selected="selected"');
  $cal_templates->set_var('lang_february', $LANG30[14]);
! if ($month == 2) $cal_templates->set_var('selected_feb','selected="selected"');
  $cal_templates->set_var('lang_march', $LANG30[15]);
! if ($month == 3) $cal_templates->set_var('selected_mar','selected="selected"');
  $cal_templates->set_var('lang_april', $LANG30[16]);
! if ($month == 4) $cal_templates->set_var('selected_apr','selected="selected"');
  $cal_templates->set_var('lang_may', $LANG30[17]);
! if ($month == 5) $cal_templates->set_var('selected_may','selected="selected"');
  $cal_templates->set_var('lang_june', $LANG30[18]);
! if ($month == 6) $cal_templates->set_var('selected_jun','selected="selected"');
  $cal_templates->set_var('lang_july', $LANG30[19]);
! if ($month == 7) $cal_templates->set_var('selected_jul','selected="selected"');
  $cal_templates->set_var('lang_august', $LANG30[20]);
! if ($month == 8) $cal_templates->set_var('selected_aug','selected="selected"');
  $cal_templates->set_var('lang_september', $LANG30[21]);
! if ($month == 9) $cal_templates->set_var('selected_sep','selected="selected"');
  $cal_templates->set_var('lang_october', $LANG30[22]);
! if ($month == 10) $cal_templates->set_var('selected_oct','selected="selected"');
  $cal_templates->set_var('lang_november', $LANG30[23]);
! if ($month == 11) $cal_templates->set_var('selected_nov','selected="selected"');
  $cal_templates->set_var('lang_december', $LANG30[24]);
! if ($month == 12) $cal_templates->set_var('selected_dec','selected="selected"');
  
  $cal_templates->set_var('lang_day', $LANG30[39]);
***************
*** 683,687 ****
      $yroptions .= '<option value="' . $y . '" ';
      if ($y == $year) {
!         $yroptions .= 'SELECTED';
      }
      $yroptions .= '>' . $y . '</option>'.LB;
--- 710,714 ----
      $yroptions .= '<option value="' . $y . '" ';
      if ($y == $year) {
!         $yroptions .= 'selected="selected"';
      }
      $yroptions .= '>' . $y . '</option>'.LB;





More information about the geeklog-cvs mailing list