Discuz教程网

Discuz!未结束的字符串常量”的解决办法

[复制链接]
authicon dly 发表于 2011-4-4 16:49:24 | 显示全部楼层 |阅读模式
在用的Discuz有个错误提示,打开来看IE6/IE7下提示“未结束的字符串常量”,IE8下提示“Unterminated string constant”。  去Discuz论坛上看看,有个帖子说是在/templates/default/viewthread.htm文件中查找

  1. <a href="java script:;" onclick="setCopy('{$thread[subject]}\n{$boardurl}viewthread.php?tid=$tid$fromuid', '{lang post_copylink}')" class="lightlink" />[{lang share_im}]</a><br /><br />
复制代码

替换为


  1. <a href="java script:;" onclick="setCopy('{$threadshare}\n{$boardurl}viewthread.php?tid=$tid$fromuid', '{lang post_copylink}')" class="lightlink" />[{lang share_im}]</a><br /><br />
复制代码

此贴说的是Discuz 7.1的问题。
Discuz 7.2的版本,查看一下viewthread.htm,已经是上面替换后的内容了。
仔细根据错误提示看看出错处的网页源码
  1. <a href="java script:;" onclick="setCopy('Another announce\nhttp://localhost/fis/forum/viewthread.php?tid=2', 'Thread URL has been Copy to clipboard<br />You can use "Ctrl + V" copy to QQ or MSN.')" class="lightlink" />[Share Friend by QQ or MSN]</a><br /><br />
复制代码

好吧 错误明显,是单引号和双引号交替使用,本该是字符串内的”变成了字符串标识符。
对比一下网页源码和程序源码,看来是post_copylink内容中带了”导致的,在templates/default/templates.lang.php中查找post_copylink,将

  1. 'post_copylink' => 'Thread URL has been Copy to clipboard<br />You can use "Ctrl + V" copy to QQ or MSN.',
复制代码

替换为

  1. 'post_copylink' => 'Thread URL has been Copy to clipboard<br />You can use Ctrl + V copy to QQ or MSN.',
复制代码

解决了,错误提示消失。





上一篇:如何在Discuz X建立属于自己的后台管理页
下一篇:如何让discuz的版面规则支持html代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2024-5-20 01:52

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表