diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-10-26 05:57:12 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-10-26 05:57:12 +0000 |
commit | 9dadc34095f5a9d83762d3c79d5ef2d7e91a1f14 (patch) | |
tree | 870fa2a28d5bd8c811f04c3fc1b83a1f49f47546 /rss | |
parent | 12b0916165ab7046d0588cf0597bc36d05c8f6eb (diff) | |
download | phpicalendar-9dadc34095f5a9d83762d3c79d5ef2d7e91a1f14.tar.gz phpicalendar-9dadc34095f5a9d83762d3c79d5ef2d7e91a1f14.tar.bz2 phpicalendar-9dadc34095f5a9d83762d3c79d5ef2d7e91a1f14.zip |
Tweeks, now shows all calendars.
Diffstat (limited to 'rss')
-rw-r--r-- | rss/index.php | 37 | ||||
-rw-r--r-- | rss/rss.php | 2 |
2 files changed, 27 insertions, 12 deletions
diff --git a/rss/index.php b/rss/index.php index e0f96a4..54f9fb2 100644 --- a/rss/index.php +++ b/rss/index.php @@ -23,7 +23,7 @@ include(BASE.'functions/ical_parser.php'); <td align="center" valign="middle"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="G10B"> <tr> - <td align="left" valign="top" width="1%" class="sideback"><img src="images/spacer.gif" width="1" height="20"></td> + <td align="left" valign="top" width="1%" class="sideback"><img src="../images/spacer.gif" width="1" height="20"></td> <td align="center" valign="center" width="98%" class="sideback"><b><?php echo 'RSS information'; ?></b></td> <td class="sideback" width="1%"></td> </tr> @@ -39,16 +39,31 @@ include(BASE.'functions/ical_parser.php'); <br> This website is RSS enabled.<br> <br> - <b>Day View:</b><br> - <?php echo $default_path.'/rss.php?cal='.$cal.'&rssview=day'; ?><br> - <br> - <b>Week View:</b><br> - <?php echo $default_path.'/rss.php?cal='.$cal.'&rssview=week'; ?><br> - <br> - <b>Month View:</b><br> - <?php echo $default_path.'/rss.php?cal='.$cal.'&rssview=month'; ?><br> - <br> - <br> + <?php + + // open file + $dir_handle = @opendir($calendar_path) or die(error(sprintf($error_path_lang, $calendar_path), $cal_filename)); + + // build the <option> tags + while ($file = readdir($dir_handle)) { + 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_tmp = substr($file,0,-4); + $cal_tmp = urlencode($cal_filename_tmp); + $cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp); + if (!in_array($cal_filename_tmp, $blacklisted_cals)) { + echo '<font class="V12" color="blue"><b>'.$cal_displayname_tmp.' '. $calendar_lang.'</b></font><br>'; + echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=day<br>'; + echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=week<br>'; + echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=month<br>'; + echo '<br><br>'; + } + } + } + ?> </td> </tr> </table> diff --git a/rss/rss.php b/rss/rss.php index d5d1014..573ea0b 100644 --- a/rss/rss.php +++ b/rss/rss.php @@ -3,7 +3,7 @@ define('BASE', '../'); include(BASE.'functions/ical_parser.php'); $theview = 'Day'; - + $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"; |