steim | about | news | EVENTS | project applications| products | contact | resources

STEIM Events | STEIM Events Archive $year_archive

"; else if(!$archive) echo "STEIM Events

For past events visit the STEIM Events Archive.

"; else { echo ""; if($archive) { $query = "select DISTINCT DATE_FORMAT(date, '%Y') from event order by date DESC"; $result = mysql_query($query); // display previous years links echo '
STEIM Events Archive
"; //echo "For future events go to STEIM Events.

"; echo "For future events go to STEIM Events.

"; } } // event type filter if(!$event) { $type_count = sizeof($event_types) ; echo "Filter on event type: "; for ($i=0;$i<$type_count;$i++) { if($i > 0) echo " | "; if($type == $i) { if($i > 0) echo "".$event_types[$i]."\n"; else echo $event_types[$i]."\n"; } else echo "".$event_types[$i]."\n"; } echo "
"; } echo "

"; // set number of displayed events to 0 $nbr_of_events = 0; $query = "select id, DATE_FORMAT(date, '%d'), DATE_FORMAT(date, '%m'), DATE_FORMAT(date, '%Y'), date, time, nbrofdays, title, text, register, cost, options, type, fancy_editor, excerpt, thumb, hide from event"; // filter on date if($event) $query = $query." where id = $event"; else if ($archive) $query = $query." where (YEAR(date) = '$year_archive') and (date < '$today')"; else // $query = $query." where (date + nbrofdays) >= '$today'"; $query = $query." where DATE_ADD(date, INTERVAL (nbrofdays - 1) DAY) >= '$today'"; // Date format.. (Y-m-d) // filter on type if($type) { if($event) $query = $query.""; else $query = $query." and type = '$type'"; } // filter on hide setting in db $query = $query." and hide = '0'" ; // ordering if($event) $query = $query." LIMIT 1"; else if ($archive) $query = $query." order by date DESC"; else $query = $query." order by date ASC"; $result = mysql_query($query); while($data = mysql_fetch_row($result)) { $event = $data[0]; $day = $data[1]; $month = $data[2]; $year = $data[3]; $date = $data[4]; $time = $data[5]; $nbrofdays = $data[6]; $title = $data[7]; $text = url2link($data[8]); $register = $data[9]; $cost = $data[10]; $options = $data[11]; $type = $data[12]; $fancy_editor = $data[13]; $excerpt = $data[14]; $thumb = $data[15]; if(!$fancy_editor) $text = nl2br($text); $date_display = ""; if($nbrofdays < 2) { $month_name = date("F", mktime(0, 0, 0, $month, $day, $year)); $day_number = date("j", mktime(0, 0, 0, $month, $day, $year)); $date_display = $day_number." ".$month_name; } else { $month_name = date("F", mktime(0, 0, 0, $month, $day, $year)); $day_number = date("j", mktime(0, 0, 0, $month, $day, $year)); $month_name2 = date("F", mktime(0, 0, 0, $month, $day + $nbrofdays - 1, $year)); $day_number2 = date("j", mktime(0, 0, 0, $month, $day + $nbrofdays - 1, $year)); $date_display = $day_number." ".$month_name." - ".$day_number2." ".$month_name2; } // keep track of number of displayed events $nbr_of_events = $nbr_of_events + 1; // list of events if(!$event_selected) { echo "$date_display $year "; echo "| $event_types[$type] "; echo "

"; if(!$fancy_editor) $title = "".$title."
"; echo $title; echo "
"; if($thumb) echo "

"; // stip tags and truncate text $text_processed = substr(strip_tags(str_replace("
", " ", $text)),0,300); // if truncated text is the same as the text itself don't try to cut off at space if(!($text_processed == strip_tags(str_replace("
", " ", $text)))) $text_processed = strrev(stristr(strrev($text_processed)," "))."...
"; if($excerpt) echo $excerpt; else echo $text_processed; echo "
Read more...

"; } // event details if($event_selected) { echo "$date_display $year "; if ($time) echo "| $time "; echo "| $event_types[$type] "; if ($cost) echo "| $cost "; echo "

"; if($register && ($date > $today)) echo "Registration is required for this event and can only be done through this form..

"; if($fancy_editor) echo $title; else echo "".$title.""; echo "
"; } // display mp3 media if available $count = 0; $query_media = "select event_media.media, event_media.event, media.id, media.descr, media.src, media.type from event_media, media where event_media.media = media.id and event_media.event = $event and media.type = 1"; $result_media = mysql_query($query_media); while($data_media = mysql_fetch_row($result_media)){ $descr = $data_media[3]; $src = $data_media[4]; $count = $count + 1; if($count == 1) echo "Audio excerpts:

\n"; echo "

$descr



\n"; echo "\n"; } // display youtube media if available $count = 0; $query_media = "select event_media.media, event_media.event, media.id, media.descr, media.src, media.type from event_media, media where event_media.media = media.id and event_media.event = $event and media.type = 2"; $result_media = mysql_query($query_media); while($data_media = mysql_fetch_row($result_media)){ $descr = $data_media[3]; $src = $data_media[4]; $count = $count + 1; if($count == 1) echo "YouTube videos:

\n"; echo "

"; } // display vimeo media if available $count = 0; $query_media = "select event_media.media, event_media.event, media.id, media.descr, media.src, media.type from event_media, media where event_media.media = media.id and event_media.event = $event and media.type = 3"; $result_media = mysql_query($query_media); while($data_media = mysql_fetch_row($result_media)){ $descr = $data_media[3]; $src = $data_media[4]; $count = $count + 1; if($count == 1) echo "Vimeo videos:

\n"; echo "

"; } // list of events if(!$event_selected) { echo "


"; } // event details if($event_selected) { echo "
"; if($archive) echo "Original annoucement:

"; echo $text; echo "

"; } } if ($nbr_of_events == 0) { echo "No events found.

"; } include '../db-disconnect.php'; ?>




Subscribe to the STEIM maillist