Update of /cvsroot/openfirst/news/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv30173/news/admin
Added Files:
delcomment.php
Log Message:
Added news comment system with Forum integration. Works without the forum as well.
--- NEW FILE: delcomment.php ---
<?php
/*
* openFIRST.news - delcomment.php
*
* Copyright (C) 2003,
* openFIRST Project
* Original Author: Greg Inozemtsev <gr...@si...>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
include_once("../../config/globals.php");
include_once($header);
?>
<br>
<table width="618" align="center">
<tr>
<th>Delete Comment</th>
</tr>
<tr>
<td align="center">
<?php
$admin=false;
if (isset($user->membertype)){
$admin=($user->membertype == "administrator");
}
if($admin) {
if(!isset($_POST["CommentID"])) {
$query = ofirst_dbquery("SELECT * FROM ofirst_news_comments WHERE ID='".$_GET["id"]."'");
if (ofirst_dbnum_rows($query) != 0){
echo('<form action="'.$_SERVER["PHP_SELF"].'" method="POST">');
echo('<input name="CommentID" type="hidden" value="'.$_GET["id"].'">');
echo('<div>Delete comment?</div><br>');
echo('<input type="submit" value="Confirm"></form>');
}
else {
echo('<div>This comment does not exist.</div>');
}
} else {
// Delete the news by ID.
ofirst_dbquery("DELETE FROM ofirst_news_comments WHERE ID=".$_POST["CommentID"].";");
echo("The comment has been deleted. [ <a href='../index.php'>Main</a> ]");
}
}
else {
echo("You must be logged on as an administrative user to delete comments.");
}
echo("</td></tr></table>");
include_once($footer);
?>
|