Update of /cvsroot/openfirst/news/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv10001/news/admin
Modified Files:
killnews.php
Log Message:
Improved efficiency
Index: killnews.php
===================================================================
RCS file: /cvsroot/openfirst/news/admin/killnews.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** killnews.php 13 Oct 2003 17:59:50 -0000 1.2
--- killnews.php 23 Oct 2003 00:52:43 -0000 1.3
***************
*** 43,58 ****
}
if($admin) {
if(!isset($_POST["StoryID"])) {
! $query = ofirst_dbquery("SELECT * FROM ofirst_news ORDER BY ID DESC");
$title="";
$found=false;
if (ofirst_dbnum_rows($query) != 0){
! while($news = ofirst_dbfetch_object($query)){
! if($news->ID==$_GET["id"]){
! $found=true;
! $title=$news->title;
! break;
! }
! }
}
?>
--- 43,58 ----
}
if($admin) {
+ $id=0;
+ if(isset($_GET["id"])){
+ $id=$_GET["id"];
+ }
if(!isset($_POST["StoryID"])) {
! $query = ofirst_dbquery("SELECT * FROM ofirst_news WHERE ID='".$id."'");
$title="";
$found=false;
if (ofirst_dbnum_rows($query) != 0){
! $news = ofirst_dbfetch_object($query);
! $found=true;
! $title=$news->title;
}
?>
|