'objectID' => $row['attach_rel_id'],
'userID' => $row['attach_member_id'] ?: null,
'filename' => $row['attach_file'],
- 'filesize' => $row['attach_filesize'],
- 'isImage' => $row['attach_is_image'],
'downloads' => $row['attach_hits'],
'uploadTime' => $row['attach_date'],
], ['fileLocation' => $fileLocation]);
'objectID' => $row['id2'],
'userID' => $row['attach_member_id'] ?: null,
'filename' => $row['attach_file'],
- 'filesize' => $row['attach_filesize'],
- 'isImage' => $row['attach_is_image'],
'downloads' => $row['attach_hits'],
'uploadTime' => $row['attach_date'],
], ['fileLocation' => $fileLocation]);
while ($row = $statement->fetchArray()) {
$fileLocation = FileUtil::addTrailingSlash($this->fileSystemPath . $row['folder']) . $row['filename'];
- $isImage = 0;
- if ($row['filetype'] == 'image/jpeg' || $row['filetype'] == 'image/png' || $row['filetype'] == 'image/gif') $isImage = 1;
-
ImportHandler::getInstance()->getImporter('com.woltlab.wbb.attachment')->import($row['id'], [
'objectID' => $row['mesid'],
'userID' => $row['userid'] ?: null,
'filename' => $row['filename'],
- 'filesize' => $row['size'],
- 'fileType' => $row['filetype'],
- 'isImage' => $isImage
], ['fileLocation' => $fileLocation]);
}
}
$statement->execute([$offset + 1, $offset + $limit]);
while ($row = $statement->fetchArray()) {
$fileLocation = FileUtil::addTrailingSlash($uploadsPath).$row['attachname'];
- if (!file_exists($fileLocation)) continue;
-
- if ($imageSize = @getimagesize($fileLocation)) {
- $row['isImage'] = 1;
- $row['width'] = $imageSize[0];
- $row['height'] = $imageSize[1];
- }
- else {
- $row['isImage'] = $row['width'] = $row['height'] = 0;
- }
ImportHandler::getInstance()->getImporter('com.woltlab.wbb.attachment')->import($row['aid'], [
'objectID' => $row['pid'],
'userID' => $row['uid'] ?: null,
'filename' => $row['filename'],
- 'filesize' => $row['filesize'],
- 'fileType' => $row['filetype'],
- 'isImage' => $row['isImage'],
- 'width' => $row['width'],
- 'height' => $row['height'],
'downloads' => $row['downloads'],
'uploadTime' => $row['dateuploaded']
], ['fileLocation' => $fileLocation]);
while ($row = $statement->fetchArray()) {
$fileLocation = FileUtil::addTrailingSlash($this->fileSystemPath.$upload_path).$row['physical_filename'];
- $isImage = 0;
- if ($row['mimetype'] == 'image/jpeg' || $row['mimetype'] == 'image/png' || $row['mimetype'] == 'image/gif') $isImage = 1;
-
ImportHandler::getInstance()->getImporter('com.woltlab.'.($conversation ? 'wcf.conversation' : 'wbb').'.attachment')->import(0, [ // TODO: support inline attachments
'objectID' => $row['post_msg_id'],
'userID' => $row['poster_id'] ?: null,
'filename' => $row['real_filename'],
- 'filesize' => $row['filesize'],
- 'fileType' => $row['mimetype'],
- 'isImage' => $isImage,
'downloads' => $row['download_count'],
'uploadTime' => $row['filetime']
], ['fileLocation' => $fileLocation]);
while ($row = $statement->fetchArray()) {
$fileLocation = FileUtil::addTrailingSlash($this->fileSystemPath.$upload_path).$row['physical_filename'];
- $isImage = 0;
- if ($row['mimetype'] == 'image/jpeg' || $row['mimetype'] == 'image/png' || $row['mimetype'] == 'image/gif') $isImage = 1;
-
ImportHandler::getInstance()->getImporter('com.woltlab.'.($conversation ? 'wcf.conversation' : 'wbb').'.attachment')->import(0, [ // TODO: support inline attachments
'objectID' => $row['post_msg_id'],
'userID' => $row['poster_id'] ?: null,
'filename' => $row['real_filename'],
- 'filesize' => $row['filesize'],
- 'fileType' => $row['mimetype'],
- 'isImage' => $isImage,
'downloads' => $row['download_count'],
'uploadTime' => $row['filetime']
], ['fileLocation' => $fileLocation]);
$fileLocation = $this->getAttachmentFilename($row['id_attach'], $row['id_folder'], $row['file_hash'], $row['filename']);
- if ($imageSize = @getimagesize($fileLocation)) {
- $row['isImage'] = 1;
- $row['width'] = $imageSize[0];
- $row['height'] = $imageSize[1];
- }
- else {
- $row['isImage'] = $row['width'] = $row['height'] = 0;
- }
-
ImportHandler::getInstance()->getImporter('com.woltlab.wbb.attachment')->import($row['id_attach'], [
'objectID' => $row['id_msg'],
'userID' => $row['id_member'] ?: null,
'filename' => $row['filename'],
- 'filesize' => $row['size'],
- 'fileType' => $row['mime_type'],
- 'isImage' => $row['isImage'],
- 'width' => $row['width'],
- 'height' => $row['height'],
'downloads' => $row['downloads'],
'uploadTime' => $row['poster_time']
], ['fileLocation' => $fileLocation]);
// unable to read file -> abort
if (!is_file($file) || !is_readable($file)) continue;
- if ($imageSize = @getimagesize($file)) {
- $row['isImage'] = 1;
- $row['width'] = $imageSize[0];
- $row['height'] = $imageSize[1];
- }
- else {
- $row['isImage'] = $row['width'] = $row['height'] = 0;
- }
ImportHandler::getInstance()->getImporter($importer)->import($row['attachmentid'], [
'objectID' => $row['contentid'],
'userID' => $row['userid'] ?: null,
'filename' => $row['filename'],
- 'filesize' => isset($row['filesize']) ? $row['filesize'] : filesize($file),
- 'fileType' => FileUtil::getMimeType($file),
- 'isImage' => $row['isImage'],
- 'width' => $row['width'],
- 'height' => $row['height'],
'downloads' => $row['counter'],
'uploadTime' => $row['dateline'],
'showOrder' => isset($row['displayOrder']) ? $row['displayOrder'] : 0
// unable to read file -> abort
if (!is_file($file) || !is_readable($file)) continue;
- if ($imageSize = @getimagesize($file)) {
- $row['isImage'] = 1;
- $row['width'] = $imageSize[0];
- $row['height'] = $imageSize[1];
- }
- else {
- $row['isImage'] = $row['width'] = $row['height'] = 0;
- }
ImportHandler::getInstance()->getImporter('com.woltlab.wbb.attachment')->import($row['nodeid'], [
'objectID' => $row['parentid'],
'userID' => $row['userid'] ?: null,
'filename' => $row['filename'],
- 'filesize' => isset($row['filesize']) ? $row['filesize'] : filesize($file),
- 'fileType' => FileUtil::getMimeType($file),
- 'isImage' => $row['isImage'],
- 'width' => $row['width'],
- 'height' => $row['height'],
'downloads' => $row['counter'],
'uploadTime' => $row['dateline'],
'showOrder' => isset($row['displayOrder']) ? $row['displayOrder'] : 0
$statement->execute([0]);
while ($row = $statement->fetchArray()) {
$fileLocation = $this->fileSystemPath.'attachments/attachment-'.$row['attachmentid'].'.'.$row['attachmentextension'];
- if (!@file_exists($fileLocation)) continue;
-
- $fileType = FileUtil::getMimeType($fileLocation);
- $isImage = 0;
- if ($fileType == 'image/jpeg' || $fileType == 'image/png' || $fileType == 'image/gif') $isImage = 1;
ImportHandler::getInstance()->getImporter($objectType)->import($row['attachmentid'], [
'objectID' => $row[$indexName],
'userID' => (!empty($row['userid']) ? $row['userid'] : null),
'filename' => $row['attachmentname'].'.'.$row['attachmentextension'],
- 'filesize' => $row['attachmentsize'],
- 'fileType' => $fileType,
- 'isImage' => $isImage,
'downloads' => $row['counter'],
'uploadTime' => (!empty($row['uploadtime']) ? $row['uploadtime'] : 0),
'showOrder' => 0
'objectID' => $row['eventID'],
'userID' => $row['userID'] ?: null,
'filename' => $row['attachmentName'],
- 'filesize' => $row['attachmentSize'],
- 'fileType' => $row['fileType'],
- 'isImage' => $row['isImage'],
'downloads' => $row['downloads'],
'lastDownloadTime' => $row['lastDownloadTime'],
'uploadTime' => $row['uploadTime'],
'objectID' => !empty($row['containerID']) ? $row['containerID'] : $row['messageID'],
'userID' => $row['userID'] ?: null,
'filename' => $row['attachmentName'],
- 'filesize' => $row['attachmentSize'],
- 'fileType' => $row['fileType'],
- 'isImage' => $row['isImage'],
'downloads' => $row['downloads'],
'lastDownloadTime' => $row['lastDownloadTime'],
'uploadTime' => $row['uploadTime'],
'objectID' => $row['objectID'],
'userID' => $row['userID'] ?: null,
'filename' => $row['filename'],
- 'filesize' => $row['filesize'],
- 'fileType' => $row['fileType'],
- 'fileHash' => $row['fileHash'],
- 'isImage' => $row['isImage'],
- 'width' => $row['width'],
- 'height' => $row['height'],
'downloads' => $row['downloads'],
'lastDownloadTime' => $row['lastDownloadTime'],
'uploadTime' => $row['uploadTime'],
$config = self::getConfig();
$fileLocation = $this->fileSystemPath.$config['internalDataPath'].'/attachments/'.floor($row['data_id'] / 1000).'/'.$row['data_id'].'-'.$row['file_hash'].'.data';
- if (!file_exists($fileLocation)) continue;
-
- if ($imageSize = @getimagesize($fileLocation)) {
- $row['isImage'] = 1;
- $row['width'] = $imageSize[0];
- $row['height'] = $imageSize[1];
- }
- else {
- $row['isImage'] = $row['width'] = $row['height'] = 0;
- }
-
ImportHandler::getInstance()->getImporter($objectType)->import($row['attachment_id'], [
'objectID' => $row['content_id'],
'userID' => $row['user_id'] ?: null,
'filename' => $row['filename'],
- 'filesize' => $row['file_size'],
- 'fileType' => FileUtil::getMimeType($fileLocation) ?: 'application/octet-stream',
- 'isImage' => $row['isImage'],
- 'width' => $row['width'],
- 'height' => $row['height'],
'downloads' => $row['view_count'],
'uploadTime' => $row['upload_date']
], ['fileLocation' => $fileLocation]);
foreach ($files as $file) {
if (!isset($file['filelink'])) continue;
$fileLocation = FileUtil::addTrailingSlash($this->fileSystemPath).$file['filelink'];
- if (!file_exists($fileLocation)) continue;
-
- if ($imageSize = @getimagesize($fileLocation)) {
- $row['isImage'] = 1;
- $row['width'] = $imageSize[0];
- $row['height'] = $imageSize[1];
- }
- else {
- $row['isImage'] = $row['width'] = $row['height'] = 0;
- }
$filename = $file['filename'] ?? $row['filelink'];
if ($convert) $filename = mb_convert_encoding($filename, 'UTF-8', 'ISO-8859-1');
'objectID' => $row['id'],
'userID' => $row['userid'] ?: null,
'filename' => $filename,
- 'filesize' => filesize($fileLocation),
- 'fileType' => FileUtil::getMimeType($fileLocation),
- 'isImage' => $row['isImage'],
- 'width' => $row['width'],
- 'height' => $row['height'],
'downloads' => 0,
'uploadTime' => strtotime($row['writetime'])
], ['fileLocation' => $fileLocation]);