Loading... > 微博图床使用中等尺寸图片作为首页图和文章图提高网站加载速度 ## 如果图片链接使用的是中等尺寸图片 `mv690`,则需要将打开后的图片链接参数改为原图 `large`,达到显示原图的目的。(ps:打开图片可能会出现 `坏图(被微博吞了)`的情况) ### 主题 `post.php`文件修改 56行 ```php <?php echo $img['url']; ?> 改为 <?php echo str_replace('mw690', 'large', $img['url']); ?> ``` ## 如果图片链接使用的是原图 `large`,则需要将首页封面图片和文章页图片链接参数改为 `mv690`,使首页封面图片和文章页图片显示为中等图片提高网站加载速度。(ps:首页封面图片和文章页图片可能会出现 `坏图(被微博吞了)`的情况) ### 主题 `post.php`文件修改 57行 ```php <?php echo $img['url'].($this->options->detailImgParm ? $this->options->detailImgParm : ''); ?> ``` 改为 ```php <?php echo $this->options->detailImgParm ? str_replace('large', $this->options->detailImgParm, $img['url']) : $img['url']; ?> ``` ### 主题 `index.list.php`文件修改 5行 ```php $this->fields->thumb.($this->options->thumbImgParm ? $this->options->thumbImgParm : '') : getPostImg($this, $this->options->wholeSrc)[0]['url'].($this->options->thumbImgParm ? $this->options->thumbImgParm : ''); endif; ?>" ``` 改为 ```php ($this->options->thumbImgParm ? str_replace('large', $this->options->thumbImgParm, $this->fields->thumb) : $this->fields->thumb) : ($this->options->thumbImgParm ? str_replace('large', $this->options->thumbImgParm, getPostImg($this, $this->options->wholeSrc)[0]['url']) : getPostImg($this, $this->options->wholeSrc)[0]['url']); endif; ?>" ``` 最后修改:2022 年 07 月 09 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 0 如果觉得我的文章对你有用,请随意赞赏