', ' / ', $name); $name = preg_replace('/<[^>]*>/', '', $name); return $name; } function getAllMatches($q, $cats) { global $config; $labellimit = 100; $pos = array(); $label = array(); $type = array(); $url = array(); $icon = array(); foreach($config['datasource'] as $ds) { $dsclass = str_replace(' ', '', ucwords(str_replace('/', ' ', $ds))).'DataSource'; list($npos, $nlabel, $ntype, $nurl, $nicon) = call_user_func(array($dsclass, 'getEntries'), $q, $cats); foreach($npos as $k => $v) $pos[$k] += $v; foreach($nlabel as $k => $v) $label[$k] += $v; foreach($ntype as $k => $v) $type[$k] = $v; foreach($nurl as $k => $v) $url[$k] = $v; foreach($nicon as $k => $v) $icon[$k] = $v; } foreach($label as $k => $v) { $label[$k] = (1000000-$v).'/'.$k; } asort($label); if(count($label) > $labellimit) $label = array_slice($label, 0, $labellimit); return array($pos, $label, $type, $url, $icon); } function getAllBookmarks() { global $config; $bookmarks = array(); foreach($config['datasource'] as $ds) { $dsclass = str_replace(' ', '', ucwords(str_replace('/', ' ', $ds))).'DataSource'; foreach(call_user_func(array($dsclass, 'getBookmarks')) as $bookmark) { $bookmarks[] = $bookmark; } } return $bookmarks; } function getExtraInfo($update) { global $config; $extraInfos = array(); foreach($config['datasource'] as $ds) { $dsclass = str_replace(' ', '', ucwords(str_replace('/', ' ', $ds))).'DataSource'; foreach(call_user_func(array($dsclass, 'getExtraInfo'), $update) as $extraInfo) { $extraInfos[] = $extraInfo; } } return $extraInfos; } function getPointInfo($uri) { global $config; $pointinfos = array(); foreach($config['datasource'] as $ds) { $dsclass = str_replace(' ', '', ucwords(str_replace('/', ' ', $ds))).'DataSource'; $pointinfo = call_user_func(array($dsclass, 'getPointInfo'), $uri); if(count($pointinfo) > 0) { return $pointinfo; } } return null; } class DataSource{ static function getAll(){return array();} static function getEntries($q, $cats){return array();} static function getDataSets(){return array();} static function getDataSetExtras(){return array();} static function getAllSites(){return array();} static function getAllBuildings(){return array();} static function processURI($uri){return false;} static function getBookmarks(){return array();} static function getExtraInfo($update){return array();} static function getPointInfo(){return array();} static $iconpath = 'http://data.southampton.ac.uk/map-icons/'; static function convertIcon($icon) { return $icon; } static function processOpeningTimes($allopen) { if(count($allopen) > 0) { foreach($allopen as $point) { if ($point['start'] != '') { $start = strtotime($point['start']); $start = date('d/m/Y',$start); } else { $start = ''; } if ($point['end'] != '') { $end = strtotime($point['end']); $end = date('d/m/Y',$end); } else { $end = ''; } $open = strtotime($point['opens']); $open = date('H:i',$open); $close = strtotime($point['closes']); $close = date('H:i',$close); $ot[$start."-".$end][$point['day']][] = $open."-".$close; } $weekday = array('Monday', 'Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'); foreach($weekday as $day) { $short_day = substr($day, 0,3); } foreach($ot as $valid => $otv) { list($from, $to) = explode('-',$valid); $now = mktime(); if ($from == '') { $from = $now - 86400; } else { $from = mktime(0,0,0,substr($from,3,2),substr($from,0,2),substr($from,7,4)); } if ($to == '') { $to = $now+86400; } else { $to = mktime(0,0,0,substr($to,3,2),substr($to,0,2),substr($to,7,4)); } if ( $to < $now ) { continue; } if ($from > $now + (60*60*24*30)) { continue; } $current = ($from <= $now )&&( $to >= $now); if ($current) { foreach($weekday as $day) { if(array_key_exists('http://purl.org/goodrelations/v1#'.$day, $otv)) { foreach($otv['http://purl.org/goodrelations/v1#'.$day] as $dot) { if($dot == '00:00-00:00') $dot = '24 hour'; if($day == date('l', $now) && !in_array($dot, $todayopening)) { $todayopening[] = $dot; } } } } } } if($todayopening != null) { echo "
"; echo "

Today's opening hours:

"; echo ""; echo "
"; } } } static function processOffers($allpos) { if(count($allpos) > 0) { echo "

Offers: (click to filter)

"; echo ""; } } } function getEnabledCategories() { global $config; if($_GET['ec'] == "") { return array_keys($config['categories']); } else { return explode(',', $_GET['ec']); } } foreach($config['datasource'] as $ds) { if(strpos($ds, '/') === false) { $ds .= '/ds'; } include_once 'modules/'.$ds.'.php'; } ?> | credits

credits

Development

The opendatamap was developed by:

with the assistance of:

Data

It makes use of the following datasets:"; echo ""; echo "

"; echo "

"; echo implode('
', $datasetextras); echo "

"; ?>

Icons

The opendatamap iconset is available under the CC BY-SA 3.0 licence. The attribution should be to opendatamap iconset, with a link provided to http://opendatamap.ecs.soton.ac.uk/iconset. Is is based on the Map Icons Collection which is also available under the same licence.

Libraries

It uses the SPARQL RDF Library for PHP, developed by:"; echo ""; echo "The library is available under the CC BY 3.0 licence."; echo "

"; echo "

It also uses the Simple HTML DOM Library, developed by:"; echo "

"; echo "The library is available under the MIT licence."; echo "

"; ?>

Source

The opendatamap source code is available under the CC BY-SA 3.0 licence. The attribution should be to opendatamap, with a link provided to http://opendatamap.ecs.soton.ac.uk/source.

Other

Thanks also to suggestions from:"; echo ""; echo "

"; ?>