[Openfirst-cvscommit] news/admin index.php,1.16,1.17
Brought to you by:
xtimg
From: Jamie <ast...@us...> - 2006-02-06 01:52:17
|
Update of /cvsroot/openfirst/news/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12329/news/admin Modified Files: index.php Log Message: More porting work (holly ****) Index: index.php =================================================================== RCS file: /cvsroot/openfirst/news/admin/index.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** index.php 6 Jan 2004 17:16:23 -0000 1.16 --- index.php 6 Feb 2006 01:52:07 -0000 1.17 *************** *** 26,38 **** * */ ! include_once("../../config/globals.php"); ! include_once($header); echo("<h1>Add News</h1>"); ! if(isset($user->membertype)){ ! if($user->membertype == "administrator") { ! if(! isset($_POST["news"])) { // Display a form for news. ?> <form name="NewsForm" id="NewsForm" method="post" action="index.php" enctype="multipart/form-data"> --- 26,39 ---- * */ ! include_once("../../includes/globals.php"); ! include_once($ogHeader); echo("<h1>Add News</h1>"); ! $ogUser->mustBeAdmin(); ! ! if(! isset($_POST["news"])) { // Display a form for news. + $upload_dir = dirname(__FILE__)."/../images/upload/"; ?> <form name="NewsForm" id="NewsForm" method="post" action="index.php" enctype="multipart/form-data"> *************** *** 53,61 **** <td width="332"><input type="radio" name="imagesrc" id="imagesrc1" value="1" checked><label for="imagesrc1">Select Image</label> <select name="image" style="width:250px"> ! <option selected>(none)</option> <?php ! if(is_readable(getcwd()."/../images/upload/")) { ! $dir=opendir(getcwd()."/../images/upload/"); ! while (false !== ($filename = readdir($dir))) { if ($filename != "." && $filename != "..") { echo("<option>$filename</option>"); --- 54,61 ---- <td width="332"><input type="radio" name="imagesrc" id="imagesrc1" value="1" checked><label for="imagesrc1">Select Image</label> <select name="image" style="width:250px"> ! <option selected="selected">(none)</option> <?php ! if(is_readable($upload_dir)) { ! foreach(glob($upload_dir.'*') as $filename) { if ($filename != "." && $filename != "..") { echo("<option>$filename</option>"); *************** *** 67,71 **** <br><input type="radio" name="imagesrc" id="imagesrc2" value="2"><label for="imagesrc2">Upload New Image</label> <?php ! if(is_writeable($fbasepath."/news/images/upload/")){ echo('<input type="file" name="imgfile" accept="image/*" style="width: 250px;">'); }else{ --- 67,71 ---- <br><input type="radio" name="imagesrc" id="imagesrc2" value="2"><label for="imagesrc2">Upload New Image</label> <?php ! if(is_writeable($upload_dir)){ echo('<input type="file" name="imgfile" accept="image/*" style="width: 250px;">'); }else{ *************** *** 115,124 **** echo("The news item " . $_POST["title"] . " has been added. [ <a href='../index.php'>Main</a> ]"); - } - } - } else { - echo("You must be logged on as an administrative user to add news."); } ! include_once($footer); ?> --- 115,120 ---- echo("The news item " . $_POST["title"] . " has been added. [ <a href='../index.php'>Main</a> ]"); } ! include_once($ogFooter); ?> |