Update of /cvsroot/openfirst/news
In directory sc8-pr-cvs1:/tmp/cvs-serv30323
Modified Files:
index.php viewnews.php
Added Files:
rssfeed.php
Log Message:
Made some minor changes, added RSS feature.
--- NEW FILE: rssfeed.php ---
<?php
/*
* openFIRST.news - index.php
*
* Copyright (C) 2003,
* openFIRST Project
* Original Author: David Di Biase <dav...@ea...>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
include("../config/globals.php");
include($header);
?>
<h2>RSS Feed Option</h2>
<p>Stay up-to-date with the latest information released directly from our teams<br>
very own news system using RSS technology. If you are unsure of how to use<br>
RSS technology then please visit this link to learn more.</p>
<?php
if(isset($_POST['get'])){
if(isset($_POST['all'])){
$numhead = "all";
}else{
$numhead = $_POST['headlines'];
}
$link = $home.$basepath."/news/rss/rss.php?headlines=".$numhead."&rss=".$_POST['version'];
?>
<table width="500" align="center" cellpadding="0">
<tr>
<th>Your RSS Customized Link</th>
</tr>
<tr>
<td><?php echo $link; ?></td>
</tr>
<tr>
<td><div align="center">[ <a href="<?php echo $link; ?>">View RSS Data</a> ]</div></td>
</tr>
</table>
<?php } ?>
<form method="POST" action="rssfeed.php">
<table width="39%" align="center">
<tr>
<th width="43%"> </th>
<th width="57%">RSS Custom Link</th>
</tr>
<tr>
<td><div align="right"># of headlines to show::</div></td>
<td><input name="headlines" type="text" id="headlines" size="5" maxlength="5">
or
<input name="all" type="checkbox" id="all2" value="all">
All</td>
</tr>
<tr>
<td><div align="right">RSS Version:</div></td>
<td><select name="version" id="version">
<option>0.91</option>
<option selected>1.0</option>
<option>2.0</option>
</select></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><input name="get" type="submit" id="get" value="Get RSS Link"></td>
</tr>
</table>
</form>
<p><br>
<br>
</p>
<?php
include($footer);
?>
Index: index.php
===================================================================
RCS file: /cvsroot/openfirst/news/index.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** index.php 28 Sep 2003 14:32:29 -0000 1.6
--- index.php 28 Sep 2003 15:30:57 -0000 1.7
***************
*** 32,37 ****
Here are the top 5 most important news outbreaks.<br><br>
<?php
! shownews(5); // Shows 5 pieces of news.
!
include($footer);
! ?>
\ No newline at end of file
--- 32,43 ----
Here are the top 5 most important news outbreaks.<br><br>
<?php
! if(isset($_GET['show'])){
! shownews(99999);
! }else{
! shownews(5); // Shows 5 pieces of news.
! }
! ?>
! [ <a href="index.php?show=all">Show All News</a> ]
! <?php
include($footer);
! ?>
Index: viewnews.php
===================================================================
RCS file: /cvsroot/openfirst/news/viewnews.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** viewnews.php 13 Sep 2003 15:38:25 -0000 1.5
--- viewnews.php 28 Sep 2003 15:30:57 -0000 1.6
***************
*** 36,43 ****
while($news = ofirst_dbfetch_object($query)){
! echo("<br><table>
! <tr><th> </th><th><strong>$news->title</strong></th></tr>
! <tr><th> </th><th>Posted on $news->date by $news->poster</th></tr>
! <tr><th><img src='$news->image' alt='$news->title'></th><td>$news->news</td></tr>
</table><br>");
}
--- 36,49 ----
while($news = ofirst_dbfetch_object($query)){
! echo("<br><table width='500'>
! <tr>
! <th><strong>$news->title</strong></th>
! </tr>
! <tr>
! <td>Posted on $news->date by $news->poster</td>
! </tr>
! <tr>
! <td><img src='$news->image' alt='$news->title'>$news->news</td>
! </tr>
</table><br>");
}
***************
*** 48,50 ****
return(0);
}
! ?>
--- 54,56 ----
return(0);
}
! ?>
\ No newline at end of file
|