Update of /cvsroot/openfirst/news/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv3397/news/admin
Modified Files:
index.php
Log Message:
Added new admin modules - edit and delete news. Modified scripts to include the DHTML editor (RSS compatible now)
Index: index.php
===================================================================
RCS file: /cvsroot/openfirst/news/admin/index.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** index.php 28 Sep 2003 16:17:27 -0000 1.9
--- index.php 1 Oct 2003 22:52:09 -0000 1.10
***************
*** 31,39 ****
echo("<h1>Add News</h1>");
! if($user->membertype == "administrator") {
! if(! isset($_POST["news"])) {
! // Display a form for news.
?>
! <form method="post" action="index.php">
<p><br />
<br />
--- 31,40 ----
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">
<p><br />
<br />
***************
*** 57,66 ****
<div align="right">Descriptions</div></td>
<td>
! <textarea name="news" cols="60" rows="20">Insert your news here.</textarea>
</td>
</tr>
<tr>
<td> </td>
! <td><input name="news2" type="submit" id="news" value="Add News Item" />
<input name="reset" type="reset" value="Clear News Item" /> </td>
</tr>
--- 58,83 ----
<div align="right">Descriptions</div></td>
<td>
! <?php
! $dhtml=function_exists("make_wysiwyg");
! if($dhtml){
! make_wysiwyg("news", 500, 300, "Insert your news here.");
! }
! else{
! echo('<textarea name="news" cols="60" rows="20">Insert your news here.</textarea>');
! }
! ?>
</td>
</tr>
<tr>
<td> </td>
! <td>
! <?php
! if($dhtml){
! echo('<input name="news2" type="button" id="news" value="Add News Item" onclick="dhtmlEditorPrepareSubmit(); document.NewsForm.submit();" />');
! }
! else {
! echo('<input name="news2" type="submit" id="news" value="Add News Item" />');
! }
! ?>
<input name="reset" type="reset" value="Clear News Item" /> </td>
</tr>
***************
*** 77,80 ****
--- 94,98 ----
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.");
|