diff options
author | jwangen <jwangen> | 2002-10-02 02:35:33 +0000 |
---|---|---|
committer | jwangen <jwangen> | 2002-10-02 02:35:33 +0000 |
commit | c4c389ff735a71c66c902aa115a3ee9240293ac3 (patch) | |
tree | 5e43be53ae29fecfc5ac68de2180fcec5b55188a /functions/list_icals.php | |
parent | 1c834d42efd75524233e1f6517e3a1cb06f6dfde (diff) | |
download | phpicalendar-c4c389ff735a71c66c902aa115a3ee9240293ac3.tar.gz phpicalendar-c4c389ff735a71c66c902aa115a3ee9240293ac3.tar.bz2 phpicalendar-c4c389ff735a71c66c902aa115a3ee9240293ac3.zip |
Modified init and day to use $HTTP_GET_VARS instead of $_GET to fix a bug with phpicalendar not working with older versions of PHP properly.
Diffstat (limited to 'functions/list_icals.php')
-rw-r--r-- | functions/list_icals.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/functions/list_icals.php b/functions/list_icals.php index 91e0404..a4025c5 100644 --- a/functions/list_icals.php +++ b/functions/list_icals.php @@ -7,25 +7,24 @@ if (isset($getdate)) { $query=""; } print "<form>\n<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value+'$query');\">\n"; -#print "<option value=\"null\">Select a Calendar</option>\n"; // open file $dir_handle = @opendir($calendar_path) or die("Unable to open $calendar_path"); // build the <option> tags while ($file = readdir($dir_handle)) { - if (strstr ($file, ".ics")) { + if (substr($file, -4) == ".ics") { // $cal_filename is the filename of the calendar without .ics // $cal is a urlencoded version of $cal_filename // $cal_displayname is $cal_filename with occurrences of "32" replaced with " " - $cal_filename = substr($file,0,-4); - $cal_tmp = urlencode($cal_filename); - $cal_displayname = str_replace("32", " ", $cal_filename); + $cal_filename_tmp = substr($file,0,-4); + $cal_tmp = urlencode($cal_filename_tmp); + $cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp); if ($cal_tmp == $cal) { - print "<option value=\"$current_view.php?cal=$cal_tmp\" selected>$cal_displayname Calendar</option>\n"; + print "<option value=\"$current_view.php?cal=$cal_tmp\" selected>$cal_displayname_tmp Calendar</option>\n"; } else { - print "<option value=\"$current_view.php?cal=$cal_tmp\">$cal_displayname Calendar</option>\n"; + print "<option value=\"$current_view.php?cal=$cal_tmp\">$cal_displayname_tmp Calendar</option>\n"; } } |