// Preamble $pageName = "Post a new Plan Entry"; $need = 'auth'; require "parts/preamble.php"; // Load most of document need ("boxes news sql"); // set up local vars $mode = $_REQUEST['mode']; $planSubj = $_REQUEST['planSubj']; $planText = $_REQUEST['planText']; $user = $userInfo['u_displayname']; if ($planText && $planSubj && $mode == "Post") { $planText = addSlashes ($planText); $query = 'INSERT INTO plans (p_date, p_user, p_subject, p_plan) VALUES (' ."NOW(), '$user', '$planSubj', '$planText')"; $rows = sqlWriteQuery ($query); if ($rows && $rows !== true) { echo '
Your plan entry has been posted successfully.
'; } else { echo "Somebody screwed up, MySQL said '$sqlError'. Bug a project admin or somethin', eh?
"; } } else { $date = date ('d M Y'); newsBoxOpen (); if ($planText) { newsBoxTitle ("Latest Plan for $user (Preview)"); printNews ($date, $user, stripSlashes ($planText)); } newsBoxTitle ("Post Plan Entry"); $form = ''; printNews ($date, $user, $form); newsBoxClose (); } ?>