Completed
Branch master (c3ca5f)
by Seth
04:51
created
purge.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once(__DIR__ . '/.ignore.calendar-ics-authentication.inc.php');
4
-require_once(__DIR__ . '/config.inc.php');
3
+require_once(__DIR__.'/.ignore.calendar-ics-authentication.inc.php');
4
+require_once(__DIR__.'/config.inc.php');
5 5
 
6
-require_once(APP_PATH . '/include/page-generator.inc.php');
7
-require_once(APP_PATH . '/include/canvas-api.inc.php');
8
-require_once(APP_PATH . '/include/mysql.inc.php');
6
+require_once(APP_PATH.'/include/page-generator.inc.php');
7
+require_once(APP_PATH.'/include/canvas-api.inc.php');
8
+require_once(APP_PATH.'/include/mysql.inc.php');
9 9
 
10 10
 $eventsApi = new CanvasApiProcess(CANVAS_API_URL, CANVAS_API_TOKEN);
11 11
 $api = new CanvasApiProcess(CANVAS_API_URL, CANVAS_API_TOKEN);
@@ -20,14 +20,14 @@  discard block
 block discarded – undo
20 20
 	)
21 21
 );
22 22
 do {
23
-	foreach($events as $event) {
23
+	foreach ($events as $event) {
24 24
 		$api->delete("calendar_events/{$event['id']}",
25 25
 			array(
26
-				'cancel_reason' => TOOL_NAME . " course_url={$_REQUEST['course_url']}"
26
+				'cancel_reason' => TOOL_NAME." course_url={$_REQUEST['course_url']}"
27 27
 			)
28 28
 		);
29 29
 	}
30
-} while($events = $eventsApi->nextPage());
30
+} while ($events = $eventsApi->nextPage());
31 31
 
32 32
 echo('Calendar purged.');
33 33
 
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once(__DIR__ . '/config.inc.php');
3
+require_once(__DIR__.'/config.inc.php');
4 4
 
5
-require_once(APP_PATH . '/include/page-generator.inc.php');
5
+require_once(APP_PATH.'/include/page-generator.inc.php');
6 6
 
7 7
 // TODO: might be nice to have an option to remove a previously synced ICS feed
8 8
 
Please login to merge, or discard this patch.
export.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once(__DIR__ . '/.ignore.calendar-ics-authentication.inc.php');
4
-require_once(__DIR__ . '/config.inc.php');
3
+require_once(__DIR__.'/.ignore.calendar-ics-authentication.inc.php');
4
+require_once(__DIR__.'/config.inc.php');
5 5
 
6
-require_once(APP_PATH . '/include/page-generator.inc.php');
7
-require_once(APP_PATH . '/include/canvas-api.inc.php');
6
+require_once(APP_PATH.'/include/page-generator.inc.php');
7
+require_once(APP_PATH.'/include/canvas-api.inc.php');
8 8
 
9 9
 
