From 0077cb99704fe863cf731fc5cab792af2ede96c2 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sun, 17 Apr 2011 20:13:07 -0400 Subject: Backporting retarded amount of changes outside of version control --- admin/announcements/functions.php | 132 +++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 66 deletions(-) (limited to 'admin/announcements/functions.php') diff --git a/admin/announcements/functions.php b/admin/announcements/functions.php index f45a7e3..b089cf3 100644 --- a/admin/announcements/functions.php +++ b/admin/announcements/functions.php @@ -1,67 +1,67 @@ -. - */ - -/** - * Note to anyone feeling the need to edit this file... - * You MUST declare $db as global inside your functions in order access MySQL from here. - */ - -function EditAnnouncements() -{ - global $db; - - if(isset($_POST['processed'])) - { - //Secure our data to prevent injection attacks. - $title = addslashes($_POST['title']); - $text = addslashes($_POST['text']); - if(empty($title) || empty($text)) - { - echo "You must fill everything out before proceeding."; - return; - } - - //Update the database with the new data. - $db->Query("UPDATE bayonet_announcements SET title = '$title', text = '$text' WHERE announcement_id = 0"); - echo "Announcement, '$title', has been edited.\n

Please wait while you are redirected.

- Click here if you don't feel like waiting."; - - // 3 second redirect to go back to the edit page - PageRedirect(2, "?op=announcements"); - - //die, because we have completed what we wanted to do. - return; - } - - - //Grab the page from the database according to the $article_id passed to the function. - $result = $db->Query("SELECT title,text FROM bayonet_announcements WHERE announcement_id = 0"); - $announcement = $db->FetchRow($result); - - ?> -
- - - - -
Announcement Title:
-
- . + */ + +/** + * Note to anyone feeling the need to edit this file... + * You MUST declare $db as global inside your functions in order access MySQL from here. + */ + +function EditAnnouncements() +{ + global $db; + + if(isset($_POST['processed'])) + { + //Secure our data to prevent injection attacks. + $title = addslashes($_POST['title']); + $text = addslashes($_POST['text']); + if(empty($title) || empty($text)) + { + echo "You must fill everything out before proceeding."; + return; + } + + //Update the database with the new data. + $db->Query("UPDATE bayonet_announcements SET title = '$title', text = '$text' WHERE announcement_id = 0"); + echo "Announcement, '$title', has been edited.\n

Please wait while you are redirected.

+ Click here if you don't feel like waiting."; + + // 3 second redirect to go back to the edit page + PageRedirect(2, "?op=announcements"); + + //die, because we have completed what we wanted to do. + return; + } + + + //Grab the page from the database according to the $article_id passed to the function. + $result = $db->Query("SELECT title,text FROM bayonet_announcements WHERE announcement_id = 0"); + $announcement = $db->FetchRow($result); + + ?> +
+ + + + +
Announcement Title:
+
+ \ No newline at end of file -- cgit