Commit 801d580e authored by Francesco Iannuzzelli's avatar Francesco Iannuzzelli

Add geo to all events pages

parent 669be491
......@@ -296,13 +296,12 @@ class Event
public function FacebookImport($link) {
include_once(SERVER_ROOT."/../classes/file.php");
include_once(SERVER_ROOT."/../classes/texthelper.php");
$conf = new Configuration();
$id_event = 0;
$track_error = false;
$this->errors = array();
if($conf->Get("fb_scraper")!='') {
$fm = new FileManager();
$th = new TextHelper();
$url = str_ireplace('FBEVENTURL', $link, $conf->Get("fb_scraper"));
$response = $fm->Browse($url);
if($response!='') {
......@@ -311,11 +310,13 @@ class Event
$db =& Db::globaldb();
if(!(isset($json->facebook_id) && $json->facebook_id!='')) {
$this->errors[] = "Facebook ID missing";
$track_error = true;
}
if(isset($json->title) && $json->title!='') {
$title = $db->SqlQuote($json->title);
} else {
$track_error = true;
$this->errors[] = "Title missing";
}
$start_ts = $end_ts = 0;
......@@ -374,14 +375,16 @@ class Event
} else {
$this->errors[] = "Invalid json";
$track_error = true;
}
} else {
$this->errors[] = "Empty response";
$track_error = true;
}
} else {
$this->errors[] = 'Scraper Missing';
}
if(count($this->errors)>0) {
if(count($this->errors)>0 && $track_error) {
UserError("Facebook import error: " . implode(',',$this->errors) , array('link'=>$link));
}
return $id_event;
......
......@@ -2904,7 +2904,6 @@ class Layout
$counter ++;
}
$e_array['months'] = $months;
$e_array['geo'] = $this->Geo();
} else {
if ($strlen>=$min_str_length || ($params['id_geo']>0))
{
......@@ -2925,7 +2924,6 @@ class Layout
}
$ev['info'] = $this->EventsInfo();
$e_array['events'] = $ev;
$e_array['geo'] = $this->Geo();
}
return $e_array;
}
......@@ -3084,6 +3082,7 @@ class Layout
$pagetype = $this->EventSearch($params,$params['id_topic'],$id_group);
break;
}
$pagetype['geo'] = $this->Geo();
$pagetype['features'] = $this->Features($this->id_type,0,array('id_event'=>$params['id'],'id_topic'=>$params['id_topic']));
$pagetype = array_merge($this->Common($params['id'],$this->id_type),$pagetype,$topic);
return $pagetype;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment