[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    www/areas/events
From:       Daniel Molkentin <molkentin () kde ! org>
Date:       2008-05-07 18:48:41
Message-ID: 1210186121.189818.25486.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 805157 by danimo:

display multiday events as such


 M  +2 -2      menu.inc  
 M  +11 -5     upcomingeventlister.inc  


--- trunk/www/areas/events/menu.inc #805156:805157
@@ -12,8 +12,8 @@
 	The calendar will move to SKO once the event module is finished.
 */
 $section =& $this->appendSection("Calendar");
-$section->appendLink("Future Events", "upcoming.php");
-$section->appendLink("Calendar History", "calendar/past-events.php");
+//$section->appendLink("Future Events", "upcoming.php");
+//$section->appendLink("Calendar History", "calendar/past-events.php");
 
 /* Those past events' material should be collected somewhere so it doesn't get lost. \
*/  
--- trunk/www/areas/events/upcomingeventlister.inc #805156:805157
@@ -8,13 +8,13 @@
 
 // How you want each thing to display.
 // By default, this contains all the bits you can grab.
-$event_display="<h4 \
id=\"###TITLE###\">###TITLE###</h4><p>###DESCRIPTION###</p><p><strong>Date:</strong> \
###DATE###<br /><strong>Location:</strong> <a \
href='###MAPLINK###'>###WHERE###</a></p>"; +$event_display="<h4 \
id=\"###TITLE###\">###TITLE###</h4><p>###DESCRIPTION###</p><p><strong>Date:</strong> \
###DATE###<br /><strong>Location:</strong> <a \
href='###MAPLINK###'>###WHERE###</a></p>\n";  
 // Loop through the (now sorted) array, and display what we wanted.
 foreach ($temp as $item) {
     // These are the dates we'll display
-    $gCalDate = gmdate($dateformat, $item['date']);
-    $gCalTime = gmdate($timeformat, $item['date']);
+    $gCalDateStart = gmdate($dateformat, $item['startTime']);
+    $gCalDateEnd = gmdate($dateformat, $item['endTime']);
 
     // reprocess description
     $linked_description=preg_replace( \
'/(http|ftp|irc|webdav)+(s)?:(\/\/)((\w|\.)+)(\/)?(\S+)?/i', '<a href="\0">\4</a>', \
$item['description'] ); @@ -24,11 +24,17 @@
     $temp_event=$event_display;
     $temp_event=str_replace("###TITLE###",$item['title'],$temp_event);
     $temp_event=str_replace("###DESCRIPTION###",$linked_description,$temp_event);
-    $temp_event=str_replace("###DATE###",$gCalDate,$temp_event);
-    $temp_event=str_replace("###FROM###",$gCalTime,$temp_event);
+   $temp_event=str_replace("###FROM###",$gCalTimeEnd,$temp_event);
     $temp_event=str_replace("###WHERE###",$item['where'],$temp_event);
     $temp_event=str_replace("###LINK###",$item['link'],$temp_event);
     $temp_event=str_replace("###MAPLINK###","http://maps.google.com/?q=".urlencode($item['where']),$temp_event);
 +
+    if ($gCalDateStart == $gCalDateEnd) {
+        $temp_event=str_replace("###DATE###",$gCalDateStart,$temp_event);
+    } else {
+        $temp_event=str_replace("###DATE###","$gCalDateStart - \
$gCalDateEnd",$temp_event); +    }
+ 
     // Accept and translate HTML
     $temp_event=str_replace("&lt;","<",$temp_event);
     $temp_event=str_replace("&gt;",">",$temp_event);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic