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、个性化修改的样式表(Style Sheet)设定项目!
https://www.onexin.net/personal-style-sheet-changes-style-sheet-to-set-the-project/

2、网站重构 CSS样式表的优化与技巧
https://www.onexin.net/site-reconstruction-of-the-css-style-sheet-optimization-and-skills/

3、网站显示谷歌纵横widget
https://www.onexin.net/latitude-widget-site-to-show-google/

4、Discuz!X 3.4升级3.5时需要注意的事项有哪些?
https://www.onexin.net/discuzx-34-upgrade-to-35/

5、26个有用的jQuery的提示,技巧及解决方案
https://www.onexin.net/26-jquery-useful-tips-techniques-and-solutions/

Leave a Reply