[Openfirst-cvscommit] news viewnews.php,1.7,1.8
Brought to you by:
xtimg
From: <i-...@us...> - 2003-10-01 22:51:07
|
Update of /cvsroot/openfirst/news In directory sc8-pr-cvs1:/tmp/cvs-serv3235/news Modified Files: viewnews.php Log Message: Fixed a bug with $basepath value being unavailable to the function and broken navigation as a result. Added navigation for new admin modules - edit and delete. Added new parameter to shownews specifying whether or not to display new admin options. This is controlled by news/index.php. Index: viewnews.php =================================================================== RCS file: /cvsroot/openfirst/news/viewnews.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** viewnews.php 28 Sep 2003 16:19:24 -0000 1.7 --- viewnews.php 1 Oct 2003 22:51:03 -0000 1.8 *************** *** 27,32 **** */ ! function shownews($limit = 5) { ! // Get a list of the users able to // be contacted via the feedback form. --- 27,31 ---- */ ! function shownews($limit = 5,$admin=false) { // Get a list of the users able to // be contacted via the feedback form. *************** *** 38,45 **** echo("<br><table width='500'> <tr><th><strong>$news->title</strong></th></tr> ! <tr><td><center><img src='$news->image' alt='$news->title'></center></td></tr> ! <tr><td class='sub'>Posted on $news->date by $news->poster</td></tr> ! <tr><td>$news->news<br><br><center>[ <a href='$basepath/news/comments.php?ID=$news->ID'>View Comments</a> ]</center></td></tr> ! </table><br>"); } --- 37,48 ---- echo("<br><table width='500'> <tr><th><strong>$news->title</strong></th></tr> ! <tr><td><center><img src='$news->image' alt='$news->title'></center></td></tr> ! <tr><td class='sub'>Posted on $news->date by $news->poster</td></tr> ! <tr><td>$news->news<br><br><center>[ <a href='".$GLOBALS["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="'.$GLOBALS["basepath"].'/news/admin/editnews.php?id='.$news->ID.'"><img alt="Edit story" border=0 src="'.$GLOBALS["basepath"].'/news/images/newdoc.gif" align=absmiddle>Edit story</a>'); ! echo('<a href="'.$GLOBALS["basepath"].'/news/admin/killnews.php?id='.$news->ID.'"><img alt="Delete story" border=0 src="'.$GLOBALS["basepath"].'/news/images/killdoc.gif" align=absmiddle>Delete story</a></div></td></tr>'); ! } ! echo("</table><br>"); } *************** *** 49,51 **** return(0); } ! ?> \ No newline at end of file --- 52,54 ---- return(0); } ! ?> |