1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

More work on the event categorization

This commit is contained in:
Rasmus Lerdorf
2003-06-01 15:52:37 +00:00
parent cd536e2e00
commit ddc3732b3b
2 changed files with 22 additions and 7 deletions

21
cal.php
View File

@@ -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,
);
}

View File

@@ -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']] , ')';
?>