Home « Server software «
Documentation: comments/post.php
comments/post.php - Post a comment
This script serves as a back-end for the Comment API and for Post-It notifications.Using the Comment API, bloggers can easily submit comments from within their preferred RSS reader.
YACS attempts to bind author information to an existing user profile.
If anonymous comments are allowed, YACS uses the value of the author field as the id of a user profile. If a password is provided, YACS validates it as well.
To achieve this YACS expects to get credentials in the user name, in the usual form
<nick_name>:<password>
.For example, for the user
foo
and the password a_password
, configure your newsreader
to send 'foo:a_password
' as user name.YACS allows for several strategies to protect from spam, depending of the settings of global parameters:
- if no user name has been provided, and if
$context['users_with_anonymous_comments'] == 'Y'
,
- if no password has been provided, and if
$context['users_with_anonymous_comments'] == 'Y'
,
- if user name and password are those of a valid user profile,
- else the comment is rejected
Here is an example of Comment API, as submit from RSS Bandit. Note that line breaks have been inserted for readability.
POST /yacs/comments/post.php/123 HTTP/1.1
Content-Type: text/xml
<?xml version="1.0" encoding="iso-8859-15"?>
<item>
<title>RE: How to create a button from an image? </title>
<link>http://www.yetanothercommunitysystem.com/</link>
<pubDate>Mon, 04 Oct 2004 12:21:52 GMT</pubDate>
<description><![CDATA[hello world ]]></description>
<author>foo.bar@acme.com (Foo)</author>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">foo.bar@acme.com (Foo)</dc:creator>
</item>
Here is an example of Post-It. Note that line breaks have been inserted for readability.
POST http://www.foo.com/yacs/comments/post.php/123
Content-Type: application/x-www-form-urlencoded
comment=My+Comment+Comes+Here
&email=joe@bitworking.org
&name=Foo+Bar
&url=http://www.bar.com/
&agent=send-cb.pl+(Version+0.1)
Accepted calls:
- post.php/<type>/<id> create a new comment for this anchor
- post.php?anchor=<type>:<id> create a new comment for this anchor
- post.php/<id> create a new comment for the anchor 'article:<id>'
If the anchor for this item specifies a specific skin (option keyword '
skin_xyz
'),
or a specific variant (option keyword 'variant_xyz
'), they are used instead default values.This script is a reference file of this system.
Voir aussi:
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com