aboutsummaryrefslogtreecommitdiffstats
path: root/rss
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2002-10-26 07:45:01 +0000
committerChad Little <clittle@users.sourceforge.net>2002-10-26 07:45:01 +0000
commitd9d6aad18a7813e9795e6a7f391fc573b45427c1 (patch)
tree539f41df82e760256ee3fba7c99b39e6181ffbc5 /rss
parent19677e0b213fecc136b8e8a7a6e0f905b18b6af9 (diff)
downloadphpicalendar-d9d6aad18a7813e9795e6a7f391fc573b45427c1.tar.gz
phpicalendar-d9d6aad18a7813e9795e6a7f391fc573b45427c1.tar.bz2
phpicalendar-d9d6aad18a7813e9795e6a7f391fc573b45427c1.zip
More tweeks.
Diffstat (limited to 'rss')
-rw-r--r--rss/index.php2
-rw-r--r--rss/rss.php88
2 files changed, 73 insertions, 17 deletions
diff --git a/rss/index.php b/rss/index.php
index 54f9fb2..74a4df4 100644
--- a/rss/index.php
+++ b/rss/index.php
@@ -37,7 +37,7 @@ include(BASE.'functions/ical_parser.php');
<td width="2%"></td>
<td width="98%" valign="top">
<br>
- This website is RSS enabled.<br>
+ This website is <a class="psf" href="http://www.oreillynet.com/rss/">RSS 0.91</a> enabled.<br>
<br>
<?php
diff --git a/rss/rss.php b/rss/rss.php
index 573ea0b..a90d289 100644
--- a/rss/rss.php
+++ b/rss/rss.php
@@ -2,8 +2,22 @@
define('BASE', '../');
include(BASE.'functions/ical_parser.php');
-$theview = 'Day';
-
+
+$start_week_time = strtotime(dateOfWeek($getdate, $week_start_day));
+$end_week_time = $start_week_time + (6 * 25 * 60 * 60);
+$start_week = localizeDate($dateFormat_week, $start_week_time);
+$end_week = localizeDate($dateFormat_week, $end_week_time);
+$rssview = $HTTP_GET_VARS['rssview'];
+
+
+if ($rssview == "day") {
+ $theview = $day_lang;
+} elseif ($rssview == "week") {
+ $theview = $week_lang;
+} elseif ($rssview == "month") {
+ $theview = $month_lang;
+}
+
$rss = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"."\n";
$rss .= '<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">'."\n";
@@ -15,23 +29,65 @@ $rss .= '<description>'.$cal.' '.$calendar_lang.' - '.$theview.'</description>'.
$rss .= '<language>us-en</language>'."\n";
$rss .= '<copyright>Copyright 2002, '.$default_path.'</copyright>'."\n";
-if (isset($master_array[($getdate)]) && sizeof($master_array[($getdate)]) > 0) {
- foreach ($master_array[("$getdate")] as $event_times) {
- foreach ($event_times as $val) {
- $event_start = @$val["event_start"];
- $event_start = date ($timeFormat, @strtotime ("$event_start"));
- $event_text = stripslashes(urldecode($val["event_text"]));
- $event_text = strip_tags($event_text, '<b><i><u>');
- $event_text = word_wrap($event_text, 21, $tomorrows_events_lines);
- $description = stripslashes(urldecode($val["description"]));
- $description = strip_tags($description, '<b><i><u>');
+
+if ($rssview == 'day') {
+ if (isset($master_array[($getdate)]) && sizeof($master_array[($getdate)]) > 0) {
+ foreach ($master_array[("$getdate")] as $event_times) {
+ foreach ($event_times as $val) {
+ $event_start = @$val["event_start"];
+ $event_start = date ($timeFormat, @strtotime ("$event_start"));
+ $event_text = stripslashes(urldecode($val["event_text"]));
+ $event_text = strip_tags($event_text, '<b><i><u>');
+ $event_text = word_wrap($event_text, 21, $tomorrows_events_lines);
+ $description = stripslashes(urldecode($val["description"]));
+ $description = strip_tags($description, '<b><i><u>');
+ $rss .= '<item>'."\n";
+ $rss .= '<title>'.$event_start.' '.$event_text.'</title>'."\n";
+ $rss .= '<link>'.$default_path.'/day.php?getdate='.$getdate.'&cal='.$cal.'</link>'."\n";
+ $rss .= '<description>'.$description.'</description>'."\n";
+ $rss .= '</item>'."\n";
+ }
+ }
+ } else {
+ $rss .= '<item>'."\n";
+ $rss .= '<title>No events today.</title>'."\n";
+ $rss .= '</item>'."\n";
+ }
+}
+
+$thisdate = $start_week_time;
+$events_week = 0;
+$i = 0;
+if ($rssview == "week") {
+ do {
+ $getdate = date("Ymd", $thisdate);
+ if (isset($master_array[($getdate)]) && sizeof($master_array[($getdate)]) > 0) {
+ foreach ($master_array[("$getdate")] as $event_times) {
+ foreach ($event_times as $val) {
+ $event_start = @$val["event_start"];
+ $event_start = date ($timeFormat, @strtotime ("$event_start"));
+ $event_text = stripslashes(urldecode($val["event_text"]));
+ $event_text = strip_tags($event_text, '<b><i><u>');
+ $event_text = word_wrap($event_text, 21, $tomorrows_events_lines);
+ $description = stripslashes(urldecode($val["description"]));
+ $description = strip_tags($description, '<b><i><u>');
+ $rss .= '<item>'."\n";
+ $rss .= '<title>'.$event_start.' '.$event_text.'</title>'."\n";
+ $rss .= '<link>'.$default_path.'/day.php?getdate='.$getdate.'&cal='.$cal.'</link>'."\n";
+ $rss .= '<description>'.$description.'</description>'."\n";
+ $rss .= '</item>'."\n";
+ $events_week++;
+ }
+ }
+ }
+ if ($events_week < 1) {
$rss .= '<item>'."\n";
- $rss .= '<title>'.$event_start.' '.$event_text.'</title>'."\n";
- $rss .= '<link>'.$default_path.'/day.php?getdate='.$getdate.'&cal='.$cal.'</link>'."\n";
- $rss .= '<description>'.$description.'</description>'."\n";
+ $rss .= '<title>No events this week.</title>'."\n";
$rss .= '</item>'."\n";
}
- }
+ $thisdate = ($thisdate + (25 * 60 * 60));
+ $i++;
+ } while ($i < 7);
}

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