10 10
 if (isset($_REQUEST['course_url'])) {
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 		displayPage('
16 16
 		<h3>Course Calendar ICS Feed</h3>
17 17
 		<p>You can subscribe to the calendar for <a href="https://' .
18
-		parse_url(CANVAS_API_URL, PHP_URL_HOST) . '/courses/' . $courseId .
19
-		'">' . $course['name'] . '</a> at <a href="' .
20
-		$webcalFeed . '">' . $webcalFeed .
18
+		parse_url(CANVAS_API_URL, PHP_URL_HOST).'/courses/'.$courseId.
19
+		'">'.$course['name'].'</a> at <a href="'.
20
+		$webcalFeed.'">'.$webcalFeed.
21 21
 		'</a> in any calendar application that supports external ICS feeds.</p>'
22 22
 		);
23 23
 		exit;
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	}
28 28
 } else {
29 29
 	displayPage('
30
-	<form method="post" action="' . $_SERVER['PHP_SELF'] . '">
30
+	<form method="post" action="' . $_SERVER['PHP_SELF'].'">
31 31
 		<label for="course_url">Course URL <span class="comment">The URL to the course whose calendar you would like to export as an ICS feed</span></label>
32 32
 		<input id="course_url" name="course_url" type="text" />
33 33
 		<input type="submit" value="Generate ICS Feed" />
Please login to merge, or discard this patch.
config.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* this will break if there are mod_rewrites, but will do for now... */
4
-define('APP_URL', 'http://' . $_SERVER['SERVER_NAME'] . str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', realpath(__DIR__)));
4
+define('APP_URL', 'http://'.$_SERVER['SERVER_NAME'].str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', realpath(__DIR__)));
5 5
 define('APP_PATH', realpath(__DIR__));
6 6
 
7 7
 /* customize generated pages */
Please login to merge, or discard this patch.
css/lightbox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once(__DIR__ . '/../config.inc.php');
3
+require_once(__DIR__.'/../config.inc.php');
4 4
 
5 5
 header('Content-type: text/css');
6 6
 header('X-Content-Type-Options: nosniff'); // because IE is not trusting
Please login to merge, or discard this patch.
css/script-ui.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once(__DIR__ . '/../config.inc.php');
3
+require_once(__DIR__.'/../config.inc.php');
4 4
 
5 5
 header('Content-type: text/css');
6 6
 header('X-Content-Type-Options: nosniff'); // because IE is not trusting
Please login to merge, or discard this patch.
phpicalendar/print.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 	'getdate'			=> $getdate,
65 65
 	'calendar_name'		=> $cal_displayname,
66 66
 	'current_view'		=> $current_view,
67
-    'printview'         => $printview,
67
+	'printview'         => $printview,
68 68
 	'display_date'		=> $display_date,
69 69
 	'sidebar_date'		=> @$sidebar_date,
70 70
 	'rss_powered'	 	=> $rss_powered,
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,42 +1,42 @@
 block discarded – undo
1 1
 <?php
2 2
 if (!defined('BASE')) define('BASE', './');
3
-$current_view 		='print';
3
+$current_view = 'print';
4 4
 require_once(BASE.'functions/date_functions.php');
5 5
 require_once(BASE.'functions/init.inc.php');
6
-$start_week_time 	= strtotime(dateOfWeek($getdate, $phpiCal_config->week_start_day));
7
-$end_week_time 		= $start_week_time + (6 * 25 * 60 * 60);
8
-$parse_month 		= date ("Ym", strtotime($getdate));
6
+$start_week_time = strtotime(dateOfWeek($getdate, $phpiCal_config->week_start_day));
7
+$end_week_time = $start_week_time + (6*25*60*60);
8
+$parse_month 		= date("Ym", strtotime($getdate));
9 9
 $events_week 		= 0;
10
-$unix_time 			= strtotime($getdate);
10
+$unix_time = strtotime($getdate);
11 11
 $printview = $phpiCal_config->default_view;
12 12
 if (isset($_GET['printview']))	$printview = $_GET['printview'];
13 13
 
14 14
 if ($printview == 'day') {
15
-	$display_date 	= localizeDate ($dateFormat_day, strtotime($getdate));
15
+	$display_date = localizeDate($dateFormat_day, strtotime($getdate));
16 16
 	$next 			= date("Ymd", strtotime("+1 day", $unix_time));
17 17
 	$prev 			= date("Ymd", strtotime("-1 day", $unix_time));
18 18
 	$week_start		= '';
19
-	$week_end		= '';
19
+	$week_end = '';
20 20
 } elseif ($printview == 'week') {
21 21
 	$start_week 	= localizeDate($dateFormat_week, $start_week_time);
22 22
 	$end_week 		= localizeDate($dateFormat_week, $end_week_time);
23
-	$display_date 	= "$start_week - $end_week";
23
+	$display_date = "$start_week - $end_week";
24 24
 	$week_start 	= date("Ymd", $start_week_time);
25 25
 	$week_end 		= date("Ymd", $end_week_time);
26 26
 	$next 			= date("Ymd", strtotime("+1 week", $unix_time));
27 27
 	$prev 			= date("Ymd", strtotime("-1 week", $unix_time));
28 28
 } elseif ($printview == 'month') {
29
-	$display_date 	= localizeDate ($dateFormat_month, strtotime($getdate));
29
+	$display_date = localizeDate($dateFormat_month, strtotime($getdate));
30 30
 	$next 			= date("Ymd", strtotime("+1 month", $unix_time));
31 31
 	$prev 			= date("Ymd", strtotime("-1 month", $unix_time));
32
-	$week_start		= '';
33
-	$week_end		= '';
32
+	$week_start = '';
33
+	$week_end = '';
34 34
 } elseif ($printview == 'year') {
35
-	$display_date 	= localizeDate ($dateFormat_year, strtotime($getdate));
35
+	$display_date = localizeDate($dateFormat_year, strtotime($getdate));
36 36
 	$next 			= date("Ymd", strtotime("+1 year", $unix_time));
37 37
 	$prev 			= date("Ymd", strtotime("-1 year", $unix_time));
38
-	$week_start		= '';
39
-	$week_end		= '';
38
+	$week_start = '';
39
+	$week_end = '';
40 40
 }
41 41
 require_once(BASE.'functions/ical_parser.php');
42 42
 require_once(BASE.'functions/list_functions.php');
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('BASE')) define('BASE', './');
2
+if (!defined('BASE')) {
3
+	define('BASE', './');
4
+}
3 5
 $current_view 		='print';
4 6
 require_once(BASE.'functions/date_functions.php');
5 7
 require_once(BASE.'functions/init.inc.php');
@@ -9,7 +11,9 @@  discard block
 block discarded – undo
9 11
 $events_week 		= 0;
10 12
 $unix_time 			= strtotime($getdate);
11 13
 $printview = $phpiCal_config->default_view;
12
-if (isset($_GET['printview']))	$printview = $_GET['printview'];
14
+if (isset($_GET['printview'])) {
15
+	$printview = $_GET['printview'];
16
+}
13 17
 
14 18
 if ($printview == 'day') {
15 19
 	$display_date 	= localizeDate ($dateFormat_day, strtotime($getdate));
Please login to merge, or discard this patch.
phpicalendar/rss/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 /* Rewritten by J. Hu 4/2/06*/
4 4
 $current_view = 'rss_index';
5
-define('BASE','../');
5
+define('BASE', '../');
6 6
 require_once(BASE.'functions/init.inc.php');
7 7
 require_once(BASE.'functions/calendar_functions.php');
8 8
 
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
 }
12 12
 
13 13
 if (empty($default_path)) {
14
-	if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) {
15
-		$default_path = 'https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/'));
14
+	if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
15
+		$default_path = 'https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], '/rss/'));
16 16
 	} else {
17
-		$default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/'));
17
+		$default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], '/rss/'));
18 18
 	}
