Discuz!X 3.4论坛附件图片attachimg增加高度height

论坛附件图片增加高度

 

ALTER TABLE `pre_forum_attachment_0` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;
ALTER TABLE `pre_forum_attachment_1` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;
ALTER TABLE `pre_forum_attachment_2` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;
ALTER TABLE `pre_forum_attachment_3` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;
ALTER TABLE `pre_forum_attachment_4` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;
ALTER TABLE `pre_forum_attachment_5` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;
ALTER TABLE `pre_forum_attachment_6` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;
ALTER TABLE `pre_forum_attachment_7` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;
ALTER TABLE `pre_forum_attachment_8` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;
ALTER TABLE `pre_forum_attachment_9` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;
ALTER TABLE `pre_forum_attachment_unused` ADD `height` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ‘0’ AFTER `width`;

修改source/class/forum/forum_upload.php文件,

$thumb = $remote = $width = $height = 0;
if($_GET['type'] == 'image' && !$upload->attach['isimage']) {
return $this->uploadmsg(7);
}
if($upload->attach['isimage']) {
if(!in_array($upload->attach['imageinfo']['2'], array(1,2,3,6))) {
return $this->uploadmsg(7);
}
if($_G['setting']['showexif']) {
require_once libfile('function/attachment');
$exif = getattachexif(0, $upload->attach['target']);
}
if($_G['setting']['thumbsource'] || $_G['setting']['thumbstatus']) {
require_once libfile('class/image');
$image = new image;
}
if($_G['setting']['thumbsource'] && $_G['setting']['sourcewidth'] && $_G['setting']['sourceheight']) {
$thumb = $image->Thumb($upload->attach['target'], '', $_G['setting']['sourcewidth'], $_G['setting']['sourceheight'], 1, 1) ? 1 : 0;
$width = $image->imginfo['width'];
$height = $image->imginfo['height'];
$upload->attach['size'] = $image->imginfo['size'];
}
if($_G['setting']['thumbstatus']) {
$thumb = $image->Thumb($upload->attach['target'], '', $_G['setting']['thumbwidth'], $_G['setting']['thumbheight'], $_G['setting']['thumbstatus'], 0) ? 1 : 0;
$width = $image->imginfo['width'];
$height = $image->imginfo['height'];
}
if($_G['setting']['thumbsource'] || !$_G['setting']['thumbstatus']) {
list($width, $height) = @getimagesize($upload->attach['target']);
}
}
if($_GET['type'] != 'image' && $upload->attach['isimage']) {
$upload->attach['isimage'] = -1;
}
$this->aid = $aid = getattachnewaid($this->uid);
$insert = array(
'aid' => $aid,
'dateline' => $_G['timestamp'],
'filename' => dhtmlspecialchars(censor($upload->attach['name'])),
'filesize' => $upload->attach['size'],
'attachment' => $upload->attach['attachment'],
'isimage' => $upload->attach['isimage'],
'uid' => $this->uid,
'thumb' => $thumb,
'remote' => $remote,
'width' => $width,
'height' => $height
);
C::t('forum_attachment_unused')->insert($insert);

转载请注明出处:https://www.onexin.net/discuzx-attachimg-height/

随机文章:

1、Win10快速打开设置项的命令大全
https://www.onexin.net/win10-ms-settings-command/

2、深入理解Magento – 第八章 – 深入Magento的系统配置
https://www.onexin.net/depth-understanding-of-magento-chapter-viii-in-depth-system-configuration-magento/

3、对菜鸟有点帮助的代码。大大也这样用。
https://www.onexin.net/code-a-little-help-on-the-rookie-significantly-so/

4、解决smarty中truncate截取中文字符串乱码问题
https://www.onexin.net/smarty-truncate-solve-the-problem-of-interception-of-chinese-string-garbled/

5、网页制作之常用CSS缩写语法总结
https://www.onexin.net/%e7%bd%91%e9%a1%b5%e5%88%b6%e4%bd%9c%e4%b9%8b%e5%b8%b8%e7%94%a8css%e7%bc%a9%e5%86%99%e8%af%ad%e6%b3%95%e6%80%bb%e7%bb%93/

Leave a Reply