$id = $umatch[2];
$hash = '';
if (!empty($umatch[3]) && strpos($umatch[3],'#')) {
- $hash = '#'. array_pop(explode('#',$umatch[3]));
+ $hh = explode('#',$umatch[3]);
+ $hash = '#'. array_pop($hh);
}
function downloadEvent($bits)
{
-// $popts = PEAR::getStaticProperty('Pman','options');
$ev = DB_DAtaObject::Factory('events');
if (!$ev->get($bits[1])) {
die("could not find event id");
}
$ff = HTML_FlexyFramework::get();
- if (!empty($ff->Pman['storedir'])) {
- $file = $ff->Pman['storedir']. '/Events/'. $user. date('/Y/m/d/',strtotime($ev->event_when)). $ev->id . ".json";
- }
- // DEPRICATED...
- if (!empty($ff->Pman['event_log_dir'])) {
- $file = $ff->Pman['event_log_dir']. '/'. $user. date('/Y/m/d/',strtotime($ev->event_when)). $ev->id . ".json";
- }
+ $file = $ev->logDir() . date('/Y/m/d/',strtotime($ev->event_when)). $ev->id . ".json";
- if(!file_exists($file)){
+ if(!$file || !file_exists($file)){
die("file was not saved");
}
continue;
}
- $src = $ff->Pman['event_log_dir']. '/'. $user. date('/Y/m/d/', strtotime($ev->event_when)). $f->tmp_name ;
- if (!file_exists($src)) {
+ $src = $file = $ev->logDir() . date('/Y/m/d/', strtotime($ev->event_when)). $f->tmp_name ;
+
+ if (!$src || !file_exists($src)) {
die("file was not saved");
}
header ('Content-Type: ' . $f->type);