news.php: add previously nonexistent check for nonexistent or formerly existing news entries... and UID 0
news.php: add previously nonexistent check for nonexistent or formerly existing news entries... and UID 0

file:a/news.php -> file:b/news.php
--- a/news.php
+++ b/news.php
@@ -34,6 +34,20 @@
 if(!isset($nid) || !isNumber($nid)) $nid = false;
 $cid = isset($_REQUEST['cid']) && isNumber($_REQUEST['cid']) ? $_REQUEST['cid'] : false;
 
+if ($nid < 1) {
+	$current = "newserror";
+	// load our template files to set up the page.
+	if (file_exists("$skindir/default.tpl")) $tpl = new TemplatePower("$skindir/default.tpl");
+	else $tpl = new TemplatePower("default_tpls/default.tpl");
+	$title = "News entry was not found";
+	$text  = "News entry with ID " . $nid . " is not in database";
+	include("includes/pagesetup.php");
+	$tpl->assign("output", "<div id='pagetitle'>" . $title . "</div>" . write_error($text));
+	$tpl->printToScreen();
+	dbclose();
+	exit();
+}
+
 if($nid) {
 
 	$output .= "<div id=\"pagetitle\">"._NEWS."</div>";
@@ -58,6 +72,19 @@
 	if(file_exists("./$skindir/newsbox.tpl"))
 		$news = new TemplatePower( "./$skindir/newsbox.tpl" );
 	else $news = new TemplatePower( "./default_tpls/newsbox.tpl" );
+	if(empty($stories)) {
+		$current = "newserror";
+		// load our template files to set up the page.
+		if (file_exists("$skindir/default.tpl")) $tpl = new TemplatePower("$skindir/default.tpl");
+		else $tpl = new TemplatePower("default_tpls/default.tpl");
+		$title = "News entry was not found";
+		$text  = "News entry with ID " . $nid . " is not in database";
+		include("includes/pagesetup.php");
+		$tpl->assign("output", "<div id='pagetitle'>" . $title . "</div>" . write_error($text));
+		$tpl->printToScreen();
+		dbclose();
+		exit();
+	}
 	$news->prepare( );	
 	//create a new number_row block
 	$news->newBlock("newsbox");