[Openfirst-cvscommit] news openfirst.info.xml,NONE,1.1 index.php,1.11,1.12 viewnews.php,1.15,1.16 op
Brought to you by:
xtimg
From: Jamie <ast...@us...> - 2006-02-06 01:43:08
|
Update of /cvsroot/openfirst/news In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9077/news Modified Files: index.php viewnews.php Added Files: openfirst.info.xml Removed Files: openfirst.info.php Log Message: Started port to oF2 Index: viewnews.php =================================================================== RCS file: /cvsroot/openfirst/news/viewnews.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** viewnews.php 14 Mar 2005 00:53:58 -0000 1.15 --- viewnews.php 6 Feb 2006 01:42:54 -0000 1.16 *************** *** 30,45 **** // Get a list of the users able to // be contacted via the feedback form. ! global $basepath; ! $query = ofirst_dbquery("SELECT * FROM ofirst_news ORDER BY ID DESC LIMIT $limit;"); ! if (ofirst_dbnum_rows($query) != 0){ ! while($news = ofirst_dbfetch_object($query)){ ! echo("<br><table width='500'> ! <tr><th><strong>$news->title</strong></th></tr>"); if($news->image!=""){ ! echo("<tr><td><center><img src='$news->image' alt='$news->title'></center></td></tr>"); } ! echo("<tr><td class='sub'>Posted on $news->date by $news->poster</td></tr><tr><td>"); if(function_exists("emoticon_translate")){ echo(emoticon_translate($news->news)); --- 30,45 ---- // Get a list of the users able to // be contacted via the feedback form. ! global $BasePath, $ogDB; ! $query = $ogDB->select('news', '*', '', array('order' => 'ID', 'limit' => $limit)); ! if ($ogDB->numberOfRows($query) != 0){ ! while($news = $ogDB->fetchObject($query)){ ! echo("<br /><table width='500'> ! <tr><th><strong>{$news->title}</strong></th></tr>"); if($news->image!=""){ ! echo("<tr><td><center><img src='{$news->image}' alt='{$news->title}'></center></td></tr>"); } ! echo("<tr><td class='sub'>Posted on {$news->date} by {$news->poster}</td></tr><tr><td>"); if(function_exists("emoticon_translate")){ echo(emoticon_translate($news->news)); *************** *** 47,63 **** echo($news->news); } ! echo("<br><br><center>[ <a href='$basepath/news/comments.php?ID=$news->ID'>View Comments</a> ]</center></td></tr>"); ! if($admin){ ! echo('<tr><td class="sub"><div style="" align="right">Admin options: <a href="'.$basepath.'/news/admin/editnews.php?id='.$news->ID.'"><img alt="Edit story" border=0 src="'.$basepath.'/news/images/newdoc.gif" align=absmiddle>Edit story</a>'); ! echo('<a href="'.$basepath.'/news/admin/killnews.php?id='.$news->ID.'"><img alt="Delete story" border=0 src="'.$basepath.'/news/images/killdoc.gif" align=absmiddle>Delete story</a></div></td></tr>'); } ! echo("</table><br>"); } } else { ! echo("There is not yet any news.<br><br>"); } if($admin){ ! echo("<div align=center>[ <b><a href=\"$basepath/news/admin\">Post News</a></b> ]</div>"); } return(0); --- 47,63 ---- echo($news->news); } ! echo("<br /><br /><center>[ <a href='{$BasePath}/news/comments.php?ID={$news->ID}'>View Comments</a> ]</center></td></tr>"); ! if ($admin) { ! echo('<tr><td class="sub"><div style="" align="right">Admin options: <a href="'.$BasePath.'/news/admin/editnews.php?id='.$news->ID.'"><img alt="Edit story" border=0 src="'.$BasePath.'/news/images/newdoc.gif" align=absmiddle>Edit story</a>'); ! echo('<a href="'.$BasePath.'admin/killnews.php?id='.$news->ID.'"><img alt="Delete story" border=0 src="'.$BasePath.'/news/images/killdoc.gif" align=absmiddle>Delete story</a></div></td></tr>'); } ! echo("</table><br />"); } } else { ! echo("There is not yet any news.<br /><br />"); } if($admin){ ! echo("<div align=center>[ <b><a href=\"$BasePath/news/admin\">Post News</a></b> ]</div>"); } return(0); --- NEW FILE: openfirst.info.xml --- <?xml version="1.0"?> <module xmlns="http://openfirst.org/xml/module/1.0" id="openfirst.news"> <!-- Info --> <!-- This is not used, except as meta data --> <name>News</name> <version>CVS</version> <author>Tim Ginn</author> <maintainer>Jamie Bliss</maintainer> <includes> <include>$fModPath/viewnews.php</include> </includes> <!-- Configuration --> <!-- Either entities or CDATA can be used. Just make sure it's parsed into the literal XHTML. --> <!-- Note the two ways of including BasePath. --> <navbar><![CDATA[ <a href="$ModPath/">Current News</a> | <a href="$ModPath/rssfeed.php">Stream our News</a> ]]></navbar> <adminbar><![CDATA[ <a href="$ModPath/admin/">Add News</a> ]]></adminbar> <!-- Database setup --> <db> <table name="news"> <fields> <!-- Should be self explainatory --> <field name="ID" null="no" autoincrement="yes"><type length="6" unsigned="yes">int</type></field> <field name="post_date"><type>date</type></field> <field name="poster"><type>text</type></field> <field name="title"><type>tinytext</type></field> <field name="news"><type>text</type></field> <field name="image"><type>text</type></field> </fields> <keys> <key type="PRIMARY"> <col>ID</col> </key> </keys> </table> <!-- Need to change this to an ID-based system. --> <table name="news_comments"> <fields> <field name="ID" null="no" autoincrement="yes"><type unsigned="yes" length="6">int</type></field> <field name="Author"><type>text</type></field> <field name="EMail"><type>tinytext</type></field> <field name="Website"><type>tinytext</type></field> <field name="Comment"><type>tinytext</type></field> <field name="comment_date"><type>date</type></field> <field name="StoryID" null="no"><type length="6" unsigned="yes">int</type></field> </fields> <keys> <key type="PRIMARY"> <col>ID</col> </key> <key name="StoryID"> <col>StoryID</col> </key> </keys> </table> </db> </module> --- openfirst.info.php DELETED --- Index: index.php =================================================================== RCS file: /cvsroot/openfirst/news/index.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** index.php 24 Dec 2003 00:46:37 -0000 1.11 --- index.php 6 Feb 2006 01:42:54 -0000 1.12 *************** *** 3,7 **** * openFIRST.news - index.php * ! * Copyright (C) 2003, * openFIRST Project * Original Author: Tim Ginn <tim...@sy...> --- 3,7 ---- * openFIRST.news - index.php * ! * Copyright (C) 2005, * openFIRST Project * Original Author: Tim Ginn <tim...@sy...> *************** *** 26,31 **** * */ ! include_once("../config/globals.php"); ! include_once($header); ?> <h2>Top Headlines</h2> --- 26,31 ---- * */ ! include_once("../includes/globals.php"); ! include_once($ogHeader); ?> <h2>Top Headlines</h2> *************** *** 33,42 **** <?php $admin=false; ! if (isset($user->membertype)){ $admin=($user->membertype == "administrator"); } ! if(isset($_GET['show'])){ ! shownews(99999,$admin); ! }else{ shownews(5,$admin); // Shows 5 pieces of news. } --- 33,42 ---- <?php $admin=false; ! if (isset($user->membertype)) { $admin=($user->membertype == "administrator"); } ! if (isset($_GET['show'])) { ! shownews(99999,$admin); ! } else { shownews(5,$admin); // Shows 5 pieces of news. } *************** *** 44,47 **** [ <a href="index.php?show=all">Show All News</a> ] <?php ! include_once($footer); ?> --- 44,47 ---- [ <a href="index.php?show=all">Show All News</a> ] <?php ! include_once($ogFooter); ?> |