是否可以只发布 fxml 评论而不让用户自己输入评论?

发布于 2024-09-25 20:08:56 字数 111 浏览 7 评论 0原文

我想让用户看到对某个主题的评论,而不给他机会输入自己的评论!这可以用 fxml 实现吗? canpost="false" 出于任何原因都不起作用...

这可能吗?

谢谢 马库斯

Im want to let the user to see the comments done to a topic without giving him the opportunity to enter a comment by his one! Is this possible with fxml? canpost="false" doesn't work for any reason...

Is this possible at all?

Thanks
Markus

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若沐 2024-10-02 20:08:56

好吧,让我们看一下来源。如果我们打开 http://connect.facebook.net/en_US/all.js ,它会包含以下代码:

FB.subclass('XFBML.Comments', 'XFBML.IframeWidget', null, {
    _visibleAfter: 'resize',
    _refreshOnAuthChange: true,
    setupAndValidate: function () {
        var a = {
            channel_url: this.getChannelUrl(),
            css: this.getAttribute('css'),
            notify: this.getAttribute('notify'),
            numposts: this.getAttribute('num-posts', 10),
            quiet: this.getAttribute('quiet'),
            reverse: this.getAttribute('reverse'),
            simple: this.getAttribute('simple'),
            title: this.getAttribute('title', document.title),
            url: this.getAttribute('url', document.URL),
            width: this._getPxAttribute('width', 550),
            xid: this.getAttribute('xid')
        };
        ...

它是传递给实际小部件 iframe 的参数列表。

坏消息是,尽管它仍然列在他们的文档中(有人感到惊讶吗?),但不再有像 canpost 这样的参数了,所以它只是被忽略了。

好消息是 css 参数仍然受支持。在过去的美好时光,他们允许您传递自定义 css(以绝对 url 的形式,http://mysite.com/style.css),但我怀疑它是否仍然有效。尝试创建隐藏注释框的自定义 css 样式(检查注释 iframe 以获得所需的类名)并通过它。如果这不起作用,那么恐怕你也无能为力。

Well lets take a look at sources. If we open http://connect.facebook.net/en_US/all.js it has the following piece of code:

FB.subclass('XFBML.Comments', 'XFBML.IframeWidget', null, {
    _visibleAfter: 'resize',
    _refreshOnAuthChange: true,
    setupAndValidate: function () {
        var a = {
            channel_url: this.getChannelUrl(),
            css: this.getAttribute('css'),
            notify: this.getAttribute('notify'),
            numposts: this.getAttribute('num-posts', 10),
            quiet: this.getAttribute('quiet'),
            reverse: this.getAttribute('reverse'),
            simple: this.getAttribute('simple'),
            title: this.getAttribute('title', document.title),
            url: this.getAttribute('url', document.URL),
            width: this._getPxAttribute('width', 550),
            xid: this.getAttribute('xid')
        };
        ...

It is a list of parameters that are getting passed to actual widget iframe.

Bad news is that there is no such parameter as canpost anymore even though it is still listed in their docs (anyone surprised?), so it just getting ignored.

Good news is that css parameter could be still supported. In good old days they allowed you to pass custom css (in a form of absolute url, http://mysite.com/style.css), but I doubt it still works. Try to create your custom css style with comment box hidden (check comments iframe for required class name) and pass it. If that doesn't work then there is nothing else you can do I'm afraid.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文