1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

#310 - Forum attachment downloading should work now. TODO: checks and error handling

This commit is contained in:
Moc
2014-08-04 10:27:42 +02:00
parent 2522d64a67
commit de45dd242e

View File

@@ -210,17 +210,18 @@ class e107forum
}
function sendFile($data)
{
$sql = e107::getDb();
$fid = intval($data['dl']);
$array = $sql->retrieve('forum_post','post_user,post_attachments','post_id='.intval($data['id']));
$attach = e107::serialize($array['post_attachments']);
$file = $this->getAttachmentPath($array['post_user']).varset($attach['file'][$fid]);
function sendFile($data)
{
$sql = e107::getDb();
$id = intval($data['id']); // forum (post) id
$fid = intval($data['dl']); // file id
e107::getFile()->send($file);
}
$array = $sql->retrieve('forum_post','post_user,post_attachments','post_id='.$id);
$attach = e107::unserialize($array['post_attachments']);
$file = $this->getAttachmentPath($array['post_user']).varset($attach['file'][$fid]);
e107::getFile()->send($file);
}
/**