Website:Comments
From MatureAsskickers Wiki
Contents |
[edit]
Comments Table
The comments table stores all of the comment data.
[edit]
Data Structure
[edit]
Fields
- commentid
- datetime_insert
- datetime_update
- datetime_expire
- recruitid_list
- commentid_list
- customkey_list
- data
[edit]
Descriptions
[edit]
commentid
- (integer, unique)
- A unique identification number for the comment. No other comment will have the same number and it is used to refer to the comment from other table's. This value is assigned when the comment is created and is read-only.
- Read Permission: comments.read.commentid (all)
- Write Permission: comments.write.commentid (none)
[edit]
datetime_insert
- (YYYY-MM-DD hh:mm:ss)
- The timestamp of when the comment was created. This value is assigned when the comment is created and is read-only.
- Read Permission: comments.read.datetime_insert (all)
- Write Permission: comments.write.datetime_insert (none)
[edit]
datetime_update
- (YY-MM-DD hh:mm:ss)
- The timestamp of when the comment was last edited. This value is automatically handled and is read-only.
- Read Permission: comments.read.datetime_update (all)
- Write Permission: comments.write.datetime_update (none)
[edit]
datetime_expire
- (YY-MM-DD hh:mm:ss)
- The timestamp of when the comment has/will expire. Once the current date-time has surpassed this value the comment is effectively deleted, however the comment can still be edited. Expiring a comment will disable general display within XML feeds.
- Read Permission: comments.read.datetime_expire (defined, self)
- Write Permission: comments.write.datetime_expire (defined)
[edit]
author_recruitid
- (integer)
- The recruitid of the author for this comment.
- Read Permission: comments.read.author_recruitid (defined)
- Write Permission: comments.write.author_recruitid (defined)
[edit]
author_userid
- (integer)
- The userid of the author for this comment.
- Read Permission: comments.read.author_userid (defined)
- Write Permission: comments.write.author_userid (defined)
[edit]
awardid_list
- (string, CSV)
- This is list of CSV (comma separated values) of awardid's that the comment is for.
- Read Permission: comments.read.awardid_list (defined, guest)
- Write Permission: comments.write.awardid_list (defined)
[edit]
commentid_list
- (string, CSV)
- This is list of CSV (comma separated values) of commentid's that the comment is for.
- Read Permission: comments.read.commentid_list (defined, guest)
- Write Permission: comments.write.commentid_list (defined)
[edit]
eventid_list
- (string, CSV)
- This is list of CSV (comma separated values) of eventid's that the comment is for.
- Read Permission: comments.read.eventid_list (defined, guest)
- Write Permission: comments.write.eventid_list (defined)
[edit]
inodeid_list
- (string, CSV)
- This is list of CSV (comma separated values) of inodeid's that the comment is for.
- Read Permission: comments.read.inodeid_list (defined, guest)
- Write Permission: comments.write.inodeid_list (defined)
[edit]
groupid_list
- (string, CSV)
- This is list of CSV (comma separated values) of groupid's that the comment is for.
- Read Permission: comments.read.groupid_list (defined)
- Write Permission: comments.write.groupid_list (defined)
[edit]
recruitid_list
- (string, CSV)
- This is list of CSV (comma separated values) of recruitid's that the comment is for.
- Read Permission: comments.read.recruitid_list (defined)
- Write Permission: comments.write.recruitid_list (defined)
[edit]
userid_list
- (string, CSV)
- This is list of CSV (comma separated values) of userid's that the comment is for.
- Read Permission: comments.read.userid_list (defined)
- Write Permission: comments.write.userid_list (defined)
[edit]
customkey_list
- (string, CSV)
- This is list of CSV (comma separated values) of custom keys that the presentation layer can use for it's own reference.
- Read Permission: comments.read.customkey_list (defined)
- Write Permission: comments.write.customkey_list (defined)
[edit]
comment
- (string)
- The comment.
- Read Permission: comments.read.comment (defined, guest)
- Write Permission: comments.write.ccomment (defined)
[edit]
data
- (array)
- This is special array of custom unreserved key value pairs. It is an optional field and any comments.data.* value can be made empty when editing a comment.
- Read Permission: comments.read.data (all)
- Write Permission: comments.write.data (defined, self)
- See Custom Data
[edit]
Reading Data
See XML Data
[edit]
XML
[edit]
Sample XML output
/xml/comments.xml
<?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
<comments>
<commentid id="1">
<commentid>1</commentid>
<datetime_insert>2006-10-10 07:55:29</datetime_insert>
<datetime_update>2007-02-19 19:02:14</datetime_update>
<datetime_expire>2008-08-05 12:00:00</datetime_expire>
<author>
<recruit id="1">
<recruitid>1</recruitid>
<username>recruit</username>
</recruit>
<user id="1">
<userid>1</userid>
<username>user</username>
</recruit>
</author>
<comment><![CDATA[ The first comment! ]]></comment>
<awardids csv="1,2,3">
<awardid>1</awardid>
<awardid>2</awardid>
<awardid>3</awardid>
</awardids>
<commentids csv="1,2,3">
<commentid>1</commentid>
<commentid>2</commentid>
<commentid>3</commentid>
</commentids>
<eventids csv="1,2,3">
<eventid>1</eventid>
<eventid>2</eventid>
<eventid>3</eventid>
</eventids>
<inodes csv="4833368,4833369,4833370">
<inode>4833368</inode>
<inode>4833369</inode>
<inode>4833370</inode>
</inodes>
<groupids csv="1,2,3">
<groupid>1</groupid>
<groupid>2</groupid>
<groupid>3</groupid>
</groupids>
<recruitids csv="1,2,3">
<recruitid>1</recruitid>
<recruitid>2</recruitid>
<recruitid>3</recruitid>
</recruitids>
<userids csv="1,2,3">
<userid>1</userid>
<userid>2</userid>
<userid>3</userid>
</userids>
<customkeys csv="1,a,99zyx">
<customkey>1</customkey>
<customkey>a</customkey>
<customkey>99xyz</customkey>
</customkeys>
<data>
<key>value</key>
<...>...</...>
</data>
</comment>
<comment id="...">
...
</comment>
</comments>
[edit]
The Request
The following url keys can be used in the HTTP GET request to filter and/or sort the XML.
- commentid (default all) - Filter by a single commentid or CSV of multiple commentid's.
/xml/comments.xml?commentid=1,2,3
/xml/comments.xml?awardids=1,2,3
- commentids (default all) - Filter by a single commentid or CSV of multiple commentid's.
/xml/comments.xml?commentids=1,2,3
/xml/comments.xml?eventids=1,2,3
/xml/comments.xml?inodes=4833368,4833369,4833370
/xml/comments.xml?groupids=1,2,3
- recruitids (default all) - Filter by a single recruitid or CSV of multiple recruitid's.
/xml/comments.xml?recruitids=1,2,3
/xml/comments.xml?userids=1,2,3
- customkeys (default all) - Filter by a single customkey or CSV of multiple customkey's.
/xml/comments.xml?customkeys=shoutbox,complaints
- expired (default 0) - Filter by 0 for non-expired, 1 for expired.
/xml/comments.xml?expired=1
[edit]
Writing Data
[edit]
HTTP POST
See HTTP POST Data
[edit]
Adding a comment (_comment_add)
- Permissions required: comments.write.comment (defined)
A simple example of adding a new comment.
<form action="/xml/httppost.xml" method="post">
<input type="hidden" name="_action" value="_comment_add">
user: <select name="userid">
<option value="1">user 1</option>
<option value="2">user 2</option>
<option value="3">user 3</option>
</select>
<textarea name="comment"></textarea>
<input type="submit" value="add">
</form>
[edit]
Editing a comment (_comment_edit)
- Permissions required: comments.write.comment (defined)
A simple example of adding a comment.
<form action="/xml/httppost.xml" method="post">
<input type="hidden" name="_action" value="_comment_edit">
<input type="hidden" name="commentid" value="99">
user: <select name="userid">
<option value="1">user 1</option>
<option value="2">user 2</option>
<option value="3">user 3</option>
</select>
<textarea name="comment"></textarea>
<input type="submit" value="edit">
</form>
[edit]
Deleting a comment (_comment_delete)
- Permissions required: comments.delete (defined)
A simple example of deleting a comment.
<form action="/xml/httppost.xml" method="post"> <input type="hidden" name="_action" value="_comment_delete"> <input type="hidden" name="commentid" value="99"> <input type="submit" value="delete"> </form>
