• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    DEDECMS内容图片在二级域名下调用的方法
    POST TIME:2020-04-10 20:46

      DedeCmsSYSTEM_配置参数->其它选项中有两个配置选项:[附件目录是否绑定为指定的二级域名|附件目录的二级域名]很明显示官方早就注意到了在二级域名下的各种子问题!

      打开include/FCKeditor/editor/dialog/目录下的文件:“dede_image.php”!

      将这个

      if($cfg_multi_site=='N')

      {

      $imgHtml.="<imgsrc=&;$imgsrcValue&;width=&;$imgwidthValue&;border=&;0&;height=&;$imgheightValue&;alt=&;$altname&;style=&;cursor:pointer&;onclick=&;window.open('$urlValue')&;/><br/> ";

      }

      else

      {

      if(empty($cfg_basehost))$cfg_basehost='http://'.$_SERVER["HTTP_HOST"];

      $imgHtml.="<imgsrc=&;$imgsrcValue&;width=&;$imgwidthValue&;border=&;0&;height=&;$imgheightValue&;alt=&;$altname&;style=&;cursor:pointer&;onclick=&;window.open('$urlValue')&;/><br/> ";

      }

      改成下面

      if($GLOBALS['cfg_addon_domainbind']){$addon_domain=$GLOBALS['cfg_addon_domain'];}

      if($cfg_multi_site=='N')

      {

      $imgHtml.="<imgsrc=&;{$addon_domain}{$imgsrcValue}&;width=&;$imgwidthValue&;border=&;0&;height=&;$imgheightValue&;alt=&;$altname&;style=&;cursor:pointer&;onclick=&;window.open('{$addon_domain}{$urlValue}')&;/><br/> ";

      }

      else

      {

      if(empty($cfg_basehost))$cfg_basehost='http://'.$_SERVER["HTTP_HOST"];

      $imgHtml.="<imgsrc=&;{$addon_domain}{$imgsrcValue}&;width=&;$imgwidthValue&;border=&;0&;height=&;$imgheightValue&;alt=&;$altname&;style=&;cursor:pointer&;onclick=&;window.open('{$addon_domain}{$urlValue}')&;/><br/> ";

      }

      现在上传的图片正常了,接下来咱们要考虑的是下面不是有一个“浏览服务器_”的按纽吗,[图片/随便/flash/多媒体]都有这个功能!

      先打开include/dialog/目录下的select_images.php|select_media.php|select_soft.php|select_templets.php

      将下面的代码:

      $activeurl='..'.$activepath;

      改成

      if($GLOBALS['cfg_addon_domainbind']){$addon_domain=$GLOBALS['cfg_addon_domain'];}

      $activeurl='..'.$addon_domain.$activepath;

      至此完成所以的更改,这样更改是在保证织梦CMS内容管理SYSTEMSYSTEM_的完整性上改的,只有内容中的图片才会变!

      当然前提是你开启:附件目录是否绑定为指定的二级域名而且指定二级域名地址!

    
    关于我们 | 付款方式 | 建站知识 | 增值服务 | 网站模板
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!