19 19
 }
20 20
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 $display_date = "RSS Info";
23 23
 
24 24
 $rss_list = "<table width='90%'>\n";
25
-$xml_icon ="<img src = 'feed.png' alt='rss icon'>";
25
+$xml_icon = "<img src = 'feed.png' alt='rss icon'>";
26 26
 $cals[] = '';
27 27
 $cal_displaynames[] = $all_cal_comb_lang;
28 28
 foreach ($cals as $k=>$file) {
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	// $cal is a urlencoded version of $cal_filename
31 31
 	// $cal_displayname is $cal_filename with occurrences of "32" replaced with " "
32 32
 	
33
-	$rss_list .= '<tr><td rowspan ="3"><font class="V12" color="blue"><b>'.$cal_displaynames[$k].' '. $lang['l_calendar'].'</b></font></td>';
33
+	$rss_list .= '<tr><td rowspan ="3"><font class="V12" color="blue"><b>'.$cal_displaynames[$k].' '.$lang['l_calendar'].'</b></font></td>';
34 34
 
35 35
 /* Changed to show links without urlencode, but links valid urls */
36 36
 	$rss_list .= "<td>".$lang['l_day']."</td>";
Please login to merge, or discard this patch.
phpicalendar/rss/rss_common.php 2 patches
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 //set the range of days to return based on the view chosen
35 35
 $rssview = $phpiCal_config->default_view;
36 36
 if (isset($_GET['rssview'])) $rssview = $_GET['rssview'];
37
-if (isset($_GET['getdate']) && $_GET['getdate'] !=''){
37
+if (isset($_GET['getdate']) && $_GET['getdate'] != '') {
38 38
 	$getdate = $_GET['getdate'];
39
-}else{
39
+} else {
40 40
 	$getdate = date("Ymd");
41 41
 }
42 42
 # for all views, $fromdate is the first day to be shown and $todate should be the last day.
43
-switch ($rssview){
43
+switch ($rssview) {
44 44
 	case 'day':
45 45
 		$fromdate = $getdate;
46 46
 		$todate = date("Ymd", strtotime($getdate) + 60*60*24);
@@ -49,52 +49,52 @@  discard block
 block discarded – undo
49 49
 	case 'today':
50 50
 		$fromdate = date("Ymd");
51 51
 		$todate = date("Ymd", strtotime('tomorrow'));
52
-		$theview = $lang['l_todays'] ;
52
+		$theview = $lang['l_todays'];
53 53
 		break;
54 54
 	case 'tomorrow':
55
-		$fromdate = date("Ymd",strtotime('tomorrow'));
55
+		$fromdate = date("Ymd", strtotime('tomorrow'));
56 56
 		$todate = date("Ymd", strtotime('tomorrow') + 60*60*24);
57
-		$theview = $lang['l_tomorrows'] ;
57
+		$theview = $lang['l_tomorrows'];
58 58
 		break;
59 59
 	case 'week':
60 60
 		$fromdate = dateOfWeek($getdate, 'Sunday');
61 61
 		$todate = date("Ymd", strtotime($fromdate) + 6*24*60*60);
62
-		$theview = $lang['l_week']." of ".date('n/d/Y',strtotime($fromdate));
62
+		$theview = $lang['l_week']." of ".date('n/d/Y', strtotime($fromdate));
63 63
 		break;
64 64
 	case 'month':
65
-		$parse_month = date ("Ym", strtotime($getdate));
66
-		$fromdate = ($parse_month *100) + 1;
67
-		$todate = ($parse_month *100) + date("t",strtotime($getdate));
68
-		$theview = date('M Y',strtotime($fromdate));
65
+		$parse_month = date("Ym", strtotime($getdate));
66
+		$fromdate = ($parse_month*100) + 1;
67
+		$todate = ($parse_month*100) + date("t", strtotime($getdate));
68
+		$theview = date('M Y', strtotime($fromdate));
69 69
 		break;
70 70
 	case 'year':
71
-		if(isset($_GET['year'])){
71
+		if (isset($_GET['year'])) {
72 72
 			$theyear = $_GET['year'];
73
-		}else{
74
-			$theyear = substr($getdate,0,4);
73
+		} else {
74
+			$theyear = substr($getdate, 0, 4);
75 75
 		}
76
-		$fromdate = ($theyear*10000)+101;	
77
-		$todate = date("Ymd", strtotime($theyear*10000+1231));
76
+		$fromdate = ($theyear*10000) + 101;	
77
+		$todate = date("Ymd", strtotime($theyear*10000 + 1231));
78 78
 		$theview = $theyear;
79 79
 		break;
80 80
 	case 'daysfrom':
81 81
 		$fromdate = $getdate;
82 82
 		$todate = date("Ymd", strtotime($getdate) + $_GET['days']*60*60*24);
83
-		$theview = $_GET['days']." days from ".date('n/d/Y',strtotime($fromdate));
83
+		$theview = $_GET['days']." days from ".date('n/d/Y', strtotime($fromdate));
84 84
 		break;
85 85
 	case 'daysto':
86 86
 		$todate = $getdate;
87 87
 		$fromdate = date("Ymd", strtotime($getdate) - $_GET['days']*60*60*24);
88
-		$theview = $_GET['days']." days before ".date('n/d/Y',strtotime($todate));
88
+		$theview = $_GET['days']." days before ".date('n/d/Y', strtotime($todate));
89 89
 		break;
90 90
 	case 'range':
91
-		if(isset($_GET['from'])){
91
+		if (isset($_GET['from'])) {
92 92
 		$fromdate = $_GET['from'];
93
-		}else{
93
+		} else {
94 94
 			$fromdate = $getdate;
95 95
 		}
96 96
 		$todate = $_GET['to'];
97
-		$theview = date('n/d/Y',strtotime($fromdate)).'-'.date('n/d/Y',strtotime($todate));
97
+		$theview = date('n/d/Y', strtotime($fromdate)).'-'.date('n/d/Y', strtotime($todate));
98 98
 		break;
99 99
 	default:
100 100
 		#default to week
@@ -117,96 +117,96 @@  discard block
 block discarded – undo
117 117
 $events_count = 0;
118 118
 
119 119
 // calculate a value for Last Modified and ETag
120
-$cal = implode(",",$cals);
120
+$cal = implode(",", $cals);
121 121
 
122 122
 //get filemtime from master array
123 123
 $filemod = 0; #default to start of unix era, overwrite with most recent mtime from master array
124
-foreach ($master_array['-4'] as $calinfo){
124
+foreach ($master_array['-4'] as $calinfo) {
125 125
 	if ($calinfo['mtime'] > $filemod) $filemod = $calinfo['mtime']; 
126 126
 }	
127 127
 $filemodtime = date("r", $filemod);
128 128
 
129 129
 //send relevant headers
130
-header ("Last-Modified: $filemodtime");
131
-header ("ETag:\"$filemodtime\"");
130
+header("Last-Modified: $filemodtime");
131
+header("ETag:\"$filemodtime\"");
132 132
 
133 133
 // checks the user agents headers to see if they kept track of our
134 134
 // stuff, if so be nice and send back a 304 and exit.
135 135
 
136
-if ( (@$_SERVER['HTTP_IF_MODIFIED_SINCE'] == $filemodtime) || (@$_SERVER['HTTP_IF_NONE_MATCH'] == $filemodtime)){
137
-	header ("HTTP/1.1 304 Not Modified");
136
+if ((@$_SERVER['HTTP_IF_MODIFIED_SINCE'] == $filemodtime) || (@$_SERVER['HTTP_IF_NONE_MATCH'] == $filemodtime)) {
137
+	header("HTTP/1.1 304 Not Modified");
138 138
 	exit;
139 139
 }
140 140
 
141 141
 /* Change languages to ISO 639-1 to validate RSS without changing long version in config.inc.php */
142
-$user_language = array ("english", "polish", "german", "french", "dutch", "italian", "japanese", "norwegian", "spanish",  "swedish", "portuguese", "catalan", "traditional_chinese", "esperanto", "korean");
143
-$iso_language = array ("en", "pl", "de", "fr", "nl", "da", "it", "ja", "no", "es", "sv", "pt", "ca", "zh-tw", "eo", "ko");
142
+$user_language = array("english", "polish", "german", "french", "dutch", "italian", "japanese", "norwegian", "spanish", "swedish", "portuguese", "catalan", "traditional_chinese", "esperanto", "korean");
143
+$iso_language = array("en", "pl", "de", "fr", "nl", "da", "it", "ja", "no", "es", "sv", "pt", "ca", "zh-tw", "eo", "ko");
144 144
 $rss_language = str_replace($user_language, $iso_language, $language);
145 145
 /* End language modification */
146 146
 
147
-$rss = 	rss_top();
147
+$rss = rss_top();
148 148
 
149 149
 //generate the items
150
-$numdays = round((strtotime($todate) - strtotime($fromdate))/(60*60*24))+1;
151
-$thisdate = $fromdate; 	#	start at beginning of date range, 
150
+$numdays = round((strtotime($todate) - strtotime($fromdate))/(60*60*24)) + 1;
151
+$thisdate = $fromdate; #	start at beginning of date range, 
152 152
 						# 	note that usage of $thisdate is different from distribution
153 153
 						# 	I use it as a date, dist uses it as a time
154 154
 $thistime = strtotime($thisdate);						
155
-$i = 1;  #day counter
155
+$i = 1; #day counter
156 156
 
157 157
 $rss_list = '';
158 158
 $rss_items = '';
159 159
 $uid_arr = array();
160 160
 do {
161
-	$thisdate=date('Ymd', $thistime);
161
+	$thisdate = date('Ymd', $thistime);
162 162
 	#	echo "Date: $thisdate\ti:$i\tnumdays:$numdays<br>\n";
163
-	$dayofweek = localizeDate ("%a %b %e %Y", strtotime($thisdate));
163
+	$dayofweek = localizeDate("%a %b %e %Y", strtotime($thisdate));
164 164
 	if (isset($master_array[($thisdate)]) && sizeof($master_array[($thisdate)]) > 0) {
165 165
 		foreach ($master_array[("$thisdate")] as $event_times) {
166 166
 			foreach ($event_times as $uid=>$val) {
167 167
 				#handle multiday all day events
168
-				if(!isset($val["event_start"])){
169
-					if (isset($uid_arr[$uid])){
170
-						$uid_arr[$uid] .= "+$dayofweek" ;
168
+				if (!isset($val["event_start"])) {
169
+					if (isset($uid_arr[$uid])) {
170
+						$uid_arr[$uid] .= "+$dayofweek";
171 171
 						continue;
172
-					}else{
173
-						$uid_arr[$uid] = "$dayofweek" ;
172
+					} else {
173
+						$uid_arr[$uid] = "$dayofweek";
174 174
 					}
175 175
 					$event_start = $lang['l_all_day'];
176
-				}else{	
176
+				} else {	
177 177
 					$event_start 	= @$val["event_start"];	
178
-					$event_start 	= date ($timeFormat, @strtotime ("$event_start"));
178
+					$event_start 	= date($timeFormat, @strtotime("$event_start"));
179 179
 				}	
180 180
 				$event_text 	= stripslashes(urldecode($val["event_text"]));
181 181
 				$event_text 	= strip_tags($event_text, '<b><i><u>');
182
-				$event_text		= str_replace('&','&amp;',$event_text);
183
-				$event_text		= str_replace('&amp;amp;','&amp;',$event_text);
182
+				$event_text		= str_replace('&', '&amp;', $event_text);
183
+				$event_text		= str_replace('&amp;amp;', '&amp;', $event_text);
184 184
 			#	$event_text		= urlencode($event_text);
185 185
 			#uncomment for shorter event text with ...
186 186
 			#	$event_text 	= word_wrap($event_text, 21, $tomorrows_events_lines); 		
187 187
 				$description 	= stripslashes(urldecode($val["description"]));
188 188
 			#	$description		= str_replace('<br />',"\n",$description);
189 189
 				$description 	= strip_tags($description, '<b><i><u><br>');
190
-				$description		= str_replace('&','&amp;',$description);
191
-				$description		= str_replace('&amp;amp;','&amp;',$description);
192
-				$rss_title		= urldecode ("$dayofweek: $event_text");	
193
-				$urlcal 		= rawurlencode ("$cal");
194
-				if (isset($rss_link_to_event) && $rss_link_to_event == 'yes'){
190
+				$description		= str_replace('&', '&amp;', $description);
191
+				$description		= str_replace('&amp;amp;', '&amp;', $description);
192
+				$rss_title = urldecode("$dayofweek: $event_text");	
193
+				$urlcal = rawurlencode("$cal");
194
+				if (isset($rss_link_to_event) && $rss_link_to_event == 'yes') {
195 195
 					$event_data = urlencode(serialize($val));
196 196
 					$rss_link		= $phpiCal_config->default_path."/includes/event.php?getdate=$thisdate&amp;cal=$cal&amp;event_data=$event_data";
197
-				}else{
198
-					$rss_link		=  ($phpiCal_config->default_path."/day.php?getdate=$thisdate&amp;cal=$urlcal");
197
+				} else {
198
+					$rss_link		= ($phpiCal_config->default_path."/day.php?getdate=$thisdate&amp;cal=$urlcal");
199 199
 	
200 200
 				}
201
-				if (isset($cpath) && $cpath !='') $rss_link.="&amp;cpath=$cpath";
202
-				$rss_description	= htmlspecialchars ("$dayofweek $event_start: $description");
203
-				$rss_list .= rss_li($rss_link,$uid);
201
+				if (isset($cpath) && $cpath != '') $rss_link .= "&amp;cpath=$cpath";
202
+				$rss_description = htmlspecialchars("$dayofweek $event_start: $description");
203
+				$rss_list .= rss_li($rss_link, $uid);
204 204
 				$rss_items .= rss_item();
205 205
 				$events_count++;
206 206
 			}
207 207
 		}
208 208
 	}
209
-	$thistime = $thistime+(60*60*24); # echo "$thisdate: ".strtotime($thisdate)."->$thistime<br>\n";
209
+	$thistime = $thistime + (60*60*24); # echo "$thisdate: ".strtotime($thisdate)."->$thistime<br>\n";
210 210
 	$i++;	
211 211
 } while ($i <= $numdays);
212 212
 if (($events_count < 1) && ($i == $numdays)) $rss_items = rss_noitems();
@@ -214,18 +214,18 @@  discard block
 block discarded – undo
214 214
 $rss_list = enclose_items($rss_list);
215 215
 $rss .= $rss_list.$rss_items.rss_close();
216 216
 
217
-foreach ($uid_arr as $uid=>$date_range){
217
+foreach ($uid_arr as $uid=>$date_range) {
218 218
 	#echo "date_range:$date_range<br>";
219 219
 
220
-	if(strpos($date_range,"+")>0){
220
+	if (strpos($date_range, "+") > 0) {
221 221
 		#echo "+ in date_range<br>";
222
-		$temp = explode("+",$date_range);
222
+		$temp = explode("+", $date_range);
223 223
 		$date_range = $temp[0].'-'.array_pop($temp);
224 224
 	}
225
-	$rss = str_replace("<uid>$uid</uid>\n<event_start>".$lang['l_all_day']."</event_start>","<uid>$uid</uid>\n<event_start>$date_range</event_start>", $rss);
225
+	$rss = str_replace("<uid>$uid</uid>\n<event_start>".$lang['l_all_day']."</event_start>", "<uid>$uid</uid>\n<event_start>$date_range</event_start>", $rss);
226 226
 
227 227
 }
228
-header ("Content-Type: application/xml");
228
+header("Content-Type: application/xml");
229 229
 
230 230
 echo "$rss";
231 231
 
Please login to merge, or discard this patch.
Braces   +19 added lines, -11 removed lines patch added patch discarded remove patch
@@ -33,10 +33,12 @@  discard block
 block discarded – undo
33 33
 
34 34
 //set the range of days to return based on the view chosen
35 35
 $rssview = $phpiCal_config->default_view;
36
-if (isset($_GET['rssview'])) $rssview = $_GET['rssview'];
36
+if (isset($_GET['rssview'])) {
37
+	$rssview = $_GET['rssview'];
38
+}
37 39
 if (isset($_GET['getdate']) && $_GET['getdate'] !=''){
38 40
 	$getdate = $_GET['getdate'];
39
-}else{
41
+} else{
40 42
 	$getdate = date("Ymd");
41 43
 }
42 44
 # for all views, $fromdate is the first day to be shown and $todate should be the last day.
@@ -70,7 +72,7 @@  discard block
 block discarded – undo
70 72
 	case 'year':
71 73
 		if(isset($_GET['year'])){
72 74
 			$theyear = $_GET['year'];
73
-		}else{
75
+		} else{
74 76
 			$theyear = substr($getdate,0,4);
75 77
 		}
76 78
 		$fromdate = ($theyear*10000)+101;	
@@ -90,7 +92,7 @@  discard block
 block discarded – undo
90 92
 	case 'range':
91 93
 		if(isset($_GET['from'])){
92 94
 		$fromdate = $_GET['from'];
93
-		}else{
95
+		} else{
94 96
 			$fromdate = $getdate;
95 97
 		}
96 98
 		$todate = $_GET['to'];
@@ -122,8 +124,10 @@  discard block
 block discarded – undo
122 124
 //get filemtime from master array
123 125
 $filemod = 0; #default to start of unix era, overwrite with most recent mtime from master array
124 126
 foreach ($master_array['-4'] as $calinfo){
125
-	if ($calinfo['mtime'] > $filemod) $filemod = $calinfo['mtime']; 
126
-}	
127
+	if ($calinfo['mtime'] > $filemod) {
128
+		$filemod = $calinfo['mtime'];
129
+	}
130
+	}	
127 131
 $filemodtime = date("r", $filemod);
128 132
 
129 133
 //send relevant headers
@@ -169,11 +173,11 @@  discard block
 block discarded – undo
169 173
 					if (isset($uid_arr[$uid])){
170 174
 						$uid_arr[$uid] .= "+$dayofweek" ;
171 175
 						continue;
172
-					}else{
176
+					} else{
173 177
 						$uid_arr[$uid] = "$dayofweek" ;
174 178
 					}
175 179
 					$event_start = $lang['l_all_day'];
176
-				}else{	
180
+				} else{	
177 181
 					$event_start 	= @$val["event_start"];	
178 182
 					$event_start 	= date ($timeFormat, @strtotime ("$event_start"));
179 183
 				}	
@@ -194,11 +198,13 @@  discard block
 block discarded – undo
194 198
 				if (isset($rss_link_to_event) && $rss_link_to_event == 'yes'){
195 199
 					$event_data = urlencode(serialize($val));
196 200
 					$rss_link		= $phpiCal_config->default_path."/includes/event.php?getdate=$thisdate&amp;cal=$cal&amp;event_data=$event_data";
197
-				}else{
201
+				} else{
198 202
 					$rss_link		=  ($phpiCal_config->default_path."/day.php?getdate=$thisdate&amp;cal=$urlcal");
199 203
 	
200 204
 				}
201
-				if (isset($cpath) && $cpath !='') $rss_link.="&amp;cpath=$cpath";
205
+				if (isset($cpath) && $cpath !='') {
206
+					$rss_link.="&amp;cpath=$cpath";
207
+				}
202 208
 				$rss_description	= htmlspecialchars ("$dayofweek $event_start: $description");
203 209
 				$rss_list .= rss_li($rss_link,$uid);
204 210
 				$rss_items .= rss_item();
@@ -209,7 +215,9 @@  discard block
 block discarded – undo
209 215
 	$thistime = $thistime+(60*60*24); # echo "$thisdate: ".strtotime($thisdate)."->$thistime<br>\n";
210 216
 	$i++;	
211 217
 } while ($i <= $numdays);
212
-if (($events_count < 1) && ($i == $numdays)) $rss_items = rss_noitems();
218
+if (($events_count < 1) && ($i == $numdays)) {
219
+	$rss_items = rss_noitems();
220
+}
213 221
 
214 222
 $rss_list = enclose_items($rss_list);
215 223
 $rss .= $rss_list.$rss_items.rss_close();
Please login to merge, or discard this patch.