mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
#310 - Forum attachment downloading should work now. TODO: checks and error handling
This commit is contained in:
@@ -210,17 +210,18 @@ class e107forum
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sendFile($data)
|
function sendFile($data)
|
||||||
{
|
{
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$fid = intval($data['dl']);
|
$id = intval($data['id']); // forum (post) id
|
||||||
|
$fid = intval($data['dl']); // file id
|
||||||
$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]);
|
|
||||||
|
|
||||||
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user