首页 > 运营 > 帮助中心 > 正文

织梦CMS内容图片如何在二级域名下调用的解决方法

2020-01-27 17:30:40
字体:
来源:转载
供稿:网友

内容图片如何在二级域名下调用的解决方法

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

找到下面的代码

  1. if($cfg_multi_site=='N')
  2. {
  3. $imgHtml.="<imgsrc=/"$imgsrcValue/"width=/"$imgwidthValue/"border=/"0/"height=/"$imgheightValue/"alt=
  4. /"$altname/"style=/"cursor:pointer/"onclick=/"window.open('$urlValue')/"/><br/>/r/n";
  5. }
  6. else
  7. {
  8. if(empty($cfg_basehost))$cfg_basehost='http://'.$_SERVER["HTTP_HOST"];
  9. $imgHtml.="<imgsrc=/"$imgsrcValue/"width=/"$imgwidthValue/"border=/"0/"height=
  10. /"$imgheightValue/"alt=/"$altname/"style=/"cursor:pointer/"onclick=/"window.open('$urlValue')/"/><br/>/r/n";
  11. }

把代码改成下面的代码

  1. if($GLOBALS['cfg_addon_domainbind']){$addon_domain=$GLOBALS['cfg_addon_domain'];}
  2. if($cfg_multi_site=='N')
  3. {
  4. $imgHtml.="<imgsrc=/"{$addon_domain}{$imgsrcValue}/"width=/"$imgwidthValue/"border=/"0/"height=/"$imgheightValue/"alt=
  5. /"$altname/"style=/"cursor:pointer/"onclick=/"window.open('{$addon_domain}{$urlValue}')/"/><br/>/r/n";
  6. }
  7. else
  8. {
  9. if(empty($cfg_basehost))$cfg_basehost='http://'.$_SERVER["HTTP_HOST"];
  10. $imgHtml.="<imgsrc=/"{$addon_domain}{$imgsrcValue}/"width=/"$imgwidthValue/"border=/"0/"height=/"$imgheightValue/"alt=
  11. /"$altname/"style=/"cursor:pointer/"onclick=/"window.open('{$addon_domain}{$urlValue}')/"/><br/>/r/n";
  12. }

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

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

将下面的代码:

  1. $activeurl='..'.$activepath;

改成以下的代码

  1. if($GLOBALS['cfg_addon_domainbind']){$addon_domain=$GLOBALS['cfg_addon_domain'];}
  2. $activeurl='..'.$addon_domain.$activepath;

现在我们已经完成所以的更改,这样更改是在保证织梦CMS内容管理SYSTEMSYSTEM_的完整性上改的,只有内容中的图片才会变!当然前提是你要开启:附件目录是否绑定为指定的二级域名而且指定二级域名地址。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表