You don't have access to this page (yet?). Bug an admin to delete a news post.

"); function newsEntrySummary ($it) { need ('date html'); return '' .' ' . $it['n_id'] . '' .' ' . dateFromSQLDateTime ($it['n_date']) . '' .' ' . $it['n_user'] . '' .' ' . substr (convertFromHTML (stripSlashes ($it['n_news'])), 0, 50) . '…' .''; } function newsEntryConfirmation ($a) { need ('boxes date html news'); $id = $a['n_id']; newsBoxOpen (); newsBoxTitle ("Confirmation: Delete #$id?", thisURL . "?newsID=$id&confirm=yes"); printNewsArray ($a); newsBoxClose (); } need ('boxes sql'); $newsID = addSlashes ($_REQUEST['newsID']); $confirm = $_REQUEST['confirm']; if ($newsID) { if ($confirm) { $query = "DELETE FROM news_main WHERE n_id='$newsID'"; $rows = sqlWriteQuery ($query); if ($rows === null) { echo "

Bad mojo, man. I couldn't talk to the SQL server. It said '$sqlError'.

"; } elseif ($rows === false) { echo "

Something bad happened, and MySQL said '$sqlError'. Bug an admin.

"; } elseif (!$rows) { echo "

News entry $newsID didn't exist."; } else { echo "

News entry $newsID has been deleted."; } } else { $query = 'SELECT n_id, n_date, n_user, n_news FROM news_main' ." WHERE n_id='$newsID'"; $entries = sqlReadQuery ($query); if ($entries === null) { echo "

Bad mojo, man. I couldn't talk to the SQL server. It said '$sqlError'.

"; } elseif ($entries === false) { echo "

Something bad happened, and MySQL said '$sqlError'. Bug an admin.

"; } elseif (count ($entries) == 1) { newsEntryConfirmation ($entries[0]); } else { echo "

This shouldn't even be possible, but there's more than one news entry with ID '$newsID'!

"; } } } else { newsBoxOpen ("All News Postings"); $query = 'SELECT n_id, n_date, n_user, n_news FROM news_main' .' ORDER BY n_date DESC'; $entries = sqlReadQuery ($query); if ($entries && is_array ($entries) && count ($entries)) { tableHeader ("100%"); ?> ID Date User Text No news available."; } newsBoxClose (); } ?>