From 0713fd6c1cebe1b32f173af0ef447e7853cbaf70 Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Mon, 21 Dec 2009 06:29:56 +0000 Subject: (OC) fixed some stuff with the calendar git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@388 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- admin/announcements/index.php | 3 +-- admin/calendar/functions.php | 22 ++++++++++++++++++++-- admin/calendar/index.php | 2 +- admin/images/image.png | Bin 0 -> 4733 bytes admin/navigation/index.php | 2 +- admin/news/index.php | 24 ++++++++++++++++++++++++ admin/settings/index.php | 2 +- blocks/mini_calendar/functions.php | 20 ++++++++++++++------ 8 files changed, 62 insertions(+), 13 deletions(-) create mode 100644 admin/images/image.png diff --git a/admin/announcements/index.php b/admin/announcements/index.php index 17b6003..6b0874e 100644 --- a/admin/announcements/index.php +++ b/admin/announcements/index.php @@ -1,6 +1,6 @@

- Edit Announcements

- -Maybe see if this can go into more depth (ie. selecting whether to display announcements or not and on what pages)

Events for:

- Add New Event + Add New Event -      +      Edit  |  @@ -140,6 +140,22 @@ echo $date_arr['year']; */ global $db; + + if(isset($_POST['processed'])){ + $title = addslashes($_POST['title']); + $text = addslashes($_POST['text']); + $year = addslashes($_POST['year']); + $month = addslashes($_POST['month']); + $day = addslashes($_POST['day']); + $time = addslashes($_POST['time']); + $color = addslashes($_POST['color']); + + $date = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year)); + +$db->Query("UPDATE `bayonet_events` SET `title` = '$title', `text` = '$text', `color` = '$color', `date` = '$date', `time` = '$time' WHERE `event_id` ='$event_id' LIMIT 1"); + + } + $result = $db->Query("SELECT * FROM `bayonet_events` WHERE `event_id` = $event_id LIMIT 1"); while(($row = $db->Fetch($result))!=false) { @@ -152,6 +168,7 @@ Title Color Date + Time Text @@ -192,6 +209,7 @@ echo "New event, '$title', has been added.\n"; + PageRedirect(2,"?op=calendar"); //die, because we have completed what we wanted to do. return; } diff --git a/admin/calendar/index.php b/admin/calendar/index.php index 64798e3..a61424f 100644 --- a/admin/calendar/index.php +++ b/admin/calendar/index.php @@ -51,7 +51,7 @@ include $basedir.'calendar/functions.php'; diff --git a/admin/images/image.png b/admin/images/image.png new file mode 100644 index 0000000..865b923 Binary files /dev/null and b/admin/images/image.png differ diff --git a/admin/navigation/index.php b/admin/navigation/index.php index f50ef55..e2179a1 100644 --- a/admin/navigation/index.php +++ b/admin/navigation/index.php @@ -1,6 +1,6 @@ . + */ + +if(!defined("ADMIN_FILE")) +{ + die("Access denied."); +} + ?> \ No newline at end of file diff --git a/admin/settings/index.php b/admin/settings/index.php index 947bba9..875abc8 100644 --- a/admin/settings/index.php +++ b/admin/settings/index.php @@ -1,6 +1,6 @@ Query("SELECT title,color FROM `bayonet_events` WHERE `date` = '$sqlDate' LIMIT 1"); + $result = $db->Query("SELECT title,color FROM `bayonet_events` WHERE `date` = '$sqlDate' ORDER BY `date` DESC"); while(($row = $db->Fetch($result))!=false) { $isEvent = true; - } - + if($day_num == $today){ + $todaysEvents[] = $row; + } + } if($day_num == $today && $isEvent==true){ - echo '
'.$day_num.'
'; + echo '
'.$day_num.'
'; }else if($day_num == $today && $isEvent==false){ echo '
'.$day_num.'
'; }else if($day_num != $today && $isEvent==true){ @@ -295,7 +297,13 @@
- Add New Event

+ Add New Event

Click on a day to add/edit/delete events
0){ + echo "

Today's Events

"; + foreach($todaysEvents as $event){ + echo "   {$event['title']}
"; + } + } } ?> \ No newline at end of file -- cgit