[Openfirst-cvscommit] news/admin index.php,1.2,1.3
Brought to you by:
xtimg
From: <xt...@us...> - 2003-06-28 14:39:39
|
Update of /cvsroot/openfirst/news/admin In directory sc8-pr-cvs1:/tmp/cvs-serv4884/admin Modified Files: index.php Log Message: Convert news module to proper coding standards and add include to MySQL scripts Index: index.php =================================================================== RCS file: /cvsroot/openfirst/news/admin/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.php 21 Jun 2003 13:09:33 -0000 1.2 --- index.php 28 Jun 2003 14:39:36 -0000 1.3 *************** *** 29,43 **** include($header); - membersmenu($user->membertype); - echo("<h1>Add News</h1>"); if($user->membertype == "administrator") { ! if($_POST["news"] == "") { ! // Display a form for news. ?> <form method="post" action="addnews.php"> Message Title: <input name="title" type="text" value="openFIRST News"> ! <br />Message: <br /><textarea name="news" cols="40" rows="20">Insert your news here.</textarea> <br /> --- 29,41 ---- include($header); echo("<h1>Add News</h1>"); if($user->membertype == "administrator") { ! if($_POST["news"] == "") { ! // Display a form for news. ?> <form method="post" action="addnews.php"> Message Title: <input name="title" type="text" value="openFIRST News"> ! <br />Message: <br /><textarea name="news" cols="40" rows="20">Insert your news here.</textarea> <br /> *************** *** 46,67 **** </form> <?php ! } else { ! // Add the news. ! // $_POST["news"], $_POST["title"] ! $now = date("D M j G:i:s T Y"); ! $query = mysql_query("INSERT INTO ! ofirst_news (date, poster, title, ! news) VALUES ('$now', '$user->user', '" . ! $_POST["title"] . "', '" . ! $_POST["news"] . "');"); ! echo("The news item " . $_POST["title"] ! . " has been added."); ! } } else { ! echo("You must be logged on as an ! administrative user to add news."); } ! include($footer); ! ?> --- 44,58 ---- </form> <?php ! } else { ! // Add the news. ! $now = date("D M j G:i:s T Y"); ! $query = mysql_query("INSERT INTO ofirst_news (date, poster, title, news) VALUES ('$now', '$user->user', '" . $_POST["title"] . "', '" . $_POST["news"] . "');"); ! echo("The news item " . $_POST["title"] . " has been added."); ! } } else { ! echo("You must be logged on as an administrative user to add news."); } ! include($footer); ! ?> \ No newline at end of file |