function delete_story($id) { $update = "UPDATE stories SET deleted ='y' where id=" . $id; $result = mysql_query($update); if (!$result) { echo "'Error deleting the stories from the database: " . $update . "<br>"; } else { $story = get_story($id); echo "<div class=\"center\"><h1>Success!</h1>" . "<h3>The story <span class=\"success\">" . $story['headline'] . "</span> has been deleted.</h3></div>"; } }
} break; case 'link_depublished': case 'link_discard': if (empty($_REQUEST['noproblem']) && empty($_REQUEST['nodiscard'])) { get_story($log->time, 'discarded', $log->log_ref_id, $log->log_user_id); } break; case 'link_edit': if (empty($_REQUEST['noedit']) && ($current_user->admin || $current_user->user_level == 'blogger')) { get_story($log->time, 'edited', $log->log_ref_id, $log->log_user_id); } break; case 'link_geo_edit': if (empty($_REQUEST['nogeoedit']) && $current_user->admin) { get_story($log->time, 'geo_edited', $log->log_ref_id, $log->log_user_id); } break; case 'comment_edit': if (User::friend_exists($current_user->user_id, $log->log_user_id) < 0) { continue; } if (empty($_REQUEST['nocomment'])) { get_comment($log->time, 'cedited', $log->log_ref_id, $log->log_user_id); } break; case 'post_new': if (User::friend_exists($current_user->user_id, $log->log_user_id) < 0) { continue; } if (empty($_REQUEST['nopost'])) {
echo "</form>\n <div class=\"footnote\">** if any links are over 128 characters: use <a href=\"http://www.bit.ly\" target=_new>bit.ly</a> to shorten the url</div>"; } else { $headline = $_POST['headline']; $story = $_POST['story']; $start_date = $_POST['start_date']; $end_date = $_POST['end_date']; $pic = $_POST['pic']; $pic_url = $_POST['pic_url']; $priority = $_POST['priority']; if (!$start_date || !$end_date || !$headline || !$story || !$pic || !$pic_url || !$priority) { echo '<div class="top-spacer_20 center error">Error - missing required value(s)</div>'; } else { $result = update_story($id, $headline, $story, $start_date, $end_date, $pic, $pic_url, $priority); if ($result) { echo '<div class="top-spacer_20 center"><h1>Update was successful!</h1>'; display_story(get_story($id)); echo "</div>"; } } } ?> <div class="top-spacer_20"> <a href="story_view_all.php">View all Stories</a> <p> <a href="cp.php">Control Panel</a> </div> </div> </div> <!-- end of row div --> <?php } require "partials/_footer.php";