require_once('parsecsv.lib.php');
$url = "https://docs.google.com/spreadsheet/pub?key=0AjuBBSguH-KrdF9VZGFCNjRYLUZLTnpqRG56dzZXdmc&single=true&gid=5&output=csv";
$cacheduration = 60;
function download($url, $cachetime = 0) {
if( $cachetime == 0 )
return shell_exec("wget -q -O - " . escapeshellcmd($url));
else {
$filename = "cache_".md5($url);
$lasttimefile = $filename."_lasttime";
$lasttime = intval(trim(shell_exec("cat $lasttimefile")));
if( $lasttime + $cachetime < time() || !file_exists($filename) ) {
shell_exec("echo ".time()." > {$filename}_lasttime");
shell_exec("wget -q -O $filename " . escapeshellcmd($url));
}
return shell_exec("cat $filename");
}
}
function getWorkshopData() {
global $url, $cacheduration;
$csv = new parseCSV();
$csv->parse(download($url, $cacheduration));
// sort the list by date
function cmp($rowa, $rowb) {
$a = date("F dS H:i",strtotime($rowa["Start DateTime"]));
$b = date("F dS H:i",strtotime($rowb["Start DateTime"]));
if ($a == $b) {
return 0;
}
return ($a < $b) ? -1 : 1;
}
usort($csv->data,'cmp');
return $csv->data;
}
?>
Fatal error: Uncaught Error: Call to undefined function getWorkshopData() in /var/www/vhosts/web12.serv01.eipserver.de/httpdocs/einrad.eu/stuff/unicon2012workshops/index.php:55
Stack trace:
#0 {main}
thrown in /var/www/vhosts/web12.serv01.eipserver.de/httpdocs/einrad.eu/stuff/unicon2012workshops/index.php on line 55