From ddc3732b3bb8ba7c5f1d2f2a4d6ff3acfdae7357 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Sun, 1 Jun 2003 15:52:37 +0000 Subject: [PATCH] More work on the event categorization --- cal.php | 21 +++++++++++++++------ include/layout.inc | 8 +++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/cal.php b/cal.php index 365cae752..977c0e4fc 100644 --- a/cal.php +++ b/cal.php @@ -326,12 +326,20 @@ function read_event($fp) // Corrupt line in CSV file if (count($linearr) < 12) { return FALSE; } - - // Put the array elements into variables - list( - $day, $month, $year, $country, - $sdesc, $id, $ldesc, $url, $recur, $tipo, $sdato, $edato - ) = $linearr; + + if(count($linearr==12) { + // Put the array elements into variables + list( + $day, $month, $year, $country, + $sdesc, $id, $ldesc, $url, $recur, $tipo, $sdato, $edato + ) = $linearr; + $category = 0; + } elseif(count($linearr==13) { + list( + $day, $month, $year, $country, + $sdesc, $id, $ldesc, $url, $recur, $tipo, $sdato, $edato, $category + ) = $linearr; + } // Get info on recurring event @list($recur, $recur_day) = explode(":", $recur, 2); @@ -348,6 +356,7 @@ function read_event($fp) 'url' => $url, 'ldesc' => base64_decode($ldesc), 'country' => $country, + 'category' => $category, ); } diff --git a/include/layout.inc b/include/layout.inc index 4a785e88b..b2654117c 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -505,7 +505,13 @@ function display_event($event, $include_date = 1) $days[$event['recur_day']], " of the month)"; break; } - + + // Event category + if(isset($event['category']) && $event['category']) { + $cat = array("unknown", "User Group Event", "Conference", "Training"); + echo ' [' . $cat[$event['category']] . '] '; + } + // Print out country information echo ' (' , $COUNTRIES[$event['country']] , ')'; ?>