Update of /cvsroot/phpicalendar/phpicalendar/rss
In directory sc8-pr-cvs1:/tmp/cvs-serv505/rss
Modified Files:
index.php
Log Message:
Added username/password login to access locked calendars. Moved
calendar availability logic (with support for login) to a
calendar_functions.php file.
RSS feeds support the login feature when determining which calendars
to return.
Styles updated for the login box.
Index: index.php
===================================================================
RCS file: /cvsroot/phpicalendar/phpicalendar/rss/index.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** index.php 21 Sep 2003 04:28:35 -0000 1.20
--- index.php 22 Nov 2003 21:16:11 -0000 1.21
***************
*** 3,6 ****
--- 3,7 ----
define('BASE','../');
include(BASE.'functions/ical_parser.php');
+ include(BASE.'functions/calendar_functions.php');
$default_path = 'http://'.$HTTP_SERVER_VARS['SERVER_NAME'].substr($HTTP_SERVER_VARS['PHP_SELF'],0,strpos($HTTP_SERVER_VARS['PHP_SELF'], '/rss/'));
if (isset($HTTP_SERVER_VARS['HTTP_REFERER']) && $HTTP_SERVER_VARS['HTTP_REFERER'] != '') {
***************
*** 58,83 ****
<?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 (preg_match("/^[^.].+\.ics$/", $file)) {
!
! // $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>';
! $footer_check = $default_path.'/rss/rss.php?cal='.$default_cal.'&rssview='.$default_view;
! echo '<br><br>';
! }
! }
}
?>
--- 59,77 ----
<?php
// build the <option> tags
! $filelist = availableCalendarNames($username, $password, $ALL_CALENDARS_COMBINED);
! foreach ($filelist as $file) {
! // $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);
! 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>';
! $footer_check = $default_path.'/rss/rss.php?cal='.$default_cal.'&rssview='.$default_view;
! echo '<br><br>';
}
?>
|