Commit b1afe532 authored by Francesco Iannuzzelli's avatar Francesco Iannuzzelli

Event image upload

parent c45bfa46
......@@ -286,6 +286,16 @@ class Event
$this->EventQueueJobSet($id_topic);
}
public function ImageUpdate($id_event,$file)
{
$filename = "uploads/events/orig/{$id_event}.jpg";
include_once(SERVER_ROOT."/../classes/file.php");
$fm = new FileManager();
$fm->Delete($filename);
$fm->MoveUpload($file['temp'],$filename);
$fm->PostUpdate();
}
/**
* Propagate the update to subtopic containing the calendar
*
......
......@@ -75,6 +75,10 @@ if ($from=="event")
$event = new Event();
$id_new_event = $event->EventInsert($start_date, $length, $allday, $id_event_type, $title, $description, $place, $address, $id_geo,
$place_details, $contact_name, $email, $phone, $link,0,$id_topic,1,0,"",0,$id_p,0);
$file = $fh->UploadedFile("img",true,5120000);
if ($file['ok']) {
$event->ImageUpdate($id_new_event,$file);
}
}
header("Location: insert.php?id=$id_new_event&id_topic=$id_topic");
}
......
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