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:
21
cal.php
21
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,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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']] , ')';
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user