aboutsummaryrefslogtreecommitdiffstats
path: root/rss/index.php
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2004-02-09 00:51:48 +0000
committerChad Little <clittle@users.sourceforge.net>2004-02-09 00:51:48 +0000
commitcb7f301d3a39acebecd56fa8d831e275bc8980f0 (patch)
tree59928251987369663bd4de215a63d4bcc23e9809 /rss/index.php
parentaba3742b77e18aa1001a70a8a87f4a10ccf0531f (diff)
downloadphpicalendar-cb7f301d3a39acebecd56fa8d831e275bc8980f0.tar.gz
phpicalendar-cb7f301d3a39acebecd56fa8d831e275bc8980f0.tar.bz2
phpicalendar-cb7f301d3a39acebecd56fa8d831e275bc8980f0.zip
Initial wiring of rss index and template.
Diffstat (limited to 'rss/index.php')
-rw-r--r--rss/index.php137
1 files changed, 50 insertions, 87 deletions
diff --git a/rss/index.php b/rss/index.php
index 3163702..fca8327 100644
--- a/rss/index.php
+++ b/rss/index.php
@@ -1,93 +1,56 @@
<?php
define('BASE','../');
-include(BASE.'functions/ical_parser.php');
-include_once(BASE.'functions/calendar_functions.php');
+require_once(BASE.'functions/ical_parser.php');
+require_once(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'] != '') {
- $back_page = $HTTP_SERVER_VARS['HTTP_REFERER'];
-} else {
- $back_page = BASE.$default_view.'.php?cal='.$cal.'&amp;getdate='.$getdate;
-}
+
$current_view = "rssindex";
$display_date = "$calendar_lang - RSS Info";
-include (BASE.'includes/header.inc.php'); ?>
-<center>
-<table border="0" width="700" cellspacing="0" cellpadding="0">
- <tr>
- <td width="520" valign="top" align="center">
- <table width="640" border="0" cellspacing="0" cellpadding="0" class="calborder">
- <tr>
- <td align="center" valign="middle">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td align="left" width="120" class="navback"><?php echo '<a href="'.$back_page.'"><img src="'.BASE.'styles/'.$style_sheet.'/back.gif" alt=" " border="0" align="left"></a>'; ?></td>
- <td class="navback">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td align="center" class="navback" nowrap valign="middle"><font class="H20"><?php echo 'RSS Information'; ?></font></td>
- </tr>
- </table>
- </td>
- <td align="right" width="120" class="navback">
- <table width="120" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><?php echo '<a class="psf" href="'.BASE.'day.php?cal='.$cal.'&amp;getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/day_on.gif" alt=" " border="0"></td>'; ?>
- <td><?php echo '<a class="psf" href="'.BASE.'week.php?cal='.$cal.'&amp;getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/week_on.gif" alt=" " border="0"></td>'; ?>
- <td><?php echo '<a class="psf" href="'.BASE.'month.php?cal='.$cal.'&amp;getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/month_on.gif" alt=" " border="0"></td>'; ?>
- <td><?php echo '<a class="psf" href="'.BASE.'year.php?cal='.$cal.'&amp;getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/year_on.gif" alt=" " border="0"></td>'; ?>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td class="dayborder"><img src="../images/spacer.gif" width="1" height="5" alt=" "></td>
- </tr>
- <?php if ($enable_rss == "yes") { ?>
- <tr>
- <td>
- <table width="100%" border="0" cellspacing="0" cellpadding="0" class="G10B">
- <tr>
- <td width="2%"></td>
- <td width="98%" valign="top" align="left">
- <br>
- <?php echo "$this_site_is_lang "; ?><a class="psf" href="http://www.oreillynet.com/rss/">RSS 0.91 enabled</a>.<br>
- <br>
- <?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>';
- }
- ?>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <?php } else { ?>
- <tr>
- <td align="center" class="navback" nowrap valign="middle"><font class="H20">RSS is not enabled on this site.</font></td>
- </tr>
- <?php } ?>
- </table>
- </td>
- </tr>
-</table>
-</center>
-<?php include (BASE.'includes/footer.inc.php'); ?>
+
+$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);
+ $rss_list = '<font class="V12" color="blue"><b>'.$cal_displayname_tmp.' '. $calendar_lang.'</b></font><br>';
+ $rss_list .= $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=day<br>';
+ $rss_list .= $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=week<br>';
+ $rss_list .= $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=month<br>';
+ $footer_check = $default_path.'/rss/rss.php?cal='.$default_cal.'&rssview='.$default_view;
+}
+
+
+$page = new Page(BASE.'templates/'.$template.'/rss_index.tpl');
+
+$page->replace_tags(array(
+ 'header' => BASE.'templates/'.$template.'/header.tpl',
+ 'footer' => BASE.'templates/'.$template.'/footer.tpl',
+ 'sidebar' => BASE.'templates/'.$template.'/sidebar.tpl',
+ 'event_js' => BASE.'functions/event.js',
+ 'default_path' => $default_path,
+ 'template' => $template,
+ 'cal' => $cal,
+ 'getdate' => $getdate,
+ 'calendar_name' => $calendar_name,
+ 'display_date' => $display_date,
+ 'current_view' => $current_view,
+ 'sidebar_date' => $sidebar_date,
+ 'rss_powered' => $rss_powered,
+ 'rss_list' => $rss_list,
+ 'rss_available' => '',
+ 'rssdisable' => '',
+ 'rss_valid' => '',
+ 'todo_js' => '',
+ 'show_search' => ''
+ ));
+
+$page->output();
+
+
+?>
+ \ No newline at end of file

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