找回密码
 立即注册

QQ登录

只需一步,快速开始

Discuz!x3.2门户文章图片Alt 问题SEO解决方案之一


文件:
static/image/editor/editor_function.js
template/default/home/spacecp_blog.htm

另存:editor_function.js为bgeditor_function.js
编辑:
editor_function.js
查找:
  1. function insertImage(image, url, width, height) {
  2.         url = typeof url == 'undefined' || url === null ? image : url;
  3.         width = typeof width == 'undefined' || width === null ? 0 : parseInt(width);
  4.         height = typeof height == 'undefined' || height === null ? 0 : parseInt(height);
  5.         var html = '<p><a href="' + url + '" target="_blank"><img src="'+image+'"'+(width?' width="'+width+'"':'')+(height?' height="'+height+'"':'')+'></a></p>';
  6.         edit_insert(html);
  7. }
复制代码


修改为:
  1. function insertImage(image, url, width, height,subject) {
  2.         url = typeof url == 'undefined' || url === null ? image : url;
  3.         width = typeof width == 'undefined' || width === null ? 0 : parseInt(width);
  4.         height = typeof height == 'undefined' || height === null ? 0 : parseInt(height);
  5.         subject = $('title').value;
  6.         var html = '<p><a href="' + url + '" target="_blank"><img alt="'+subject+'" src="'+image+'"'+(width?' width="'+width+'"':'')+(height?' height="'+height+'"':'')+'></a></p>';
  7.         edit_insert(html);
  8. }
复制代码


再编辑:bgeditor_function.js
查找:
  1. function insertImage(image, url, width, height) {
  2. url = typeof url == 'undefined' || url === null ? image : url;
  3. width = typeof width == 'undefined' || width === null ? 0 : parseInt(width);
  4. height = typeof height == 'undefined' || height === null ? 0 : parseInt(height);
  5. var html = '<p><a href="' + url + '" target="_blank"><img src="'+image+'"'+(width?' width="'+width+'"':'')+(height?' height="'+height+'"':'')+'></a></p>';
  6. edit_insert(html);
  7. }
复制代码

修改为
  1. function insertImage(image, url, width, height,subject) {
  2.         url = typeof url == 'undefined' || url === null ? image : url;
  3.         width = typeof width == 'undefined' || width === null ? 0 : parseInt(width);
  4.         height = typeof height == 'undefined' || height === null ? 0 : parseInt(height);
  5.         subject = $('title').value;
  6.         var html = '<p><a href="' + url + '" target="_blank"><img alt="'+subject+'" src="'+image+'"'+(width?' width="'+width+'"':'')+(height?' height="'+height+'"':'')+'></a></p>';
  7.         edit_insert(html);
  8. } {
复制代码

再编辑:template/default/home/spacecp_blog.htm
查找:
  1. editor_function.js
复制代码

替换为
  1. bgeditor_function.js
复制代码


覆盖同名文件,更新缓存,发布文章测试看看

本教程由无限星辰工作室CRX349独家整理和提供,转载请注明地址,谢谢。本文地址:https://www.xmspace.net/thread-285-1-1.html
无限星辰工作室  好集导航 Discuz全集下载  星辰站长网  集热爱361  一品文学  手机小游戏合集   海外空间网 星辰api  星辰支付二维码管理平台 阿里云服务器 腾讯云服务器
服务Discuz!建站|DiscuzQ配置|二开|小程序|APP|搬家|挂马清理|防护|Win/Linux环境搭建|优化|运维|
服务理念:专业 诚信 友好QQ842062626 服务项目 Q群315524225

发表于 2014-12-1 23:19:34 | 显示全部楼层 |阅读模式

回复 | 使用道具 举报

该帖共收到 0 条回复!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

美图秀

    • fastadmin 后台界面使用字段数组类型
    • Discuz!x3.5 修改标题高亮颜色
    • Discuz!x3.5 应用中心 下载应用一直下载中
    • 帖子定时显示
    • 论坛辅助审核
拖动客服框
Online Service
点击这里给我发消息
点击这里联系我们
微信扫一扫
在线客服
快速回复 返回顶部 返回列表