XML RPC wordpress 匿名评论发布

发布于 2024-11-25 16:06:19 字数 894 浏览 1 评论 0原文

我在我的博客上发布评论,它工作正常,但有一个问题,我无法使用 alexjamesbrown 的 XML-RPC

而不是评论作者来发布匿名评论,这里是管理员名称

,这是我的代码

var wrapper = new WordPressWrapper(textblogUrltemp + "/xmlrpc.php", adminunUser, adminPass);
                var post = new Post();
                post.title = toPost.VideoTitle;
                post.dateCreated = Convert.ToDateTime(toPost.PostingDateTime);
                post.description = toPost.VideoCode;
              post.postid =  wrapper.NewPost(post, true);

 var comment = new Comment();

                    var wrap =new  WordPressWrapper(textblogUrltemp + "/xmlrpc.php", adminunUser, adminPass);

                    comment.author = videoComments.userName;
                    comment.author_email = videoComments.email;
                    comment.content = videoComments.Comment;
                    wrap.NewComment(post.postid, comment);

i am posting comments on my blog it works fine but there is one problem that i cannot post anonymous comments using XML-RPC by alexjamesbrown

instead of comment author there is name of admin

here is my code

var wrapper = new WordPressWrapper(textblogUrltemp + "/xmlrpc.php", adminunUser, adminPass);
                var post = new Post();
                post.title = toPost.VideoTitle;
                post.dateCreated = Convert.ToDateTime(toPost.PostingDateTime);
                post.description = toPost.VideoCode;
              post.postid =  wrapper.NewPost(post, true);

 var comment = new Comment();

                    var wrap =new  WordPressWrapper(textblogUrltemp + "/xmlrpc.php", adminunUser, adminPass);

                    comment.author = videoComments.userName;
                    comment.author_email = videoComments.email;
                    comment.content = videoComments.Comment;
                    wrap.NewComment(post.postid, comment);

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

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

发布评论

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

评论(2

ゃ人海孤独症 2024-12-02 16:06:19

我解决了它

var wrap =new  WordPressWrapper(textblogUrltemp + "/xmlrpc.php", "", "");

,您还需要修改 class-wp-xmlrpc-server.php 文件并在 newComment 函数中允许匿名评论

I resolved it

var wrap =new  WordPressWrapper(textblogUrltemp + "/xmlrpc.php", "", "");

also you need to modify the class-wp-xmlrpc-server.php file and in newComment function allow the anonymous comments

恋竹姑娘 2024-12-02 16:06:19

我在 WP Remote Control 中遇到了这个问题。通过 XMLRPC 解锁匿名发布是非常糟糕的主意。正如任何人都可以做到的那样,您可能会被垃圾邮件淹没。

秘密是发布评论并编辑它。有两个请求,但你很安全。在我的课堂上有一个方法可以做到这一点。问候。

顺便说一句我的课程是 PHP。我也用 C++ 编写了它,但它太依赖于我的 C++ 库而无法发布。

I bumped into this working for WP Remote Control. Very bad idea to unlock anonymous posting through XMLRPC. You can get flooded by Spam as anyone can do it.

The secret is to post the comment and edit it. Two requests but you're safe. There's a single method that does it in my class. Regards.

BTW: My class is PHP. I have it written in C++ too but it's too dependent to my C++ library to publish.

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