aboutsummaryrefslogtreecommitdiffstats
path: root/functions/init.inc.php
diff options
context:
space:
mode:
authorjwangen <jwangen>2002-10-04 02:32:28 +0000
committerjwangen <jwangen>2002-10-04 02:32:28 +0000
commit3d3e022345611be7e3bb61dc5478873082b03d2a (patch)
treeb0a28edb4af1627c64b46fa41e13aa9ce8efc180 /functions/init.inc.php
parentd6958637d6263bf539bced5c0d2d73d58b0dc5c0 (diff)
downloadphpicalendar-3d3e022345611be7e3bb61dc5478873082b03d2a.tar.gz
phpicalendar-3d3e022345611be7e3bb61dc5478873082b03d2a.tar.bz2
phpicalendar-3d3e022345611be7e3bb61dc5478873082b03d2a.zip
Modified event and init so HTTP_GET_VARS is explicitly called instead of
assuming vars are globally set. Modified language files so there are no more double quotes.
Diffstat (limited to 'functions/init.inc.php')
-rw-r--r--functions/init.inc.php45
1 files changed, 32 insertions, 13 deletions
diff --git a/functions/init.inc.php b/functions/init.inc.php
index 7525fbc..f70bb64 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -8,6 +8,7 @@ if(phpversion() >= "4.2.0")
}
include('./config.inc.php');
+include('./functions/error.php');
// subscribe link prefix, doesn't need to be user configureable
$fullpath = 'webcal://'.$HTTP_SERVER_VARS['SERVER_NAME'].dirname($HTTP_SERVER_VARS['PHP_SELF']).'/'.$calendar_path.'/';
@@ -26,28 +27,46 @@ if (file_exists($lang_file)) {
include("../languages/english.inc.php");
}
+if (isset($HTTP_GET_VARS['getdate']) && ($HTTP_GET_VARS['getdate'] !== '')) {
+ $getdate = $HTTP_GET_VARS['getdate'];
+} else {
+ $getdate = date('Ymd');
+}
+
// $cal_displayname is $cal_filename with occurrences of "32" replaced with " "
// $cal_filename should always be the filename of the calendar without .ics
+$is_webcal = FALSE;
if (isset($HTTP_GET_VARS["cal"])) {
- $cal_filename = stripslashes(urldecode($HTTP_GET_VARS["cal"]));
+ if (substr($HTTP_GET_VARS["cal"], 0, 7) == "http://") {
+ $is_webcal = TRUE;
+ $cal_filename = $HTTP_GET_VARS["cal"];
+ } else {
+ $cal_filename = stripslashes(urldecode($HTTP_GET_VARS["cal"]));
+ }
} else {
$cal_filename = $default_cal;
}
-$cal_displayname = str_replace("32", " ", $cal_filename);
-$cal = urlencode($cal_filename);
-
-if (!isset($filename)) {
- $filename = $calendar_path."/".$cal_filename.".ics";
- if (!file_exists($filename)) {
- $dir_handle = @opendir($calendar_path) or die("Unable to open $calendar_path");
- while ($file = readdir($dir_handle)) {
- if (substr($file, -4) == ".ics") {
- $filename = $calendar_path."/".$file;
- break;
+
+if ($is_webcal) {
+ $cal_displayname = substr(str_replace("32", " ", basename($cal_filename)), 0, -4);
+ $cal = $cal_filename;
+ $filename = $cal;
+} else {
+ $cal_displayname = str_replace("32", " ", $cal_filename);
+ $cal = urlencode($cal_filename);
+
+ if (!isset($filename)) {
+ $filename = $calendar_path."/".$cal_filename.".ics";
+ if (!file_exists($filename)) {
+ $dir_handle = @opendir($calendar_path) or die("Unable to open $calendar_path");
+ while ($file = readdir($dir_handle)) {
+ if (substr($file, -4) == ".ics") {
+ $filename = $calendar_path."/".$file;
+ break;
+ }
}
}
}
}
-
?> \ No newline at end of file

© 2014-2024 Faster IT GmbH | imprint | privacy policy