diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-11-15 03:51:29 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-11-15 03:51:29 +0000 |
commit | cd501de7c511b7bb0c840fd9a38dfbb95a87ff73 (patch) | |
tree | 62609dce72832f26086923ff7b44b87db0dfefed | |
parent | 98c430276226e8a145946d7c98b52fc90d3e7038 (diff) | |
download | phpicalendar-cd501de7c511b7bb0c840fd9a38dfbb95a87ff73.tar.gz phpicalendar-cd501de7c511b7bb0c840fd9a38dfbb95a87ff73.tar.bz2 phpicalendar-cd501de7c511b7bb0c840fd9a38dfbb95a87ff73.zip |
More prefs work.
-rw-r--r-- | functions/ical_parser.php | 8 | ||||
-rw-r--r-- | preferences.php | 16 |
2 files changed, 17 insertions, 7 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php index bed4d02..4521988 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -691,7 +691,7 @@ if ($parse_file) { // sort the sub (day) arrays so the times are in order foreach (array_keys($master_array) as $k) { if (isset($master_array[$k]) && is_array($master_array[$k])) { - krsort($master_array[$k]); + ksort($master_array[$k]); reset($master_array[$k]); } } @@ -709,12 +709,12 @@ if ($parse_file) { //If you want to see the values in the arrays, uncomment below. -print '<pre>'; -print_r($master_array); +//print '<pre>'; +//print_r($master_array); //print_r($overlap_array); //print_r($day_array); //print_r($rrule); -print '</pre>'; +//print '</pre>'; ?> diff --git a/preferences.php b/preferences.php index 98efede..78c1060 100644 --- a/preferences.php +++ b/preferences.php @@ -6,6 +6,16 @@ include(BASE.'functions/ical_parser.php'); $default_path = 'http://'.$HTTP_SERVER_VARS['SERVER_NAME'].substr($HTTP_SERVER_VARS['PHP_SELF'],0,strpos($HTTP_SERVER_VARS['PHP_SELF'], '/rss/')); $default_view = "$default_view" . ".php"; if ($allow_preferences == 'no') header("Location: $default_view"); +$action = $HTTP_GET_VARS['action']; +if ($action == 'setcookie') { + $cookie_language = $HTTP_POST_VARS['cookie_language']; + $cookie_calendar = $HTTP_POST_VARS['cookie_calendar']; + $cookie_view = $HTTP_POST_VARS['cookie_view']; + $the_cookie = array ("cookie_language" => "$cookie_language", "cookie_calendar" => "$cookie_calendar", "cookie_view" => "$cookie_view"); + echo '<pre>'; print_r($the_cookie); echo '</pre>'; + serialize($the_cookie); + #setcookie("the_cookie","$the_cookie",time()+6604800,"/","localhost",0); +} ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" @@ -57,7 +67,7 @@ if ($allow_preferences == 'no') header("Location: $default_view"); <tr> <td width="2%"></td> <td width="98%" valign="top" align="left"> - <form action="preferences.php?action=setcookie"> + <form action="preferences.php?action=setcookie" METHOD="post"> <?php @@ -72,7 +82,7 @@ if ($allow_preferences == 'no') header("Location: $default_view"); while ($file = readdir($dir_handle)) { if (substr($file, -8) == ".inc.php") { $language_tmp = urlencode(ucfirst(substr($file, 0, -8))); - if ($language_tmp == $tmp_pref_language) { + if ($language_tmp == $cookie_language) { print "<option value=\"$language_tmp\" selected>in $language_tmp</option>\n"; } else { print "<option value=\"$language_tmp\">in $language_tmp</option>\n"; @@ -94,7 +104,7 @@ if ($allow_preferences == 'no') header("Location: $default_view"); $cal_tmp = urlencode($cal_filename_tmp); $cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp); if (!in_array($cal_filename_tmp, $blacklisted_cals)) { - if ($cal_tmp == $cal) { + if ($cal_tmp == $cookie_calendar) { print "<option value=\"$cal_tmp\" selected>$cal_displayname_tmp $calendar_lang</option>\n"; } else { print "<option value=\"$cal_tmp\">$cal_displayname_tmp $calendar_lang</option>\n"; |