/** * This will save a submission * * @param string $type Type of submission we are dealing with * @param array $A Data for that submission * */ function savesubmission($type, $A) { global $_CONF, $_TABLES, $LANG12; COM_clearSpeedlimit($_CONF['speedlimit'], 'submit'); $last = COM_checkSpeedlimit('submit'); if ($last > 0) { $retval = COM_showMessageText($LANG12[30] . $last . $LANG12[31], $LANG12[26]); $retval = COM_createHTMLDocument($retval); return $retval; } if (!empty($type) && $type !== 'story') { // Update the submitspeedlimit for user - assuming Plugin approves // submission record COM_updateSpeedlimit('submit'); // see if this is a submission that needs to be handled by a plugin // and should include its own redirect $retval = PLG_saveSubmission($type, $A); if ($retval === false) { COM_errorLog("Could not save your submission. Bad type: {$type}"); } elseif (empty($retval)) { // plugin should include its own redirect - but in case handle // it here and redirect to the main page PLG_submissionSaved($type); COM_redirect($_CONF['site_url'] . '/index.php'); } else { PLG_submissionSaved($type); return $retval; } } if (!empty($A['title']) && !empty($A['introtext']) && TOPIC_checkTopicSelectionControl()) { $retval = savestory($A); PLG_submissionSaved($type); } else { $retval = COM_showMessageText($LANG12[23], $LANG12[22]) . submissionform($type); $retval = COM_createHTMLDocument($retval); } return $retval; }
/** * This will save a submission * * @param string $type Type of submission we are dealing with * @param array $A Data for that submission * */ function savesubmission($type, $A) { global $_CONF, $_TABLES, $_USER, $LANG12; $retval = COM_siteHeader(); COM_clearSpeedlimit($_CONF['speedlimit'], 'submit'); $last = COM_checkSpeedlimit('submit'); if ($last > 0) { $retval .= COM_startBlock($LANG12[26], '', COM_getBlockTemplate('_msg_block', 'header')) . $LANG12[30] . $last . $LANG12[31] . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer')) . COM_siteFooter(); return $retval; } if (!empty($type) && $type != 'story') { // Update the submitspeedlimit for user - assuming Plugin approves // submission record COM_updateSpeedlimit('submit'); // see if this is a submission that needs to be handled by a plugin // and should include its own redirect $retval = PLG_saveSubmission($type, $A); if ($retval === false) { COM_errorLog("Could not save your submission. Bad type: {$type}"); } elseif (empty($retval)) { // plugin should include its own redirect - but in case handle // it here and redirect to the main page return COM_refresh($_CONF['site_url'] . '/index.php'); } else { return $retval; } } if (!empty($A['title']) && !empty($A['introtext'])) { $retval = savestory($A); } else { $retval .= COM_startBlock($LANG12[22], '', COM_getBlockTemplate('_msg_block', 'header')) . $LANG12[23] . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer')) . submissionform($type) . COM_siteFooter(); } return $retval; }
if (!$_SESSION["logged_in"]) { loginPrompt($_POST[username], $_POST[remember_me], $_SESSION["error"]); } else { /*----- CONTENT ------*/ ?> <div style="padding: 2em;"> <?php $id = $_GET['id']; $start_date = $_POST['start_date']; $end_date = $_POST['end_date']; $headline = $_POST['headline']; $story = $_POST['story']; $pic = $_POST['pic']; $pic_url = $_POST['pic_url']; $priority = $_POST['priority']; if (!$id || !$start_date || !$end_date || !$headline || !$story || !$priority) { echo 'Error - missing value(s)'; exit; } savestory($id, $start_date, $end_date, $headline, $story, $pic, $pic_url, $priority); ?> <center><h1>Story (<?php echo $headline; ?> ) has been saved</h1></center> <a href="viewallstories.php"><< Back to All Stories</a> | <a href="cp.php"><< Back to Control Panel</a> </div> <?php } require "ext/footer.php";