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

"); need ('boxes news sql'); function convertToHTML ($string) { $table = array_flip (get_html_translation_table (HTML_ENTITIES)); return strtr ($string, $table); } function convertFromHTML ($string) { $table = get_html_translation_table (HTML_ENTITIES); return strtr ($string, $table); } function formatPlanArray ($a) { need ("date"); return formatNews (dateFromSQLDateTime ($a['p_date']), $a['p_user'], stripSlashes($a['p_plan'])); } function planEntrySummary ($it) { need ("date"); return '' .' ' . $it['p_id'] . '' .' ' . dateFromSQLDateTime ($it['p_date']) . '' .' ' . $it['p_user'] . '' .' ' . substr (convertFromHTML (stripSlashes ($it['p_plan'])), 0, 50) . '…' .''; } function planEntryConfirmation ($a) { need ("date"); $id = $a['p_id']; newsBoxOpen (); newsBoxTitle ("Confirmation: Delete #$id?", thisURL . "?planID=$id&confirm=yes"); echo formatPlanArray ($a); newsBoxClose (); } $planID = addSlashes ($_REQUEST['planID']); $confirm = $_REQUEST['confirm']; if ($planID) { if ($confirm) { $query = "DELETE FROM plans WHERE p_id='$planID'"; $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 "

Plan entry $planID didn't exist."; } else { echo "

Plan entry $planID has been deleted."; } } else { $query = 'SELECT p_id, p_date, p_user, p_plan FROM plans' ." WHERE p_id='$planID'"; $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) { planEntryConfirmation ($entries[0]); } else { echo "

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

"; } } } else { newsBoxOpen ("All Plan Postings"); $query = 'SELECT p_id, p_date, p_user, p_plan FROM plans' .' ORDER BY p_date DESC'; $entries = sqlReadQuery ($query); if ($entries && is_array ($entries) && count ($entries)) { tableHeader ("100%"); ?> ID Date User Text No plans available."; } newsBoxClose (); } ?>