我正在本地开发一个柯比网站。我正在尝试将 Disqus 评论添加到我的文章页面。我正在关注如何做的解释
我逐字逐句地遵循了它。我已经下载了以下片段并将其添加到我的片段文件夹中:
1:<?php
2:
3:// set the defaults
4:if(!isset($disqus_shortname)) die('ThisIsMyShortname');
5:if(!isset($disqus_title)) $disqus_title = $page->title();
6:if(!isset($disqus_developer)) $disqus_developer = false;
7:if(!isset($disqus_identifier)) $disqus_identifier = $page->uri();
8:if(!isset($disqus_url)) $disqus_url = thisURL();
9:
10:$disqus_title = addcslashes($disqus_title, "'");
11:$disqus_developer = ($disqus_developer) ? 'true' : 'false';
12:
13:?>
14:<div id="disqus_thread"></div>
15:<script type="text/javascript">
16:var disqus_shortname = '<?php echo $ThisIsMyShortname ?>'; // required: replace example with your forum shortname
17:var disqus_title = '<?php echo html($disqus_title) ?>';
18:var disqus_developer = '<?php echo $disqus_developer ?>'; // developer mode
19:var disqus_identifier = '<?php echo $disqus_identifier ?>';
20:var disqus_url = '<?php echo $disqus_url ?>';
21:
22:(function() {
23:var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
24:dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
25:(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
26:})();
27:</script>
28:<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
29:<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
在第 4 行和第 16 行,我已将短名称更改为我的 ThisIsMyShortname(我的实际短名称)
然后将评论放在我的页面上,我有:
<?php snippet('disqus', array('disqus_shortname' => 'WeShapeDigital', 'disqus_developer' => true )) ?>
我已经包括
'disqus_developer' => true ))
因为我在本地工作,这显然应该允许 Disqus 至少不会出错。
显示的错误是:
任何帮助都会很棒!