aboutsummaryrefslogtreecommitdiff
path: root/blocks/mini_calendar
diff options
context:
space:
mode:
authorjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-21 01:29:56 -0500
committerjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-21 01:29:56 -0500
commit0713fd6c1cebe1b32f173af0ef447e7853cbaf70 (patch)
tree6d9afe839eaa54a0918f672317371369518e0f59 /blocks/mini_calendar
parent84fc0b30493e9b8081898ec48451cec06a2cf2bc (diff)
downloadbayonetcms-0713fd6c1cebe1b32f173af0ef447e7853cbaf70.tar.gz
(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
Diffstat (limited to 'blocks/mini_calendar')
-rw-r--r--blocks/mini_calendar/functions.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/blocks/mini_calendar/functions.php b/blocks/mini_calendar/functions.php
index 06ce910..3291e6b 100644
--- a/blocks/mini_calendar/functions.php
+++ b/blocks/mini_calendar/functions.php
@@ -132,7 +132,7 @@
$date = time();
date_default_timezone_set("America/New_York"); //EASTERN TIME ZONE
-
+
//GET values for month and year
$month = "";
$year = "";
@@ -252,14 +252,16 @@
$isEvent=false;
global $db;
- $result = $db->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 '<div class="eventtoday">'.$day_num.'</div>';
+ echo '<div class="eventtoday">'.$day_num.'</div>';
}else if($day_num == $today && $isEvent==false){
echo '<div class="monthtoday">'.$day_num.'</div>';
}else if($day_num != $today && $isEvent==true){
@@ -295,7 +297,13 @@
</table>
</center>
<?php
-
+ //list events for today
+ if(count($todaysEvents)>0){
+ echo "<h3>Today's Events</h3>";
+ foreach($todaysEvents as $event){
+ echo "<span style=\"background-color: {$event['color']}\">&nbsp;&nbsp;</span>&nbsp;{$event['title']}<br />";
+ }
+ }
}
?> \ No newline at end of file